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

Public Member Functions

 description ()
 time_left ($attempt, $timenow)

Static Public Member Functions

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

Detailed Description

A rule representing the time limit. It does not actually restrict access, but we use this class to encapsulate some of the relevant code.

Definition at line 39 of file rule.php.


Member Function Documentation

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 50 of file rule.php.

Here is the call graph for this function:

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 41 of file rule.php.

Here is the call graph for this function:

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.

Parameters:
object$attemptthe current attempt
int$timenowthe time now. We don't use $this->timenow, so we can give the user a more accurate indication of how much time is left.
Returns:
mixed false if there is no deadline, of the time left in seconds if there is one.

Reimplemented from quiz_access_rule_base.

Definition at line 55 of file rule.php.


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