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
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?
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
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!