Welcome to the LimeSurvey Community Forum

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

Randomization question sequence

  • julia.wunder
  • julia.wunder's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 6 months ago #220960 by julia.wunder
Randomization question sequence was created by julia.wunder
Hi everyone,

I have a question about randomization in LimeSurvey.

The problem is as follows:
There is a question group with 8 questions. These 8 questions are randomized using the Randomization group name, as specified in the logic.
Randomization works as expected, but I ran into a problem concerning question naming. The questions should have generic names like "Question 1" through "Question 8", where the number represents the sequence in which the questions are displayed. If I use qseq as a variable the displayed questions are not in order, as I suspect the randomization occurs after writing the variables. This leads to the qseq actually not being in sequence.
What I already tried is enabling question numbering in the Presentation settings. This gave me sequential numbering but I couldn't access the numbering for usage in the question title.

Is there any way to access this sequence number similarly to qseq?

Thank you, kind regards,
Julia
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 6 months ago #220965 by tpartner
Replied by tpartner on topic Randomization question sequence
What LimeSurvey version?

Are all questions on the same page?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • julia.wunder
  • julia.wunder's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 6 months ago #220967 by julia.wunder
Replied by julia.wunder on topic Randomization question sequence
I'm using version 3.9.0+180604.

Yes, the randomized questions are on the same page.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 6 months ago #220970 by tpartner
Replied by tpartner on topic Randomization question sequence
It seems that the {QUESTION_NUMBER} placeholder no longer works, so I think you will need to insert the numbers via JavaScript.

1) Place a span element like this in the text of each question:
 
 
Code:
<span class="question-order">1</span>

2) Place this script in the source of the first question:
 
 
Code:
<script type="text/javascript" data-author="Tony Partner">    
    $(document).on('ready pjax:scriptcomplete',function(){
        // Load the question order elements
        $('.question-order').each(function(i) {
            $(this).text(i+1);
        });
    });
</script>

Sample survey attached: 

File Attachment:

File Name: limesurvey...1446.lss
File Size:40 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: julia.wunder
The topic has been locked.
  • julia.wunder
  • julia.wunder's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 6 months ago #220989 by julia.wunder
Replied by julia.wunder on topic Randomization question sequence
Thank you so much, this solution worked perfectly well for me.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 6 months ago - 2 years 6 months ago #221000 by holch
Replied by holch on topic Randomization question sequence

I'm using version 3.9.0+180604.


Off-topic: You (or your organization) should really look into updating your Limesurvey installation. Your installation hasn't received any update, bug fix or security fix for over 3 years now.

Based on your name I assume that you are from a German speaking country, which afaik all fall under GDPR/DSVGO. One of the principles is to use "state of the art software" and I think one can hardly say that a software that potentially collects personal data is "state of the art" if it hasn't been updated for more than 3 years (despite many updates being available).

But even if you do not collect personal data or do not fall under GDPR/DSVGO, it is highly recommended to keep up to date with updates, as the principle of keeping software up to date is never wrong. ;-)

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

Last edit: 2 years 6 months ago by holch.
The topic has been locked.
  • julia.wunder
  • julia.wunder's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 6 months ago #221023 by julia.wunder
Replied by julia.wunder on topic Randomization question sequence
Thank you for this advice. I will inform our sysadmin about this.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 6 months ago #221043 by holch
Replied by holch on topic Randomization question sequence
Keep in mind that between LS3 and LS5 a few things have changed. So I would first update to the latest LS3 and then later doing the tests and adaptations to themes and workarounds for LS5.

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.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 5 months ago #221341 by DenisChenu
Replied by DenisChenu on topic Randomization question sequence
Anouther solution is usage of gseq.

For example, if you put Q01 ans Q02 in same randomization group , and the hidden group are the 1st group, you can compare Q01.gseq and Q02.gseq.

The question shown have the upper gseq.

User see {if(Q01.gseq > Q02.gseq,"Q01","Q02)}

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.

Lime-years ahead

Online-surveys for every purse and purpose