I am making an app where:
The user writes inputs in a text box a question and the answer that goes with it. Then the user adds it to a list. When they click choose random (button), it displays a random question.
I’d like the user to be able to click a button called Display Answer that displays the answer that goes with the question.
I have the question part working, so the user can add a bunch of questions and the app will chose a random one.
I’m unsure about the part where the answer that goes with the random question shows.
One way to do it is a sublist. You have a minilist of Question and Answer. So each pair is a question and answer. You put that into one list, and you can then look up from there.
If you want to store them, you can do it a different way with firebase or localdb
I get the concept now, but if the user is going to input many questions and answers, how do I make the list have the enough amount of items in the list?
Also for the part where I click the Choose Random button it displays a question, then I click the Show Answer button and it displays the answer, I don’t know how to collect the right answer to the random question.
Here is my code so far if it helps:
Here is the layout:
Right now the the app chooses a random question when the user clicks on the random question box. Then the whole list deletes itself when the user clicks clear questions.