Welcome to the LimeSurvey Community Forum

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

Random variables generated again when changing survey language

  • Zirys
  • Zirys's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
2 years 1 week ago - 2 years 1 week ago #227891 by Zirys
Please help us help you and fill where relevant:
Your LimeSurvey version: 2.62.2+170203
Own server or LimeSurvey hosting: I don't know, I think it is hosted
Survey theme/template: 
==================
I have a multilingual survey. In the first group of question, random hidden variables are generated with an equation question. When filling out the survey, changing the language, even when in a different question group, re-initializes the random variables, meaning they can change.

Is there any way to
a) prevent the variables from re-initializing when changing the langauge?
b) prevent the possibility for participants to change the language (without changing the template, because I cannot do that due to lacking admin rights)?

I attached an example. If you start the survey, go to the second page, and then change the language, it will also change the random number shown, even though it was generated in a previous question group.

Thanks in advance.
Last edit: 2 years 1 week ago by Zirys.

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 1 week ago #227893 by tpartner
a) Use an equation like this:

Code:
{if(is_empty(random), rand(0, 10), random)}

b) No.

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: Zirys

Please Log in to join the conversation.

  • Zirys
  • Zirys's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
2 years 1 week ago #227894 by Zirys
Awesome. Totally forgot about that. Used it in the past.
Thanks a lot.

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose