# Having trouble getting quiz app to count the score

**URL:** <https://community.thunkable.com/t/having-trouble-getting-quiz-app-to-count-the-score/1518926>\
**Category:** Questions about Thunkable X\
**Tags:** beginner\
**Created:** [September 22, 2021, 2:19am UTC](https://community.thunkable.com/t/having-trouble-getting-quiz-app-to-count-the-score/1518926 "2021-09-22T02:19:14Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![travisgerbergpy](https://avatars.discourse-cdn.com/v4/letter/t/9de053/32.png) [@travisgerbergpy](https://community.thunkable.com/u/travisgerbergpy)\
**Post date:** [September 22, 2021, 2:19am UTC](https://community.thunkable.com/t/having-trouble-getting-quiz-app-to-count-the-score/1518926/1 "2021-09-22T02:19:14Z")

</div>

Hello everyone,

I have been helping my 14 year old son create a quiz app as a school project. We watched the youtube video on the quiz blocks dozens of times and have figured out most of the basic functions in Thunkable X. What we are having problems figuring out is the APP Score. We cant seen to get it to keep track of the score. It will show 0/7 but will not count correct answers. I have attached a pic of our blocks and app screen and would appreciate any and all assistance.

 ![APP Blocks](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/e/3e609499a431ea7da9d8e18d4a772d2b0f72e6ba.jpeg)

 ![screen](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/4/94d572eecce756987699ad81efdebd9940bc186c.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 22, 2021, 5:35am UTC](https://community.thunkable.com/t/having-trouble-getting-quiz-app-to-count-the-score/1518926/2 "2021-09-22T05:35:56Z")

</div>

Welcome to Thunkable.

The blocks are too small to read. Appreciate if you can share the link to your project so someone can review and hopefully advise how to solve the issue.

---

<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:** [September 22, 2021, 5:56am UTC](https://community.thunkable.com/t/having-trouble-getting-quiz-app-to-count-the-score/1518926/3 "2021-09-22T05:56:17Z")

</div>

This is a great starting project! Although not a terribly easy one. 😉

Your blocks look correct to me but I can’t really tell without seeing the database values. As @muneer suggested, it’s best to share the project link if you’re able.

---

<div class="post-metadata">

**Author:** ![travisgerbergpy](https://avatars.discourse-cdn.com/v4/letter/t/9de053/32.png) [@travisgerbergpy](https://community.thunkable.com/u/travisgerbergpy)\
**Post date:** [September 22, 2021, 1:59pm UTC](https://community.thunkable.com/t/having-trouble-getting-quiz-app-to-count-the-score/1518926/4 "2021-09-22T13:59:24Z")

</div>

I hope this link works. Let me know if it doesn’t. Thanks in advance for taking the time to assist.

[https://x.thunkable.com/projects/6144d857f250e800115b62d0/d079d8ae-a279-4d79-a700-c1c5dd117813/blocks](https://x.thunkable.com/projects/6144d857f250e800115b62d0/d079d8ae-a279-4d79-a700-c1c5dd117813/blocks)

---

<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 22, 2021, 2:13pm UTC](https://community.thunkable.com/t/having-trouble-getting-quiz-app-to-count-the-score/1518926/5 "2021-09-22T14:13:46Z")

</div>

Do it this way

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

Set the change of **Score** as the first block in the function. These blocks work asynchronously and therefore the _after answer_ function will run and will not wait for the _correct answer_ function to finish.

---

<div class="post-metadata">

**Author:** ![travisgerbergpy](https://avatars.discourse-cdn.com/v4/letter/t/9de053/32.png) [@travisgerbergpy](https://community.thunkable.com/u/travisgerbergpy)\
**Post date:** [September 22, 2021, 11:12pm UTC](https://community.thunkable.com/t/having-trouble-getting-quiz-app-to-count-the-score/1518926/6 "2021-09-22T23:12:45Z")

</div>

Thanks for the quick advice. I have tried it as you suggested and I still get no change on the score. I have even deleted the variable, recreated and tried in the incorrect answer function all with no success. Banging my had on the desk but still enjoying ever minute working with my son.

---

<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:** [September 23, 2021, 12:16am UTC](https://community.thunkable.com/t/having-trouble-getting-quiz-app-to-count-the-score/1518926/7 "2021-09-23T00:16:47Z")

</div>

The tricky thing is that Thunkable hides the local data when sharing the project so this is all I can see:

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

Without knowing what your actual data looks like, it’s hard to troubleshoot your blocks.

You can try adding a Vibrate block (from the Devices drawer) to one or more places in your code to determine if the code is firing or not when you test the project on a device. Or in a browser, you can make a change to a label’s value to also determine this.

---

<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 23, 2021, 9:44am UTC](https://community.thunkable.com/t/having-trouble-getting-quiz-app-to-count-the-score/1518926/8 "2021-09-23T09:44:30Z")

</div>

Actually, I tend to think the data is stored in Google sheets. This is why we do not get to see the data and it makes it way hard to debug.

---

<div class="post-metadata">

**Author:** ![travisgerbergpy](https://avatars.discourse-cdn.com/v4/letter/t/9de053/32.png) [@travisgerbergpy](https://community.thunkable.com/u/travisgerbergpy)\
**Post date:** [September 25, 2021, 4:13am UTC](https://community.thunkable.com/t/having-trouble-getting-quiz-app-to-count-the-score/1518926/9 "2021-09-25T04:13:36Z")

</div>

You are correct in saying it is stored in google sheets. Is there a better file type that might make it easier.

---

<div class="post-metadata">

**Author:** ![travisgerbergpy](https://avatars.discourse-cdn.com/v4/letter/t/9de053/32.png) [@travisgerbergpy](https://community.thunkable.com/u/travisgerbergpy)\
**Post date:** [September 25, 2021, 5:03am UTC](https://community.thunkable.com/t/having-trouble-getting-quiz-app-to-count-the-score/1518926/10 "2021-09-25T05:03:10Z")

</div>

Tonight I tried and created my own local db table and entered my data but still I can’t get it to count correct answers. I can move it around to different functions and it works with some but not all. I am greatly in need of assistance.

[Thunkable](https://x.thunkable.com/projects/614e8d0af18cd70010fa50c1/734a6ce6-9cf6-4e76-a4b9-d410725c921e/designer)

![Capture](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/9/c9dd11d46c4de95c119dd0db0ffcbd2939e4c4e1.png)

---

<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:** [September 25, 2021, 5:21am UTC](https://community.thunkable.com/t/having-trouble-getting-quiz-app-to-count-the-score/1518926/11 "2021-09-25T05:21:40Z")

</div>

I find this setup to be really confusing:

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

I don’t understand why you’re comparing the number 1 to a database value. Shouldn’t you compare the value of A’s button text to that database value? And only to the “answer column” value… which by the way should be the actual answer, not the index/position of the answer. And then the column names are integers which adds to the confusion, at least for me! Let me see if I can craft a simpler way to do this…

---

<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:** [September 25, 2021, 5:36am UTC](https://community.thunkable.com/t/having-trouble-getting-quiz-app-to-count-the-score/1518926/12 "2021-09-25T05:36:32Z")

</div>

Here’s what I’d do instead:

[Modified project link](https://x.thunkable.com/copy/8e0fea12e8543a369dd3b1bcfc08b3a3)

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

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

---

<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 25, 2021, 8:24am UTC](https://community.thunkable.com/t/having-trouble-getting-quiz-app-to-count-the-score/1518926/13 "2021-09-25T08:24:51Z")

</div>

The conditions are not just confusing but unachievable. See this example for first question  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/c/3cf35abde710eb087c4446a8e8d380aa764bae09.png)

I added a **Yes/No** message to make it easier for me. The correct answer for Q1 is **button A** , but the condition can never be valid because the saved value under column **1** is actually 2 but the condition is expecting 1 so the `score variable` will never increment resulting on displaying 0 at the `results screen`.

---

<div class="post-metadata">

**Author:** ![travisgerbergpy](https://avatars.discourse-cdn.com/v4/letter/t/9de053/32.png) [@travisgerbergpy](https://community.thunkable.com/u/travisgerbergpy)\
**Post date:** [September 26, 2021, 5:58am UTC](https://community.thunkable.com/t/having-trouble-getting-quiz-app-to-count-the-score/1518926/14 "2021-09-26T05:58:25Z")

</div>

I am still trying to wrap my head around what you did but it’s amazing. I have only been using Thunkable for around 2 weeks and have learned a lot but what you did is going to take some time to sink in. I can not thank everyone in the community enough for their help.

I have a side question to ask and I can post a separate question if you would like so everyone can see. My local DB will eventually have around 100 questions. If I wanted to say do a short quiz of 15 or 20 random questions. Would that be done by modifying the “initialize app variable question” block. I see the "random integer from 1 to 100 " block but not sure how to limit it to say 15 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:** [September 26, 2021, 7:27am UTC](https://community.thunkable.com/t/having-trouble-getting-quiz-app-to-count-the-score/1518926/15 "2021-09-26T07:27:51Z")

</div>

This will get (and display, for testing purposes) 15 random **row numbers** from the local database. You can then use the generated list to select questions from the original database.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/0/40c4432fc6c684f63a4d5e2cc8cff69b9f105ad7.png)

If you use the `get and remove` list block each time you pick a row number, you will only select unique rows and won’t repeat any.

---

<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, 1:15pm UTC](https://community.thunkable.com/t/having-trouble-getting-quiz-app-to-count-the-score/1518926/16 "2024-11-08T13:15:10Z")

</div>


