Stopping a timer when all questions are correct

I’d like to be able to stop a timer when the student completes all the questions so the student has a record of how long it took them to complete it.
Here’s an example of what I’m trying to achieve.
Currently the timer just runs until it hits the limit, set at 300 seconds
https://teacher.desmos.com/activitybuilder/custom/61a24e10260d0a0a0bc22cef
The activity isn’t perfect in many other ways, so all suggestions welcome :smiley:

Potentially you could add an Action Button that is hidden until the student completes the table, that ‘captures’ the timer value when it is pressed. You could then show that using lastValue.

Another alternative would be to have the timer in the graph component, since you have a hidden graph anyway. Using the ticker to increase a particular timer value, with an added condition would do the trick - for example, if you had a variable c_0 set to 0 and t_0 representing your timer, the ticker action would be

t_0 → t_0+0.1 {c_0=0} every 100ms

Once the table is correct, set c_0 to 1 or any non-zero value and the timer t_0 will stop increasing.

2 Likes

Thanks :+1: Loving both those solutions :smiley: I went with the Action Button method just because I thought it would be easier for my fellow teachers to follow and I’m trying to keep the CL as maintainable as possible.
However the ticker in the graph approach did inspire me to sort out the timer display so that it rounds the time to the nearest second, which had the added bonus of stopping the flickering when it was rushing through all the milliseconds.
I did have a bit of trouble positioning the Action button below the table as it wanted to associate with the hidden graph component at the top, however I fixed that by moving the hidden graph below the table. It didn’t stop it associating with the hidden graph, but at least it appeared in the right place :grin:
Thanks for the super quick response.