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


Public Member Functions | |
| start_attempt (question_attempt_step $step, $variant) | |
| apply_attempt_state (question_attempt_step $step) | |
| get_question_summary () | |
| get_order (question_attempt $qa) | |
| get_response (question_attempt $qa) | |
| is_choice_selected ($response, $value) | |
| check_file_access ($qa, $options, $component, $filearea, $args, $forcedownload) | |
| make_html_inline ($html) | |
Data Fields | |
| const | LAYOUT_DROPDOWN = 0 |
| const | LAYOUT_VERTICAL = 1 |
| const | LAYOUT_HORIZONTAL = 2 |
| $answers | |
| $shuffleanswers | |
| $answernumbering | |
| $layout = self::LAYOUT_VERTICAL | |
| $correctfeedback | |
| $correctfeedbackformat | |
| $partiallycorrectfeedback | |
| $partiallycorrectfeedbackformat | |
| $incorrectfeedback | |
| $incorrectfeedbackformat | |
Protected Member Functions | |
| init_order (question_attempt $qa) | |
Protected Attributes | |
| $order = null | |
Base class for multiple choice questions. The parts that are common to single select and multiple select.
Definition at line 37 of file question.php.
| apply_attempt_state | ( | question_attempt_step $ | step | ) |
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.
| question_attempt_step | The first step of the question_attempt being loaded. |
Reimplemented from question_definition.
Reimplemented in qtype_calculatedmulti_multi_question, and qtype_calculatedmulti_single_question.
Definition at line 65 of file question.php.

| check_file_access | ( | $ | qa, |
| $ | options, | ||
| $ | component, | ||
| $ | filearea, | ||
| $ | args, | ||
| $ | forcedownload | ||
| ) |
Checks whether the users is allow to be served a particular file.
| question_attempt | $qa | the question attempt being displayed. |
| question_display_options | $options | the options that control display of the question. |
| string | $component | the name of the component we are serving files for. |
| string | $filearea | the name of the file area. |
| array | $args | the remaining bits of the file path. |
| bool | $forcedownload | whether the user must be forced to download the file. |
Reimplemented from question_definition.
Definition at line 94 of file question.php.

| get_order | ( | question_attempt $ | qa | ) |
Generate a brief, plain-text, summary of this question. This is used by various reports. This should show the particular variant of the question as presented to students. For example, the calculated quetsion type would fill in the particular numbers that were presented to the student. This method will return null if such a summary is not possible, or inappropriate.
Reimplemented from question_definition.
Definition at line 69 of file question.php.

| get_response | ( | question_attempt $ | qa | ) | [abstract] |
Reimplemented in qtype_multichoice_multi_question, and qtype_multichoice_single_question.

| init_order | ( | question_attempt $ | qa | ) | [protected] |
Definition at line 84 of file question.php.


| is_choice_selected | ( | $ | response, |
| $ | value | ||
| ) | [abstract] |
Reimplemented in qtype_multichoice_multi_question, and qtype_multichoice_single_question.

| make_html_inline | ( | $ | html | ) |
Definition at line 128 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(...).
| question_attempt_step | The first step of the question_attempt being started. Can be used to store state. | |
| int | $varant | which variant of this question to start. Will be between 1 and get_num_variants() inclusive. |
Reimplemented from question_definition.
Reimplemented in qtype_calculatedmulti_multi_question, and qtype_calculatedmulti_single_question.
Definition at line 57 of file question.php.

| $answernumbering |
Definition at line 45 of file question.php.
| $answers |
Definition at line 42 of file question.php.
| $correctfeedback |
Definition at line 48 of file question.php.
| $correctfeedbackformat |
Definition at line 49 of file question.php.
| $incorrectfeedback |
Definition at line 52 of file question.php.
| $incorrectfeedbackformat |
Definition at line 53 of file question.php.
| $layout = self::LAYOUT_VERTICAL |
Definition at line 46 of file question.php.
$order = null [protected] |
Definition at line 55 of file question.php.
| $partiallycorrectfeedback |
Definition at line 50 of file question.php.
| $partiallycorrectfeedbackformat |
Definition at line 51 of file question.php.
| $shuffleanswers |
Definition at line 44 of file question.php.
| const LAYOUT_DROPDOWN = 0 |
Definition at line 38 of file question.php.
| const LAYOUT_HORIZONTAL = 2 |
Definition at line 40 of file question.php.
| const LAYOUT_VERTICAL = 1 |
Definition at line 39 of file question.php.