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


Public Member Functions | |
| is_compatible_question (question_definition $question) | |
| get_min_fraction () | |
| get_right_answer_summary () | |
| process_action (question_attempt_pending_step $pendingstep) | |
| process_save (question_attempt_pending_step $pendingstep) | |
| summarise_action (question_attempt_step $step) | |
| process_finish (question_attempt_pending_step $pendingstep) | |
Static Public Member Functions | |
| static | get_unused_display_options () |
Data Fields | |
| const | IS_ARCHETYPAL = true |
Question behaviour for deferred feedback.
The student enters their response during the attempt, and it is saved. Later, when the whole attempt is finished, their answer is graded.
Definition at line 40 of file behaviour.php.
| get_min_fraction | ( | ) |
What is the minimum fraction that can be scored for this question. Normally this will be based on $this->question->get_min_fraction(), but may be modified in some way by the model.
Reimplemented from question_behaviour.
Reimplemented in qbehaviour_deferredcbm.
Definition at line 52 of file behaviour.php.
Generate a brief, plain-text, summary of the correct answer to this question. This is used by various reports, and can also be useful when testing. This method will return null if such a summary is not possible, or inappropriate.
Reimplemented from question_behaviour.
Reimplemented in qbehaviour_deferredcbm.
Definition at line 56 of file behaviour.php.
| static get_unused_display_options | ( | ) | [static] |
'Override' this method if there are some display options that do not make sense 'during the attempt'.
Reimplemented from question_behaviour.
Reimplemented in qbehaviour_deferredcbm.
Definition at line 47 of file behaviour.php.
| is_compatible_question | ( | question_definition $ | question | ) |
Some behaviours can only work with certing types of question. This method allows the behaviour to verify that a question is compatible.
This implementation is only provided for backwards-compatibility. You should override this method if you are implementing a behaviour.
| question_definition | $question | the question. |
Reimplemented from question_behaviour.
Definition at line 43 of file behaviour.php.
| process_action | ( | question_attempt_pending_step $ | pendingstep | ) |
The main entry point for processing an action.
All the various operations that can be performed on a question_attempt get channeled through this function, except for question_attempt::start() which goes to init_first_step(). question_attempt::finish() becomes an action with im vars finish => 1, and manual comment/grade becomes an action with im vars comment => comment text, and mark => ..., max_mark => ... if the question is graded.
This method should first determine whether the action is significant. For example, if no actual action is being performed, but instead the current responses are being saved, and there has been no change since the last set of responses that were saved, this the action is not significatn. In this case, this method should return question_attempt::DISCARD. Otherwise it should return question_attempt::KEEP.
If the action is significant, this method should also perform any necessary updates to $pendingstep. For example, it should call question_attempt_step::set_state() to set the state that results from this action, and if this is a grading action, it should call question_attempt_step::set_fraction().
This method can also call question_attempt_step::set_behaviour_var() to store additional infomation. There are two main uses for this. This can be used to store the result of any randomisation done. It is important to store the result of randomisation once, and then in future use the same outcome if the actions are ever replayed. This is how regrading works. The other use is to cache the result of expensive computations performed on the raw response data, so that subsequent display and review of the question does not have to repeat the same expensive computations.
Often this method is implemented as a dispatching method that examines the pending step to determine the kind of action being performed, and then calls a more specific method like process_save() or process_comment(). Look at some of the standard behaviours for examples.
| question_attempt_pending_step | $pendingstep | a partially initialised step containing all the information about the action that is being peformed. This information can be accessed using question_attempt_step::get_behaviour_var(). |
Reimplemented from question_behaviour.
Definition at line 60 of file behaviour.php.

| process_finish | ( | question_attempt_pending_step $ | pendingstep | ) |
Reimplemented in qbehaviour_deferredcbm.
Definition at line 107 of file behaviour.php.


| process_save | ( | question_attempt_pending_step $ | pendingstep | ) |
Implementation of processing a save action that should be suitable for most subclasses.
| question_attempt_pending_step | $pendingstep | a partially initialised step containing all the information about the action that is being peformed. |
Reimplemented from question_behaviour_with_save.
Definition at line 76 of file behaviour.php.


| summarise_action | ( | question_attempt_step $ | step | ) |
Reimplemented from question_behaviour.
Reimplemented in qbehaviour_deferredcbm.
Definition at line 97 of file behaviour.php.

| const IS_ARCHETYPAL = true |
Reimplemented from question_behaviour.
Reimplemented in qbehaviour_deferredcbm.
Definition at line 41 of file behaviour.php.