Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Variable changes unexpectedly

  • pbernau
  • pbernau's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 6 months ago #142928 by pbernau
Variable changes unexpectedly was created by pbernau
I have a problem with an unexpected change in the value of a variable.

In my survey, I use an equation type question to define the variable "treatment" out of rand(1,2) within the first question group. However, two question groups later, "treatment" sometimes has a different value out of 1 or 2.
Is this normal? What can I do to change this? Ist there another way to randomly select participants into different treatments?

I have attached the logic file.

My LimeSurvey version is 2.50+160908. Unfortunately, I am not able to change it.

Thank you for all your help!
Attachments:
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 6 months ago #142937 by tpartner
Replied by tpartner on topic Variable changes unexpectedly
Have a look at this post about using an IF statement to ensure the rand() function only gets fired once - www.limesurvey.org/forum/can-i-do-this-w...randomisation#141077 .

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • pbernau
  • pbernau's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 6 months ago #142959 by pbernau
Replied by pbernau on topic Variable changes unexpectedly
This really seems to work! Thank you very much, Tony!
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose