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


Public Member Functions | |
| is_real_question_type () | |
| is_usable_by_random () | |
| can_analyse_responses () | |
| save_question ($question, $form) | |
| actual_number_of_questions ($question) | |
| get_random_guess_score ($questiondata) | |
The description 'question' type.
Definition at line 38 of file questiontype.php.
| actual_number_of_questions | ( | $ | question | ) |
Returns the number of question numbers which are used by the question
This function returns the number of question numbers to be assigned to the question. Most question types will have length one; they will be assigned one number. The 'description' type, however does not use up a number and so has a length of zero. Other question types may wish to handle a bundle of questions and hence return a number greater than one.
| object | $question | The question whose length is to be determined. Question type specific information is included. |
Used for the feature number-of-questions-per-page to determine the actual number of questions wrapped by this question. The question type description is not even a question in itself so it will return ZERO!
Reimplemented from question_type.
Definition at line 58 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 47 of file questiontype.php.
| get_random_guess_score | ( | $ | questiondata | ) |
| object | $question |
Reimplemented from question_type.
Definition at line 67 of file questiontype.php.
Reimplemented from question_type.
Definition at line 39 of file questiontype.php.
Reimplemented from question_type.
Definition at line 43 of file questiontype.php.
| 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 51 of file questiontype.php.