Animation with button press and correct check

I have a fireworks animation set up to go with a button press, and I have the correct check working, so how can I only make the fireworks go off when the answer is correct? Thank you!

number(“a”):b1.timeSincePress>0
b1.lastvalue(“correct”)

You can set the time variable to button.timeSincePress when the answer is correct, and if it’s not, set it to zero. In the graph, make a conditional statement for the fireworks to show when the time is greater than zero. Feel free to share the activity if you have trouble making it work!

Edit: I remembered that I had a few activities that used a similar animation. Learning Targets 28-29 Review • Activity Builder by Desmos

That was excellent, thank you! I was able to use that example to make your fireworks work with an input. I couldn’t get it to work with the other fireworks or with the button press, so I might end up posting a slide after all, but I really appreciate all your help!

Yeah, I need help.

I made some changes to the timer variable in the calculator code, and changed the conditionals for the two fireworks colors in the graph and it works!

1 Like

That’s perfect. Thank you again! I can’t tell you how much I appreciate all your help.