random order of answer categories, except for...

More
4 years 8 months ago #86690 by arielmosto
arielmosto replied the topic: random order of answer categories, except for...
Dear Tony:

I need the same for the Ranking question type.

Is that possible?
I tried this same code, but does not work.

Thank you very much ! Regards ! Ariel

Please Log in to join the conversation.

More
4 years 8 months ago #86691 by tpartner
tpartner replied the topic: random order of answer categories, except for...
Ariel, this thread is getting a little convoluted. Do you want to randomize all choices except except the last one or all except the first one.

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
4 years 8 months ago #86692 by arielmosto
arielmosto replied the topic: random order of answer categories, except for...
Dear Tony, thanks.

I need to randomize all choices except the last one.

Regards !

Please Log in to join the conversation.

More
4 years 8 months ago #86697 by tpartner
tpartner replied the topic: random order of answer categories, except for...
I think the easiest way to achieve that would be to...

1) Append the answer code of the last item with "_l"


2) In the ranking question, set "Random answer order" to "Yes"


3) Add the following script to the source of the ranking question. Replace "QQ" with the ranking question ID .
<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function() {
 
		var qID = QQ;
 
		$('#question'+qID+' .rank.label select').append($('#question'+qID+' .rank.label option[value$="_l"]'));
	});
 
</script>

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now