Welcome to the LimeSurvey Community Forum

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

Randomising between question groups

  • danielderbyshire
  • danielderbyshire's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 9 months ago #223853 by danielderbyshire
Randomising between question groups was created by danielderbyshire
Your LimeSurvey version: Version 3.27.32
Own server or LimeSurvey hosting: Limesurvey (not live yet)
Theme: fruity (extended to increase the text size globally though)
==================
I have a survey and I want to randomise participants to one of 4 question groups (the last 4 question groups in the attached file).

At the moment, I have a hidden Equation question in the instructions question group (so before all the 4 I want to randomise between), the question field contains the following: {random=rand(1,4)}

I then set the Relevance equation for each of the 4 question groups as "random=1", "random=2", etc (without the quotation marks).

But at the moment it just takes me through each group sequentially as if there was no logic.

Any help on how to get this method to work or even alternative methods would be massively appreciated, I have searched around and tried a few different things.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 9 months ago #223854 by tpartner
Replied by tpartner on topic Randomising between question groups
Attaching a question export does not help us see the problem. Attach a survey export (.lss file) containing only the relevant questions.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
  • danielderbyshire
  • danielderbyshire's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 9 months ago #223855 by danielderbyshire
Replied by danielderbyshire on topic Randomising between question groups
Apologies - that's what I had intended to attach, please see the attached.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 9 months ago #223856 by tpartner
Replied by tpartner on topic Randomising between question groups
Additionally, your relevance equations should be "random == 1", "random == 2", etc.

- www.limesurvey.org/manual/ExpressionScri...ntation/en#Operators

I would suggest this for your equation question so it does not cet re-calculated on page reload:

Code:
{random = if(is_empty(random), rand(1,4), random)}

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • danielderbyshire
  • danielderbyshire's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 9 months ago - 2 years 9 months ago #223857 by danielderbyshire
Replied by danielderbyshire on topic Randomising between question groups
That is amazing - I can confirm that has fixed the problem and it is now working as intended.

Sincere thanks for the swift and informative reply. I've now flagged the post with the tick to indicate it is solved.
Last edit: 2 years 9 months ago by danielderbyshire.
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose