I have a survey where for the following list of answers in an array question I need to show the first answer (in blue) always at 1st possition and all others should be randomized:
Value-for-money ratio of fruit and vegetable products
Reliable and consistent quality of fruit and vegetable products
Good taste of fruit and vegetable products
Appetizing appearance of fruit and vegetable products
Long shelf-life of fruit and vegetable products at home
Information about origins of fruit and vegetable products
A large selection of fruit and vegetable products
Promotional offers for fruit and vegetables (e.g. leaflet-promotions)
The availability of fruit and vegetable products (few gaps in shelves)
The availability of promoted fruit and vegetable special offers.
The selection of organic fruit and vegetable products
The selection of regional fruit and vegetable products
The selection of exotic fruit and vegetable products (e.g. pomegranate, physalis, kaki)
The selection of snack products and pre-cut fruits and vegetables for instant consumption (e.g. freshly cut pineapple)
The selection of seasonal fruit and vegetable products (e.g. asparagus in spring and pumpkins in autumn)
The selection of different packaging and serving sizes for fruit and vegetable products
The selection of loosely fruits and vegetables
An attractive selection of private labels for fruit and vegetable products
The availability of innovative products (e.g. red basil, avocado-lime-chili-mix for Guacamole, etc.)
The cleanliness and hygiene of the fruit and vegetable section
An appealing presentation of products in the fruit and vegetable section
An inviting atmosphere in the fruit and vegetable section
Initiate random order in the question settings and add a script like this to the question source:
Code:
<script type="text/javascript" charset="utf-8">
$(document).on('ready pjax:scriptcomplete',function(){
// The sub-question code to be fixed in the first position
var fixedCode = '1';
var qID = '{QID}';
// Move the sub-question
$('#question'+qID+' table.subquestion-list tbody:eq(0)').prepend($('#question{QID} tr.answers-list[id$="X'+qID+fixedCode+'"]'));
// Fix up the row background colours
$('#question'+qID+' tr.answers-list').each(function(i){
$(this).removeClass('array1, array2');
if(i % 2 == 0) {
$(this).addClass('array1');
}
else {
$(this).addClass('array2');
}
});
});
</script>