Events

You can listen to all events in a session by registering through addExerciseListener(). An eventData object is passed with each event. The eventData.event property denotes the type of event and what eventData.data to expect with this event. These types are listed below including their specific data.


exercise-created

Submitted when the exercise with its initial interactions is created and ready in the web page.

Data

Property Type Description
element Element The DOM element of the exercise web component.

interaction-created

Submitted when an interaction widget is created and ready in the web page.

Data

Property Type Description
element Element The DOM element of the exercise web component.

interaction-activated

Submitted when an interaction widget is activated for the first time (e.g. the student clicked on the widget).


interaction-hint

The student requested a hint.


interaction-evaluate

The student submitted an (intermediate) step, which was evaluated by Algebrakit.

Data

Property Type Description
exerciseFinished boolean Indicates whether the interaction is now finished or not.
interactionType string The widget type (e.g. 'multistep', 'choice', etc
progress number Value in the range [0,1] indicating how far the student is with solving the exercise. Applies to exercises that contain multiple sub problems in the authored correction model.
replay boolean When true, the widget submitted this event while replaying all the events to reconstruct an already existing session. This applies when the student revisits an interaction or when the widget is created in review mode.
scoring Object Contains scoring information, if a scoring model is set in Create Session. See Scoring for more information.

interaction-finished

The student finished the interaction

Data Same as for interaction-evaluate


question-finished

All interactions in a question of the exercise are finished.

Data

Property Type Description
scoring Object Contains scoring information for all interactions in this question combined, if a scoring model is set in Create Session](/webservice/create-session). See Scoring for more information.
replay boolean When true, the widget submitted this event while replaying all the events to reconstruct an already existing session. This applies when the student revisits an interaction or when the widget is created in review mode.

exercise-finished

All interactions in the exercise are finished.

Data

Property Type Description
scoring Object Contains scoring information for this exercise, if a scoring model is set in Create Session](/webservice/create-session). See Scoring for more information.
replay boolean When true, the widget submitted this event while replaying all the events to reconstruct an already existing session. This applies when the student revisits an interaction or when the widget is created in review mode.