Forum Discussion

AprilDrennan-f8's avatar
AprilDrennan-f8
Community Member
13 days ago

Calculator won't reset

Hi. I used someone else's calculator that they built for my project. I needed several instances of it. The only problem is that they seem to be connected. Maybe it is due to the variables? Anyway, some of the calculators are directly on the slide while others attach to a lightbox. I even tried building multiple lightboxes to see if that would solve the problem, but it didn't. 

When a user makes calculations on the calendar on one page, I want the calendar to reseat at zero. Is this possible? Any help would be appreciated!

  • Yes, the problem is that all of the calculators use the same variables. 

    If you don't need a given calculator to show the previously calculated value if a learner returns to a slide, you can simply add a trigger that sets the "currentNum" variable to 0 when the timeline starts. Put that trigger on every slide with a calculator.

    If you do want each calculator to retain its previously entered value, you need to use a different variable to store each calculation. 

  • Yes, the problem is that all of the calculators use the same variables. 

    If you don't need a given calculator to show the previously calculated value if a learner returns to a slide, you can simply add a trigger that sets the "currentNum" variable to 0 when the timeline starts. Put that trigger on every slide with a calculator.

    If you do want each calculator to retain its previously entered value, you need to use a different variable to store each calculation. 

  • JesseWu's avatar
    JesseWu
    Community Member

    When the timeline starts on this slide:

    Set standbyNum to value 0;

    Set currentNum to value 0;

    I assume at least you need these 2.

    Or just duplicate a CE button (Rect. 6) and change the condition to when the timeline starts