# How to only check when button is pressed (rather than TimeSinceSubmit)

**URL:** <https://cl.desmos.com/t/how-to-only-check-when-button-is-pressed-rather-than-timesincesubmit/504>\
**Category:** Questions\
**Tags:** validation, correctness\
**Created:** [June 6, 2019, 4:45pm UTC](https://cl.desmos.com/t/how-to-only-check-when-button-is-pressed-rather-than-timesincesubmit/504 "2019-06-06T16:45:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ASmith](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/asmith/32/360_2.png) [@ASmith](https://cl.desmos.com/u/ASmith)\
**Post date:** [June 6, 2019, 4:45pm UTC](https://cl.desmos.com/t/how-to-only-check-when-button-is-pressed-rather-than-timesincesubmit/504/1 "2019-06-06T16:45:14Z")

</div>

On slide 5 of this activity,  
we are dragging numbers onto a number line.  
We want students to not know if they are correct until they click the button.  
If they are wrong, then we want them to have to reset button before they find out if they are correct. Right now, after clicking button, they get oops, keep dragging points and immediately find out if correct without having to click button again.  
So is there a way to only show results when button is pressed instead of basing it off the time that has passed?

> **[\[AM\] Number Line TEMPLATE • Activity by Amber Smith](https://classroom.amplify.com/activity/5cf92a21dd681006a0a7ef30)**
>
> by Amber Smith

Input:

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/desmos/original/1X/b80e7d8e790ec353d5d87f2e01f2a2bbee7ce0f5.png)

I found this comment about modulo, but it doesn’t seem to count correctly.

> [@Action Buttons boolean for pressed/depressed?](https://cl.desmos.com/t/action-buttons-boolean-for-pressed-depressed/287):
>
> Is there a way to get a boolean value identifying whether an action button has been pressed or not? I do not mean whether it has EVER been pressed. For that I could use pressCount. I want to have the action button toggle something on or off. One way I can think of doing it would be to check if the pressCount is divisible by 2, but I am not sure if there is some kind of modulo function or some way to return the decimal part of a number.

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/desmos/original/1X/92406837d3ffc0b2a29e78789e44cf2c8a34461d.png)

---

<div class="post-metadata">

**Author:** ![sergeballif](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/sergeballif/32/231_2.png) [@sergeballif](https://cl.desmos.com/u/sergeballif)\
**Post date:** [June 6, 2019, 6:16pm UTC](https://cl.desmos.com/t/how-to-only-check-when-button-is-pressed-rather-than-timesincesubmit/504/2 "2019-06-06T18:16:56Z")

</div>

What you probably want to do is create two versions of the point, only one of which is draggable. Display the draggable point until the button gets pushed. Here’s a sample of how it might be done. [Draggable vs nondraggable • Activity Builder by Desmos](https://teacher.desmos.com/activitybuilder/custom/5cf954dc4d3af15da53a0981)

---

<div class="post-metadata">

**Author:** ![ASmith](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/asmith/32/360_2.png) [@ASmith](https://cl.desmos.com/u/ASmith)\
**Post date:** [June 6, 2019, 7:04pm UTC](https://cl.desmos.com/t/how-to-only-check-when-button-is-pressed-rather-than-timesincesubmit/504/3 "2019-06-06T19:04:52Z")

</div>

Thank you.  
I had the button reset label defined. But I didn’t program a label for the button. So clicking “reset” wasn’t setting the press count back to 0?  
I also used your suggestions for a set of non-draggable points.  
Thanks again!

---

<div class="post-metadata">

**Author:** ![HumanizedMath](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/humanizedmath/32/2947_2.png) [@HumanizedMath](https://cl.desmos.com/u/HumanizedMath)\
**Post date:** [June 6, 2019, 10:44pm UTC](https://cl.desmos.com/t/how-to-only-check-when-button-is-pressed-rather-than-timesincesubmit/504/4 "2019-06-06T22:44:37Z")

</div>

I have some examples of reset buttons that I’ve used. Usually defining a variable in the graph component using mod. I can post it here when I’m at a laptop. If you think that will help.

---

<div class="post-metadata">

**Author:** ![JayChow](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jaychow/32/1674_2.png) [@JayChow](https://cl.desmos.com/u/JayChow)\
**Post date:** [June 7, 2019, 7:17pm UTC](https://cl.desmos.com/t/how-to-only-check-when-button-is-pressed-rather-than-timesincesubmit/504/5 "2019-06-07T19:17:19Z")

</div>

You might also find some help here: [Reset Action Button with User Movement](https://cl.desmos.com/t/reset-action-button-with-user-movement/507/2)
