Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: Randomize experimental treatment

Randomize experimental treatment 2 years 11 months ago #102612

  • frankala
  • frankala's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 1
  • Karma: 0
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
The administrator has disabled public write access.

Randomize experimental treatment 2 years 11 months ago #102618

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6566
  • Thank you received: 1477
  • Karma: 578
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))}
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.
Time to create page: 0.241 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form