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


Public Member Functions | |
| can_analyse_responses () | |
| get_question_options ($question) | |
| save_question_options ($question) | |
| save_question ($authorizedquestion, $form) | |
| delete_question ($questionid, $contextid) | |
| get_random_guess_score ($questiondata) | |
Protected Member Functions | |
| initialise_question_instance ($question, $questiondata) | |
The multi-answer question type class.
Definition at line 38 of file questiontype.php.
Whether this question type can perform a frequency analysis of student responses.
If this method returns true, you must implement the get_possible_responses method, and the question_definition class must implement the classify_response method.
Reimplemented from question_type.
Definition at line 40 of file questiontype.php.
| delete_question | ( | $ | questionid, |
| $ | contextid | ||
| ) |
Deletes the question-type specific data when a question is deleted.
| int | $question | the question being deleted. |
| int | $contextid | the context this quesiotn belongs to. |
Reimplemented from question_type.
Definition at line 186 of file questiontype.php.
| get_question_options | ( | $ | question | ) |
Loads the question type specific options for the question.
This function loads any question type specific options for the question from the database into the question object. This information is placed in the $question->options field. A question type is free, however, to decide on a internal structure of the options field.
| object | $question | The question object for the question. This object should be updated to include the question type specific information (it is passed by reference). |
Reimplemented from question_type.
Definition at line 44 of file questiontype.php.

| get_random_guess_score | ( | $ | questiondata | ) |
| object | $question |
Reimplemented from question_type.
Definition at line 216 of file questiontype.php.

| initialise_question_instance | ( | $ | question, |
| $ | questiondata | ||
| ) | [protected] |
| save_question | ( | $ | question, |
| $ | form | ||
| ) |
Saves (creates or updates) a question.
Given some question info and some data about the answers this function parses, organises and saves the question It is used by question.php when saving new data from a form, and also by import.php when importing questions This function in turn calls save_question_options to save question-type specific data.
Whether we are saving a new question or updating an existing one can be determined by testing !empty($question->id). If it is not empty, we are updating.
The question will be saved in category $form->category.
| object | $question | the question object which should be updated. For a new question will be mostly empty. |
| object | $form | the object containing the information to save, as if from the question editing form. |
| object | $course | not really used any more. |
Question already exists, update.
Reimplemented from question_type.
Definition at line 171 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 question_type.
Definition at line 81 of file questiontype.php.
