Count Button Click Rate- input to table & histogram

Hi! I need some help converting button clicks to visual data.

I’d like to add a histogram like in slide 2 of “Click Battle” Click Battle • Activity Builder by Desmos

Here’s what I’ve started with (it’s a choppy vid of me chucking wood).
•I envision using this as a template for other data gathering vids- like jumping jacks or jump roping or balloon popping…


Easy peasy. Name your button, and something like this:

"Click the button to keep track of how many pieces of wood are taken out of the truck in one load.

Wood Chucked: ${btn1.pressCount}"

Awesome! I added that,

Now, how to get that data to show up on the next slide in the table and on the graph as a histogram (like Click Battle)

Are you talking about aggregating student data into a histogram? Or just a single bar graph for one student? I think both are possible. I’d search the forum for histogram. There are a bunch of threads.

The graph in Click Battle just uses a single number input, so I don’t think you can use the built in histogram function. In times like this, I just create a polygon. Is this what you’re looking for? The bounds will need to be adjusted, but it’s similar to Click Battle.

:raised_hands:t4: Yes! That’s exactly it!
Thank you so much! You earned me more sleep tonight! :slight_smile:

Now… how about a timer on it to line up with the video?
As in, the button disables after a set amount of time. I’ve tried doing this with the disable: when btn1.timeSincePress(56)=56 true otherwise false
but it keeps resetting to the last time pressed. I need it to start the timer with the first press.

I’m not at a computer right now, but you can do that. Check out the Graphing Stories activity for an example of that. If it’s not editable, I know I have an example somewhere too.

Not sure what the Graphing Stories do, but you could increase the time, and make it >56, so


Tried it, but each time the button is clicked, it resets.
I tried connecting a .pressCount like this:
disabled: start.timeSincePress(1000)>=56

but that didn’t work either.
Other suggestion to get the timer to start on first click, not last?

I guess I’m a bit confused as to what you’re trying to accomplish. Are you saying that you want to play the video, then pause the video at a random time (say 3.14 seconds), then that time should show up in the note? If so, I updated the copy of the activity from above to show that. Just put ${media.time} in the note and name the video component.

That’s almost it-
I was thinking of connecting a time to the woodchuck rate, woodchucking:time
I added the timer data to show up on the table.

2- more thoughts/possibilities:

  1. Can the milliseconds be removed from the timer?
  2. Make the timer to start when the first action button is clicked. (That way it would time the chucking wood, without the walking around/getting ready time)

Hey @cwinske,
Can you help me offer a reset option on this counter button?
I posted it today with an assignment, and a few kids asked for that. Evidently, they wanted to recount or they over-counted…
When I tried adding a resetlabel, it was in the same place as the button and messed up the counting.


You can remove the milliseconds. I updated that in the previous link.

As for the second question above, I think there is a way to do it. I had it working once but the timer wasn’t updating in real-time so I scrapped the code. You will need to use capture, but I don’t use it often and it will take me a little while to figure it out. Unfortunately, I don’t have a lot of time to troubleshoot. Unless someone else has an answer, I would suggest setting up a time with @Jay to chat. He’ll get you through the questions in no time.

Thanks for the getting rid of the millisecond.
I’ll seek out @Jay next. :slight_smile:

You could do an action button on the second page to reset the first.

Thanks @Daniel_Grubbs- that sounds like a good work around.

I am wondering if it would be possible to build off this idea. I would like to collect bivariate data (time, clicks). My goal would be to have students click as an event occurs (woodchucks, jumping jacks, or just clicks of the submit button) but then have the number of clicks recorded every…say…10 seconds. For example the student would see how many clicks they could do in 60 seconds. Then next slide would be table of values (Time in 10 sec increments, #of clicks at that time). With the goal being I could have them look at rates of change. Thank you for any thoughts.