Okay, if using LS 2.05, you will need to...
1)
Set up your survey to use JavaScript
.
2) Add an "N/A" option to the x-scale answers for the arrays. (you will need to use normal array type questions, not array-10-point-choice type)
3) Place these functions in
template.js (I think the comments adequately explain what's going on):
Code:
// A function to randomly display one row of an array type question
function showRandomRow(qid) {
// Identify this question
var thisQuestion = $('#question'+qid);
// Hide the "N/A" column
$('table.subquestions-list tr > :last-child', thisQuestion).addClass('na-column').hide();
// If question not previously seen...
if($('.na-column input.radio:checked', thisQuestion).length == 0) {
// Hide all answer rows
$('tr.answers-list', thisQuestion).hide();
// Create an array of answer row IDs
var rowIDs = [];
$('tr.answers-list', thisQuestion).each(function(i) {
rowIDs.push($(this).attr('id'));
});
// Shuffle the array
rowIDs = $.shuffle(rowIDs);
// Show the first row in the array
$('#'+rowIDs[0]).removeClass('array1').addClass('array2').show();
// Click "N/A" in all hidden rows
$('tr.answers-list:hidden .na-column input.radio', thisQuestion).trigger('click');
}
// If question previously seen...
else {
// Hide answer rows that have "N/A" clicked
$('.na-column input.radio:checked', thisQuestion).closest('tr.answers-list').hide();
}
}
// A function to shuffle elements or contents of arrays
(function($){
$.fn.shuffle = function() {
return this.each(function(){
var items = $(this).children();
return (items.length)
? $(this).html($.shuffle(items))
: this;
});
}
$.shuffle = function(arr) {
for(
var j, x, i = arr.length; i;
j = parseInt(Math.random() * i),
x = arr[--i], arr[i] = arr[j], arr[j] = x
);
return arr;
}
})(jQuery);
4) In the source of every question you want randomized in this way, call the function like this:
Code:
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
showRandomRow({QID});
});
</script>