0 votes

[Copied from GT FB group]

What do you think is the best way to ask a list of questions in a different (random) order to each user?

I was thinking if there could be a way to randomize a list like Q=[1,2,...,20], then do

*while: i<=20
*question: questionstext[Q[i]]
*answers: answerstext[Q[i]]

Is there a way to randomize Q? If so, is this the best way to accomplish this?

by (5.8k points)

1 Answer

0 votes

 You can randomize the order of a collection of items such as:

>> Q = [1,2,3,4,5]

Using:

>> Q.shuffle

Another approach to doing what you want to do is to use *randomize: all

And put each question in its own *group indented beneath *randomize

image
A similar approach but with 2 levels deep array, e.g.

questions_and_answers = [[["What is your favourite colour?"],["Red","Green","Blue"]],[["How awesome is this on a scale of 1 to 10?"],[1,2,3,4,5,6,7,8,9,10]]]
by (5.8k points)
Welcome to Guidedtrack Q&A, where you can ask questions and receive answers from other members of the community.
134 questions
144 answers
55 comments
40 users