[NEED HELP] shuffling questions list not showing after shuffled

Hi, Everyone! I'm new of this thing.

several days ago, I started to build an app for exam purpose, The app is running well. The issue was coming after i tried to shuffle questions.

This is the issue

The error I got:
Screenshot 2024-09-14 211743

and this is my block
block for getting data from Database

this is some procedure blocks



any help would be appreciated.

thank you

Perhaps:

There are many different approaches to list shuffling, depending on your needs.

In:


Screenshot_2024-09-14-20-03-09-977_com.android.chrome
i and list_shuffle should be swapped.
not sure if there are any other errors

1 Like

i got the same error

Sorry, I misread the error message. I'm assuming it's this:

You join three lists using the text join block (which should return text), and then you try to get the length of that. Use the append to list block instead.

Bring some delay by clock, I got the same problem in my project but fixed by giving some delay by using notifier and clock component.

Because Web.GotText block is not instant provide you whole data and the local variable are also not getting instant data from that block.

And it is is due that list block which is not getting instant data from the web which needs to be implemented into global variable and with some delay of 1000ms to 1500ms

Yes, this article I found and read before I try to shuffle the questions list, and I take some advantages of this, by the way. So I build new approach but getting error.

Thank you

be honest, those variable is coming from single list, and I separated to 3 lists, since I have to keep shorting questions ascendingly in order to user keep going continue the exam from multiple choice question to short answer and paragraph questions, but for each questions list should be shuffled.

Thank you

First of all you are not initialising variable i as a list.

So you can't treat it as a list.

You already self confused with variable i and list_suffle you got from the procedure

Fix these basic issues first.

2 Likes

how it should be?

Remove length of list block from Initialisation of Variable i

And remove set variable i to i-1 block in the last.
And replace the same with variable j

Provide Sample value of these all variables one by one.

Show your Display Question Procedure.

sample value

display question procedure

You have not fixed untill now

Make a list of each Json block if you have 18 values in only one JSON store it in a list as number 1 or you can double decode using JSON decoder.

Then call random or shuffle using this block :

lists_pick_random_item

You have too many procedures try to check which block is giving errors.

Experiment it by a Notifier.ShowAlert block

And give name of the block where you need to check it.

Like if you place Notifier in Display Question block then use Notifier.ShowAlert("Display Question")

Same in ShuffleList procedure use Notifier.ShowAlert("Shuffle List")

Use this method in each and every block and let us know which block and procedures giving you the errors.

I do appreciate for guiding me. I'll try to facing the error, and I inform you after I fix it!

thank you

Okay Sure Hasan we are waiting for you kind response.

If you like to do with extension , i made simple extension
Untitled
com.xtiger.sortlist.aix (4.0 KB)

3 Likes

The extension is great :+1::smiley:,

But he needs to call and get every question's each four options, but that the thing he can't be able to do.

He cannot be able to got the questions first so he isn't be able to shuffle that.

But really it helps in further proceedings.