LLMS_Student_Quizzes::count_attempts_by_quiz( int $quiz_id )
Retrieve the number of quiz attempts for a quiz
Parameters Parameters
- $quiz_id
-
(int) (Required) WP Post ID of the quiz.
Return Return
(int)
Source Source
File: includes/models/model.llms.student.quizzes.php
public function count_attempts_by_quiz( $quiz_id ) { $query = new LLMS_Query_Quiz_Attempt( array( 'student_id' => $this->get_id(), 'quiz_id' => $quiz_id, 'per_page' => 1, ) ); return $query->get_found_results(); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
6.0.0 | Don't access LLMS_Query_Quiz_Attempt properties directly. |
3.16.0 | Introduced. |