Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: Piping from Multiple Choice to Multiple Numerical

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

  • rvenkat
  • rvenkat's Avatar
  • Offline
  • Senior Lime
  • Posts: 44
  • 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.

Piping from Multiple Choice to Multiple Numerical 5 years 2 months ago #66102

  • rvenkat
  • rvenkat's Avatar
  • Offline
  • Senior Lime
  • Posts: 44
  • 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.

Piping from Multiple Choice to Multiple Numerical 5 years 2 months ago #66107

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6570
  • Thank you received: 1477
  • Karma: 579
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.
The administrator has disabled public write access.

Piping from Multiple Choice to Multiple Numerical 5 years 2 months ago #66135

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

Thanks so much. It works like a charm.


Ramesh
The administrator has disabled public write access.

Piping from Multiple Choice to Multiple Numerical 5 years 2 months ago #66169

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6029
  • Thank you received: 373
  • Karma: 260
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)survey-consulting.com'"
The administrator has disabled public write access.

Piping from Multiple Choice to Multiple Numerical 5 years 2 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.

Piping from Multiple Choice to Multiple Numerical 5 years 2 months ago #66636

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6570
  • Thank you received: 1477
  • Karma: 579
That may indicate that the {INSERTANS} value is incorrect.

Did you use the replacement field button in the editor?
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.

Piping from Multiple Choice to Multiple Numerical 5 years 2 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: 5 years 2 months ago by stigchelg.
The administrator has disabled public write access.

Piping from Multiple Choice to Multiple Numerical 5 years 2 months ago #66665

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6570
  • Thank you received: 1477
  • Karma: 579
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.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.
The following user(s) said Thank You: stigchelg

Piping from Multiple Choice to Multiple Numerical 5 years 2 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.

Piping from Multiple Choice to Multiple Numerical 5 years 2 months ago #66705

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6029
  • Thank you received: 373
  • Karma: 260
If you are missing some information in the manual feel free to improve it. Our manual is a wiki, everyone can edit it and you can't do much wrong.
So if you miss anything in the manual and you found out how to do it please add this information. Thanks!

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

Piping from Multiple Choice to Multiple Numerical 4 years 7 months ago #79634

  • rvenkat
  • rvenkat's Avatar
  • Offline
  • Senior Lime
  • Posts: 44
  • Thank you received: 1
  • Karma: 2
I upgraded to 1.92 Build 120418. The following script provided by Tony does not work in this version of Limesurvey. Nothing else has changed. (Please see my initial question in this thread).


From tpartner's message
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>
The administrator has disabled public write access.

Piping from Multiple Choice to Multiple Numerical 4 years 7 months ago #79636

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6570
  • Thank you received: 1477
  • Karma: 579
rvenkat, can you attach a sample survey?
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.

Piping from Multiple Choice to Multiple Numerical 4 years 7 months ago #79651

  • rvenkat
  • rvenkat's Avatar
  • Offline
  • Senior Lime
  • Posts: 44
  • Thank you received: 1
  • Karma: 2
Here the link to the survey.
This is just a sample survey I created to demonstrate the problem.

Select only one choice in Group 1 (page 1), and you will see two boxes (one without any label). Also, it asks for value in both boxes.

This was working fine in 1.91.

Thanks for looking into this.
The administrator has disabled public write access.

Piping from Multiple Choice to Multiple Numerical 4 years 7 months ago #79653

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6570
  • Thank you received: 1477
  • Karma: 579
Can you please attach an exported copy of the survey?
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.
Time to create page: 0.455 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form