LLMS_Quiz_Attempt::is_last_attempt()

Determine if the attempt is the last attempt of its quiz.


Return Return

(bool)


Top ↑

Source Source

File: includes/models/model.llms.quiz.attempt.php

	public function is_last_attempt() {

		$student = llms_get_student( $this->get( 'student_id' ) );
		if ( ! $student ) {
			return false;
		}

		$last_attempt = $student->quizzes()->get_last_attempt( $this->get( 'quiz_id' ) );
		return $last_attempt && ( $this->get( 'id' ) === $last_attempt->get( 'id' ) );
	}


Top ↑

Changelog Changelog

Changelog
Version Description
7.8.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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