Is it possible to take this one step further and have the array question in the same group as the radio list question?
To maintain the same order in a multiple-choice as the previous multiple-choice on the same page, add this script to the second multiple-choice question:
Code:
<script type="text/javascript" charset="utf-8">
$(document).on('ready pjax:scriptcomplete',function(){
// Identify the questions
var thisQID = {QID};
var thisQuestion = $('#question'+thisQID);
var prevQuestion = $(thisQuestion).prevAll('.multiple-opt:eq(0)');
var prevQID = $(prevQuestion).attr('id').replace(/question/, '');
// Loop through the previous question sub-questions
$('.answer-item', prevQuestion).each(function(i) {
// Move the sub-questions
var thisCode = $(this).attr('id').split('X'+prevQID)[1];
$('.answers-list ul:eq(0)', thisQuestion).append($('.answer-item[id$="X'+thisQID+thisCode+'"]', thisQuestion));
});
});
</script>
To maintain the same order in a list-radio as the previous list-radio on the same page, add this script to the second list-radio question:
Code:
<script type="text/javascript" charset="utf-8">
$(document).on('ready pjax:scriptcomplete',function(){
// Identify the questions
var thisQID = {QID};
var thisQuestion = $('#question'+thisQID);
var prevQuestion = $(thisQuestion).prevAll('.list-radio:eq(0)');
var prevQID = $(prevQuestion).attr('id').replace(/question/, '');
// Loop through the previous question answers
$('.answer-item', prevQuestion).each(function(i) {
// Move the sub-questions
var thisCode = $(this).attr('id').split('X'+prevQID)[1];
$('.answers-list ul:eq(0)', thisQuestion).append($('.answer-item[id$="X'+thisQID+thisCode+'"]', thisQuestion));
});
});
</script>
To maintain the same order in an array as the previous list-radio on the same page, add this script to the array question:
Code:
<script type="text/javascript" charset="utf-8">
$(document).on('ready pjax:scriptcomplete',function(){
// Identify the questions
var thisQID = {QID};
var thisQuestion = $('#question'+thisQID);
var prevQuestion = $(thisQuestion).prevAll('.list-radio:eq(0)');
var prevQID = $(prevQuestion).attr('id').replace(/question/, '');
// Loop through the previous question answers
$('.answer-item', prevQuestion).each(function(i) {
// Move the sub-questions
var thisCode = $(this).attr('id').split('X'+prevQID)[1];
$('table.subquestion-list tbody:eq(0)', thisQuestion).append($('.answers-list[id$="X'+thisQID+thisCode+'"]', thisQuestion));
});
});
</script>
Here is your sample survey back with those scripts incorporated: