Events

This article describes the Events that Reports API provides, and details how the to bind function callbacks to these events.

Supported Events

Reports API provides methods which provide the ability to bind callback functions to particular events, usually triggered by user actions, or specific events occurring in a report.

To learn more about how to bind to these events, please see the on() method for the Report Object on our Methods section.

Example

var report = reportsApp.getReport("report-1");

report.on("load:data", function(data) {
    console.log("this item has been loaded with the following data: ", data);
});

        

Common events

Common events are events that are shared between all reports, and provide mechanisms such as accessing raw data behind a report.

Event name Description Event data
load:data
This event is raised when a report has successfully pulled down the data it needs to render from Learnosity infrastructure.
  • data - object
    The data for this report

Click events

Click events are events that are provided by certain reports, to provide mechanisms to bind to specific click events within the report.

They are not available on every report - the specific reports that can use these events are noted below

Event name Description Event data
click:activity

This event is raised when someone clicks on the 'activity' field in certain reports.

This functionality is available in:

  • activity_id - string
    the id of the clicked activity.
click:progress

This event is raised when someone clicks on the 'progress' field in certain reports.

This functionality is available in:

  • user_id - string
    the id of the clicked user.
  • tag_type - string
    the tag type that has been clicked.
  • tag_name - string
    the tag name that has been clicked.
click:score

This event is raised when someone clicks on the 'score' field in certain reports.

This functionality is available in:

  • activity_id - string
    the activity_id associated with the clicked user row.
  • session_id - string
    the session_id associated with the clicked user row.
  • user_id - string
    the id of the clicked user.
click:session

This event is raised when someone clicks on the 'session' field in certain reports.

This functionality is available in:

  • session_id - string
    the session_id associated with the clicked user row.
  • activity_id - string
    the activity_id associated with the clicked user row.
  • user_id - string
    the id of the clicked user.
click:tag

This event is raised when someone clicks on the 'tag' field in certain reports.

This functionality is available in:

  • tag_type - string
    the tag type that has been clicked.
  • tag_name - string
    the tag name that has been clicked.
click:user

This event is raised when someone clicks on the 'user' field in certain reports.

This functionality is available in:

  • session_id - string
    the session_id associated with the clicked user row.
  • activity_id - string
    the activity_id associated with the clicked user row.
  • user_id - string
    the id of the clicked user.

API Ready events

API ready events are events that are provided by certain reports, to provide mechanisms to access the underlying Assessment API used to render the items and questions.

They are not available on every report - the specific reports that can use these events are noted below

Event name Description Event data
ready:itemsApi

This event is raised when Reports API has used Items API to render a visual report, showing the students responses.

This functionality is available in:

  • itemsApp - Items API application instance
    the itemsApp instance used to render the report
ready:questionsApi

This event is raised when Reports API has used Questions API to render a visual report, showing the students responses.

This functionality is available in:

Live progress events

Live progress events are events that are provided by certain reports, to provide mechanisms to bind to events raised through Learnosity's Events API.

They are only available when using the live-activitystatus-by-user report.

Event name Description Event data
start

Student started test. eg, "Start" button clicked.

paused

Student paused test. eg, A modal has been opened.

resumed

Student resumed test. eg, A modal has been closed.

saved

Test saved successfully.

submit

Test submitted successfully.

terminate

Test(session) abandoned.

progressed

Student navigated to another item.

consumed

Audio playback completed or stopped.

Aggregate report events

Click events are events that are provided by certain reports, to provide mechanisms to bind to specific click events within the report.

They are not available on every report - the specific reports that can use these events are noted below

Event name Description Event data
change:data

This event is raised in large scale aggregate reports, when users take an action that causes the report to pull new information.

This functionality is available in:

Fires after the data for a new group_path is loaded, in response to user navigation or a call to viewGroup().

The event handler is passed the raw data object for the newly loaded group_path.

The object structure is equivalent to that available via getGroup().

  • data - object
    the group hierarchy information for this specific group path.