Hi,
of course, you have to validate.
In my opinion the best solution is to use two multiple questions for 1st and 2nd with "array exclusion filter.
But you can use an array(numbers)
with the randomization, Tony provided in the linked post
Code:
<script type="text/javascript" charset="utf-8">
$(document).on('ready pjax:complete',function() {
// Define the subquestion code to be fixed at the bottom of the array
var fixedCode = 'SQ009';
// Move that row to the bottom
$('#question{QID} table.subquestion-list tbody:eq(0)').append($('tr[id$="X{QID}'+fixedCode+'"]'));
// Fix up the row background colours
$('#question{QID} tr.answers-list').each(function(i){
$(this).removeClass('ls-even, ls-odd');
if(i % 2 == 0) {
$(this).addClass('ls-even');
}
else {
$(this).addClass('ls-odd');
}
});
// Define the subquestion code to be fixed at the bottom of the array
var fixedCode = 'SQ010';
// Move that row to the bottom
$('#question{QID} table.subquestion-list tbody:eq(0)').append($('tr[id$="X{QID}'+fixedCode+'"]'));
// Fix up the row background colours
$('#question{QID} tr.answers-list').each(function(i){
$(this).removeClass('ls-even, ls-odd');
if(i % 2 == 0) {
$(this).addClass('ls-even');
}
else {
$(this).addClass('ls-odd');
}
});
});
</script>
As I am unable to create a script I just repeated it (for "others" and "don't know")
But somewhere in the forum I saw a script for a variable number of fixed options.
and a validation like this considering that there may be two selections in the row of "Others" and in "don't know" as well.
count(self.sq_X001)==1 AND count(self.sq_X002)==1 AND
count(self.sq_SQ001)<2 AND
count(self.sq_SQ002)<2 AND
count(self.sq_SQ003)<2 AND
count(self.sq_SQ004)<2 AND
count(self.sq_SQ005)<2 AND
count(self.sq_SQ006)<2 AND
count(self.sq_SQ007)<2 AND
count(self.sq_SQ008)<2
This is fine
1.
2.
Here we get errors
1.
2.
Joffm