I am trying to create a simple app for practicing mental math factoring and I need help with the following:
The app picks two random integers (IntA and IntB) from a list of -12 to 12 (excluding 0), then displays two identical rows of buttons which contain IntA and IntB and some incorrect integers. I have it to the point that you can turn the buttons on (green) or off (back to blue).
I am stuck not knowing the best way to check if the two buttons that are currently green are the correct two integers once you press the ācheckā button.
Are these radio buttons where there can only be one green answer per row? If so, every time one of the row buttons is clicked, maybe have a workflow that updates a page state with the current value for A and B. Then another workflow when the CHECK button is checked to compare these A&B values to correct answers that are already calculated.
Thanks for your help. They are not radio buttons but buttons generated in a repeating group.
I guess I donāt know how to update a page state with the current values. My intuition was to create a group and update the group with the values of the current cellās selection when the button was turned green, and remove the values when the button is turned blue, but I was having trouble figuring out how to do that.
I am treading lightly here because I am very newish to Bubble, but Iāll offer what I think I know:
First to create a page state which is just Bubbleās name for a variable that has a scope of the current page. Click on your page element. Hit the āiā info button on the inspector thing. There you can create an A and B integer variable.
For your button rows, You would need to have a way so that a user can only select one per row. Your app seems like it would break if they just clicked all the buttons and made them green.
I havenāt messed with the radio buttons element yet, but usually radio buttons have a mutually exclusiveness to them where if one is selected others cant be.
If that doesnāt work, then maybe when any of the buttons in your RG are selected, a workflow is triggered which makes all buttons blue first them on a second step makes the selected one green and a third step makes the current button value the value of the page state for variable āAā that you made above.
1 Like
Thanks, that helps a lot actually, I donāt know why I didnāt understand how to create a page state after going through their basic tutorials.
My plan is to compare the set of selections with the set of correct answers and only return correct if itās an exact match.
1 Like