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


Public Member Functions | |
| save_question_options ($question) | |
| comment_header ($question) | |
| comment_on_datasetitems ($qtypeobj, $questionid, $questiontext, $answers, $data, $number) | |
| get_virtual_qtype () | |
| get_possible_responses ($questiondata) | |
| move_files ($questionid, $oldcontextid, $newcontextid) | |
Protected Member Functions | |
| make_question_instance ($questiondata) | |
| initialise_question_instance (question_definition $question, $questiondata) | |
| delete_files ($questionid, $contextid) | |
The calculated multiple-choice question type.
Definition at line 39 of file questiontype.php.
| comment_header | ( | $ | question | ) |
Reimplemented from qtype_calculated.
Definition at line 193 of file questiontype.php.
| comment_on_datasetitems | ( | $ | qtypeobj, |
| $ | questionid, | ||
| $ | questiontext, | ||
| $ | answers, | ||
| $ | data, | ||
| $ | number | ||
| ) |
Reimplemented from qtype_calculated.
Definition at line 210 of file questiontype.php.

| delete_files | ( | $ | questionid, |
| $ | contextid | ||
| ) | [protected] |
Delete all the files belonging to this question.
| int | $questionid | the question being deleted. |
| int | $contextid | the context the question is in. |
Reimplemented from qtype_calculated.
Definition at line 288 of file questiontype.php.

| get_possible_responses | ( | $ | questiondata | ) |
This method should return all the possible types of response that are recognised for this question.
The question is modelled as comprising one or more subparts. For each subpart, there are one or more classes that that students response might fall into, each of those classes earning a certain score.
For example, in a shortanswer question, there is only one subpart, the text entry field. The response the student gave will be classified according to which of the possible $question->options->answers it matches.
For the matching question type, there will be one subpart for each question stem, and for each stem, each of the possible choices is a class of student's response.
A response is an object with two fields, ->responseclass is a string presentation of that response, and ->fraction, the credit for a response in that class.
Array keys have no specific meaning, but must be unique, and must be the same if this function is called repeatedly.
| object | $question | the question definition data. |
Reimplemented from qtype_calculated.
Definition at line 251 of file questiontype.php.

Reimplemented from qtype_calculated.
Definition at line 247 of file questiontype.php.

| initialise_question_instance | ( | question_definition $ | question, |
| $ | questiondata | ||
| ) | [protected] |
Initialise the common question_definition fields.
| question_definition | $question | the question_definition we are creating. |
| object | $questiondata | the question data loaded from the database. |
Reimplemented from qtype_calculated.
Definition at line 169 of file questiontype.php.

| make_question_instance | ( | $ | questiondata | ) | [protected] |
Create an appropriate question_definition for the question of this type using data loaded from the database.
| object | $questiondata | the question data loaded from the database. |
Reimplemented from question_type.
Definition at line 159 of file questiontype.php.

| move_files | ( | $ | questionid, |
| $ | oldcontextid, | ||
| $ | newcontextid | ||
| ) |
Move all the files belonging to this question from one context to another.
| int | $questionid | the question being moved. |
| int | $oldcontextid | the context it is moving from. |
| int | $newcontextid | the context it is moving to. |
Reimplemented from qtype_calculated.
Definition at line 274 of file questiontype.php.

| save_question_options | ( | $ | question | ) |
Saves question-type specific options
This is called by save_question() to save the question-type specific data
| object | $question | This holds the information from the editing form, it is not a standard question object. |
Reimplemented from qtype_calculated.
Definition at line 41 of file questiontype.php.
