Hello!
Unfortunately not having any knowledge in JavaScript, I'd appreciate your assistance with the following:
I want to randomize a set of answers, but keeping a specific amount fixed at the bottom. Most often there are two answer options ("don't know" and "no answer", whereas the "no answer"-option isn't the default option but programmed manually). Sometimes there is an additional "none of the above". Ideally they should all show up under the "Other"-field.
I have found the following script from
this
thread:
Code:
script type=textjavascript charset=utf-8
$(document).ready(function() {
Identify this question
var qID = {QID};
var thisQuestion = $('#question'+qID);
Define the sub-question code to be placed last
var lastItem = 'SQ004';
Move that item to the end of the list
$('.question-item[id$=X'+qID+lastItem+']', thisQuestion).addClass('last-item').parent().appendTo($('.subquestion-list', thisQuestion));
});
script
Interestingly, this was the only code that worked for us. It was also a rather simple code, which is important to us as it should be easy and quick to modify and ideally easy to understand for multiple people.
Of course, this solution is only for one answer option, not for 2 or 3 and, so I understand, for multiple choice questions.
We would need a code that works for both array and multiple choice options.
My question is: is it possible to modify this code so it works for 2 or optionally 3 options? And if so, how?
Thanks in advance for the answers!