- Posts: 6
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Text of multiple choice question to use in detailed admin notification
- gavleborg01
- Topic Author
- Offline
- New Member
Less
More
10 years 1 month ago #105814
by gavleborg01
Text of multiple choice question to use in detailed admin notification was created by gavleborg01
I have a multiple choice question with three choices. I want to display the question using Qcodes, and only the selected choices, in a detailed admin notification e-mail.
Question text
I've tried to use {Q1.question} do display the question text, but it doesn't work with the multiple choice question type, works fine with list radio and long text question types.
How can I display the question text of a multiple choice question?
Selected choices
Do i need to use if() and isempty(Q1_1) to decide if a choice has been selected, or is there an easier way?
Example
Question text: What colors do you like
Choice 1: Red (user selected)
Choice 2: Green
Choice 3: Blue (user selected)
Output in notification e-mail:
What colors do you like
Red
Blue
Question text
I've tried to use {Q1.question} do display the question text, but it doesn't work with the multiple choice question type, works fine with list radio and long text question types.
How can I display the question text of a multiple choice question?
Selected choices
Do i need to use if() and isempty(Q1_1) to decide if a choice has been selected, or is there an easier way?
Example
Question text: What colors do you like
Choice 1: Red (user selected)
Choice 2: Green
Choice 3: Blue (user selected)
Output in notification e-mail:
What colors do you like
Red
Blue
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
10 years 1 month ago #105820
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Text of multiple choice question to use in detailed admin notification
I think you'll need to use something like this:
.
Code:
{if(Q1_SQ001 == "Y", Q1_SQ001.shown, "")}
.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- gavleborg01
- Topic Author
- Offline
- New Member
Less
More
- Posts: 6
- Thank you received: 0
10 years 1 month ago #106041
by gavleborg01
Replied by gavleborg01 on topic Text of multiple choice question to use in detailed admin notification
I did it like this:
The advantage of using the is_empty() function is that I do not need to know what value is stored in the variable.
Code:
{if(!is_empty(Q1_1),Q1_1.shown + "<br />",'')} ... {if(!is_empty(Q1_6),Q1_6.shown + "<br />",'')} {if(!is_empty(Q1_other),Q1_other + "<br />",'')}
The advantage of using the is_empty() function is that I do not need to know what value is stored in the variable.
The topic has been locked.