Module: playerapi/page/PageInteractionEventContext

This context provides methods to handle events in the quiz object scope.

To handle the differences between standard and HTML5 player, it is recommended
to take note of the following example.

Example

onCallback: function (dataTHML5, dataHTML4) {
    var data = dataHTML4 || dataTHML5;
    […]
}

Methods

<inner> bindOnCorrect(component)

Binds a component method to the bindOnCorrect event that is sent by the TTKF Player.

Preconditions:


  • The stated component must provide an "bindOnCorrect" method.


  • Works only for pages with interactions.

Callback time point:

  • When the user is triggering the correct interaction on the page.
Parameters:
Name Type Description
component Object

The component that provides the specified callback method.

<inner> bindOnWrong(component)

Binds a component method to the bindOnWrong event that is sent by the TTKF Player.

Preconditions:


  • The stated component must provide an "bindOnWrong" method.


  • Works only for pages with interactions.

Callback time point:


  • On every time the user is triggering an interaction, that is not allowed on the page.

  • On callback the method receives the following arguments:

    • data: Provides the current fields for the wrong interaction

      • feedback: the text to show the user for the wrong interaction




Parameters:
Name Type Description
component Object

The component that provides the specified callback method.