The same random order

More
4 months 4 days ago #171233 by vic54ga
vic54ga created the topic: The same random order
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!!

Please Log in or Create an account to join the conversation.

More
4 months 4 days ago #171236 by tpartner
tpartner replied the 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.

Please Log in or Create an account to join the conversation.

More
4 months 3 days ago #171254 by ollehar
ollehar replied the topic: The same random order
Not without JavaScript, AFAIK.

Please Log in or Create an account to join the conversation.

More
4 months 3 days ago #171255 by tpartner
tpartner replied the 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.

Please Log in or Create an account to join the conversation.

More
4 months 3 days ago #171260 by vic54ga
vic54ga replied the topic: The same random order
Ok thank you!

Yes, it´s on the same page and sequencial. Version is 2.5 RC

Please Log in or Create an account to join the conversation.

More
4 months 3 days ago #171267 by holch
holch replied the 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'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds
The following user(s) said Thank You: DenisChenu

Please Log in or Create an account to join the conversation.

More
4 months 18 hours ago #171312 by tpartner
tpartner replied the 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.

<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.
Attachments:
The following user(s) said Thank You: LouisGac

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!