Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Output the non-selected options in multiple choice

  • shobanas
  • shobanas's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 3 months ago #177808 by shobanas
Hi,

I would like to output the non-picked options in a multiple choice question to give them some guidance on where they can improve. I know you can use "shown" to display the picked option, can you please help me with how I can display those options that the user did not select.

Thanks
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 3 months ago #177813 by holch
For a multiple Choice question ".shown" will not give you the one das has been picked. Shown basically shows the text of the answer/subquestion, not the code. That is what shown does. For single choice question it is the same as the picked one, but not for multiple choice questions.

For multiple choice questions you can find out if a subquestion has been marked by checking if it has a "Y" in the database.

So what you could do to show the subquestions in a multiple choice question that have not been picked is check one by one if it equals Y or not.

Something like this should do the trick (untested):
Code:
{if(questioncode_subquestioncode != "Y", "questioncode.subquestioncode.shown", "")}

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: DenisChenu
The topic has been locked.
  • shobanas
  • shobanas's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 3 months ago #177815 by shobanas
Thank you for your response. Since I assign a value to each choice in the multiple choice question, I know what choices were not picked based on summing the values of the picked choices. So I had tried something along the lines of what you said earlier and all it displays is "MOQ1_B.shown". In this case I had picked choice A and I want it to output text of choice B

{if(SumBO==1, "Business Operations is at Level 1. You can get to next level by completing all of the following: MOQ1_B.shown")}
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 3 months ago #177817 by holch
This can't work. Limesurvey will take MOQ1_B.shown as normal text, as you post it within the normal text in between "". The expression manager can't know that you want this to be the variable.

Maybe you can do this (not sure, not tested):
Code:
{if(SumBO==1, "Business Operations is at Level 1. You can get to next level by completing all of the following: " + MOQ1_B.shown, "")}

Otherwise you probably have to go the long way and use two if statements, one for the text "Business Operations is ...." and the other one for MOQ1_B.shown.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • shobanas
  • shobanas's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 3 months ago #177823 by shobanas
That did not help either. I noticed that I am only able to output the string text in the choice I have selected using .shown.
Can anybody suggest how I can output the text in other non-selected options.
Example
A. Car
B. Bicycle
C. Train
And I selected Car, but I want to print out Bicycle and Train too.

Thanks
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 3 months ago #177824 by holch
Hmmm, I think I know what it is. I think you need to use MOQ1_B.question. This will give you the text of the subquestion, which should be your "Car", Bicycle, Train...

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: shobanas
The topic has been locked.
  • shobanas
  • shobanas's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 3 months ago #177825 by shobanas
Thank you so much ".question" worked. Appreciate your help.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose