This is for my future reference.
I keep coming back to this post and forgot some few details.
Thank you so much Tpartner for the Help.
So this is the right code that worked on my Limesurvey 3.2.1
Conditions are as follows:
Global Setting - Security is set to xss OFF
Radio List
- Randomize on each page load
- No answer option is Turned OFF
- Answer Code should be sequential
- Fixed answer is only changed. (Qid is automatically changed -credits to Tpartner)
This is the code::
Code:
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
// The number of answers to be fixed at the end of the list
var fixedAnswers = [color=red][b][size=5]2[/size][/b][/color];
// Identify this question
var qID = {QID};
// Find the number of answers
var ansCount = $('#question'+qID+' .answer-item').length;
// Place the last n answers created at the end of the list
var fixedIndex = fixedAnswers - 1;
for (var i=0; i<fixedAnswers; i++) {
var answerItem = $('.answer-item[id^="javatbd"][id$="X'+qID+(ansCount-fixedIndex)+'"]');
if($('#question'+qID).hasClass('multiple-opt')) {
$(answerItem).closest('.subquestion-list').append($(answerItem).parent());
}
else {
$(answerItem).closest('.answers-list').append(answerItem);
}
fixedIndex--;
}
});
</script>