- Posts: 25
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Using EM for answer options - List (radio)
- ChacoKevy
- Topic Author
- Offline
- Junior Member
Less
More
6 years 4 months ago #160195
by ChacoKevy
Using EM for answer options - List (radio) was created by ChacoKevy
Hi all,
Currently using Version 2.62.2+170303
This is a question that's been asked previously, but was asked in previous versions, so just seeing if there is an update on how to go about this; how to conditionally display an answer option in a list-radio question based on (insert your criteria here (mine is a check to TOKEN:ATTRIBUTE_XX))?
I like using the relevance equation fields provided for sub-questions in array questions, but the fields don't appear alongside the answer option fields in list radio questions. Is it still the case, then, to come up with some javascript?
Thanks all!
CK
Currently using Version 2.62.2+170303
This is a question that's been asked previously, but was asked in previous versions, so just seeing if there is an update on how to go about this; how to conditionally display an answer option in a list-radio question based on (insert your criteria here (mine is a check to TOKEN:ATTRIBUTE_XX))?
I like using the relevance equation fields provided for sub-questions in array questions, but the fields don't appear alongside the answer option fields in list radio questions. Is it still the case, then, to come up with some javascript?
Thanks all!
CK
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12713
- Thank you received: 3924
6 years 4 months ago #160201
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Using EM for answer options - List (radio)
Hi, CK,
if the previous question is a multiple question you use array filter.
Like:
Q1: Which car brands are you aware of? (multiple)
Q2: Which is you preferred brand? (single with array filter Q1)
if the previous question is single you have to insert a hidden multiple where you check by equation. And again array filter.
Like:
Q1: Which cars do you prefer? (italian, german, french, japanese, korean)
M1: hidden multiple with answer options of Q2,
eqM1: hidden equation like {M1_SQ001=if(Q1==1,"Y","")}, {M1_SQ002=if(Q1==1,"Y","")}, {M1_SQ002=if(Q1==2,"Y","")}, ...
Q2: And more detailled, which brand do you prefer? (only show brands of the selected country) array filter M1.
Best regards
Joffm
if the previous question is a multiple question you use array filter.
Like:
Q1: Which car brands are you aware of? (multiple)
Q2: Which is you preferred brand? (single with array filter Q1)
if the previous question is single you have to insert a hidden multiple where you check by equation. And again array filter.
Like:
Q1: Which cars do you prefer? (italian, german, french, japanese, korean)
M1: hidden multiple with answer options of Q2,
eqM1: hidden equation like {M1_SQ001=if(Q1==1,"Y","")}, {M1_SQ002=if(Q1==1,"Y","")}, {M1_SQ002=if(Q1==2,"Y","")}, ...
Q2: And more detailled, which brand do you prefer? (only show brands of the selected country) array filter M1.
Best regards
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- ChacoKevy
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 25
- Thank you received: 0
6 years 4 months ago #160229
by ChacoKevy
Replied by ChacoKevy on topic Using EM for answer options - List (radio)
Thanks for chiming in,Joffm
I've not used array filters before, so this is me on the learning curve. That said, I'm not sure how to go about using an array filter for what I'm trying to do. The LS manual says array filters are to be used when checking against what was input as answers to previous questions. That's not what I'm doing.
I need to make a list-radio question to display options based on a check to the Token table.
Example:
Who are you?
A1: An associate (TOKEN:ATTRIBUTE_1=="Associate")
A2: A team member (TOKEN:ATTRIBUTE_1=="Team Member")
A3: Employee
Where only one would be displayed.
Thanks again for any feedback!
-CK
I've not used array filters before, so this is me on the learning curve. That said, I'm not sure how to go about using an array filter for what I'm trying to do. The LS manual says array filters are to be used when checking against what was input as answers to previous questions. That's not what I'm doing.
I need to make a list-radio question to display options based on a check to the Token table.
Example:
Who are you?
A1: An associate (TOKEN:ATTRIBUTE_1=="Associate")
A2: A team member (TOKEN:ATTRIBUTE_1=="Team Member")
A3: Employee
Where only one would be displayed.
Thanks again for any feedback!
-CK
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12713
- Thank you received: 3924
6 years 4 months ago #160232
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Using EM for answer options - List (radio)
Hello,
as I said
1. create a hidden multiple question (M1) with these three options.
2. create an equation: eqM1:
{M1_SQ001=if(TOKEN:ATTRIBUTE=="Associate","Y","")}
{M1_SQ002=if(TOKEN:ATTRIBUTE=="Team Member","Y","")}
{M1_SQ003=if(TOKEN:ATTRIBUTE=="Employee","Y","")}
3. Set the array filter of your question to M1.
Please, have a look into the sample surveys, especially here: manual.limesurvey.org/Expression_Manager...cading_Array_Filters
Best regards
Joffm
And of course: Send a sample of your survey with these questions. (*.lss)
as I said
1. create a hidden multiple question (M1) with these three options.
2. create an equation: eqM1:
{M1_SQ001=if(TOKEN:ATTRIBUTE=="Associate","Y","")}
{M1_SQ002=if(TOKEN:ATTRIBUTE=="Team Member","Y","")}
{M1_SQ003=if(TOKEN:ATTRIBUTE=="Employee","Y","")}
3. Set the array filter of your question to M1.
This is exactly what you do in this case. You check against the input in the previous question (M1), nevertheless how the input takes place, by typing or by an equationThe LS manual says array filters are to be used when checking against what was input as answers to previous questions. That's not what I'm doing.
Please, have a look into the sample surveys, especially here: manual.limesurvey.org/Expression_Manager...cading_Array_Filters
Best regards
Joffm
And of course: Send a sample of your survey with these questions. (*.lss)
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- ChacoKevy
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 25
- Thank you received: 0
6 years 4 months ago #160236
by ChacoKevy
Replied by ChacoKevy on topic Using EM for answer options - List (radio)
Boom - got it. Thanks.
Sorry I was slow and didn't pick up on the notion of the hidden question when you first mentioned it. That was clever.
-CK
Sorry I was slow and didn't pick up on the notion of the hidden question when you first mentioned it. That was clever.
-CK
The topic has been locked.