Welcome to the LimeSurvey Community Forum

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

Same randomization order for following questions

  • HalloHans
  • HalloHans's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 11 months ago #184313 by HalloHans
Hi all,

In a survey I have several questions each having the same answer options.

Now, I would like to randomize my answer options in the first question. In the following questions I would like to show this randomized order from the first question.

Does anybody know how to do this?

Any help is greatly appreciated, thanks in advance
The topic has been locked.
More
4 years 11 months ago #184314 by jelo
You might add the used version of LimeSurvey and the questiontypes involved (e.g. create a small survey with 2-3 questions and attach an LSS-export here).

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 11 months ago #184363 by holch
I don't think this is doable. LS will randomize each question separately, so the order will most probably be different in every question.

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

The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 11 months ago #184371 by tpartner
You can use JavaScript to record the answer/sub-question order of the first question in a hidden short-text question and then apply it to subsequent questions.

As Jelo suggests attach a small sample survey containing only the relevant questions.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • HalloHans
  • HalloHans's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 11 months ago #184376 by HalloHans
Replied by HalloHans on topic Same randomization order for following questions
Hi guys,

thanks for your answers. I very much appreciate it.

I'll attach a sample containing of 3 questions. For question 1 the answer options should be randomized. For q2 and q3 the same randomized order as in q1 should apply for the answer options.

Thanks a lot in advance,
Hans

File Attachment:

File Name: Test_Randomize.lss
File Size:24 KB
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 11 months ago #184389 by DenisChenu
Replied by DenisChenu on topic Same randomization order for following questions
It's remind me this feature request : bugs.limesurvey.org/view.php?id=11988

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 11 months ago #184397 by Joffm
Hi, Hans,

you will find this question several times in the forum, and also you will find the standard answer:
"Limesurvey does not support dynamic lists"

There are several feature requests, but nothing happened so far.

If you read the thread www.limesurvey.org/forum/future-features...-is-missing-the-most
you will see.

Best regards
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 11 months ago - 4 years 11 months ago #184408 by tpartner
My workaround...

1) Disable AJAX mode in the survey theme settings.

2) Insert a hidden (via Question CSS class) short-text question directly after the first list-radio question. For this example, we'll give the hidden question a code "randomOrder".

3) Add this script to the source of the first list-radio question:

Code:
<script type="text/javascript" charset="utf-8">
  $(document).on('ready pjax:scriptcomplete',function(){
 
    //Identify the questions
    var thisQuestion = $('#question{QID}');
    var hiddenQuestion = $(thisQuestion).nextAll('.text-short:eq(0)');
 
    // Create an array of answer codes
    var answerCodes = [];
    $('li.answer-item', thisQuestion).each(function(i) {
      answerCodes.push($(this).attr('id').split('X{QID}')[1]);
    });
 
    // Load the hidden question
    $('input:text', hiddenQuestion).val(answerCodes);
 
  });
</script>

4) Add this script to the source of following list-radio questions:

Code:
<script type="text/javascript" charset="utf-8">
  $(document).on('ready pjax:scriptcomplete',function(){
 
    //Identify this question
    var thisQuestion = $('#question{QID}');
    var thisAnswerList = $('li.answer-item:eq(0)', thisQuestion).parent();
 
    // Retrieve the answer codes from the "randomOrder" question
    var answerCodes = '{randomOrder}'.split(',');
 
    // Loop through the answer codes
    $.each(answerCodes, function(i, val) {
      // Move the answer item
      $(thisAnswerList).append($('li.answer-item[id$="X{QID}'+val+'"]', thisQuestion));
    });
 
  });
</script>

Sample survey attached:

File Attachment:

File Name: limesurvey...1341.lss
File Size:29 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 4 years 11 months ago by tpartner.
The following user(s) said Thank You: FreshLemonUser, hamstr
The topic has been locked.
  • HalloHans
  • HalloHans's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 11 months ago #184501 by HalloHans
Replied by HalloHans on topic Same randomization order for following questions
Thanks a lot, that's exactly what I was looking for.
The topic has been locked.
More
4 years 10 months ago #185098 by FreshLemonUser
Replied by FreshLemonUser on topic Same randomization order for following questions
Hi dear tpartner, thank you so much for your workarround, i Know that many of us has the same issue, that was whati was looking for, thanks again, now i need just ramdomize just some options, how can i do that?

I try to use the "moveSomeAnswers" plugin but i couldnt depliy it on my server LimeSurvey
Versión 3.17.4+190529

Best regards
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 10 months ago #185101 by tpartner
Here is a workaround for partial randomization - manual.limesurvey.org/Workarounds:_Manip...meSurvey_version_3.x :

Apply it to the first question before applying any of the scripts in this thread.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • HalloHans
  • HalloHans's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 7 months ago #188036 by HalloHans
Replied by HalloHans on topic Same randomization order for following questions
Hi Guys,

now I would like to do a similar thing related to the initial question.

I would like to "record" randomized order of a first multiple answer question and apply the randomized answer-order to a subsequential array question.

Does anyone know how to do this?

Thanks a lot in advance, any help is greatly appreciated.

Hans
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose