# I Want to get my Quiz number randomly

**URL:** <https://community.thunkable.com/t/i-want-to-get-my-quiz-number-randomly/305836>\
**Category:** Questions about Thunkable X\
**Created:** [November 6, 2019, 4:28pm UTC](https://community.thunkable.com/t/i-want-to-get-my-quiz-number-randomly/305836 "2019-11-06T16:28:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![farhadkubd1](https://avatars.discourse-cdn.com/v4/letter/f/b38774/32.png) [@farhadkubd1](https://community.thunkable.com/u/farhadkubd1)\
**Post date:** [November 6, 2019, 4:28pm UTC](https://community.thunkable.com/t/i-want-to-get-my-quiz-number-randomly/305836/1 "2019-11-06T16:28:10Z")

</div>

Hello Brothers. I am new and demanding inspiration from you. I am trying to make a quiz app in where the quiz “question Number” will appear randomly.It is okay if i select the question number change by 1. It is vising my all rows. But if I select the question number change by " integer 1 to 70(or any max)" It just showed 2 or 3 question successfully then showing null value ( and navigate the screen 1 as my program) .  
My wish is the “question number” to be appeared randomly and will visit all the rows of my local DB.  
[Here is my block](https://x.thunkable.com/projects/5dc142249aaa0d72d0cc220b/5aa40ab1-8d4e-48c5-8a0e-4d9f448877d4/blocks)

 ![newpro2](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/d/ad7163dfb1865c1f9ac1e06c7aa2a7fef48429ce.jpeg) ![newprob](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/3/63958098e3034e00e4882d86ca8d31f5bd1573fe.jpeg)

---

<div class="post-metadata">

**Author:** ![CBVG](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/cbvg/32/32401_2.png) [@CBVG](https://community.thunkable.com/u/CBVG)\
**Post date:** [November 6, 2019, 4:46pm UTC](https://community.thunkable.com/t/i-want-to-get-my-quiz-number-randomly/305836/2 "2019-11-06T16:46:20Z")

</div>

That is an obvious issue. You change the question number by a random value between 1 to 70, so on average, it will increment it by 35. If you have 70 questions, and starting with #1, then on average the second one would be #36, and the 3rd one would be #71, and already out of range. And there is one chance out of 70 that the second question would be calculated to be #71 right away.  
You need to either SET Question Number to the random integer, not to CHANGE it BY the random integer.  
Or, if you increment it, you need to test if Question Number \> 70 after incrementing it, and if the index is larger than the number of questions, you need subtract 70 from it, to keep the index in bound.

And for an optimal experience, you actually need a more sophisticated system, since there is a 1 chance out of 70 the second question would be the same as the first.  
So, if you insist on changing the the Question Number by incrementing it, you need to pick a random number between 1 and 69, as picking 70 would bring you right back to the same one.

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [November 6, 2019, 6:12pm UTC](https://community.thunkable.com/t/i-want-to-get-my-quiz-number-randomly/305836/3 "2019-11-06T18:12:12Z")

</div>

To solve your problem, you must create a temporary list of all items from which it will be deleted already randomly selected questions. Simply put, first select a random question out of 70, then of 69, then 68, etc.

---

<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, 12:08pm UTC](https://community.thunkable.com/t/i-want-to-get-my-quiz-number-randomly/305836/4 "2024-11-08T12:08:26Z")

</div>


