# Working on a quiz app and need a little help to end the quiz

**URL:** <https://community.thunkable.com/t/working-on-a-quiz-app-and-need-a-little-help-to-end-the-quiz/2036170>\
**Category:** Questions about Thunkable X\
**Tags:** beginner, help\
**Created:** [September 10, 2022, 11:13pm UTC](https://community.thunkable.com/t/working-on-a-quiz-app-and-need-a-little-help-to-end-the-quiz/2036170 "2022-09-10T23:13:57Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![luellencm4dtjv](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/luellencm4dtjv/32/138930_2.png) [@luellencm4dtjv](https://community.thunkable.com/u/luellencm4dtjv)\
**Post date:** [September 10, 2022, 11:13pm UTC](https://community.thunkable.com/t/working-on-a-quiz-app-and-need-a-little-help-to-end-the-quiz/2036170/1 "2022-09-10T23:13:58Z")

</div>

The quiz works great however when I reach the end it just stays at the last question. It does not return to the home page or loop to the beginning. I have followed several tutorials however many are several years old and the blocks are slightly different so I think I missed something. I am new so please be as detailed as possible on steps needed to fix this, or show a screenshot would be best. Thank you.

Here is my link [Thunkable](https://x.thunkable.com/projectPage/631de7de92ae990225274397)

Here are images to what I have so far.

 ![old q1](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/6/c65e6afb90e6bb8d606c0cdac6d441e2c4a8c4f1.jpeg)

 ![old q2](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/f/8f49eaf0ed8f3f4894d01607eb6326cb6c1a2a96.jpeg)

 ![QuizDB](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/a/1ae1e3e19887f373ec344abd41416d57b4431961.jpeg)

---

<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:** [September 11, 2022, 12:51am UTC](https://community.thunkable.com/t/working-on-a-quiz-app-and-need-a-little-help-to-end-the-quiz/2036170/2 "2022-09-11T00:51:09Z")

</div>

Have you watched this?

[![](https://img.youtube.com/vi/6BGBqm15WpQ/maxresdefault.jpg "Thunkable 4.3. Make a Trivia app from a spreadsheet") ](https://www.youtube.com/watch?v=6BGBqm15WpQ)

---

<div class="post-metadata">

**Author:** ![shrey](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/shrey/32/105637_2.png) [@shrey](https://community.thunkable.com/u/shrey)\
**Post date:** [September 11, 2022, 1:30am UTC](https://community.thunkable.com/t/working-on-a-quiz-app-and-need-a-little-help-to-end-the-quiz/2036170/3 "2022-09-11T01:30:51Z")

</div>

Before the if condition in when next question button is pressed, add a change app variable block by 1 and set the variable to index

---

<div class="post-metadata">

**Author:** ![luellencm4dtjv](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/luellencm4dtjv/32/138930_2.png) [@luellencm4dtjv](https://community.thunkable.com/u/luellencm4dtjv)\
**Post date:** [September 11, 2022, 1:59am UTC](https://community.thunkable.com/t/working-on-a-quiz-app-and-need-a-little-help-to-end-the-quiz/2036170/4 "2022-09-11T01:59:50Z")

</div>

Is this what you mean? If so it made no change.

![Quiz5](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/4/5446847f80126715a9769a978c8839c303a21cdf.jpeg)

---

<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:** [September 11, 2022, 2:08am UTC](https://community.thunkable.com/t/working-on-a-quiz-app-and-need-a-little-help-to-end-the-quiz/2036170/5 "2022-09-11T02:08:57Z")

</div>

What you have in theory should work. So What I would do to debug this, is have both the value of index and question list display on the screen, that way you can see if they are updating correctly.

---

<div class="post-metadata">

**Author:** ![luellencm4dtjv](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/luellencm4dtjv/32/138930_2.png) [@luellencm4dtjv](https://community.thunkable.com/u/luellencm4dtjv)\
**Post date:** [September 11, 2022, 2:39am UTC](https://community.thunkable.com/t/working-on-a-quiz-app-and-need-a-little-help-to-end-the-quiz/2036170/6 "2022-09-11T02:39:26Z")

</div>

Thank you @shrey for the fix and @zander for pointing me to the final issue…

Yes @zander you was correct that it should be working. It worked flawless… I just had another error and your test idea pointed me to it… I forgot the “Set app variable questionlist to 1 block” at screen start. So it had nothing to compare the index to.

![Quiz6](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/3/53da3288c18638217e528884e827a2b02b7e5dac.jpeg)

---

<div class="post-metadata">

**Author:** ![luellencm4dtjv](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/luellencm4dtjv/32/138930_2.png) [@luellencm4dtjv](https://community.thunkable.com/u/luellencm4dtjv)\
**Post date:** [September 11, 2022, 4:21pm UTC](https://community.thunkable.com/t/working-on-a-quiz-app-and-need-a-little-help-to-end-the-quiz/2036170/7 "2022-09-11T16:21:34Z")

</div>

I was making cosmetic changes (button backgrounds and shadows) and tested it again and its no longer going to home screen after end of quiz. I have gone over all the code and I cannot see the issue. Here are current screenshots of the blocks and the link to the project. I am racking my brain trying to figure out why its no longer working. I added a test message to the header to keep track of the Index and QuestionList numbers and they update accordingly.

[https://x.thunkable.com/projectPage/631de7de92ae990225274397](https://x.thunkable.com/projectPage/631de7de92ae990225274397)

 ![Quiz1](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/4/140ebf268e93ff0e04187fa929c0d07f2cc113e7.jpeg)

 ![Quiz2](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/c/2c794bd9159f3bc828e17bdfcbdf47b058d1db71.jpeg)

 ![Quiz3](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/6/36ee17760aec6d6a1e00da4176f946b7c952be42.jpeg)

 ![QuizDB](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/a/1ae1e3e19887f373ec344abd41416d57b4431961.jpeg)

---

<div class="post-metadata">

**Author:** ![shrey](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/shrey/32/105637_2.png) [@shrey](https://community.thunkable.com/u/shrey)\
**Post date:** [September 11, 2022, 4:28pm UTC](https://community.thunkable.com/t/working-on-a-quiz-app-and-need-a-little-help-to-end-the-quiz/2036170/8 "2022-09-11T16:28:15Z")

</div>

Try removing the length of block before the app variable QuestionList block

Another thing, remove the change app variable QuestionList by 1 block.

Also, at set the app variable QuestionList block to the number of questions there are (variable block located in the GK T1 opens block)

---

<div class="post-metadata">

**Author:** ![luellencm4dtjv](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/luellencm4dtjv/32/138930_2.png) [@luellencm4dtjv](https://community.thunkable.com/u/luellencm4dtjv)\
**Post date:** [September 11, 2022, 4:52pm UTC](https://community.thunkable.com/t/working-on-a-quiz-app-and-need-a-little-help-to-end-the-quiz/2036170/9 "2022-09-11T16:52:25Z")

</div>

Ok I changed the 1st and 2nd things you said and it now goes to home screen after the 1st question is answered. As for the 3rd thing you mentioned I am not exactly sure what your asking me to do. Please clarify. Thanks.

 ![fix 1](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/d/dde6c2f3706198cbe2ab73bf8186fb2ca695fef7.jpeg)

---

<div class="post-metadata">

**Author:** ![shrey](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/shrey/32/105637_2.png) [@shrey](https://community.thunkable.com/u/shrey)\
**Post date:** [September 11, 2022, 4:59pm UTC](https://community.thunkable.com/t/working-on-a-quiz-app-and-need-a-little-help-to-end-the-quiz/2036170/10 "2022-09-11T16:59:57Z")

</div>

I meant the variable block named Questionlist, the one that is in the screen opens block.

Set that variable to the number of questions you have in the quiz

---

<div class="post-metadata">

**Author:** ![luellencm4dtjv](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/luellencm4dtjv/32/138930_2.png) [@luellencm4dtjv](https://community.thunkable.com/u/luellencm4dtjv)\
**Post date:** [September 11, 2022, 5:07pm UTC](https://community.thunkable.com/t/working-on-a-quiz-app-and-need-a-little-help-to-end-the-quiz/2036170/11 "2022-09-11T17:07:37Z")

</div>

OK I changed that and now it only shows the 3rd question, however it shows it 3 times then continues to the home screen as it should.

My other issue will be if I set that to the number of questions then I have to make edits to the blocks any time I want to add or remove questions to the database. This is not ideal. I think that is why the tutorial I followed put the “length of” block in the IF statement.

 ![fix 2](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/1/91d5badf948c82265a84480ac34210d67882224a.jpeg)

---

<div class="post-metadata">

**Author:** ![shrey](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/shrey/32/105637_2.png) [@shrey](https://community.thunkable.com/u/shrey)\
**Post date:** [September 11, 2022, 5:11pm UTC](https://community.thunkable.com/t/working-on-a-quiz-app-and-need-a-little-help-to-end-the-quiz/2036170/12 "2022-09-11T17:11:52Z")

</div>

Ok set that back to 1 and add the the change variable block.

Let me think about the ending part

---

<div class="post-metadata">

**Author:** ![shrey](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/shrey/32/105637_2.png) [@shrey](https://community.thunkable.com/u/shrey)\
**Post date:** [September 11, 2022, 5:22pm UTC](https://community.thunkable.com/t/working-on-a-quiz-app-and-need-a-little-help-to-end-the-quiz/2036170/13 "2022-09-11T17:22:51Z")

</div>

Instead of the app variable questionlist block in the if condition put this:  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/0/2025bc987a0a33a74cc280e07b3768d1a831d66b.png)  
(instead of table 1 it’s supposed to be GK T1)

Also, delete the unused rows

---

<div class="post-metadata">

**Author:** ![luellencm4dtjv](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/luellencm4dtjv/32/138930_2.png) [@luellencm4dtjv](https://community.thunkable.com/u/luellencm4dtjv)\
**Post date:** [September 11, 2022, 5:39pm UTC](https://community.thunkable.com/t/working-on-a-quiz-app-and-need-a-little-help-to-end-the-quiz/2036170/14 "2022-09-11T17:39:02Z")

</div>

Ok now it cycles through all 3 questions but it just stays and does not continue to home screen.

I highlighted and deleted all rows from 4-50 in the database.

 ![fix 3](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/4/f4c0be164d2ec4d385e839bf613c117c3e28ccbc.jpeg)

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [September 11, 2022, 5:51pm UTC](https://community.thunkable.com/t/working-on-a-quiz-app-and-need-a-little-help-to-end-the-quiz/2036170/15 "2022-09-11T17:51:16Z")

</div>

The project will halt and will not move to next block if you try to force a type casting.

The `app variable QuestionList` is initialized as an integer (a number) and then within the codes you use `Length of` block which is used specifically for **lists** and not numbers.

Replace this block with another more appropriate block. For instance, check if the variable equals to zero or greater than a number but avoid getting the length of that variable.

---

<div class="post-metadata">

**Author:** ![luellencm4dtjv](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/luellencm4dtjv/32/138930_2.png) [@luellencm4dtjv](https://community.thunkable.com/u/luellencm4dtjv)\
**Post date:** [September 11, 2022, 5:55pm UTC](https://community.thunkable.com/t/working-on-a-quiz-app-and-need-a-little-help-to-end-the-quiz/2036170/16 "2022-09-11T17:55:51Z")

</div>

See the comment just above yours. I think we addressed that issue and have moved on to the issue of staying at the last question. I cannot get it to move on to the home page after last question. I am new so I’m still learning. Im not sure how to check if variable equals zero or greater.

---

<div class="post-metadata">

**Author:** ![shrey](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/shrey/32/105637_2.png) [@shrey](https://community.thunkable.com/u/shrey)\
**Post date:** [September 11, 2022, 6:07pm UTC](https://community.thunkable.com/t/working-on-a-quiz-app-and-need-a-little-help-to-end-the-quiz/2036170/17 "2022-09-11T18:07:07Z")

</div>

Did you press sync with source?

To get to it, go to design, press data, and then click on the google sheet you want to update. Then you will see the button.

---

<div class="post-metadata">

**Author:** ![luellencm4dtjv](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/luellencm4dtjv/32/138930_2.png) [@luellencm4dtjv](https://community.thunkable.com/u/luellencm4dtjv)\
**Post date:** [September 11, 2022, 6:11pm UTC](https://community.thunkable.com/t/working-on-a-quiz-app-and-need-a-little-help-to-end-the-quiz/2036170/18 "2022-09-11T18:11:44Z")

</div>

Yes and just for good measure I did it again just now and it still stops at last question.

---

<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:** [September 11, 2022, 7:59pm UTC](https://community.thunkable.com/t/working-on-a-quiz-app-and-need-a-little-help-to-end-the-quiz/2036170/19 "2022-09-11T19:59:56Z")

</div>

can you share the link to the latest version?

---

<div class="post-metadata">

**Author:** ![luellencm4dtjv](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/luellencm4dtjv/32/138930_2.png) [@luellencm4dtjv](https://community.thunkable.com/u/luellencm4dtjv)\
**Post date:** [September 11, 2022, 8:05pm UTC](https://community.thunkable.com/t/working-on-a-quiz-app-and-need-a-little-help-to-end-the-quiz/2036170/20 "2022-09-11T20:05:29Z")

</div>

Yes of course… I believe this is the link. [Thunkable](https://x.thunkable.com/projectPage/631de7de92ae990225274397)

If you can get it to work let me know thanks

[Next page](https://community.thunkable.com/t/working-on-a-quiz-app-and-need-a-little-help-to-end-the-quiz/2036170.md?page=2)
