Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Do not rotate last option

  • Mon2016
  • Mon2016's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
11 months 3 weeks ago #243733 by Mon2016
Do not rotate last option was created by Mon2016
Please help us help you and fill where relevant:
Your LimeSurvey version: [see right hand bottom of your LimeSurvey admin screen]
Own server or LimeSurvey hosting:
Survey theme/template:
==================
(Write here your question/remark)

Hello dear Forum,

I have been searching the forum for something that can help me but I have not found anything yet so I dare to create a new topic.

Maybe it's something simple but something hasn't worked for me in my version.

I have a Matrix question for a scale from 1 to 10 and I want my last option not to rotate on each page load.

I used this script a long time ago but it worked for me for version 2 now I'm using version Version 3.25.10:

<script type="text/javascript" charset="utf-8">    
    $(document).ready(function() {
 
        // The sub-question code to place in the last position
        var fixedCode = 'A1';
 
        // Identify this question
        var q1ID = {QID};
        var thisQuestion = $('#question'+q1ID);
 
        // Move the "fixed" row to the end
        $('table.subquestions-list tbody', thisQuestion).append($('tr[id$="X'+q1ID+fixedCode+'"]'));
            
        // Fix up the array row background colours
        $('tr.answers-list', thisQuestion).each(function(i){
            $(this).removeClass('array1 array2').addClass('array'+(2-(i%2)));
        });
 
    });
</script>Attached a test poll in lssThank you all.

Hugs

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose