LLMS_Quiz::is_open( int $user_id = null )

Determine if a student can take the quiz.


Parameters Parameters

$user_id

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

Default value: null


Top ↑

Return Return

(boolean)


Top ↑

Source Source

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

			if ( ! $lesson || $this->get( 'id' ) !== $lesson->get( 'quiz' ) ) {
				return true;
			}
		}

		return false;

	}

	/**
	 * Determine if a student can take the quiz.
	 *
	 * @since 3.0.0
	 * @since 3.16.0 Unkwnown.
	 * @since 3.37.2 Added `llms_quiz_is_open` filter hook.
	 *
	 * @param int $user_id Optional. WP User ID, none supplied uses current user. Default `null`.
	 * @return boolean
	 */
	public function is_open( $user_id = null ) {

		$student = llms_get_student( $user_id );
		if ( ! $student ) {
			$quiz_open = false;
		} else {


Top ↑

Changelog Changelog

Changelog
Version Description
3.37.2 Added llms_quiz_is_open filter hook.
3.16.0 Unkwnown.
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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