LLMS_Quiz_Attempt::get_next_question( $last_question = null )
Retrieve the next unanswered question in the attempt
Description Description
Return Return
(int|false)
Source Source
File: includes/models/model.llms.quiz.attempt.php
public function get_next_question( $last_question = null ) { $next = false; foreach ( $this->get_questions() as $question ) { if ( $next || is_null( $question['answer'] ) ) { return $question['id']; // when rewinding and moving back through we don't want to skip questions } elseif ( $last_question && $last_question == $question['id'] ) { $next = true; } } 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: