# Randomize conditions based on previous answers

1 year 2 days ago #161510
joannatrinh created the topic: Randomize conditions based on previous answers
I was wondering if I would be able to randomize question groups of different conditions based on previous answers.
First, I randomized 3 conditions already. But depending on the one that each participant receives, I want to randomize 1 of 2 question groups that they should then receive. However, I cannot find a way to do this as the 2 question groups of each of the next 3 conditions just all disappear. My limesurvey looks like this right now:

Question Group 1: normal question, hidden equation which randomizes 3 conditions
Question Group 2: condition 1
Question Group 3: condition 2
Question Group 4: condition 3
Question Group 5: normal question, hidden equation which randomizes 2 conditions [4,5] that is only "shown"/relevant if participant receives condition 1, hidden equation which randomizes 2 conditions [6,7] that is only "shown"/relevant if participant receives condition 2, hidden equation which randomizes 2 conditions [8,9] that is only "shown"/relevant if participant receives condition 3
Question Group 6: condition 4
Question Group 7: condition 5
Question Group 8: condition 6
Question Group 9: condition 7
Question Group 10: condition 8
Question Group 11: condition 9

However, using this structure, my question groups 6-11 are all disappearing.

1 year 2 days ago #161511 by jelo
jelo replied the topic: Randomize conditions based on previous answers
You should create a simple survey with just these groups and attach an export to this thread.
That will help to understand and check what might went wrong.

What does "randomize 2 conditions [4,5]" mean? The hidden equation delivers 4 or 5 as a result?
If that is the case, why not put this hidden equation inside Question Group 2?
Question Group 6 und 7 need than a condition/relevance on this hidden equation question inside Question Group 2. If result=4 than show QG6. If result=5 than show QG7. Same approach for the other Question Groups.

Please tell us what version/build of LimeSurvey is used.

Are you a student conducting a survey? If yes, tell me why you use LimeSurvey?
www.limesurvey.org/forum/development/116...y-you-use-limesurvey
The following user(s) said Thank You: joannatrinh

1 year 2 days ago #161513
joannatrinh replied the topic: Randomize conditions based on previous answers
Hi jelo, thanks for your reply! I would attach an export to this thread, but the survey is for work and I'd most likely get in trouble for posting it. However, if we're unable to figure this out, then I'll create a similar dummy survey and export it. If I were to export it, what format do I use?
My limesurvey says it's Version 2.72.6.

I did think about putting the hidden equation inside Question Group 2, but the thing is QG 6-11 should only be shown if the answers to their respective conditions QG 2-4 is "Yes." QG 2-4 already have to be randomized, and only 1 of 3 hidden equations in QG 5 is shown based on a participant responding "Yes" to the corresponding question group.
How am I to link the 2 randomizations together? For example, if participant receives QG 2/condition 1, and answer "Yes" to that, then they should only receive hidden equation that randomizes conditions 4-5.

Do you have ideas?

Thanks a million for helping me out!

1 year 2 days ago - 1 year 2 days ago #161515 by Joffm
Joffm replied the topic: Randomize conditions based on previous answers
Hi, joannatrinh,
when we ask for a sample survey, it's always only a sample to see the structure.
Nobody wants to struggle with hundreds of questions (it's true, some attach this though there is only a small issue in one question).

So the structure with some placeholders is sufficient.
And in my opinion it's necessary.
After your first post I thought I understood; but after the second I am more confused.

I think it's the phrase "randomize conditions".
But I think you just want to show question groups randomly to your respondents.

Well, I thought:
In Group 1 there is created a random number (RN1) 1-3
Group 2 only shown to RN1==1
Group 3 only shown to RN1==2
Group 4 only shown to RN1==3
Group 5 creates a new random number (RN2) 1-2 (I think it's sufficient)
Group 6 only shown to (RN1==1) AND (RN2==1)
Group 7 only shown to (RN1==1) AND (RN2==2)
Group 8 only shown to (RN1==2) AND (RN2==1)
Group 9 only shown to (RN1==2) AND (RN2==2)
Group 10 only shown to (RN1==3) AND (RN2==1)
Group 11 only shown to (RN1==3) AND (RN2==2)

This is my understanding of your first post.

Best regards
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last Edit: 1 year 2 days ago by Joffm.
The following user(s) said Thank You: joannatrinh

1 year 2 days ago - 1 year 2 days ago #161516
joannatrinh replied the topic: Randomize conditions based on previous answers
Hi Joffm, thanks for your reply! How do I export my survey to you? Do I have to create another survey, and which format do I export it in?
And it's true that sometimes I refer to question groups as conditions!
I'll try to make my post clearer...

In Group 1 there is created a random number (RN1) 1-3
Group 2 only shown do RN1==1
Group 3 only shown do RN1==2
Group 4 only shown do RN1==3
Group 5 creates a new random number (RN2) 1-2, but also a new random number (RN3) 3-4, and (RN4) 5-6
Group 6 only shown do (RN1==1) AND response was 'Yes' AND (RN2==1)
Group 7 only shown do (RN1==1) AND response was 'Yes' AND (RN2==2)
Group 8 only shown do (RN1==2) AND response was 'Yes' AND (RN3==3)
Group 9 only shown do (RN1==2) AND response was 'Yes' AND (RN3==4)
Group 10 only shown do (RN1==3) AND response was 'Yes' AND (RN4==5)
Group 11 only shown do (RN1==3) AND response was 'Yes' AND (RN4==6)

Each participant can only see 1 question group out of Question Groups 6-11.
If they received RN1 == 1, they are randomized to receive only either Question Group 6 or 7.
Which is why I have set conditions for each of the last 3 RN's; for example, RN2 is only relevant/shown if RN1 == 1 and the response to that was 'Yes.'
(Of course, these RN's have been set to "Always hide question" as they are equations that will do the randomizing.)
##### Attachments:
Last Edit: 1 year 2 days ago by joannatrinh.

1 year 2 days ago #161517
joannatrinh replied the topic: Randomize conditions based on previous answers
Hopefully the attachment works..
##### Attachments:

1 year 1 day ago #161520 by jelo
jelo replied the topic: Randomize conditions based on previous answers

joannatrinh wrote: only 1 of 3 hidden equations in QG 5 is shown based on a participant responding "Yes" to the corresponding question group.

Only 1 of 3 hidden equations in QG5 is shown makes no sense to me.

I don't have the time to check the Limesurvey file now.
But one idea. You tell me, why that won't help

Group 1. Choose random number between 1-6.

Group 2 is shown when 1 or 2
Group 3 is shown when 3 or 4
Group 4 is shown when 5 or 6

Group 6 is shown when 1 AND response is 'Yes'
Group 7 is shown when 2 AND response is 'Yes'
Group 8 is shown when 3 AND response is 'Yes'
Group 9 is shown when 4 AND response is 'Yes'
Group 10 is shown when 5 AND response is 'Yes'
Group 11 is shown when 6 AND response is 'Yes'

Don't put hidden questions alone in questiongroups. That somestimes is buggy and the questionsgroup is not executed at all. So always have a displayed question in a questiongroup.

Are you a student conducting a survey? If yes, tell me why you use LimeSurvey?
www.limesurvey.org/forum/development/116...y-you-use-limesurvey
The following user(s) said Thank You: joannatrinh

1 year 1 day ago #161528
joannatrinh replied the topic: Randomize conditions based on previous answers
Jelo, you solved my problem! It worked great. Thank you so much and I hope you have a wonderful weekend!