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
1 year 6 months 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.

More
1 day 14 hours ago #268303 by sara.beschi
Replied by sara.beschi on topic Do not rotate last option
Hello, I downloaded your attachment and loaded it in my surveys list. This code works correctly with my LimeSurvey version but I don't understand where did you write the code used to fix the position of the response. I thought it was in the 'Script' section of the question but it is empty. Can you kindly help me? Thank you, Sara

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 day 11 hours ago #268316 by Joffm
Replied by Joffm on topic Do not rotate last option
Hi,
most of us are still used to write these scripts into the question text (source code mode).

 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose