How do you randomize a list?

How do I sync the list that I make I want to synch the answerChoices and answerList to logoList since the logoList is randomized

Here is my aia
GUESSTHELOGO00 (1).aia (3.6 MB)

Could you please explain what you want to do in greater detail (I don't exactly understand what "syncing" means, in this context)?

since the logoList is randomized the 2 variables answerChoices and questionNumber is not syncing with logoList that 2 variables which is answerChoices and questionNumber starts with index 1 and I want it to be same with the logoList for example if the logoList select index 4 I want the answerChoices and questionNumber select index 4 aswell.

I think I've understood.
You could try combining all the variables into nested lists or a dictionary, so you don't have to worry about "syncing" them.

can you help me with the blocks? I'm new in MIT and still having a hard time

add this to the QuizScreen.Initialize event:


Now, in the sublists of the answerChoices list, the 4th index will be the answer, and the 5th index will be the logo. You can adjust your code accordingly (though, there is a lot of adjusting to be done).

You may also change the name of the list if it confuses you.

I already match the answerChoices to the logoList, However the last problem that I have now is that the answerList that is not matching with the logoList it gives me wrong answer. Is there any way to pass the value of index in submitBtn?


1 Like

Make index a global variable.

blocks (6)

Here is an example of how to access related data in a list of lists, when one item is extracted and randomly selected:

(relies on unique values in index 1, otherwise the first occurrence will always be selected)

1 Like

one way (easy but may cost some time) is to merge two list into one.

or Do not shuffle the question and answer list, but shuffle the index list:

  1. make a list of number 1, 2, 3, to length of question list.
  2. shuffle this index list.
  3. get list item one by one, and with this index, get the relavent question and answer.
1 Like


Using this block it matches the question and answer but after pressing the nextBtn it shuffles again.

here is my nextBtn
2

demo for my suggestion at post 15#

1 Like

GUESSTHELOGO00 (2).aia (3.6 MB)
Can you try it with my aia? Im having a hard time trying to understands those blocks. I dont know exactly what blocks i need to replace

just replace the questions and anwsers list with your data.

1
2
Can you check this one? I'm getting a lot of errors

what's the error? please always make your question clear / completed and easy to understand for others.

The first screen gives me same index for variables logoList,answerChoice,answerList but after pressing the nextBtn it gives me different index for the variables logoList,answerChoice,answerList example.
In question 1 it gives me index 1 in logoList,answerChoice,answerList after pressing the nextbtn it gives me index 1 for logolist index 2 for answerChoice index 3 for answerList.

I want them to give me same index after pressing nextbtn


2
3

here is my aia
GUESSTHELOGO00 (2).aia (3.6 MB)

you are not following my suggestion.

1


already got it with some tricks
by deleting the index of the answerChoice and answerList using the index of logoList

and calling the procedure2 under the correct and incorrect function

Using the example from my snippets you got a random index
Just use the same Index for the other 2 lists to get the corresponding items from these lists

Taifun