- Posts: 5056
- Thank you received: 1267
Ask the community, share ideas, and connect with other LimeSurvey users!
Adding a script like this to the question source will "fix" the item with sub-question code "A1" in the last position.If you want to randomize not all items of an array, but keep certain item on there position.
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { // The sub-question code to place in the last position var fixedCode = 'A1'; // Identify this question var q1ID = {QID}; var thisQuestion = $('#question'+q1ID); // Move the "fixed" row to the end $('table.subquestions-list tbody', thisQuestion).append($('tr[id$="X'+q1ID+fixedCode+'"]')); }); </script>
No, that is an error....Is that the case? I haven't seen this option (in the uptodate versions)?
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { // The sub-question code to place in the last position var fixedCode = 'A1'; // Identify this question var q1ID = {QID}; var thisQuestion = $('#question'+q1ID); // Move the "fixed" row to the end $('table.subquestions-list tbody', thisQuestion).append($('tr[id$="X'+q1ID+fixedCode+'"]')); // Fix up the array row background colours $('tr.answers-list', thisQuestion).each(function(i){ $(this).removeClass('array1 array2').addClass('array'+(2-(i%2))); }); }); </script>
I do a little searching in my files for previous workarounds but most are from scratch.do you have a big library of workaround? Or are doing it all out of your head.
Now it is - www.limesurvey.org/manual/Workarounds:_M...rs_-_Array_questionsIf I get it right, this workaround for arrays is not in the manual/wiki.