Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: keep order of response in a multiple choice question

keep order of response in a multiple choice question 4 years 3 months ago #68004

  • rafael_ur
  • rafael_ur's Avatar
  • Offline
  • Senior Lime
  • Posts: 74
  • Karma: 0
Hi,

I have a multiple choice question and I need to keep order of response for first three responses. How could I do it?

Many thank,
Rafael
The administrator has disabled public write access.

keep order of response in a multiple choice question 4 years 3 months ago #68027

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5840
  • Thank you received: 347
  • Karma: 261
Simply don't set "randomize answer options" at the advanced question settings :-)

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.

keep order of response in a multiple choice question 4 years 3 months ago #68028

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5411
  • Thank you received: 1154
  • Karma: 479
Do you mean the order in which the respondent clicks them?

If so, is the survey in "group by group" mode so you can have a hidden question on the page?
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.

keep order of response in a multiple choice question 4 years 3 months ago #68033

  • rafael_ur
  • rafael_ur's Avatar
  • Offline
  • Senior Lime
  • Posts: 74
  • Karma: 0
Hi Mazi,

What I need is to identify it down first, second and third place on the multiple chice question, I don't want to have to ask three questions single. Is it possible?

Thanks,
Rafael
The administrator has disabled public write access.

keep order of response in a multiple choice question 4 years 3 months ago #68036

  • rafael_ur
  • rafael_ur's Avatar
  • Offline
  • Senior Lime
  • Posts: 74
  • Karma: 0
Hi Tony,

Yes I need the order in which the respondent clicks them.

Thanks,
Rafael
The administrator has disabled public write access.

keep order of response in a multiple choice question 4 years 3 months ago #68041

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5411
  • Thank you received: 1154
  • Karma: 479
1) Set up your survey to use JavaScript.

2) Add a short-text question to the page with the multiple-options question.

3) Add the following script to the source of the short-text question. Replace "11" with the multiple-options question ID and "HH" with the short-text question ID.

If a checkbox in the multiple-options question is checked, its answer code is added to an array. When the Next/Submit button is clicked, the array is loaded into the hidden question storing the answer codes listed in order of checking.
<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function() {
 
		var q1ID = 11;
		var qHidden = HH;
 
		$('#question'+qHidden+'').hide();
 
		var q1Answers = new Array();
 
		// Build an array of q1 answers checked
		$('#question'+q1ID+' input.checkbox').click(function(){
			var ansIDArr = $(this).attr('id').split('X'+q1ID+'');
			var ansCode = ansIDArr[1];
			if($(this).attr('checked') == true) {
				q1Answers.push(ansCode);
			}
		});
 
		// Interrupt next/submit function 
		$('#movenextbtn, #movesubmitbtn').click(function(){
 
			$('#question'+qHidden+' input.text').val(q1Answers);
 
			return true;
		});
 
	});
</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.

keep order of response in a multiple choice question 4 years 3 months ago #68051

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5840
  • Thank you received: 347
  • Karma: 261
Thanks for clarifying. Why don't you just use a ranking question?

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.

keep order of response in a multiple choice question 4 years 3 months ago #68056

  • rafael_ur
  • rafael_ur's Avatar
  • Offline
  • Senior Lime
  • Posts: 74
  • Karma: 0
Toni,

Fantastic,
this is what I needed.


Many thanks,

Rafael
The administrator has disabled public write access.

keep order of response in a multiple choice question 4 years 3 months ago #68060

  • rafael_ur
  • rafael_ur's Avatar
  • Offline
  • Senior Lime
  • Posts: 74
  • Karma: 0
Mazi,

Could be, but otherwise fills.

Many thanks,
Rafael
The administrator has disabled public write access.

keep order of response in a multiple choice question 4 years 3 months ago #68593

  • cegreja
  • cegreja's Avatar
  • Offline
  • Junior Lime
  • Posts: 25
  • Karma: 0
Hi. I find this useful. However, I don't understand how you then make use of the ranked labels. I'd like to apply this script and then select the first option to the formulation of question A, the second choice in question B and the third option in question C, for example. I don't understand how that's done.

I found this in the manual: docs.limesurvey.org/tiki-index.php?page=...estion_for_later_use

However, I don't want it to be randomized. I'd like the three options selected to correspond to 3 different questions.

Thanks a lot
The administrator has disabled public write access.

keep order of response in a multiple choice question 4 years 3 months ago #68633

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5411
  • Thank you received: 1154
  • Karma: 479
I'm afraid I don't understand.

Do you want to use conditions to display following questions based on the selections in a multiple-options question?
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.

keep order of response in a multiple choice question 4 years 3 months ago #68650

  • cegreja
  • cegreja's Avatar
  • Offline
  • Junior Lime
  • Posts: 25
  • Karma: 0
Lets see: I have a multiple options question with 50 car brands, from which I ask respondents to choose up to 3 that they own. Later (in other page) I want to ask them the following array questions:

«Regarding the first car you have stated to own [BRAND_1], in a scale from 1 to 10, how satisfied are you with the following aspects?»
«Regarding the second car you have stated to own [BRAND_2], in a scale from 1 to 10, how satisfied are you with the following aspects?»
«Regarding the third car you have stated to own [BRAND_3], in a scale from 1 to 10, how satisfied are you with the following aspects?»

I will use conditions to display the appropriate number of questions according to the previously selected items in the multiple options Q.
What I don't understand is how to insert each of the brands selected into the corresponding question text.

(Because I'd like to have only 3 array questions instead of 50, one for each brand, and then simply use conditions to show the ones that apply - I'm trying not to overload the database; it's already huge as it is...).
The administrator has disabled public write access.

keep order of response in a multiple choice question 4 years 3 months ago #68674

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5840
  • Thank you received: 347
  • Karma: 261
You can use an array question (see docs.limesurvey.org/Question+type+-+Arra...tions+for+LimeSurvey) with your own, predefined scale from 1-10. As subquestions list the same answer options as used at the multiple choice question. Then use the array filter question attribute to only display the items that were ticked previously: docs.limesurvey.org/Question+type+-+Arra...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.

keep order of response in a multiple choice question 4 years 3 months ago #68681

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5411
  • Thank you received: 1154
  • Karma: 479
Yeah you could do that but you wouldn't have the sub-questions in the order that they were selected in Q1 and you couldn't have multiple rows for each Q1 selection.

So, in this case you will want to save the Q1 values (not codes) in order and then pipe them into the question text for the arrays.

1) Add a short-text to the first group (to be hidden and loaded with the Q1 answers).

2) Add the following script to the source of the short-text question. Replace "11" with the multiple-options question ID and "HH" with the short-text question ID. The script loads the hidden question with the Q1 answers in the order that they were checked.
<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function() {
 
		var q1ID = 11;
		var qHidden = HH;
 
		// Hide the hidden question
		$('#question'+qHidden+'').hide();
 
		var q1Answers = new Array();
 
		// Build an array of q1 answers checked
		$('#question'+q1ID+' input.checkbox').click(function(){
			var ansText = $(this).siblings('label').text();
			if($(this).attr('checked') == true) {
				q1Answers.push(ansText);
			}
		});
 
		// Interrupt next/submit function 
		$('#movenextbtn, #movesubmitbtn').click(function(){
 
			// Load the hidden question with the Q1 answers
			$('#question'+qHidden+' input.text').val(q1Answers);
 
			return true;
		});
 
	});
</script>

3) In source of the 3 array questions, add a span element to be loaded with a Q1 answer. So the source of the question text should look something like:
Regarding the first car you have stated to own <span class="pipedText">&nbsp;</span>, in a scale from 1 to 10...

4) Add the following script to the source of one of the arrays. It will retrieve the Q1 answers (in order) and load the spans with the resulting text. Replace "11111X22X33" with the correct SGQA for the hidden question.
<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function() {
 
		// Retrieve the Q1 answers
		var q1Answers = '{INSERTANS:11111X22X33}';
		var q1Arr = q1Answers.split(',');
 
		// Load the piped text spans
		$(q1Arr).each(function(i, value){
			$('.pipedText:eq('+i+')').text(value);
		});
 
	});
</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.
Last Edit: 4 years 3 months ago by tpartner.
The administrator has disabled public write access.

keep order of response in a multiple choice question 4 years 3 months ago #68697

  • cegreja
  • cegreja's Avatar
  • Offline
  • Junior Lime
  • Posts: 25
  • Karma: 0
That's exactly it, tpartner. It worked. You're great.

It will take a while but I'll definitely donate. Thanks for all the hard work.
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.195 seconds