Moodle APIs 4.3
Moodle 4.3.6 (Build: 20240812)
|
Test subclass to allow access to some protected data so that the correct behaviour can be verified. More...
Public Member Functions | |
get_attempts_added () | |
get_attempts_modified () | |
get_metadata_added () | |
get_metadata_modified () | |
get_modified () | |
get_steps_added () | |
get_steps_deleted () | |
get_steps_modified () | |
notify_attempt_added (question_attempt $qa) | |
Called when a new question attempt is added to this usage. | |
notify_attempt_modified (question_attempt $qa) | |
Called when the fields of a question attempt in this usage are modified. | |
notify_attempt_moved (question_attempt $qa, $oldslot) | |
Called when a question_attempt has been moved to a new slot. | |
notify_metadata_added (question_attempt $qa, $name) | |
Called when a new metadata variable is set on a question attempt in this usage. | |
notify_metadata_modified (question_attempt $qa, $name) | |
Called when a metadata variable on a question attempt in this usage is updated. | |
notify_modified () | |
Called when a field of the question_usage_by_activity is changed. | |
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. | |
notify_step_deleted (question_attempt_step $step, question_attempt $qa) | |
Called when a new step is updated in a question attempt in this usage. | |
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. | |
save (question_engine_data_mapper $dm) | |
Write all the changes we have recorded to the database. | |
Protected Member Functions | |
is_step_added (question_attempt_step $step) | |
Determine if a step is new. | |
is_step_deleted (question_attempt_step $step) | |
is_step_modified (question_attempt_step $step) | |
Determine if a step is modified. | |
Protected Attributes | |
question_attempt[] | $attemptsadded = array() |
list of slot => that have been added to the usage. | |
question_attempt[] | $attemptsdeleted = array() |
list of slot => that have been added to the usage. | |
question_attempt[] | $attemptsmodified = array() |
list of slot => that were already in the usage, and which have been modified. | |
array | $metadataadded = array() |
int slot => string name => question_attempt. | |
array | $metadatamodified = array() |
int slot => string name => question_attempt. | |
boolean | $modified = false |
whether any of the fields of the usage have been changed. | |
question_usage_by_activity | $quba |
the usage being tracked. | |
array | $stepsadded = array() |
of array(question_attempt_step, question_attempt id, seq number) of steps that have been added to question attempts in this usage. | |
question_attempt_step[] | $stepsdeleted = array() |
list of question_attempt_step.id => question_attempt_step of steps that were previously stored in the database, but which are no longer required. | |
array | $stepsmodified = array() |
of array(question_attempt_step, question_attempt id, seq number) of steps that have been modified in their attempt. | |
Test subclass to allow access to some protected data so that the correct behaviour can be verified.
|
protectedinherited |
Determine if a step is new.
If so get its array key.
question_attempt_step | $step | a step |
int|false | if the step is in the list of steps to be added, return the key, otherwise return false. |
|
protectedinherited |
question_attempt_step | $step | a step |
bool | whether the step is in the list of steps to be deleted. |
|
protectedinherited |
Determine if a step is modified.
If so get its array key.
question_attempt_step | $step | a step |
int|false | if the step is in the list of steps to be modified, return the key, otherwise return false. |
|
inherited |
Called when a new question attempt is added to this usage.
question_attempt | $qa | the newly added question attempt. |
Implements question_usage_observer.
|
inherited |
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.
|
inherited |
Called when a question_attempt has been moved to a new slot.
question_attempt | $qa | The question attempt that was moved. |
int | $oldslot | The previous slot number of that attempt. |
Implements question_usage_observer.
|
inherited |
Called when a new metadata variable is set on a question attempt in this usage.
question_attempt | $qa | the question attempt the metadata is being added to. |
int | $name | the name of the metadata variable added. |
Implements question_usage_observer.
|
inherited |
Called when a metadata variable on a question attempt in this usage is updated.
question_attempt | $qa | the question attempt where the metadata is being modified. |
int | $name | the name of the metadata variable modified. |
Implements question_usage_observer.
|
inherited |
Called when a field of the question_usage_by_activity is changed.
Implements question_usage_observer.
|
inherited |
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.
|
inherited |
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.
|
inherited |
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.
|
inherited |
Write all the changes we have recorded to the database.
question_engine_data_mapper | $dm | the mapper to use to update the database. |