VARIABLES: How to reset tally to 0 before making new calculations?
Mar 02, 2017
Hi, I have a project with multiple slide layers. Each layer has a question and yes/no buttons. The yes button was given a variable count of 2 and the no button, 0. Each time the user clicks on one of the buttons, the layer advances to the next layer. The final layer is the results layer, where the user clicks on a submit button and the tally appears in a text box on the layer. Everything works fine and the numbers tally up correctly if one goes through the process once, however, if the user should go back to the initial layer and retake the questions, the count continues to be added to the tally.
I want the user to be able to retake the questions and have the tally reset to 0 before making the new calculation. I tried adding a trigger to the submit button to set the tally to 0 before adding up the variables, and I made sure that it is the first trigger in the stack, but it still continues to add to the tally without zeroing out first. Help!!
7 Replies
In your trigger, make sure that you use the Assign option to reset the variable to 0 (sometimes users pick Add, instead of Assign). Otherwise you can always share your .story file here and someone will have a look.
Hi Michael, I'm pretty sure I did that. I attached the project file. Thanks!
Hi A B
see attached if these changes work for you.
Hi Wendy, thanks, but that brings up a new problem. Now the text field where the tally is supposed to appear doesn't clear out at all.
Hi everyone, I think I might have fixed the problem.
Not sure, if that's what you were asking about, but have a look at the attached file.
Thanks, Mike! Your solution works too. I also attached my own solution in the post above yours. Thanks again everyone!
This discussion is closed. You can start a new discussion or contact Articulate Support.