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


Public Member Functions | |
| __construct () | |
| make_behaviour (question_attempt $qa, $preferredbehaviour) | |
| get_expected_data () | |
| get_correct_response () | |
| get_question_summary () | |
This class represents a 'question' that actually does not allow the student to respond, like the description 'question' type.
Definition at line 350 of file questionbase.php.
| __construct | ( | ) |
Constructor. Normally to get a question, you call question_bank::load_question(), but questions can be created directly, for example in unit test code.
Reimplemented from question_definition.
Definition at line 351 of file questionbase.php.
What data would need to be submitted to get this question correct. If there is more than one correct answer, this method should just return one possibility. If it is not possible to compute a correct response, this method should return null.
Reimplemented from question_definition.
Definition at line 367 of file questionbase.php.
What data may be included in the form submission when a student submits this question in its current state?
This information is used in calls to optional_param. The parameter name has question_attempt::get_field_prefix() automatically prepended.
Reimplemented from question_definition.
Definition at line 363 of file questionbase.php.
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 371 of file questionbase.php.
| make_behaviour | ( | question_attempt $ | qa, |
| $ | preferredbehaviour | ||
| ) |
Creat the appropriate behaviour for an attempt at this quetsion, given the desired (archetypal) behaviour.
This default implementation will suit most normal graded questions.
If your question is of a patricular type, then it may need to do something different. For example, if your question can only be graded manually, then it should probably return a manualgraded behaviour, irrespective of what is asked for.
If your question wants to do somthing especially complicated is some situations, then you may wish to return a particular behaviour related to the one asked for. For example, you migth want to return a qbehaviour_interactive_adapted_for_myqtype.
| question_attempt | $qa | the attempt we are creating an behaviour for. |
| string | $preferredbehaviour | the requested type of behaviour. |
Reimplemented from question_definition.
Definition at line 358 of file questionbase.php.
