LLMS_Student_Quizzes::get_attempts_by_quiz( int $quiz_id, array $args = array() )
Retrieve quiz attempts
Parameters Parameters
- $quiz_id
-
(int) (Required) WP Post ID of the quiz.
- $args
-
(array) (Optional) Additional args to pass to LLMS_Query_Quiz_Attempt.
Default value: array()
Return Return
Source Source
File: includes/models/model.llms.student.quizzes.php
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | public function get_attempts_by_quiz( $quiz_id , $args = array () ) { $args = wp_parse_args( array ( 'student_id' => $this ->get_id(), 'quiz_id' => $quiz_id , ), $args ); $query = new LLMS_Query_Quiz_Attempt( $args ); if ( $query ->has_results() ) { return $query ->get_attempts(); } return array (); } |
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.16.0 | Introduced. |