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:
- The stated component must provide an "onBestPracticeSolution" method.
- Works only for quiz pages.
Callback time point:
- The best practice solution is displayed.
- 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
Parameters:
Name Type Description component
Object 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:
- The stated component must provide an "onEvaluateTestRun" method.
- Works only for quiz pages.
Callback time point:
- On every test run is evaluated.
- 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
Parameters:
Name Type Description component
Object 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:
- The stated component must provide an "onUserSolution" method.
- Works only for quiz pages.
Callback time point:
- The user has no tries left and the result is displayed.
- 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
Parameters:
Name Type Description component
Object The component that provides the specified callback method.