LLMS_Quiz::get_student_last_attempt_key( int $user_id = null )

Gets quiz’s last attempt key of a user.


Parameters Parameters

$user_id

(int) (Optional) WP User ID, none supplied uses current user. Default null.

Default value: null


Top ↑

Return Return

(string|bool)


Top ↑

Source Source

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

	public function get_student_last_attempt_key( $user_id = null ) {

		$student          = llms_get_student( $user_id );
		$last_attempt_key = false;

		if ( $student ) {
			$last_attempt = $student->quizzes()->get_last_attempt( $this->get( 'id' ) );
			if ( $last_attempt ) {
				$last_attempt_key = $last_attempt->get_key();
			}
		}

		return $last_attempt_key;
	}


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.