Add Scoring Variables

Create new variables to keep score and track correct answers.

Step 1

Create two new Variables called “Score” and “CorrectAnswers”:

  • The Score Variable will record the score, beginning at “0”
  • The CorrectAnswers Variable will keep track of whether the user has answered the question correctly before or not

If you didn’t include the CorrectAnswers Variable, the user would be able to cheat by clicking on the right answer again and again to gain extra points!

Step 2

To add scoring to the AfterPicking event, insert another If...Then... block.

Step 3

The If Statement should say “If the user has not answered the question correctly before, then increase the score by one, change the Score Label text and update the CorrectAnswers Variable.”

See the example below:

Step 4

Test the code now! Your app now keeps score!