Partial randomization for ranking questions

More
4 months 3 weeks ago #155160 by cyclingdecisions
cyclingdecisions created the topic: Partial randomization for ranking questions
Hi!

I have a problem getting a ranking question partially randomized.

As I have three times the option 'other, please specify :<text>' I would like to randomize all factors except these three options. I found ways to do it for all kinds of questions but not for ranking questions in specific. Can anybody help me with this?
Attachments:

Please Log in to join the conversation.

More
4 months 3 weeks ago - 4 months 3 weeks ago #155163 by tpartner
tpartner replied the topic: Partial randomization for ranking questions
Assuming, for the sake of example, you wanted to fix sub-question codes "SQ005", "SQ006" and "SQ007" at the end of the choices list, set up your survey to use JavaScript and place the following script in the source of the question:


<script type="text/javascript" charset="utf-8">
   $(document).ready(function() {
 
		// Identify this question code
		var qID = {QID}; 
 
		// Define the sub-question codes to be positioned last
		var sqCodes = ['SQ005', 'SQ006', 'SQ007']; 
 
		// Loop through those sq codes and place that sub-question at the end of the choices list
		$(sqCodes).each(function(i, code) {
			if($('#question'+qID+' .dragDropChoiceList li[id$="X'+qID+code+'"]').length > 0) {
				$('#question'+qID+' .dragDropChoiceList').append($('li[id$="X'+qID+code+'"]'));
			}
		});
	});
</script>

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last Edit: 4 months 3 weeks ago by tpartner.

Please Log in to join the conversation.

More
4 months 3 weeks ago #155167 by cyclingdecisions
cyclingdecisions replied the topic: Partial randomization for ranking questions
Thank you so much, this is exactly what I needed!!!

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now