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
  • gavleborg01's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 2 weeks ago #105814 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
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 2 weeks ago #105820 by tpartner
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
  • gavleborg01's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 1 week ago #106041 by gavleborg01
I did it like this:
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.

Lime-years ahead

Online-surveys for every purse and purpose