But I still want to see Joffm's ideas.
Oh, really?
And I tell you it is more or less the same approach.
Of course the code is much more clumpsy. But with the help of W3Schools...
But as it was my first own script I am really proud.
But I used a different way to define the questions.
I joined the values and created eight arrays (8 ttt groups)
The relID is not necessary as it is the same as the id. But you can add it as well. Or you add the number of the corresponding question.
Code:
var questionsArray1 = ["0011A6", "0021A6", "0031A6", "0041A6", "0051A8", "0061A8", "0071A8", "0081A8", "0091C6", "0101C6", "0111C6", "0121C6", "0131C6", "0141C6", "0151C6", "0161C6"];
var questionsArray2 = ["0172A5", "0182A5", "0192A5", "0202A5", "0212A7", "0222A7", "0232A7", "0242A7", "0252B5", "0262B5", "0272B5", "0282B5", "0292B5", "0302B5", "0312B5", "0322B5"];
Now I can capture the ttt-value as "substr(string,3.1)" and the xn-value as "substr(string,4,2)"
Now
1) Shuffle the arrays
2) Add the first objects of each array to a new array "finalArray"
3) Remove those objects from the shuffled arrays
4) Joined the eight arrays to one "restArray"
5) Remove all of the previously selected "xn" values from this array
6) Shuffle the "restArray"
7) Find the first object in this "restArray" and add it to "finalArray"

Remove all objects with the same "ttt" value as above from the array
9) Shuffle the "restArray"
10) Again, find the first object in this array and add it to "finalArray"
Now there are 10 objects in the "finalArray".
Either you load the "substr(string,0,3)" into the question or you leave it for later use of ttt and xn.
As the IDs of array B are only IDArrayA+96 you can easily calculate
Joffm