Welcome to the LimeSurvey Community Forum

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

The same random order

  • vic54ga
  • vic54ga's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 9 months ago #171233 by vic54ga
The same random order was created by vic54ga
Hello, I have two questions with multiple answers. In both questions, answers are being displayed with a random order.

I need the answers on Question1 to display with the same random order as answers in Question1.

Is there a way to save the random order generated for answers on Question1 so I can use it on the answers of Question2?

Thanks!!
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 9 months ago #171236 by tpartner
Replied by tpartner on topic The same random order
LimeSurvey version?

Are both questions on the same page and sequential?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • ollehar
  • ollehar's Avatar
  • Offline
  • LimeSurvey GmbH Employee
  • LimeSurvey GmbH Employee
More
5 years 9 months ago #171254 by ollehar
Replied by ollehar on topic The same random order
Not without JavaScript, AFAIK.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 9 months ago #171255 by tpartner
Replied by tpartner on topic The same random order
Yup, that's why I asked about the survey structure. :)

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • vic54ga
  • vic54ga's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 9 months ago #171260 by vic54ga
Replied by vic54ga on topic The same random order
Ok thank you!

Yes, it´s on the same page and sequencial. Version is 2.5 RC
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 9 months ago #171267 by holch
Replied by holch on topic The same random order
You should definitely make an upgrade. RC stands for "Release Candidate", so it is not even a stable version of Limesurvey. This should not be used for production.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: DenisChenu
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 9 months ago #171312 by tpartner
Replied by tpartner on topic The same random order
If the questions are on the same page and sequential, in 2.x, you can add this script to the source of the first question.

Code:
<script type="text/javascript" charset="utf-8">
 
  $(document).on('ready pjax:scriptcomplete',function(){
 
    // Identify the questions
    var q1ID = {QID};
    var q1 = $('#question'+q1ID);
    var q2 = $(q1).nextAll('.multiple-opt:eq(0)');
    var q2ID = $(q2).attr('id').replace(/question/, '');
 
    // Loop through the Q1 sub-questions
    $('div.answer-item', q1).each(function(i) {
      // Move the corresponding Q2 sub-question
      var thisCode = $(this).attr('id').split('X'+q1ID)[1];
      $('div.subquestion-list', q2).append($('div.answer-item[id$="X'+q2ID+thisCode+'"]', q2).parent());
    });
    });
</script>

Sample survey attached:

File Attachment:

File Name: limesurvey...7-16.lss
File Size:19 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
4 years 6 months ago #188988 by hamstr
Replied by hamstr on topic The same random order
Hi! I came across this post when looking for a solution to a similar issue - only difference is that the mc-questions are on different pages. Is there a way to transfer the order across different question groups, too?

Best,
hamstr
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose