Moodle  2.2.1
http://www.collinsharper.com
quizaccess_password Class Reference
Inheritance diagram for quizaccess_password:
Collaboration diagram for quizaccess_password:

Public Member Functions

 description ()
 is_preflight_check_required ($attemptid)
 add_preflight_check_form_fields (mod_quiz_preflight_check_form $quizform, MoodleQuickForm $mform, $attemptid)
 validate_preflight_check ($data, $files, $errors, $attemptid)
 notify_preflight_check_passed ($attemptid)
 current_attempt_finished ()

Static Public Member Functions

static make (quiz $quizobj, $timenow, $canignoretimelimits)

Detailed Description

A rule implementing the password check.

Definition at line 38 of file rule.php.


Member Function Documentation

Add any field you want to pre-flight check form. You should only do something here if is_preflight_check_required() returned true.

Parameters:
mod_quiz_preflight_check_form$quizformthe form being built.
MoodleQuickForm$mformThe wrapped MoodleQuickForm.
int | null$attemptidthe id of the current attempt, if there is one, otherwise null.

Reimplemented from quiz_access_rule_base.

Definition at line 57 of file rule.php.

Here is the call graph for this function:

This is called when the current attempt at the quiz is finished. This is used, for example by the password rule, to clear the flag in the session.

Reimplemented from quiz_access_rule_base.

Definition at line 94 of file rule.php.

Information, such as might be shown on the quiz view page, relating to this restriction. There is no obligation to return anything. If it is not appropriate to tell students about this rule, then just return ''.

Returns:
mixed a message, or array of messages, explaining the restriction (may be '' if no message is appropriate).

Reimplemented from quiz_access_rule_base.

Definition at line 48 of file rule.php.

is_preflight_check_required ( attemptid)
Parameters:
int | null$attemptidthe id of the current attempt, if there is one, otherwise null.
Returns:
bool whether a check is required before the user starts/continues their attempt.

Reimplemented from quiz_access_rule_base.

Definition at line 52 of file rule.php.

static make ( quiz quizobj,
timenow,
canignoretimelimits 
) [static]

Return an appropriately configured instance of this rule, if it is applicable to the given quiz, otherwise return null.

Parameters:
quiz$quizobjinformation about the quiz in question.
int$timenowthe time that should be considered as 'now'.
bool$canignoretimelimitswhether the current user is exempt from time limits by the mod/quiz:ignoretimelimits capability.
Returns:
quiz_access_rule_base|null the rule, if applicable, else null.

Reimplemented from quiz_access_rule_base.

Definition at line 40 of file rule.php.

Here is the call graph for this function:

The pre-flight check has passed. This is a chance to record that fact in some way.

Parameters:
int | null$attemptidthe id of the current attempt, if there is one, otherwise null.

Reimplemented from quiz_access_rule_base.

Definition at line 89 of file rule.php.

validate_preflight_check ( data,
files,
errors,
attemptid 
)

Validate the pre-flight check form submission. You should only do something here if is_preflight_check_required() returned true.

If the form validates, the user will be allowed to continue.

Parameters:
array$datathe submitted form data.
array$filesany files in the submission.
array$errorsthe list of validation errors that is being built up.
int | null$attemptidthe id of the current attempt, if there is one, otherwise null.
Returns:
array the update $errors array;

Reimplemented from quiz_access_rule_base.

Definition at line 70 of file rule.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations