# Button question

**URL:** <https://cl.desmos.com/t/button-question/1614>\
**Category:** Questions\
**Created:** [October 2, 2020, 2:18pm UTC](https://cl.desmos.com/t/button-question/1614 "2020-10-02T14:18:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Micah\_Baldree](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/micah_baldree/32/387_2.png) [@Micah\_Baldree](https://cl.desmos.com/u/Micah_Baldree)\
**Post date:** [October 2, 2020, 2:18pm UTC](https://cl.desmos.com/t/button-question/1614/1 "2020-10-02T14:18:37Z")

</div>

I have a button that when pressed will pop a table up showing all the correct or incorrect slides on an activity. How can add some code so that when you go to a different slide away from the button it will reset the button and hide the table?

Here is an example. Button on the last slide:

> **[Topic 2 QUIZ • Activity Builder by Desmos](https://teacher.desmos.com/activitybuilder/custom/5f6dc43f7ba5f32baf3d3a31)**
>
> by Micah Baldree

---

<div class="post-metadata">

**Author:** ![Daniel\_Grubbs](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/daniel_grubbs/32/719_2.png) [@Daniel\_Grubbs](https://cl.desmos.com/u/Daniel_Grubbs)\
**Post date:** [October 2, 2020, 4:36pm UTC](https://cl.desmos.com/t/button-question/1614/2 "2020-10-02T16:36:07Z")

</div>

Didn’t look in the code, but timeSincePress resets when you move away from a slide.

---

<div class="post-metadata">

**Author:** ![Micah\_Baldree](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/micah_baldree/32/387_2.png) [@Micah\_Baldree](https://cl.desmos.com/u/Micah_Baldree)\
**Post date:** [October 2, 2020, 4:56pm UTC](https://cl.desmos.com/t/button-question/1614/3 "2020-10-02T16:56:32Z")

</div>

![image](https://canada1.discourse-cdn.com/flex031/uploads/desmos/original/2X/0/05fba092d7f2afa6e922ffa1c36006ec471b4d4f.png)

This is what I have inside the button. It stays hidden and the table stays up when I go back to other slides.

---

<div class="post-metadata">

**Author:** ![Micah\_Baldree](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/micah_baldree/32/387_2.png) [@Micah\_Baldree](https://cl.desmos.com/u/Micah_Baldree)\
**Post date:** [October 2, 2020, 5:23pm UTC](https://cl.desmos.com/t/button-question/1614/4 "2020-10-02T17:23:51Z")

</div>

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

This is what I came up with. When you go to a new slide it will jump to 100 and when it does that causes it to reset.

---

<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:** [October 2, 2020, 5:43pm UTC](https://cl.desmos.com/t/button-question/1614/5 "2020-10-02T17:43:35Z")

</div>

timeSincePress will jump to the max when you change screens. This was implemented primarily to keep students from returning to screens with animations still in progress.

There is, however an option on buttons to reset time when a student navigates away:  
 ![image](https://canada1.discourse-cdn.com/flex031/uploads/desmos/original/2X/a/a34ad2ec6a4008e7015920b541307e0029f8280b.png)

---

<div class="post-metadata">

**Author:** ![Micah\_Baldree](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/micah_baldree/32/387_2.png) [@Micah\_Baldree](https://cl.desmos.com/u/Micah_Baldree)\
**Post date:** [October 2, 2020, 5:46pm UTC](https://cl.desmos.com/t/button-question/1614/6 "2020-10-02T17:46:44Z")

</div>

😅 I didnt even think to click that and see what was there… Thanks Jay!
