Forum Discussion

MarissaSterl's avatar
MarissaSterl
Community Member
8 months ago

Resetting a Variable on Retry Quiz Button

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? 

 

  • 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. 

    • MarissaSterl's avatar
      MarissaSterl
      Community Member

      Thanks Judy, unfortunately each question is worth 5 points. She wants to show the learner the percentage AND the number of correctly answered questions :( i.e. 80% (16/20) 

  • 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. 

    • MarissaSterl's avatar
      MarissaSterl
      Community Member

      Thanks Judy, I tried what you explained and it still doesn't work. It totals the number of points each question is worth:

      I used quizscorepoints and quizpasspoints neither worked :(

      • JudyNollet's avatar
        JudyNollet
        Super Hero

        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
  • 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) 

    • MarissaSterl's avatar
      MarissaSterl
      Community Member

      Thanks Judy, I had mentioned before that each question was not worth 1 point. Is there a way to have it calculate both the percent score and tally for the ratio? TIA

      • JudyNollet's avatar
        JudyNollet
        Super Hero

        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. 

  • When I download the file I don't see the questions answered correctly, in Judy's I do.

    Is it possible the reset trigger is before the next button?

  • MarissaSterl's avatar
    MarissaSterl
    Community Member

    Thanks Judy, appreciate your patience with me. I’ll try this and see if it works. Keep you posted!