Quantcast
Viewing all articles
Browse latest Browse all 17529

expression manager and random answer - by: jelo

Well, I would be surprised if you get a even distributed exposure of questions.

You let choose the random number 43 times in the equation.
Since the nested ifs are evaluated in a sequential way, you most likely will end up with a lot of chosen questions in the higher range. E.g. rand=1 could only be choosen, if the 42 other rand(1,43) are no matching in the next 42 times. That is very uncommon.

To ensure a evenly distribution of random number, you should create a equation question and use rand(1,43) one time. This equation question code should replace the rand(1,43) in your nested if.
The performance be will better too, since a random number is calculated one time only.

Viewing all articles
Browse latest Browse all 17529

Trending Articles