I need my forever cycle continue when i push a button

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

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.


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

1 Like

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?

1 Like


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

1 Like

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:

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!

1 Like