Welcome, Guest
Username: Password: Remember me

TOPIC: Piping from Multiple Choice to Multiple Numerical

Piping from Multiple Choice to Multiple Numerical 2 years 10 months ago #66098

  • rvenkat
  • rvenkat's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 42
  • Thank you received: 1
  • Karma: 2
Is there a way to pipe answers selected from a Multiple Choice question (in page 1) and set them answer categories for a Multiple Numerical question (in page 2)?

I don't see the logic/array filter under advanced settings for Multiple Numerical. I am wondering if there is a workaround for this?

Thanks very much.

Ramesh
The administrator has disabled public write access.

Re: Piping from Multiple Choice to Multiple Numerical 2 years 10 months ago #66102

  • rvenkat
  • rvenkat's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 42
  • Thank you received: 1
  • Karma: 2
I should clarify my question.

In Q1, suppose I have something like this:
Which brands of car are you familiar with?
The answer choices are: Brand A, Brand B, Brand C, Brand D, Brand E and Brand F.

Assume that the respondent selected Brand A and Brand B.

In Q2, on page 2, I can use {INSERTANS:34664x144x1558SQ001} etc. as subquestions in the Multiple Numerical question.

When I do this, the subsqquestions for Q2 show up as following:

Brand A
Brand B
No answer
No answer
No answer
No answer

I want only Brand A and Brand B to show up subsquestions in Q2. I am sure I am missing something simple here. How do I filter out the unselected answers from Q1? Under advanced settings there is no array filter option. Is a javascript needed to do what I want?

Thanks.

Ramesh
The administrator has disabled public write access.

Re: Piping from Multiple Choice to Multiple Numerical 2 years 10 months ago #66107

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4068
  • Thank you received: 746
  • Karma: 341
You can use JavaScript.

1) Set up your survey to use JavaScript.

2) Add the following script to the source of the multiple-numeric question. Replace "QQ" with the multiple-numeric question ID.

The script looks for all labels with text that exactly matches "No answer" and hides their parent list item (sub-question row).
<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function(){
 
		var qID = QQ;
 
		$('#question'+qID+' label').filter(function() {
			return $(this).text() == 'No answer';
		}).parent().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.

Re: Piping from Multiple Choice to Multiple Numerical 2 years 10 months ago #66135

  • rvenkat
  • rvenkat's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 42
  • Thank you received: 1
  • Karma: 2
Tony,

Thanks so much. It works like a charm.


Ramesh
The administrator has disabled public write access.

Re: Piping from Multiple Choice to Multiple Numerical 2 years 10 months ago #66169

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5300
  • Thank you received: 291
  • Karma: 247
Great solution, Tony!

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.

Re: Piping from Multiple Choice to Multiple Numerical 2 years 9 months ago #66622

  • stigchelg
  • stigchelg's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 26
  • Karma: 0
Hey all,

I'm trying to implement something like this too. I have a multi options question which needs to prefill a multi numerical (slider). I'm trying to use INSERTANS but I can't figure out where to put it.

You state in your top post:
"In Q2, on page 2, I can use {INSERTANS:34664x144x1558SQ001} etc. as subquestions in the Multiple Numerical question."

This is not working for me. When I put the INSERTANS in as a subquestion, I get it as the actual question text. It doesn't 'do' anything.
The administrator has disabled public write access.

Re: Piping from Multiple Choice to Multiple Numerical 2 years 9 months ago #66636

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4068
  • Thank you received: 746
  • Karma: 341
That may indicate that the {INSERTANS} value is incorrect.

Did you use the replacement field button in the editor?
Capture_2011-10-03.PNG
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: Piping from Multiple Choice to Multiple Numerical 2 years 9 months ago #66658

  • stigchelg
  • stigchelg's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 26
  • Karma: 0
Yes I did. I used the field button to create the INSERTANS and then I pasted that INSERTANS into the subquestion box. That resulted in the INSERTANS being displayed as the subquestion instead of it displaying the value it refers to.

I'm clearly missing the point. Where do I put the INSERTANS? In the subquestion box (where you do not get the editor) or in the question text (where one would normally paste scripts and such)?

I'm using {INSERTANS:81898X39X517SQ001} which should run up to SQ012 to insert all 12 options. They way I understand it is that the filter will display only those options selected in the previous question and display the rest as 'no answer'. You already provided a script to hide those.
Last Edit: 2 years 9 months ago by stigchelg.
The administrator has disabled public write access.

Re: Piping from Multiple Choice to Multiple Numerical 2 years 9 months ago #66665

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4068
  • Thank you received: 746
  • Karma: 341
Where do I put the INSERTANS? In the subquestion box (where you do not get the editor) or in the question text (where one would normally paste scripts and such)?
You do have access to an editor when creating/editing subquestions. Click the little pencil and then add your replacement field.

Capture2_2011-10-03.PNG
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: stigchelg

Re: Piping from Multiple Choice to Multiple Numerical 2 years 9 months ago #66671

  • stigchelg
  • stigchelg's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 26
  • Karma: 0
See, I'm stoopid. You rock. Gonna try this.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.147 seconds
Donation Image