Graph Button and Table Button (multiple buttons)

We’ve got this cool animation about rotating a shape. We want students to press the button (connected to the graph) to watch the animation. We’d like the students to be able to press the button more than once to keep watching the animation if they want.
After watching the animation, students will then respond to a question in a table that has a submit button.
When the students try to respond in the table, it seems that CL resets the graph button counters back to zero which means the final image disappears.
I started playing with the coding and created a value called “q”. Once the students press the button twice, then the final image will stay visible forever. But it still gets reset if they only press the button once.
I’ve created a green point at the top of the graph editor that is controlled by q if you want to use that for testing. (visible when q>1).
Activity


img2
img3

It comes out pretty choppy without looking at a whole lot of your graph, but you can have a playhead appear if you define an animation sink in your CL. (I disabled p and q, opting to set them to a specific number in the graph:

#Sets the length of the animation to 5 seconds
animationDuration: 5

#Sets t_0 to the time on the playhead
number(`t_0`): this.animationTime

Also, it’s convenient to use functions for rotating. Maybe you’ll find this useful:

Thank you! Animation Button is perfect!

Good to know about rotations with a function. I’ll definitely take a look. I’m not sure who created the original file or where the coding came from.

If you mean the one I posted, it’s from me, so if you need explanation I can help.

No, I mean that we got the original rotation graph (in the activity I shared) is from someone else, I didn’t code it. But your method for rotation is definitely simpler! If I start from scratch, I’ll use your method in the future!
Thank you again for the help with rotation and replacing button with animation duration.

No worries. That’s what I thought you meant. It was just a little ambiguous.