|
Moodle
2.2.1
http://www.collinsharper.com
|


Public Member Functions | |
| description () | |
| prevent_access () | |
| is_finished ($numprevattempts, $lastattempt) | |
| time_left ($attempt, $timenow) | |
Static Public Member Functions | |
| static | make (quiz $quizobj, $timenow, $canignoretimelimits) |
A rule enforcing open and close dates.
| description | ( | ) |
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 ''.
Reimplemented from quiz_access_rule_base.
Definition at line 45 of file rule.php.

| is_finished | ( | $ | numprevattempts, |
| $ | lastattempt | ||
| ) |
If this rule can determine that this user will never be allowed another attempt at this quiz, then return true. This is used so we can know whether to display a final grade on the view page. This will only be called if there is not a currently active attempt for this user.
| int | $numattempts | the number of previous attempts this user has made. |
| object | $lastattempt | information about the user's last completed attempt. |
Reimplemented from quiz_access_rule_base.
Return an appropriately configured instance of this rule, if it is applicable to the given quiz, otherwise return null.
| quiz | $quizobj | information about the quiz in question. |
| int | $timenow | the time that should be considered as 'now'. |
| bool | $canignoretimelimits | whether the current user is exempt from time limits by the mod/quiz:ignoretimelimits capability. |
Reimplemented from quiz_access_rule_base.
| prevent_access | ( | ) |
Whether the user should be blocked from starting a new attempt or continuing an attempt now.
Reimplemented from quiz_access_rule_base.
| time_left | ( | $ | attempt, |
| $ | timenow | ||
| ) |
If, because of this rule, the user has to finish their attempt by a certain time, you should override this method to return the amount of time left in seconds.
| object | $attempt | the current attempt |
| int | $timenow | the time now. We don't use $this->timenow, so we can give the user a more accurate indication of how much time is left. |
Reimplemented from quiz_access_rule_base.