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


Public Member Functions | |
| __construct (question_usage_by_activity $quba) | |
| notify_modified () | |
| notify_attempt_modified (question_attempt $qa) | |
| notify_attempt_added (question_attempt $qa) | |
| notify_step_added (question_attempt_step $step, question_attempt $qa, $seq) | |
| notify_step_modified (question_attempt_step $step, question_attempt $qa, $seq) | |
| notify_step_deleted (question_attempt_step $step, question_attempt $qa) | |
| save (question_engine_data_mapper $dm) | |
Protected Member Functions | |
| is_step_added (question_attempt_step $step) | |
| is_step_modified (question_attempt_step $step) | |
| is_step_deleted (question_attempt_step $step) | |
Protected Attributes | |
| $quba | |
| $modified = false | |
| $attemptsmodified = array() | |
| $attemptsadded = array() | |
| $stepsadded = array() | |
| $stepsmodified = array() | |
| $stepsdeleted = array() | |
Implementation of the unit of work pattern for the question engine.
See http://martinfowler.com/eaaCatalog/unitOfWork.html. This tracks all the changes to a question_usage_by_activity, and its constituent parts, so that the changes can be saved to the database when save() is called.
Definition at line 1006 of file datalib.php.
| __construct | ( | question_usage_by_activity $ | quba | ) |
Constructor.
| question_usage_by_activity | $quba | the usage to track. |
Definition at line 1047 of file datalib.php.
| is_step_added | ( | question_attempt_step $ | step | ) | [protected] |
| question_attempt_step | $step | a step |
Definition at line 1145 of file datalib.php.

| is_step_deleted | ( | question_attempt_step $ | step | ) | [protected] |
| question_attempt_step | $step | a step |
Definition at line 1174 of file datalib.php.

| is_step_modified | ( | question_attempt_step $ | step | ) | [protected] |
| question_attempt_step | $step | a step |
Definition at line 1160 of file datalib.php.

| notify_attempt_added | ( | question_attempt $ | qa | ) |
Called when a new question attempt is added to this usage.
| question_attempt | $qa | the newly added question attempt. |
Implements question_usage_observer.
Definition at line 1062 of file datalib.php.

Called when the fields of a question attempt in this usage are modified.
| question_attempt | $qa | the newly added question attempt. |
Implements question_usage_observer.
Definition at line 1055 of file datalib.php.

| notify_modified | ( | ) |
Called when a field of the question_usage_by_activity is changed.
Implements question_usage_observer.
Definition at line 1051 of file datalib.php.
| notify_step_added | ( | question_attempt_step $ | step, |
| question_attempt $ | qa, | ||
| $ | seq | ||
| ) |
Called when a new step is added to a question attempt in this usage.
| question_attempt_step | $step | the new step. |
| question_attempt | $qa | the usage it is being added to. |
| int | $seq | the sequence number of the new step. |
Implements question_usage_observer.
Definition at line 1066 of file datalib.php.

| notify_step_deleted | ( | question_attempt_step $ | step, |
| question_attempt $ | qa | ||
| ) |
Called when a new step is updated in a question attempt in this usage.
| question_attempt_step | $step | the step to delete. |
| question_attempt | $qa | the usage it is being added to. |
Implements question_usage_observer.
Definition at line 1118 of file datalib.php.

| notify_step_modified | ( | question_attempt_step $ | step, |
| question_attempt $ | qa, | ||
| $ | seq | ||
| ) |
Called when a new step is updated in a question attempt in this usage.
| question_attempt_step | $step | the step that was updated. |
| question_attempt | $qa | the usage it is being added to. |
| int | $seq | the sequence number of the new step. |
Implements question_usage_observer.
Definition at line 1097 of file datalib.php.

| save | ( | question_engine_data_mapper $ | dm | ) |
Write all the changes we have recorded to the database.
| question_engine_data_mapper | $dm | the mapper to use to update the database. |
Definition at line 1187 of file datalib.php.

$attemptsadded = array() [protected] |
Definition at line 1023 of file datalib.php.
$attemptsmodified = array() [protected] |
Definition at line 1017 of file datalib.php.
$modified = false [protected] |
Definition at line 1011 of file datalib.php.
$quba [protected] |
Definition at line 1008 of file datalib.php.
$stepsadded = array() [protected] |
Definition at line 1029 of file datalib.php.
$stepsdeleted = array() [protected] |
Definition at line 1041 of file datalib.php.
$stepsmodified = array() [protected] |
Definition at line 1035 of file datalib.php.