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

Public Member Functions

 start_attempt (question_attempt_step $step, $variant)
 apply_attempt_state (question_attempt_step $step)
 calculate_all_expressions ()

Data Fields

 $datasetloader
 $vs
 $synchronised

Detailed Description

Represents a calculated multiple-choice multiple-response question.

Definition at line 90 of file question.php.


Member Function Documentation

When an in-progress question_attempt is re-loaded from the database, this method is called so that the question can re-initialise its internal state as needed by this attempt.

For example, the multiple choice question type needs to set the order of the choices to the order that was set up when start_attempt was called originally. All the information required to do this should be in the $step object, which is the first step of the question_attempt being loaded.

Parameters:
question_attempt_stepThe first step of the question_attempt being loaded.

Reimplemented from qtype_multichoice_base.

Definition at line 110 of file question.php.

Replace all the expression in the question definition with the values computed from the selected dataset by calling $this->vs->calculate() and $this->vs->replace_expressions_in_text() on the parts of the question that require it.

Implements qtype_calculated_question_with_expressions.

Definition at line 115 of file question.php.

start_attempt ( question_attempt_step step,
variant 
)

Start a new attempt at this question, storing any information that will be needed later in the step.

This is where the question can do any initialisation required on a per-attempt basis. For example, this is where the multiple choice question type randomly shuffles the choices (if that option is set).

Any information about how the question has been set up for this attempt should be stored in the $step, by calling $step->set_qt_var(...).

Parameters:
question_attempt_stepThe first step of the question_attempt being started. Can be used to store state.
int$varantwhich variant of this question to start. Will be between 1 and get_num_variants() inclusive.

Reimplemented from qtype_multichoice_base.

Definition at line 105 of file question.php.


Field Documentation

$datasetloader

Definition at line 94 of file question.php.

$synchronised

Definition at line 103 of file question.php.

$vs

Definition at line 97 of file question.php.


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