Create a counter
With the counter you can score points after user actions, display the result and trigger actions based on the result. Make your counter by creating a Score variable or use an invisible Multi-State component.
Create a score variable
Let's take the example of a 20 question quiz, each question scores one point. The objective is to increment the score with the correct answers and display the user's final score.
Create the "score" variable
Data: /score Function: Increment Value: 1
Display "score" final value
Replace my-bind by:
Trigger an action based on score
If you want to trigger an action based on the score, you need to
create a condition.
Use an invisible Multi-state component
The Multi-state component allows you to reproduce a counter and all its states. For a 20 questions quizz where each question yields one point, the component includes n+1 states, where n is the number of points. This solution is not viable if the number of points is too high, you have to create a score variable.
Insert the Multi-state component
Create 21 states inside this component. Rename state 1 "zero", state 2 "one" etc...
Increment the component
Display a score
Tip : it is possible to go further and assign different scores depending on the answers. The Go to next state action includes an interval and it is possible to increment the number of your choice. It is also possible to make people lose points by using the Go to previous state action.