# I need my forever cycle continue when i push a button

**URL:** <https://community.thunkable.com/t/i-need-my-forever-cycle-continue-when-i-push-a-button/1437029>\
**Category:** Questions about Thunkable X\
**Tags:** beginner, forever-block\
**Created:** [August 8, 2021, 2:20am UTC](https://community.thunkable.com/t/i-need-my-forever-cycle-continue-when-i-push-a-button/1437029 "2021-08-08T02:20:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rodama](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/rodama/32/112073_2.png) [@rodama](https://community.thunkable.com/u/rodama)\
**Post date:** [August 8, 2021, 2:20am UTC](https://community.thunkable.com/t/i-need-my-forever-cycle-continue-when-i-push-a-button/1437029/1 "2021-08-08T02:20:17Z")

</div>

Hi, guys! I really need some help. I am making an app for my kids (I am a elementary teacher). I need to generate problems in an infinite loop (forever loop) but i do not want to make the cycles with seconds, i want to make the program create a new problem when my students solves the current problem on the screen!  
Currently, the app makes a new problem every 5 seconds but i want my kids take the time they need in order to solve their practice

Sorry, the variables are in Spanish due to am a spanish speaker

 ![Captura de pantalla 2021-08-07 193820](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/0/709096835f33baff2dec35f92b2c3ad98d0c8e26.png)

 ![photo4934058168108034439](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/4/94b45487a639f06d093dfc6aa85abaf8ffa885d0.jpeg)

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [August 8, 2021, 5:14am UTC](https://community.thunkable.com/t/i-need-my-forever-cycle-continue-when-i-push-a-button/1437029/2 "2021-08-08T05:14:09Z")

</div>

You should not use a loop for this. You should just reset/change the values of the text and variables when the student answers the question.

---

<div class="post-metadata">

**Author:** ![rodama](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/rodama/32/112073_2.png) [@rodama](https://community.thunkable.com/u/rodama)\
**Post date:** [August 8, 2021, 9:26pm UTC](https://community.thunkable.com/t/i-need-my-forever-cycle-continue-when-i-push-a-button/1437029/3 "2021-08-08T21:26:10Z")

</div>

Can you please give me an example of how to do that ?

---

<div class="post-metadata">

**Author:** ![bnice](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bnice/32/110648_2.png) [@bnice](https://community.thunkable.com/u/bnice)\
**Post date:** [August 8, 2021, 11:56pm UTC](https://community.thunkable.com/t/i-need-my-forever-cycle-continue-when-i-push-a-button/1437029/4 "2021-08-08T23:56:56Z")

</div>

Hello @rodama,  
Thank you for posting to the community. I would create a function like “Check Answer”, and then call that function whenever one of the three answer buttons is clicked. What is supposed to happen if a user clicks the right answer? What if the wrong answer is clicked?

---

<div class="post-metadata">

**Author:** ![rodama](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/rodama/32/112073_2.png) [@rodama](https://community.thunkable.com/u/rodama)\
**Post date:** [August 9, 2021, 2:41am UTC](https://community.thunkable.com/t/i-need-my-forever-cycle-continue-when-i-push-a-button/1437029/5 "2021-08-09T02:41:45Z")

</div>

![image_2021-08-08_203948](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/b/5b24b7d9fd1d5399de997cb6727cc7e4df81d9cf.png)

I name my buttons “option 1” , “option 2” and “option 3” . The instructions are already given but I am still struggling with that part. I’ll try what you say. Thank you very much

---

<div class="post-metadata">

**Author:** ![bnice](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bnice/32/110648_2.png) [@bnice](https://community.thunkable.com/u/bnice)\
**Post date:** [August 9, 2021, 3:58am UTC](https://community.thunkable.com/t/i-need-my-forever-cycle-continue-when-i-push-a-button/1437029/6 "2021-08-09T03:58:45Z")

</div>

I am assuming everything in the If statement is repeated across all the buttons? If so, that is what you would put in the function. I would make a function with a parameter, and in that parameter I would pass the value of the button selected.

Example in simple written view:

```auto
var CorrectAnswer = Blah Blah Blah

someFunction CheckAnswer(var answer){
   if answer = CorrectAnswer{
      ...stuff and Good job
   } else{
      ...stuff and try again
   }
}

When Option1 click{
   Option2 disabled = false
   Option3 disabled = false
   CheckAnswer(Option1 text value)
}

```

Something like that. Tweek as you need (and you would need a lot as that was a very simple example). Hope that helps!

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 1:17pm UTC](https://community.thunkable.com/t/i-need-my-forever-cycle-continue-when-i-push-a-button/1437029/7 "2024-11-08T13:17:28Z")

</div>


