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


Public Member Functions | |
| requires_qtypes () | |
| is_usable_by_random () | |
| get_question_options ($question) | |
| save_question_options ($question) | |
| delete_question ($questionid, $contextid) | |
| create_session_and_responses (&$question, &$state, $cmoptions, $attempt) | |
| restore_session_and_responses (&$question, &$state) | |
| get_sa_candidates ($categorylist, $questionsinuse=0) | |
| get_random_guess_score ($question) | |
Data Fields | |
| const | MAX_SUBQUESTIONS = 10 |
The randomsamatch question type class.
TODO: Make sure short answer questions chosen by a randomsamatch question can not also be used by a random question
Definition at line 39 of file questiontype.php.
| create_session_and_responses | ( | &$ | question, |
| &$ | state, | ||
| $ | cmoptions, | ||
| $ | attempt | ||
| ) |
| 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 85 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 50 of file questiontype.php.

| get_random_guess_score | ( | $ | question | ) |
| object | $question |
Reimplemented from question_type.
Definition at line 251 of file questiontype.php.
| get_sa_candidates | ( | $ | categorylist, |
| $ | questionsinuse = 0 |
||
| ) |
Reimplemented from question_type.
Definition at line 46 of file questiontype.php.
| requires_qtypes | ( | ) |
Definition at line 42 of file questiontype.php.
| restore_session_and_responses | ( | &$ | question, |
| &$ | state | ||
| ) |
| 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 63 of file questiontype.php.
| const MAX_SUBQUESTIONS = 10 |
Definition at line 40 of file questiontype.php.