Prefill a hidden question with a random number

More
8 years 3 months ago #77088 by davidspivak
Hi,

Using LimeService.
How do I prefill a hidden question with a random number (either 1 or 2)?

I want to use this question for random assignment of participants to groups.
If answer is 1 show participants a specific question, and if answer is 2 show them another question (I know how to do this).

Thanks!
David
The topic has been locked.
LimeSurvey Partners
More
8 years 3 months ago #77122 by granen
Hi,

If it is a closed survey I normally uses attributes to do this. Create random numbers between 1 and 2 in the excel table and import together with email.

//Erik
The topic has been locked.
More
8 years 3 months ago #77127 by davidspivak
Hi granen,

Thanks for your reply.

What do you mean by 'closed survey'? using tokens? because if that's the case, I'm not using tokens - anyone can participate in my survey.

Thanks,
David
The topic has been locked.
More
8 years 3 months ago #77139 by lfanfoni
With the new version (1.92), you can use the question type "equation" and define the formula: rand(1,2). You can also hide this question.
The problem is that the random value is calculated at the moment of the page loading, so you have to put the specific question at the next group or page.

Aiutaci a far crescere la comunità italiana di LimeSurvey: vai sul forum Italiano per richieste e soluzioni citando sempre la versione usata, non scrivere in privato, suggerisci modifiche o nuove traduzioni - www.limesurvey.org/forum/italian-forum/118441
The topic has been locked.
More
8 years 3 months ago #77148 by davidspivak
Hi Ifanfoni,
I'm using LimeService, and they're using v1.91, so I can't do that.
The topic has been locked.
More
8 years 3 months ago #77166 by tpartner

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
The topic has been locked.
More
8 years 3 months ago #77208 by davidspivak
Thanks tpartner, that worked perfectly!
The topic has been locked.
More
8 years 3 months ago #77212 by Steve01
You're welcome :-)

If our hints have been helpful and you enjoy limesurvey please consider a donation to the team .
We do all this in our free time and you don't have to pay a penny for this software.

Without your help we can't keep this project alive.

Mit freundlichen Grüßen/Best regards,

Stefan Gohlke
LimeSurvey Team
The topic has been locked.

Start now!

Just create your account and start using Limesurvey today.

Register now