To allow for a mandatory question, you would need to add an "N/A" column to the second scale.
and place the following script in the source of the question. The script will:
Code:
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
// Identify this question
var thisQuestion = $('#question{QID}');
// Identify the "exclusive" column(s)
// Multiple columns separated by commas
var exclusiveCols = [3];
// Assign classes to various elements
$('.answers-list', thisQuestion).each(function(i){
var column = 1;
var scale = 1;
$('td', this).each(function(i){
if($(this).hasClass('radio-item')) {
$(this).addClass('scale-'+scale+' column-'+column+'');
column++;
}
else {
column = 1;
scale = 2;
}
});
$('td:last', this).addClass('na-item');
});
$(exclusiveCols).each(function(i) {
$('td.scale-1.column-'+this, thisQuestion).addClass('exclusive-item');
});
// Hide the "N/A" column
$('td.na-item', thisQuestion).hide();
$('.questions-list .dsheader:last', thisQuestion).attr('colspan', Number($('.questions-list thead tr.groups .dsheader:last', thisQuestion).attr('colspan'))-1);
$('.questions-list thead tr:not(.groups) th:last', thisQuestion).hide();
var colsWidth = $('col.odd:eq(0)', thisQuestion).attr('width').replace(/%/, '')*$('col.odd, col.even', thisQuestion).length;
var newColWidth = colsWidth/($('col.odd, col.even', thisQuestion).length-1);
$('col.odd, col.even', thisQuestion).attr('width', newColWidth+'%');
// Listener on the radios
$('td.scale-1 input.radio', thisQuestion).click(function(e) {
var thisCell = $(this).closest('td');
var thisRow = thisCell.closest('tr');
if(thisCell.hasClass('exclusive-item')) {
$('.na-item input.radio', thisRow).trigger('click');
$('td.scale-2:not(.na-item) input.radio', thisRow).prop('disabled', true);
}
else {
$('.na-item input.radio', thisRow).prop('checked', false);
$('td.scale-2:not(.na-item) input.radio', thisRow).prop('disabled', false);
}
});
// Initial states
$('td.exclusive-item input.radio:checked', thisQuestion).each(function(i) {
var thisRow = $(this).closest('tr');
$('.na-item input.radio', thisRow).trigger('click');
$('td.scale-2:not(.na-item) input.radio', thisRow).prop('disabled', true);
});
});
</script>