- Posts: 1
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
Oups,elissa wrote: It seems that there is no such a setting for multiple choice question.
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ // Identify this question var thisQuestion = $('#question{QID}'); var thisList = $('li.answer-item:eq(0)', thisQuestion).closest('ul'); // Build an array of sub-question labels var optionsArr = []; $('li.answer-item', thisQuestion).each(function(i) { optionsArr.push($.trim($('label:eq(0)', this).text())); }); // Sort the array optionsArr.sort(); // Reposition the sub-questions $(optionsArr).each(function(i) { var thisVal = this; $('li.answer-item', thisQuestion).filter(function() { return $.trim($('label:eq(0)', this).text()) == thisVal; }).appendTo(thisList); }); }); </script>