Randomize experimental treatment

3 years 3 months ago #102612 by frankala
Hi everybody, we are currently setting up a questionaire for our online experiment and have problems randomizing the treatment in the beginning. Can anybody help us out? Would be great!
We created an equation question (in an own question group) with {rand(1,5). In the following we created five question groups which contain our five different treatments. Here we picked for relevance: ((randnumber == "X")) (X=1-5).
But still, the preview shows all of the treatments. Does that mean it doesn't work? Or is it just not possible to see it in the preview?

Thanks a lot in advance! Best, Franka

Please Log in to join the conversation.

3 years 3 months ago #102618 by tpartner
Yeah, that should work in preview.

Try this for the equation in the "randnumber" question. It will ensure that the random number is only generated once.
{if(randnumber >= 0, randnumber, rand(1,5))}

Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.