Welcome, Guest
Username: Password: Remember me

TOPIC: Piping from Multiple Choice to Multiple Numerical

Re: Piping from Multiple Choice to Multiple Numerical 3 years 2 weeks ago #66705

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5331
  • Thank you received: 296
  • Karma: 249
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)limesurvey.org'"
The administrator has disabled public write access.

Re: Piping from Multiple Choice to Multiple Numerical 2 years 5 months ago #79634

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

Re: Piping from Multiple Choice to Multiple Numerical 2 years 5 months ago #79636

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4271
  • Thank you received: 805
  • Karma: 369
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.

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 5 months ago #79651

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

Re: Piping from Multiple Choice to Multiple Numerical 2 years 5 months ago #79653

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4271
  • Thank you received: 805
  • Karma: 369
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.

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 5 months ago #79658

  • rvenkat
  • rvenkat's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 42
  • Thank you received: 1
  • Karma: 2
Exported survey file is attached.

thanks very much.


File Attachment:

File Name: limesurvey_survey_83932.lss
File Size: 26 KB
The administrator has disabled public write access.

Re: Piping from Multiple Choice to Multiple Numerical 2 years 5 months ago #79659

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4271
  • Thank you received: 805
  • Karma: 369
...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.

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 5 months ago #79665

  • rvenkat
  • rvenkat's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 42
  • Thank you received: 1
  • Karma: 2
Thank you so much!
It works now.



Ramesh
The administrator has disabled public write access.

Re: Piping from Multiple Choice to Multiple Numerical 2 years 1 week ago #86700

  • ck2603
  • ck2603's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 9
  • Karma: 0
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!!!
The administrator has disabled public write access.

Re: Piping from Multiple Choice to Multiple Numerical 2 years 1 week ago #86713

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4271
  • Thank you received: 805
  • Karma: 369
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.138 seconds
Donation Image