LLMS_Quiz_Attempt::get_next_question( $last_question = null )

Retrieve the next unanswered question in the attempt


Description Description


Return Return

(int|false)


Top ↑

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;

	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.9.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.





Permalink: