Prefill a hidden question with a random number

More
5 years 5 days ago #77088 by davidspivak
Hi,

Using LimeService (now LimeSurvey Professional).
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

Please Log in to join the conversation.

More
5 years 4 days 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

Please Log in to join the conversation.

More
5 years 4 days 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

Please Log in to join the conversation.

More
5 years 4 days 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.

Please Log in to join the conversation.

More
5 years 4 days ago #77148 by davidspivak
Hi Ifanfoni,
I'm using LimeService (now LimeSurvey Professional), and they're using v1.91, so I can't do that.

Please Log in to join the conversation.

More
5 years 4 days ago #77166 by tpartner

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
5 years 4 days ago #77208 by davidspivak
Thanks tpartner, that worked perfectly!

Please Log in to join the conversation.

More
5 years 4 days 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

Please Log in to join the conversation.