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> bindOnBestPracticeSolution(component)
-
Binds a component method to the onBestPracticeSolution event that is sent by the TTKF Player.
Preconditions:
- Works only for quiz pages.
- The stated component must provide an "onBestPracticeSolution" method.
- On callback the method receives the following arguments:
- {object} event The event object
- {object} params Testrun parameters
- On callback the method receives the following arguments:
- state: Provides the current state of the test
- isPassed: true if the test is passed. Otherwise false
- isProvisionalPassed: true if the test is provisional passed. Otherwise false
- isFailed: true if the test is failed. Otherwise false
- currentTestRun: The current test run level
- testRuns: The max value of test runs. 0 if the testruns are set to infinity.
- isFinalized: true if the test is finished and the user is not allowed to make any changes on this test.
- text: Provides the texts to the test
- instruction
- feedback
- tip
- state: Provides the current state of the test
- On callback the method receives the following arguments:
Callback time point:
- The best practice solution is displayed.
Parameters:
Name Type Description component
Component The component that provides the specified callback method.
-
<inner> bindOnEvaluateTestRun(component)
-
Binds a component method to the onEvaluateTestRun event that is sent by the TTKF Player.
Preconditions:
- Works only for quiz pages.
- The stated component must provide an "onEvaluateTestRun" method.
- On callback the method receives the following arguments:
- {object} event The event object
- {object} params Testrun parameters
- On callback the method receives the following arguments:
- state: Provides the current state of the test
- isPassed: true if the test is passed. Otherwise false
- isProvisionalPassed: true if the test is provisional passed. Otherwise false
- isFailed: true if the test is failed. Otherwise false
- currentTestRun: The current test run level
- testRuns: The max value of test runs. 0 if the testruns are set to infinity.
- isFinalized: true if the test is finished and the user is not allowed to make any changes on this test.
- text: Provides the texts to the test
- instruction
- feedback
- tip
- state: Provides the current state of the test
- On callback the method receives the following arguments:
Callback time point:
- On every test run is evaluated.
Parameters:
Name Type Description component
Component The component that provides the specified callback method.
-
<inner> bindOnUserSolution(component)
-
Binds a component method to the onUserSolution event that is sent by the TTKF Player.
Preconditions:
- Works only for quiz pages.
- The stated component must provide an "onUserSolution" method.
- On callback the method receives the following arguments:
- {object} event The event object
- {object} params Testrun parameters
- On callback the method receives the following arguments:
- state: Provides the current state of the test
- isPassed: true if the test is passed. Otherwise false
- isProvisionalPassed: true if the test is provisional passed. Otherwise false
- isFailed: true if the test is failed. Otherwise false
- currentTestRun: The current test run level
- testRuns: The max value of test runs. 0 if the testruns are set to infinity.
- isFinalized: true if the test is finished and the user is not allowed to make any changes on this test.
- text: Provides the texts to the test
- instruction
- feedback
- tip
- state: Provides the current state of the test
- On callback the method receives the following arguments:
- Works only for quiz pages.
Callback time point:
- The user has no tries left and the result is displayed.
Parameters:
Name Type Description component
Component The component that provides the specified callback method.