- Posts: 196
- Thank you received: 69
Ask the community, share ideas, and connect with other LimeSurvey users!
{A1.gseq},{B1.gseq},{C1.gseq}
<script type="text/javascript" data-author="Tony Partner"> $(document).on('ready pjax:scriptcomplete',function(){ // Identify this question var thisQID = {QID}; var thisQuestion = $('#question'+thisQID); var groupOrder = '{groupOrder.question}'.split(','); // Build an associative array of group positions var answerIndexes = { }; $('.answer-item', thisQuestion).each(function(i) { var thisCode = $(this).attr('id').split('X'+thisQID)[1]; answerIndexes[groupOrder[i]] = thisCode; }); // Move the answer items var answersList = $('.answer-item:eq(0)', thisQuestion).parent(); $.each(answerIndexes, function(i, val) { answersList.append($('.answer-item[id$="X'+thisQID+val+'"]')); }); }); </script>