Need little help on my app logic

i have build an quiz app on thunkable , and i want help on one logic,there is a game which has 100 levels , like level one quiz is " im an odd number , Take away one letter and i become even. what number am i ?" , if the user type the correct answer( exapmle answer is seven) and click submit then it will be redirect to level 2 which will be on same screen just chagne the quiz text, and also it should saved to the store variable , but im getting erorr you can see my code


i have made the question list as you see , but the problem is im getting all those items at once like as you see
Screenshot 2024-05-27 173359
please can you help me to spot any mistakes i made into the code which is reason of that eroor ?

i will set the visibility depending on what is showing
ie
if TextInPut=null
then set check mark to fause

i might also set there vis to fales when page opens

i hope this helps

i did not understood , you can take look att : Thunkable

@tthompson41231 hy friend if you are free , can you please take a look at this , i realy appreciate

You need to set the visiblity of items you donโ€™t want displayed to false, until you want them displayed and set them to true.

@salmannawaz1724xjqj0 it may be worth changing your list setup to include the question and answers together to make it easier to maintain.

Something like this:

Then you can setup a function and use the level # to get the question and answers from a single list, and you donโ€™t have to manage two different lists, and you can easily manage the answers to each question.

@salmannawaz1724xjqj0 I just understood what you were asking, and you have a list block in your open block that doesnโ€™t need to be there.

I see that you also did the same thing in your button click block. The logic issue youโ€™re having is because youโ€™re creating a new list from the list youโ€™ve already created w/ the Questions and Answers.

The *list block creates a list. When you initialize Questions and assign it the list items, Questions becomes your list. When youโ€™re using the โ€œin listโ€ block you just need to use the Questions variable because itโ€™s already a list. When you use the *list block youโ€™re creating a new list with the value of Questions.

I remixed your app, and made the suggested changes, plus a few more I thought of while I was refactoring your blocks.

https://x.thunkable.com/copy/fb2bf11cc4e3db0d3405a95c208cb259

I didnโ€™t fully understand your question & answer scenario, I got the impression it would be multiple choice.

Hopefully this will help get you past the logic challenges you were facing.

I will take a look soon ! But i have a question? You have made question and answer together, so how the code will know if the answer is correct of specific question

I stored the sublist with the question and answer in a variable. When the text answer is submitted it can be used to evaluate against #2 directly in the sublist.

1 Like

i reay do not understood the code you made


what is the question and answer, because when type yes on the input , the label 2 changes into โ€œselect posssiblyโ€ and also it does not even save those progress!, how to add new one

I find the nested lists to be a complicated way to store data. Itโ€™s fine if you understand it but I think perhaps a better structure is to use objects which then can be given property names that you can refer to. However, the best way to set up a quiz/trivia app is to use a data source.

Thereโ€™s an official tutorial that walks you through the steps. I recommend it!

ยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท
Need help? How to Ask Great Questions :sparkles: Debugging A Project :sparkles: API JSON Tutorial

Want to hire a Certified Thunkable Expert? Elevate your app with Tatiang on Fiverr

now i have used this metthod but the only problem is that my app is not a quiz app , its a brain testing app , where some levels contain images and difrent design of text , so how i can deal with it, and also why its again start from begining and continue from where i left of the last time when i stop and restart the web preview, you can see here if anyhting wrong

Sorry about the confusion, I played around with that a bit more after posting my reply.

Iโ€™ve refacotred the example app:
https://x.thunkable.com/copy/3f432cd26c2331c49207c2c208656e4a

Iโ€™ve moved the questions and answers in to a local data store. No list.

The level will increase and persist as you move through the questions and answer them correctly.

Question 3 offers a possible solution to your image question.

You will need to figure out:

  • how you want to display the images, and present the UI to the user.
  • what happens when the user completes the final level
  • error capturing if values are null

Thank you for refactoring my app , but Iโ€™m already move out to data source methods
After tatiang reply, I just want to know how I can use any ui and design on specific level if I want to , as I said in my previous reply

You will need to draw the different UIs you need on the same screen depending on the question and answer.

In the refactored app I addressed this issue by using a few functions based on the answer type.

You can use the clone and/or create blocks to add these elements and position them, but if you can make each of the different UIs the same and just change the content it would probably be easier.