I need to shuffle a sequence of questions randomly based on their question Ids from 1 to 10. How can I achieve this using the random() function?
That’s a fun question! You do it by ordering by the result of the random function, e.g.
open Seq;
let numbers = range(1, 10); // example data set: numbers 1-10
return numbers.orderBy(x => random(0, 1)); // return them in random order
1 Like