Welcome, Guest
Username: Password: Remember me

TOPIC: Combining Multiple choice answers and {Insertans} without showing "No answer"

Combining Multiple choice answers and {Insertans} without showing "No answer" 2 years 9 months ago #67212

  • jpluedtke
  • jpluedtke's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 4
  • Karma: 0
Hi guys,
thanks so far for a great great software but now I am stuck and I didnt find any help in the manual or the forums. Here is my problem:

In Qestion 1, I ask subjects to select anyone of four alternatives
[1] A
[2] B
[3] C
[4] D

In Question 2, I need to display the selected answers from Qestion 1. I do so by
writing

{INSERTANS[1]}
{INSERTANS[2]}
{INSERTANS[3]}
{INSERTANS[4]}

If a subject selected in Question 1 for example answers "A", "B" and "D", the feedback in Question 2 right now is

A
B
No Answer
D

But for my survey, I need to display only
A
B
D

Please, please help me. I would greatly appreciate any hint. If you need any further clarification, just tell me. Thanks!
The administrator has disabled public write access.

Re: Combining Multiple choice answers and {Insertans} without showing "No answer" 2 years 9 months ago #67213

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 2549
  • Thank you received: 285
  • Karma: 102
I assume that the first question is a multiple choice question and the second one is also a multiple choice question or an array question. In this case the best way to do what you want is to use the function array filter. It does exactly what you want to achive.

docs.limesurvey.org/Advanced+question+se...eSurvey#array_filter
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Re: Combining Multiple choice answers and {Insertans} without showing "No answer" 2 years 9 months ago #67215

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5300
  • Thank you received: 291
  • Karma: 247
Have a look at the question attribute "Array filter": docs.limesurvey.org/Advanced+question+se...eSurvey#array_filter

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Aw: Combining Multiple choice answers and {Insertans} without showing "No answer" 2 years 9 months ago #67216

  • jpluedtke
  • jpluedtke's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 4
  • Karma: 0
Actually, I have to integrate the selected items as part of the question text. The Question Nr. 2 is a text only element. As such, the items should not be translated into another multiple choice question. I imagine some kind of javascript might do the trick but, alas, I am not capable of performing such tricks. Greatly appreciate your help, guys!
The administrator has disabled public write access.

Re: Combining Multiple choice answers and {Insertans} without showing "No answer" 2 years 9 months ago #67219

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4049
  • Thank you received: 739
  • Karma: 341
Yes, you can hide the offending rows with JavaScript but the details of the script depend on the question types.

Can you attach a small sample survey?
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: Combining Multiple choice answers and {Insertans} without showing "No answer" 2 years 9 months ago #67240

  • jpluedtke
  • jpluedtke's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 4
  • Karma: 0
Dear Tony,

please find the sample attached. In Q2 the "No answer" rows should be supressed. Thanks for your help

Best

Jan-Paul

File Attachment:

File Name: limesurvey_survey_mc_sample.lss
File Size: 23 KB
The administrator has disabled public write access.

Re: Combining Multiple choice answers and {Insertans} without showing "No answer" 2 years 9 months ago #67250

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4049
  • Thank you received: 739
  • Karma: 341
Ah, I see. Q2 is simply a text-display question with a series of <p> (paragraph) elements that have the Q1 answers piped in.
Capture_2011-10-13.PNG


In this case, you can simply set up your survey to use JavaScript and add the following script to Q2. The script will hide all <p> elements that contain "No answer".
<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function() {
 
		$('p:contains("No answer")').hide();
	});
</script>
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.
The following user(s) said Thank You: jpluedtke

Re: Combining Multiple choice answers and {Insertans} without showing "No answer" 2 years 9 months ago #67252

  • jpluedtke
  • jpluedtke's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 4
  • Karma: 0
Great, works like a charm! I really appreciate your help. Tons of Thanks!
The administrator has disabled public write access.

Re: Combining Multiple choice answers and {Insertans} without showing "No answer" 2 years 9 months ago #67258

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5300
  • Thank you received: 291
  • Karma: 247
You're welcome!

If our hints have been helpful and you enjoy limesurvey please consider a donation to the team .
We do all this in our free time and you don't have to pay a penny for this software.

Without your help we can't keep this project alive.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.138 seconds
Donation Image