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

190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
        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.