Welcome, Guest
Username: Password: Remember me

TOPIC: random order of answer categories, except for...

Re: random order of answer categories, except for... 1 year 9 months ago #86690

  • arielmosto
  • arielmosto's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 29
  • Karma: 0
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
The administrator has disabled public write access.

Re: random order of answer categories, except for... 1 year 9 months ago #86691

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4066
  • Thank you received: 745
  • Karma: 341
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.

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: random order of answer categories, except for... 1 year 9 months ago #86692

  • arielmosto
  • arielmosto's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 29
  • Karma: 0
Dear Tony, thanks.

I need to randomize all choices except the last one.

Regards !
The administrator has disabled public write access.

Re: random order of answer categories, except for... 1 year 9 months ago #86697

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4066
  • Thank you received: 745
  • Karma: 341
I think the easiest way to achieve that would be to...

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


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


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.

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.114 seconds
Donation Image