Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
question_usage_observer Interface Reference

Interface for things that want to be notified of signficant changes to a question_usage_by_activity. More...

Inheritance diagram for question_usage_observer:
question_engine_unit_of_work question_usage_null_observer testable_question_engine_unit_of_work

Public Member Functions

 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.
 

Detailed Description

Interface for things that want to be notified of signficant changes to a question_usage_by_activity.

A question behaviour controls the flow of actions a student can take as they work through a question, and later, as a teacher manually grades it.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ notify_attempt_added()

question_usage_observer::notify_attempt_added ( question_attempt $qa)

Called when a new question attempt is added to this usage.

Parameters
question_attempt$qathe newly added question attempt.

Implemented in question_engine_unit_of_work, and question_usage_null_observer.

◆ notify_attempt_modified()

question_usage_observer::notify_attempt_modified ( question_attempt $qa)

Called when the fields of a question attempt in this usage are modified.

Parameters
question_attempt$qathe newly added question attempt.

Implemented in question_engine_unit_of_work, and question_usage_null_observer.

◆ notify_attempt_moved()

question_usage_observer::notify_attempt_moved ( question_attempt $qa,
$oldslot )

Called when a question_attempt has been moved to a new slot.

Parameters
question_attempt$qaThe question attempt that was moved.
int$oldslotThe previous slot number of that attempt.

Implemented in question_engine_unit_of_work, and question_usage_null_observer.

◆ notify_metadata_added()

question_usage_observer::notify_metadata_added ( question_attempt $qa,
$name )

Called when a new metadata variable is set on a question attempt in this usage.

Parameters
question_attempt$qathe question attempt the metadata is being added to.
int$namethe name of the metadata variable added.

Implemented in question_engine_unit_of_work, and question_usage_null_observer.

◆ notify_metadata_modified()

question_usage_observer::notify_metadata_modified ( question_attempt $qa,
$name )

Called when a metadata variable on a question attempt in this usage is updated.

Parameters
question_attempt$qathe question attempt where the metadata is being modified.
int$namethe name of the metadata variable modified.

Implemented in question_engine_unit_of_work, and question_usage_null_observer.

◆ notify_modified()

question_usage_observer::notify_modified ( )

Called when a field of the question_usage_by_activity is changed.

Implemented in question_engine_unit_of_work, and question_usage_null_observer.

◆ notify_step_added()

question_usage_observer::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.

Parameters
question_attempt_step$stepthe new step.
question_attempt$qathe usage it is being added to.
int$seqthe sequence number of the new step.

Implemented in question_engine_unit_of_work, and question_usage_null_observer.

◆ notify_step_deleted()

question_usage_observer::notify_step_deleted ( question_attempt_step $step,
question_attempt $qa )

Called when a new step is updated in a question attempt in this usage.

Parameters
question_attempt_step$stepthe step to delete.
question_attempt$qathe usage it is being added to.

Implemented in question_engine_unit_of_work, and question_usage_null_observer.

◆ notify_step_modified()

question_usage_observer::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.

Parameters
question_attempt_step$stepthe step that was updated.
question_attempt$qathe usage it is being added to.
int$seqthe sequence number of the new step.

Implemented in question_engine_unit_of_work, and question_usage_null_observer.


The documentation for this interface was generated from the following file: