This context provides methods to use components as quiz objects.
Members
-
<inner> event :Object
-
This object provides methods to handle events in the quiz object scope.
Type:
- Object
Methods
-
<inner> add(component, groupId, isCorrectSelectionRequired)
-
Adds a component as a quiz object (e.g. Multiple Choice or Drag&Drop element) to the current quiz page context.
The following event callbacks will be registered automatically if the stated component provides the according methods:- standardPlayer/PageQuizEventContext.bindOnEvaluateTestRun
- standardPlayer/PageQuizEventContext.bindOnUserSolution
- standardPlayer/PageQuizEventContext.bindOnBestPracticeSolution
Parameters:
Name Type Description component
Component A component.
groupId
string The group id.
isCorrectSelectionRequired
Boolean Determine thats the component must be selected (true) for a correct answer or not (false).
- See:
-
- module:standardPlayer/PageQuizEventContext}
-
<inner> evaluate()
-
Tells the TTKF Player to evaluate a quiz. Only available on quiz pages.
-
<inner> setSelected(component, isSelected)
-
Sets the selected state of a quiz object.
Parameters:
Name Type Description component
Component A component.
isSelected
boolean Sets the selected state.
-
<inner> switchToBestPracticeSolution()
-
Switches to the best practice result. Only available on quiz pages.
-
<inner> switchToUserSolution()
-
Tells the TTKF Player to switch to the user solution mode. As a result, the player sends
the onUserSolution event and will displaying the result for the current quiz page.
Only available on quiz pages.