multi-choice question getting response options from previous questions

More
9 months 2 weeks ago #148150 by drbray
drbray created the topic: multi-choice question getting response options from previous questions
So i have two multi-choice questions, each having the exact same options to choose from. The second question should only pull in responses that were checked off in the first question. For example...

Q1: Which fruits do you like?
01 - Apples
02 - Pears
03 - Bananas
04 - Oranges
05 - Strawberries

Q2: Which two or three of those fruits do you like the best?
01 - Apples
02 - Pears
03 - Bananas
04 - Oranges
05 - Strawberries

For subquestion code 01 in the second question i put this code...
{if(q1_01=="Y",join("- ",q2_01.question,": ",q2_01.shown),"")}

And even though it will not show the text of "01 Apples" in Q2, it does still show the checkbox...which i need hidden.

I also need to know how to only get Q2 if more than one answers are checked in Q1...can't quite figure that out.

Please Log in to join the conversation.

More
9 months 2 weeks ago - 9 months 2 weeks ago #148158 by holch
holch replied the topic: multi-choice question getting response options from previous questions
I think you are going too complicated.

First solution: use Array filter. It should work with multiple choice questions as well: manual.limesurvey.org/QS:Array_filter/en

I am not too sure what you are trying to do with the expression you are showing.

To show only the responses that have been marked in the first question you should only write this into the relevance equation for this subquestion:
q1_01 == 'Y'

If that is not what you are looking for, provide a copy of the survey with only those two questions so that we can look at what you are trying to do.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds
Last Edit: 9 months 2 weeks ago by holch.
The following user(s) said Thank You: drbray

Please Log in to join the conversation.

More
9 months 2 weeks ago #148169 by DenisChenu
DenisChenu replied the topic: multi-choice question getting response options from previous questions
And for hidding Q2 if Q1 have more than 1 answer: count(Q1.NAOK)>0

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
The following user(s) said Thank You: drbray

Please Log in to join the conversation.

More
9 months 2 weeks ago #148227 by drbray
drbray replied the topic: multi-choice question getting response options from previous questions
thank you both...your answers worked like a charm.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!