After the array aggregator I have a webhoock response. I think I need to introduce one (or 2) modules in between to do the shuffling. Do I have to convert the bundles into an array? And if yes how ?
If I understand correctly, your Parse JSON module gives you the array of collections shown in your text window. Each element in that array is a collection consisting of âtextâ (the question) and âanswersâ (an array of multiple choice answers).
Youâre not just trying to pick array element at random - that might result in the same element being picked again. You need to produce an entirely new array that has been shuffled. You need to shuffle both the top level array, and within each of those top levels, you need to shuffle the answers.
Make includes a handy âshuffleâ function in the array functions. Shuffle() returns a new, shuffled array.
So I would use the Iterator to turn your top-level array into bundles. For each of these bundles you would then construct a new data structure of the âtextâ and a shuffled array for the answers. Youâd then use the Aggregator to turn all those back into a top-level array, and then youâd shuffle that.
The downside is that this could use a lot of operations. If you had say 3 operations, youâll use 3 x Q x A operations (where Q = number of questions and A = number of answers).
could I add a Key âorderâ to the array and assigne it a random number (5 digits or even 10) and then Order the array by the key order? or does this also costs a lot?