# How to add answers to questions generated in a problem generator

**URL:** <https://community.thunkable.com/t/how-to-add-answers-to-questions-generated-in-a-problem-generator/490228>\
**Category:** Questions about Thunkable X\
**Tags:** beginner\
**Created:** [February 28, 2020, 10:37pm UTC](https://community.thunkable.com/t/how-to-add-answers-to-questions-generated-in-a-problem-generator/490228 "2020-02-28T22:37:09Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![malia9411tyd](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/malia9411tyd/32/62320_2.png) [@malia9411tyd](https://community.thunkable.com/u/malia9411tyd)\
**Post date:** [February 28, 2020, 10:37pm UTC](https://community.thunkable.com/t/how-to-add-answers-to-questions-generated-in-a-problem-generator/490228/1 "2020-02-28T22:37:09Z")

</div>

Hi everyone! I’m a beginner at Thunkable, I am currently making a math app for my school project and I have a problem generator in my project. Where when you click a button, a randomized equation pops up. I have already coded and designed the problem generator but, I wanted to know if it is possible to put a button that you can click after each problem that has randomly popped up that has the answer to each of the questions.

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [February 28, 2020, 11:22pm UTC](https://community.thunkable.com/t/how-to-add-answers-to-questions-generated-in-a-problem-generator/490228/2 "2020-02-28T23:22:23Z")

</div>

That probably depends on how complex the problems are. Is it simple addition/subtraction/multiplication/division?

---

<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:** [February 29, 2020, 12:18am UTC](https://community.thunkable.com/t/how-to-add-answers-to-questions-generated-in-a-problem-generator/490228/3 "2020-02-29T00:18:54Z")

</div>

Sure. You can change the value of a label and then make the label visible to reveal the correct answer. You can store the answer values in a list if you like, and then reference them by problem #.

---

<div class="post-metadata">

**Author:** ![malia9411tyd](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/malia9411tyd/32/62320_2.png) [@malia9411tyd](https://community.thunkable.com/u/malia9411tyd)\
**Post date:** [March 2, 2020, 1:32am UTC](https://community.thunkable.com/t/how-to-add-answers-to-questions-generated-in-a-problem-generator/490228/4 "2020-03-02T01:32:47Z")

</div>

What would the blocks look like for that?

---

<div class="post-metadata">

**Author:** ![malia9411tyd](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/malia9411tyd/32/62320_2.png) [@malia9411tyd](https://community.thunkable.com/u/malia9411tyd)\
**Post date:** [March 2, 2020, 1:37am UTC](https://community.thunkable.com/t/how-to-add-answers-to-questions-generated-in-a-problem-generator/490228/5 "2020-03-02T01:37:01Z")

</div>

No it is complex algebra problems. An example is, 4x+2x+3x+1+2=?, or (2x+3)(3x+1)=

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [March 2, 2020, 2:37am UTC](https://community.thunkable.com/t/how-to-add-answers-to-questions-generated-in-a-problem-generator/490228/6 "2020-03-02T02:37:48Z")

</div>

Hey @malia9411tyd! Thanks for your response. I wonder if the app is creating the problems at random or if you will provide a list of these along with a list of solutions

---

<div class="post-metadata">

**Author:** ![malia9411tyd](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/malia9411tyd/32/62320_2.png) [@malia9411tyd](https://community.thunkable.com/u/malia9411tyd)\
**Post date:** [March 2, 2020, 2:43am UTC](https://community.thunkable.com/t/how-to-add-answers-to-questions-generated-in-a-problem-generator/490228/7 "2020-03-02T02:43:21Z")

</div>

![Thunkable codin](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/0/a01d829e54b771a122d724cf380ed6f24f921595.png)  
Here is an example of the code I have put. All I know is that when I press the button, a random equation pops up from the numbers I have inserted.

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [March 2, 2020, 2:49am UTC](https://community.thunkable.com/t/how-to-add-answers-to-questions-generated-in-a-problem-generator/490228/8 "2020-03-02T02:49:08Z")

</div>

Got it! Do you have a list of answers?

If not, using [This](https://www.wolframalpha.com/calculators/equation-solver-calculator) site might be helpful. You would include the polynomial in the url and it returns images of the solutions

Well, you would have to parse the response for your purposes and assign the resultant image url as a arc for an image in your app. But totally doable I’d think.

---

<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:** [March 2, 2020, 3:06am UTC](https://community.thunkable.com/t/how-to-add-answers-to-questions-generated-in-a-problem-generator/490228/9 "2020-03-02T03:06:54Z")

</div>

But some of those are **equations** , like y-3=0, which have a solution (y=3), and some are **expressions** , like 6x+4+8x+3=, which do not have a solution but can be simplified (14x+7=).

Are you wanting the user to simplify expressions?

And assuming you have a list of answers that match the indexes for your problems (that is, problem #1 has answer #1, problem #2 has answer #2, etc.), then you would have a variable that stores the question # – 1 for the first question, 2 for the second, etc. And something like these blocks:

![Screen Shot 2020-03-01 at 6.53.15 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/9/294d4d09f08493a3b8ed4eddbd62821202b513cb.png)

---

<div class="post-metadata">

**Author:** ![malia9411tyd](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/malia9411tyd/32/62320_2.png) [@malia9411tyd](https://community.thunkable.com/u/malia9411tyd)\
**Post date:** [March 2, 2020, 10:27pm UTC](https://community.thunkable.com/t/how-to-add-answers-to-questions-generated-in-a-problem-generator/490228/10 "2020-03-02T22:27:41Z")

</div>

Yes, I would like the user to simplify the expressions. Would I add these blocks and add all of my information into those two sets of blocks and then delete the one I have currently? Do I also need to add a “reveal button” on my user interface aside from the button where when the user clicks it generates the questions?

---

<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:** [March 3, 2020, 4:06am UTC](https://community.thunkable.com/t/how-to-add-answers-to-questions-generated-in-a-problem-generator/490228/11 "2020-03-03T04:06:10Z")

</div>

You need to first choose a random number from 1 to the length of your list. Assign that number to a variable. Let’s call it problemNum. Use that variable whenever you need to display a problem or answer. The blocks I posted above will work for displaying those from your two lists (problems & answers).

Just so you know, the _in list app answers get # app questionNum_ block above is shown like this in the list components drawer:

![Screen Shot 2020-03-02 at 7.51.16 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/2/c2fcf043cd32de6c1eddec2643b520fc16e6a3e9.png)

Yes, I believe you’d need a button to reveal the answer as well.

---

<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, 11:40am UTC](https://community.thunkable.com/t/how-to-add-answers-to-questions-generated-in-a-problem-generator/490228/12 "2024-11-08T11:40:35Z")

</div>


