Assuming the survey is in group-by-group mode, here is an example of how to use hidden multiple-choice questions to filter the ranking question.
1) Ensure that the arrays have unique sub-question codes (no two array are the same).
2) Directly after each array, insert a multiple-choice question with exactly the same sub-questions as the array.
3) Ensure that answer codes for the ranking question match those in the arrays.
4) Set the
array filter
in the ranking question to the IDs if the multiple-choice questions.
5)
Set up your survey to use JavaScript
and insert the following script into the source of each array. It will hide the following multiple-choice and toggle corresponding check-boxes depending on if a row is answered >= 7. The LimeSurvey array filter takes care of the rest.
Code:
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
// Identify the questions
var thisQuestion = $('#question{QID}');
var thisQuestionID = '{QID}';
var qHidden = $(thisQuestion).nextAll('.multiple-opt:eq(0)');
var qHiddenID = $(qHidden).attr('id').split('question')[1];
// Hide the checkbox question
qHidden.css({
'position': 'absolute',
'left': '-9999em',
'top': '-9999em'
});
// Listener on the radios
$('input.radio', thisQuestion).on('click', function(e) {
var thisSQCode = $(this).attr('name').split('X'+thisQuestionID)[1];
var hiddenCheckbox = $('input.checkbox[id$="X'+qHiddenID+thisSQCode+'"]');
// Toggle the hidden checkbox
if($(this).val() > 6) {
hiddenCheckbox.prop('checked', true);
hiddenCheckbox.nextAll('input:hidden').val('Y');
}
else {
hiddenCheckbox.prop('checked', false);
hiddenCheckbox.nextAll('input:hidden').val('');
}
// Fire Expression Manager
checkconditions(hiddenCheckbox.value, hiddenCheckbox.name, hiddenCheckbox.type);
});
});
</script>
Sample survey attached: