Welcome to the LimeSurvey Community Forum

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

Customized Rotation for Check box & Radio Bottom

  • rajkumar_dms
  • rajkumar_dms's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 weeks 4 days ago #260585 by rajkumar_dms
Please help us help you and fill where relevant:
Your LimeSurvey version: 6.5
Own server or LimeSurvey hosting:Clould
Survey theme/template:
==================
Hello Team,
We are the great!
I would like the Rotation in radio bottom & check box type question with some codes are not be part of rotation and that code will placed in their original place
For Example i had Q1 having option 1 to 9 then i would like to Rotate the option but code 2,5,8 would not be rotate and these code are to be shown their respectively position

Please Log in to join the conversation.

  • rajkumar_dms
  • rajkumar_dms's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 weeks 4 days ago - 2 weeks 4 days ago #260587 by rajkumar_dms
Replied by rajkumar_dms on topic Customized Rotation for Check box & Radio Bottom
I am wondering where is the error in this script
<script type="text/javascript" charset="utf-8">

$(document).on('ready pjax:scriptcomplete',function(){

// Define the answers to be fixed at specific positions
var fixedAnswers = [2,4,6]

// Identify this question
var qID = {QID};

// Move fixed answers to their respective positions
fixedAnswers.forEach(function(fixedAnswer) {
var answer = $('input[id^="answer"][id$="X'+ qID + fixedAnswer +'"]');
var answerItem = $(answer).closest('.answer-item');
var answersList = $(answer).closest('ul');
var targetPosition = fixedAnswer.position - 1; // Adjust position for zero-based index
$(answersList).find('.answer-item').eq(targetPosition).before(answerItem);
});

});
</script>
Last edit: 2 weeks 4 days ago by rajkumar_dms.

Please Log in to join the conversation.

  • rajkumar_dms
  • rajkumar_dms's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 weeks 1 day ago #260845 by rajkumar_dms
Replied by rajkumar_dms on topic Customized Rotation for Check box & Radio Bottom
Hello,
Good day

Anyone can help me on this to execute to this

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 weeks 1 day ago #260867 by Joffm
Please, do not try to push again if you do not get an answer over the weekend
We do this work in our spare time on a voluntary base.

If you do not have time you should contact one of the LimeSurvey partners for professional support.
[url] www.limesurvey.com/ [/url]
 

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

Please Log in to join the conversation.

  • rajkumar_dms
  • rajkumar_dms's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 weeks 1 day ago #260869 by rajkumar_dms
Replied by rajkumar_dms on topic Customized Rotation for Check box & Radio Bottom
Joffm@ Sorry for inconvenienced caused by me
i will not push for if i didn't the answer
i will keep the patience for the same

Please Log in to join the conversation.

  • rajkumar_dms
  • rajkumar_dms's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
1 week 1 day ago #262563 by rajkumar_dms
Replied by rajkumar_dms on topic Customized Rotation for Check box & Radio Bottom
Hi Joffm,

Can you share the solutions for the same

Please Log in to join the conversation.

  • rajkumar_dms
  • rajkumar_dms's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
1 day 5 hours ago #263337 by rajkumar_dms
Replied by rajkumar_dms on topic Customized Rotation for Check box & Radio Bottom
Hi,

Anyone can you help me on this request

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 day 4 hours ago #263338 by Joffm
You can adapt this (of course without removing certain checkboxes)
[url] forums.limesurvey.org/forum/can-i-do-thi...-random-items#263207 [/url]
One array with your random codes.
Shuffle it
Insert your "fixed" codes at the resp. places (javascript function "splice")
[url] www.w3schools.com/jsref/jsref_splice.asp [/url]

Joffm

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

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose