As always i tried to search the forum before, but the search wasn't fruitful. Neither is their an entry for this in the workaround documentation.
I want to randomize an array, but fix a certain amount of subquestions at the end (4 to be precise). Sadly, my whole experience with javascript is copying scripts from the documentation and slightly changing them. Is there such a thing and i am just blind, or can anyone avid with javascript experience help me out here? Much appreciated.
<script type="text/javascript" charset="utf-8">
$(document).on('ready pjax:scriptcomplete',function(){
// List of sub-question codes to be pinned to the bottom (in order)
var sqCodes = ['8', '9', '10', '11'];
// Identify this question
var qID = '{QID}';
var thisQuestion = $('#question'+qID);
// Loop through the sub-question codes and reposition the corresponding row
$.each(sqCodes, function(i, val) {
var thisRow = $('tr[id^="javatbd"][id$="X'+qID+val+'"]');
$('table.subquestion-list tbody:last', thisQuestion).append(thisRow);
});
});
</script>
Here is your sample survey back with that script inserted: