Welcome to the LimeSurvey Community Forum

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

Randomize groups

More
6 years 10 months ago #154615 by Shari
Randomize groups was created by Shari
Hello,

I am working with a German version 2.06+ Build 150930


I have built 3 questionnaires and named them "Randomization" to generate the
group and named the questionnaires "1", "2" and "3". I managed to create a functioning random selection of a user group resulting in the desired result. I, however, am not able to teach the program to then select only questions of the appropriate group. Either the program tells me that the command ((random=="1")) does not work, because the program cannot interpret the word "random". Same with the commands "rand" or "randtumber". Consequently, the selection of the proper questions is not working.

I now ask you to specifically tell me, how the necessary commands have to be spelled out - and into which fields they have to be entered into.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 10 months ago #154640 by tpartner
Replied by tpartner on topic Randomize groups
1) At the beginning of the survey, insert an equation type question with question-code "random1".

2) To load a random number between 1 and 3, place this expression in that question:
Code:
{if(random1 == '', rand(1, 3), random1)}

3) Insert a relevance equation for each group like:
Code:
random1 == 1

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
6 years 10 months ago #154711 by Shari
Replied by Shari on topic Randomize groups
Hallo Tony Partner,
Thank you so much for your answer!
Now it´s working :)

Greetings,
Shari
The topic has been locked.
  • Mazi
  • Mazi's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
5 years 2 weeks ago #181671 by Mazi
Replied by Mazi on topic Randomize groups
This is also doable for questions instead of groups e.g. if you want to do some A/B testing. See survey-consulting.com/how-to-randomize-i..._used_for_AB_testing for more details and randomizing items at Limesurvey in general.

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose