Text of multiple choice question to use in detailed admin notification

More
3 years 3 months ago #105814 by gavleborg01
gavleborg01 created the topic: Text of multiple choice question to use in detailed admin notification
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

Please Log in to join the conversation.

More
3 years 3 months ago #105820 by tpartner
tpartner replied the topic: Text of multiple choice question to use in detailed admin notification
I think you'll need to use something like this:

{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.

Please Log in to join the conversation.

More
3 years 3 months ago #106041 by gavleborg01
gavleborg01 replied the topic: Text of multiple choice question to use in detailed admin notification
I did it like this:
{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.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now