Welcome, Guest
Username: Password: Remember me

TOPIC: Randomly display certain groups of questions

Randomly display certain groups of questions 2 months 5 days ago #111780

  • lamjas
  • lamjas's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 6
  • Karma: 0
Hi there,

My study is a longitudinal study and I have collected several waves of data. So, all participants have their own token.

In the next wave, I want to have two versions of surveys. Certain "optional" groups of questions will be randomly shown to participants.

For example, I have 10 groups of questions (G1-G10). G1 to G6 are core questions and everyone should answer them. Thus, one group of people will see G1-G8, while another group will see G1-G6 and G9-G10.

In my study, many people have been dropped out. But, I will still send invitation to them anyway. I don't want to create two surveys and randomly assign participants to one of the versions as the number of participants may not be approximately equal to each other at the end. I want to create one survey only and let LS to randomly assign for me so that the probability is half-half all the time.

Is it possible to do this?
The administrator has disabled public write access.

Randomly display certain groups of questions 2 months 5 days ago #111784

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4281
  • Thank you received: 807
  • Karma: 370
You can load an equation type question (code "random1") with a random number between 1 and 2:
if(random1 > 0, random1 , rand(1, 1))


The relevance for groups 7 & 8:
random1 == '1'


The relevance for groups 9 & 10:
random1 == '2'


.
Cheers,
Tony Partner

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

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
Last Edit: 2 months 5 days ago by tpartner.
The administrator has disabled public write access.

Randomly display certain groups of questions 2 months 22 hours ago #111845

  • lamjas
  • lamjas's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 6
  • Karma: 0
Hello again,

As I am new for version 1.92+, I need some time to make sure I understand your solution.

However, I tested the activated survey after inserting the solution, but only G7-G8 (random == '1') are always shown. I never saw G9-G10. Could you please kindly check my setting. I am not sure what goes wrong. Thanks very much for your help.

(1) I created a hidden equation type question (code "random1") in G1 and stated the equation if(random1 gt 0, random1, rand(1, 1)) using "Source" button. By default, the relevance equation becomes "1" after choosing "equation" type question.

(2) In G7 and G8 Group Relevance (not each questions on G7 and G8), I stated random1 == '1' (note: the color of random1 becomes brown)

(3) In G9 and G10 Group Relevance, I stated random1 == '2' (again, the color of random1 is brown).
The administrator has disabled public write access.

Randomly display certain groups of questions 2 months 15 hours ago #111853

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4281
  • Thank you received: 807
  • Karma: 370
Sorry, a typo in my solution...

This:
if(random1 gt 0, random1, rand(1, 1))

Should be changed to:
if(random1 gt 0, random1, rand(1, 2))


.
Cheers,
Tony Partner

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

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
Last Edit: 2 months 15 hours ago by tpartner.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.370 seconds
Donation Image