Resetting a Variable on Retry Quiz Button

Jan 16, 2024

Hi everyone,

Client wants a "number of questions correct/total questions" listed next to the percentage score. I created a variable "questionscorrect" to represent "number of questions correct" on the results screen (the total questions is just represented by a text box ). I have been able to get it to total the "number of questions correct" but for the life of me I can't get it to reset when the learner wants to retry the quiz. I tried:

Adjust Variable

Set QuestionsCorrect to Value to 0

When the User clicks Retry Button

But it will not reset to 0. Since the client wants to provide the learner the option to Review their responses before they submit all answers I can't set the variable to 0 when the timeline starts on the first question slide. Any other ideas to try on the Results slide so it will reset to 0 when they click Retry only? 

 

12 Replies
Judy Nollet

Here's a simpler way to show the number of correctly answered questions: 

In FORM VIEW on each question, change the Points value to 1

When every question is worth 1 point, the built-in [Quiz].ScorePoints variable will be the number of correctly answered questions. So you can display that variable, and it will reset automatically every time the user retakes the quiz. 

Obviously, this won't work if you have weighted questions or responses. But if the current questions are all worth the default 10 points (with no partial scores on multiple-choice questions), then making them all worth 1 point will give you same % score. 

Judy Nollet

Whether each question is worth 1, 5, 10, or some other number of points, the program will calculate the percentage for 16 out of 20 questions as 80%.

This is shown in the attached file. Answer 16 of the twenty 1-point questions correctly, and the Results slide will show the Success layer and display that you got 80% (16 questions) correct. 

Judy Nollet

Do you have more than one Results slide in the course? If so, you might be referencing the wrong variable.

Did you duplicate or import the Results slide? If so, that might be the problem. (Because inserting a Results slide automatically creates the appropriate built-in variables, a Results slide that is duplicated or imported usually won't work correctly.) 

It's virtually impossible to troubleshoot without seeing the .story file. Here are the best practices for uploading a .story file:

  • Only include slides that are involved in the problem.
  • Be sure all objects, layers, motion paths, and variables have meaningful names.
  • If there is proprietary content, replace or delete it. For example, replace proprietary text with ipsum lorem text.
  • Be sure to clearly describe the following (in the file and/or in the question posted in the discussion):
    • What you want to happen
    • What is not happening that should happen
    • What is happening that shouldn’t happen
    • What you have tried
Marissa Sterl

Thank you Judy, appreciate your determination to help me. Here is the file. I just need the ratio of "questions answered correctly/total number of questions" i.e. x/9 to appear on the results screen whether they pass or fail. As you will see in the file learners have the opportunity to Review their answers before submitting for a grade and then again after they receive their grade. They also have an opportunity to Retry regardless of their grade. I created a questionscorrect variable and and on the results slide set it to set it's value back to 0 when the learner clicks the Retry button. When I test it, the ratio is correctly displayed when the learner attempts the quiz the first time but it just keeps adding to the previous number if they Retry (for example first try 8/9, Retry 16/9). Hope this helps, I left the variable in and the ratio place holder on the Results slide. 

Judy Nollet

The file you attached doesn't assign 1 point to each question, as I suggested. Most of them are worth 11 points; one was worth 12 points.

The attached file has all nine questions worth 1 point each. And the Results slide references the built-in Quiz1.ScorePoints variable.

As I said above, when each question is worth 1 point, the [Quiz].ScorePoints variable will equal the number of questions that the user answered correctly. 

FYI: Here's the User Guide info about finding built-in variables: Variables in Storyline 360 - E-Learning Heroes (articulate.com) 

Judy Nollet

Do the math:

Assume there are 20 questions, and the passing score is 80%.

For 5-point questions

  • 20 question x 5 points each = 100 total points
  • 100 x 0.80  = 80 points needed for a score of 80%
  • 80 points ÷ 5 points per question = 16 correctly answered questions for a score of 80%

For 1-point questions

  • 20 questions x 1 point each = 20 total points
  • 20 x 0.80 = 16 points needed for a score of 80%
  • 16 points ÷ 1 point per question = 16 correctly answered questions for a score of 80%

Thus, a quiz with 1 point/question will be scored the same as a quiz with 5 points/question. But using only 1 point/question lets you take advantage of the built-in [Quiz].ScorePoints variable to display the number of correctly answered questions—as demonstrated in the file I attached previously.

I'm afraid I don’t have any more ways to explain that, when all of the questions have the same point value, the number of points per question doesn’t affect the number of correctly answered questions needed to achieve a given percentage. And I don’t see any good reason for requiring the points/question to be higher than 1.

If your client insists on using 5-point questions (despite that having no impact on scoring), then you will need to use a Project variable to track the number of correctly answered questions, as you described in your original post. If you can't get that to work, upload a copy of the .story file so it's available if someone wants to assist with further troubleshooting.