# Unique random questions

**URL:** <https://community.thunkable.com/t/unique-random-questions/1977076>\
**Category:** Questions about Thunkable X\
**Tags:** beginner\
**Created:** [July 27, 2022, 12:56am UTC](https://community.thunkable.com/t/unique-random-questions/1977076 "2022-07-27T00:56:12Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![mantarosiegabrielq55](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@mantarosiegabrielq55](https://community.thunkable.com/u/mantarosiegabrielq55)\
**Post date:** [July 27, 2022, 12:56am UTC](https://community.thunkable.com/t/unique-random-questions/1977076/1 "2022-07-27T00:56:12Z")

</div>

Hello all, I am making a trivia game, everything went fine until now… I followed a Thunkable tutorial and I got in that point, I made a loop blockchain and a database so it’s going to be easier but when I open the app one random question appear and then after I respond the same question remain, what can I do so other question would come?

P.S. I got other blocks with correct answear and other stuff, they work fine, only this problem.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/c/ec120c360dfaca49c1b97014b5bfcd84aeaf2c4a.png)

---

<div class="post-metadata">

**Author:** ![zander](https://avatars.discourse-cdn.com/v4/letter/z/ecb155/32.png) [@zander](https://community.thunkable.com/u/zander)\
**Post date:** [July 27, 2022, 2:01am UTC](https://community.thunkable.com/t/unique-random-questions/1977076/2 "2022-07-27T02:01:39Z")

</div>

Without seeing the other parts, I’m assuming you are doing something like  
“When user click” → check answer → get next question

---

<div class="post-metadata">

**Author:** ![mantarosiegabrielq55](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@mantarosiegabrielq55](https://community.thunkable.com/u/mantarosiegabrielq55)\
**Post date:** [July 27, 2022, 4:53am UTC](https://community.thunkable.com/t/unique-random-questions/1977076/3 "2022-07-27T04:53:05Z")

</div>

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/3/4342dd29a87d84a4e3989e0384b4f14fe106d5f4.png)  
This are all the blocks, I tried to fit all of them inside this photo… If there is any other block that will tell the program to pick another question that wasn’t picked I would love to see it, maybe will fix my problem

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [July 27, 2022, 5:09am UTC](https://community.thunkable.com/t/unique-random-questions/1977076/4 "2022-07-27T05:09:36Z")

</div>

at the end of  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/d/6dc3e34c84cd369c46cd52a242a86539a4abc3e4.png)

(right after set Image3 blah and set Image2 blah…  
you have to insert  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/2/d2adb61ca574cf6a289ef8e8f27f3b76c24cb8f0.png)

---

<div class="post-metadata">

**Author:** ![mantarosiegabrielq55](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@mantarosiegabrielq55](https://community.thunkable.com/u/mantarosiegabrielq55)\
**Post date:** [July 27, 2022, 5:32am UTC](https://community.thunkable.com/t/unique-random-questions/1977076/5 "2022-07-27T05:32:39Z")

</div>

The questions are changing now, but the correct answear isn’t matching after the first one, sometimes it changes the correct answear but not the rest, pretty weird

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [July 27, 2022, 5:48am UTC](https://community.thunkable.com/t/unique-random-questions/1977076/6 "2022-07-27T05:48:18Z")

</div>

can you post the contents of your table.  
can you post a screen that shows you answered the question correctly - then show one where the question doesnt have the correct answer.

---

<div class="post-metadata">

**Author:** ![zander](https://avatars.discourse-cdn.com/v4/letter/z/ecb155/32.png) [@zander](https://community.thunkable.com/u/zander)\
**Post date:** [July 27, 2022, 11:33am UTC](https://community.thunkable.com/t/unique-random-questions/1977076/7 "2022-07-27T11:33:35Z")

</div>

If you can, share your project, it makes it easier to try and help 😀

---

<div class="post-metadata">

**Author:** ![mantarosiegabrielq55](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@mantarosiegabrielq55](https://community.thunkable.com/u/mantarosiegabrielq55)\
**Post date:** [July 27, 2022, 11:49am UTC](https://community.thunkable.com/t/unique-random-questions/1977076/8 "2022-07-27T11:49:14Z")

</div>

This is the link of the project ( [Thunkable](https://x.thunkable.com/copy/bfb8684c6a8fba59df4224a4d3ef4aa8) ), I am trying for now to understand how it’s working, after that I will work more at the design and other stuff, but the question randomization it’s a pain xP

---

<div class="post-metadata">

**Author:** ![zander](https://avatars.discourse-cdn.com/v4/letter/z/ecb155/32.png) [@zander](https://community.thunkable.com/u/zander)\
**Post date:** [July 27, 2022, 12:01pm UTC](https://community.thunkable.com/t/unique-random-questions/1977076/9 "2022-07-27T12:01:09Z")

</div>

Here is what you need to do. You are trying to change the question before assigning a new question number. I moved the get random integer to just before the update question. And now it works 🙂

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/2/82d89553876098bae6b76d6a3b6f7a41bbed2f8a.png)

---

<div class="post-metadata">

**Author:** ![mantarosiegabrielq55](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@mantarosiegabrielq55](https://community.thunkable.com/u/mantarosiegabrielq55)\
**Post date:** [July 27, 2022, 6:36pm UTC](https://community.thunkable.com/t/unique-random-questions/1977076/10 "2022-07-27T18:36:10Z")

</div>

It works \<3, thank you so much ^^ … I have one more question, is there any way to set the question number to be unique? Like when you start once, if you give the answear, doesn’t matter if it’s correct or not, you’re not gonna take this question again. Because a 0/40 trivia, to see your score at the end is a good idea xD

---

<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:** [July 27, 2022, 7:45pm UTC](https://community.thunkable.com/t/unique-random-questions/1977076/11 "2022-07-27T19:45:18Z")

</div>

You need to use a different method for randomizing questions without repeating them. One way to do this is to create a database/table with cell values for each question number:

1  
2  
3  
4  
etc.

Then, when you want to pick a random question number, choose a random row from 1 to the number of rows in the database. Store that number as the question number (in a variable). Delete the row from the database. Repeat until all rows have been used up.

It’s possible to do this with a list instead but if you’re not experienced with using lists, I would probably recommend sticking with a database.

---

<div class="post-metadata">

**Author:** ![zander](https://avatars.discourse-cdn.com/v4/letter/z/ecb155/32.png) [@zander](https://community.thunkable.com/u/zander)\
**Post date:** [July 27, 2022, 7:55pm UTC](https://community.thunkable.com/t/unique-random-questions/1977076/12 "2022-07-27T19:55:53Z")

</div>

I second what you say, you can just creatse a data source and input all of your questions. Or connect it to a google sheet or something 😀

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [July 27, 2022, 8:01pm UTC](https://community.thunkable.com/t/unique-random-questions/1977076/13 "2022-07-27T20:01:14Z")

</div>

you can use this technique: create a shuffled list of numbers from 1 to # of questions. (eg. 7,4,1,2,6,3,5)  
as you run your quiz, start using numbers from the left. when you’ve used 7, remove it from the list , leaving 4,1,2,6,3,5. when the list is empty you’ve used them all up.  
here’s a picture of the blocks.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/c/2ccc50e0a4154f7ab1318dcb91cd1ad008b14ba1.png)

you can use the question number as an index to your table of questions.

here’s a link to the demo (select Screen4)  
[https://x.thunkable.com/copy/3ad3d4ccd6996bcf1b1218bb1deefd27](https://x.thunkable.com/copy/3ad3d4ccd6996bcf1b1218bb1deefd27)  
i hope this helps.

---

<div class="post-metadata">

**Author:** ![mantarosiegabrielq55](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@mantarosiegabrielq55](https://community.thunkable.com/u/mantarosiegabrielq55)\
**Post date:** [July 29, 2022, 4:17am UTC](https://community.thunkable.com/t/unique-random-questions/1977076/14 "2022-07-29T04:17:46Z")

</div>

I will look into that also, for now I put a limit of 3 fails, and I want to have a lot of questions so if 2-3 questions will come again won’t be a problem… I got only one more question, when I upload a gif I got a error with “Please select a animation file” and nothing shows, any idea how I could repair that? Thanks everyone for the help ^^

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [July 29, 2022, 6:21am UTC](https://community.thunkable.com/t/unique-random-questions/1977076/15 "2022-07-29T06:21:56Z")

</div>

this is what i did: i found my lottie (animation) file and renamed it to DL\_icon.json  
and uploaded it to my File Assets

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/8/c866427457851fccdf1cd3aec7ab84b742337007.png)

then i added it to my screen in thunkable

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/e/ee3461123d3054bbabccc1eb2d4bba80d4fb171c.png)

and inside the blocks, i set the properties ot the animation component.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/9/89afc7500c431863406b023f885de110d3736f7d.png)

you can do the same.

---

<div class="post-metadata">

**Author:** ![mantarosiegabrielq55](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@mantarosiegabrielq55](https://community.thunkable.com/u/mantarosiegabrielq55)\
**Post date:** [July 30, 2022, 1:54am UTC](https://community.thunkable.com/t/unique-random-questions/1977076/16 "2022-07-30T01:54:41Z")

</div>

I guess it worked, thanks again ^^… I add some more question and now I have to figure out how to stop the acces to the button after 1 resonse, cuz now if I spam a button I will respond more times on a single question and it’s bugging the score

---

<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:** [July 30, 2022, 2:20am UTC](https://community.thunkable.com/t/unique-random-questions/1977076/17 "2022-07-30T02:20:46Z")

</div>

Your algorithm should be:

1. Select new question number
2. Enable guess button(s)
3. User clicks guess button
4. Disable guess button(s)
5. Check to see if guess is correct
6. Provide feedback to user
7. Repeat steps 1-6 until no questions remain

---

<div class="post-metadata">

**Author:** ![mantarosiegabrielq55](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@mantarosiegabrielq55](https://community.thunkable.com/u/mantarosiegabrielq55)\
**Post date:** [August 1, 2022, 5:20am UTC](https://community.thunkable.com/t/unique-random-questions/1977076/18 "2022-08-01T05:20:30Z")

</div>

It makes sense, now I have to put the blocks xD… I try to understand as much as possible, thanks again for help 😃

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [October 30, 2022, 5:20am UTC](https://community.thunkable.com/t/unique-random-questions/1977076/19 "2022-10-30T05:20:50Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
