Initialization Option Items API

readyListener

This function is called when the API has been successfully initialized.

You would want to use this callback so that you can run your own application logic after the assessment has completed loading, such as adding event listeners for Items API Events or injecting additional content into the page, for example.

Examples

var callbacks = {
    readyListener: function () {
        console.log('The callback that is executed when the API has been successfully initialized.');

        // Example event listener that runs when the assessment has started
        itemsApp.on('test:start', function () {
            console.log('The assessment has started.');
        });
    },
    // ...
};

var itemsApp = window.LearnosityItems.init(
    initializationOptions,
    callbacks
);

Values

Type function

Related articles

Was this article helpful?