LLMS_Student_Quizzes::get_last_attempt( int $quiz_id )
Retrieve the last recorded attempt for a student for a given quiz/lesson “Last” is defined as the attempt with the highest attempt number
Description Description
Parameters Parameters
- $quiz_id
-
(int) (Required) WP Post ID of the quiz
Return Return
(obj|false)
Source Source
File: includes/models/model.llms.student.quizzes.php
public function get_last_attempt( $quiz_id ) { $attempts = $this->get_attempts_by_quiz( $quiz_id, array( 'per_page' => 1, 'sort' => array( 'attempt' => 'DESC', ), ) ); if ( $attempts ) { return $attempts[0]; } return false; }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.9.0 | Introduced. |
User Contributed Notes User Contributed Notes
Permalink: