Piping from Multiple Choice to Multiple Numerical

More
6 years 1 month ago #66705 by Mazi
Mazi replied the topic: Piping from Multiple Choice to Multiple Numerical
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'"

Please Log in to join the conversation.

More
5 years 6 months ago #79634 by rvenkat
rvenkat replied the topic: Piping from Multiple Choice to Multiple Numerical
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>

Please Log in to join the conversation.

More
5 years 6 months ago #79636 by tpartner
tpartner replied the topic: Piping from Multiple Choice to Multiple Numerical
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.

Please Log in to join the conversation.

More
5 years 6 months ago #79651 by rvenkat
rvenkat replied the topic: Piping from Multiple Choice to Multiple Numerical
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.

Please Log in to join the conversation.

More
5 years 6 months ago #79653 by tpartner
tpartner replied the topic: Piping from Multiple Choice to Multiple Numerical
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.

Please Log in to join the conversation.

More
5 years 6 months ago #79658 by rvenkat
rvenkat replied the topic: Piping from Multiple Choice to Multiple Numerical
Exported survey file is attached.

thanks very much.


File Attachment:

File Name: limesurvey...3932.lss
File Size:26 KB
Attachments:

Please Log in to join the conversation.

More
5 years 6 months ago #79659 by tpartner
tpartner replied the topic: Piping from Multiple Choice to Multiple Numerical

...does not work in this version of Limesurvey...

Replace your script with this:
<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function(){
 
		var qID = QQ;
 
		$('#question'+qID+' label').filter(function() {
			return $(this).text() == '';
		}).parent().hide();
 
	});
 
</script>

Also, it asks for value in both boxes.

Make the question non-mandatory.

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
5 years 6 months ago #79665 by rvenkat
rvenkat replied the topic: Piping from Multiple Choice to Multiple Numerical
Thank you so much!
It works now.



Ramesh

Please Log in to join the conversation.

More
5 years 1 month ago #86700 by ck2603
ck2603 replied the topic: Piping from Multiple Choice to Multiple Numerical
Hi,
I found out this post when I was desperately looking for a solution for my problem, and tried it but it didn't work. :(

I wanted to pipe multiple choice responses to another question's text. Assume that I have a question like this:
(in page 1) Q1. what population or group do you think are under-served?
the choices are population A, B, C, D

Assume that the answers are population A and C;

then in page 2, I have another question:
Q2. You indicated {answers from Q1} are under-served....

I got the question text like this:
You indicated population A No answer population C No answer are under-served....

this looks weird so I added in "," between the piped answers, and got this:
You indicated population A, No answer, population C, No answer are under-served....

I tried to get rid of "No answer" so added in the script you posted after Q2:
Q2.You indicated {answers from Q1} are under-served....

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

BUT IT DIDN'T WORK.

I replaced QQ by the question ID (17751X270X7545, surveyID: 17751; groupID: 270; QuestionID:7545).
I use version 1.91.

Did I miss anything?

Another question--if I successfully hide all "No answer" in the text, the question will end up like this:

You indicated population A,, population C, are under-served....

which still looks weird as a sentence. Is there any way to make the sentence look ok?

Any help would be appreciate!!!

Please Log in to join the conversation.

More
5 years 1 month ago #86713 by tpartner
tpartner replied the topic: Piping from Multiple Choice to Multiple Numerical
ck2603, please attach a small sample survey.

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.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!