Welcome to the LimeSurvey Community Forum

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

Random assignment to scenario groups not working

More
3 days 23 hours ago #274266 by inesahb
Please help us help you and fill where relevant:
Your LimeSurvey version: [see right hand bottom of your LimeSurvey admin screen]
Own server or LimeSurvey hosting:
Survey theme/template:
==================
Hi everyone !I am trying to randomly assign respondents to one of 4 scenario groups in my survey (LimeSurvey Cloud 6.17.1).My setup:
  • I have a first group called "randomizer" containing a hidden Equation question with code 
    Code:
    rnd
     and equation 
    Code:
    rand(1,4)
  • I have 4 groups, each representing one scenario
  • Each scenario group has a relevance condition: 
    Code:
    rnd == 1
    Code:
    rnd == 2
    Code:
    rnd == 3
    Code:
    rnd == 4
The problem: None of the scenario groups ever display. When I preview the survey, I only see the "randomizer" group page (blank, as expected since the question is hidden), but after clicking Next, nothing appears — no scenario is shown.What I have tried:
  • Code:
    rand(1,4)
     as the equation
  • Code:
    if(is_empty(rnd.NAOK), rand(1,4), rnd.NAOK)
     as the equation
  • Conditions: 
    Code:
    rnd == 1
    Code:
    rnd.NAOK == 1
    Code:
    {rnd} == 1
  • When I remove the condition from a scenario group entirely, it displays correctly
The variable 
Code:
rnd
 seems to not be recognized in the group relevance condition (shown in red with "undefined variable").Any help would be greatly appreciated!Many thanks

Please Log in to join the conversation.

More
3 days 18 hours ago #274277 by holch
Provide an LSS file that shows the issue. If you don't want to provide your whole study, you can copy it, delete everything that is not necessary, anonymize your questions and items and then export it as LSS and upload it here.

It can be minor things in the way you have set this up, so we need to see what you actually did. The description here can only help so much.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose