Welcome to the LimeSurvey Community Forum

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

Tokens and randomisation

  • brussell
  • brussell's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 7 months ago #141068 by brussell
Tokens and randomisation was created by brussell
Hi there,

I am using version 2.50 and have a complex survey that I need help with if anyone has the time please.... In one part of the survey I need participants to be randomised to one of four sets of 18 questions but I would also like to enable participants to save and return to the survey if they get interrupted (it takes about 20 minutes to complete).

To set up the randomisation I have made each of the 18 questions a separate group - so question group 1 includes questions 1a, 1b, 1c and 1d, question group 2 includes questions 2a, 2b, 2c and 2d etc. I then inserted a hidden question prior to this section, with an automatic randomisation to one of four groups using the formula 'rand(1,4)'. I then set a relevance equation (eg '((random==1))', '((random==2))' etc) for each question in each group so that only questions 1a, 2a, 3a, 4a etc were displayed to those participants randomised to group 1, and only questions 1b, 2b, 3b, 4b etc were displayed to those particiapants randomised to group 2, and so on.
The strategy I used was as described in this helpful blog: www.ryananddebi.com/2015/04/09/limesurve...xperimental-designs/

I know that when using the 'resume later' / 'save and return' feature this undoes any randomisation because the randomisation is generated afresh each time you log on. However, I am wondering if tokens can overcome this? ie when a participant is allocated a token, does that 'freeze' the particular survey generated for them so when they log in at a later time they will still be allocated to the same randomisation stream and be able to pick up with the same set of questions at the same point where they logged out earlier?

To make things even more complicated, I would like to randomise the order in which the question blocks are displayed, ie this would mean someone allocated to group 3 in my hidden question would see questions appear in random order 7c, 10c, 1c, 18c, 3c, 8c... rather than 1c, 2c, 3c, 4c, 5c, 6c... etc. However, if this complicates things too much, it is optional! The most important thing is that participants are randomly allocated to one of the four sets of questions and that ideally they can save and return to the same set of questions.

Thanks so much for your time!

Beth
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 7 months ago #141077 by tpartner
Replied by tpartner on topic Tokens and randomisation
Try placing an IF statement on the random question so the rand() function only gets fired once.

Code:
{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.
  • brussell
  • brussell's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 7 months ago #141079 by brussell
Replied by brussell on topic Tokens and randomisation
Thanks tpartner but I don't fully understand what you mean (I am still learning lots about Lime Survey as I go!).
My hidden randomisation question only appears once, just before the section of questions that I want randomised. Will adding this IF statement enable the token system to remember which group the participant had been randomised to?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 7 months ago #141080 by tpartner
Replied by tpartner on topic Tokens and randomisation
No, this has nothing to do with tokens. It simply ensures that the randomization question does not get re-loaded when the respondent returns to the survey. It retains its value from the first visit so they are still in the same randomized group.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • brussell
  • brussell's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 7 months ago #141082 by brussell
Replied by brussell on topic Tokens and randomisation
Fantastic - sounds like just what I'm looking for! My recruitment plan was to circulate the URL through flyers and the newsletters of relevant organisations so I'd prefer not to use tokens anyway. I assume with this method I should now re-activate the 'save and return' function?

A few more questions though:
Does this mean I will need to use non-anonymous responses?
Does this mean I will need to not randomise the order of the 18 questions? (I had planned to use the randomisation group function for this but it's not essential.)
Also, are you able to explain for my learning what the equation actually means? ie does it mean "only if the randomisation question is empty then assign random number between 1 and 4" ? I am wondering what the last 'random' means.

Thanks so much for your time and help, and for answering my post so quickly - much appreciated.

Beth
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 7 months ago - 7 years 7 months ago #141090 by tpartner
Replied by tpartner on topic Tokens and randomisation

Does this mean I will need to use non-anonymous responses?

Non-anonymous responses are only a factor when tokens are used. That setting simply separates the token and data tables.

Does this mean I will need to not randomise the order of the 18 questions?

You can still use group randomization. It's not affected by question relevance.

Also, are you able to explain for my learning what the equation actually means?

The IF statements work as follows:
Code:
{if(condition, 'Returned if true', 'Returned if false')}
So, in your case the IF statement checks to see if question code "random" has no value (yet). If that is true the question is populated with rand(1,4). If that is false, the question is populated with the existing value of question code "random" so remains the same.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 7 years 7 months ago by tpartner.
The topic has been locked.
  • brussell
  • brussell's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 7 months ago #141119 by brussell
Replied by brussell on topic Tokens and randomisation
OK thanks again. Just one more question:

"You can still use group randomization. It's not affected by question relevance."

Will this impact the save and return function though? I thought that group randomization would mean that the save and return function would not work (or would restart the participant back at the part of the survey prior to the randomized section).

Thanks!
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 7 months ago #141124 by tpartner
Replied by tpartner on topic Tokens and randomisation
Hmm...not sure because I rarely use save and return. Please test.

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: brussell
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose