Capturing randomization order

More
3 years 10 months ago #102039 by itsdanwall
itsdanwall created the topic: Capturing randomization order
I am trying to determine if the question order and the order of answer options for the attached survey. There is randomization on which side each answer option is presented (via the "Random order: Randomize on each page load" within the question options). Further the questions themselves are presented in a random order (via the "Randomization group" within the question group options). I would like to be able to capture both the side of the answer options were presented on and the order which the questions were presented. Is there a way to do this in LimeSurvey?

Note: I used the "copy_of_default.zip" template to make List(radio) questions appear horizontally.
Attachments:

Please Log in to join the conversation.

More
3 years 10 months ago #102047 by holch
holch replied the topic: Capturing randomization order
without having had a look at your files, I'd say no, not out of the box. At least I am not aware of any feature like this.

Maybe one can do something with Javascript writing the order into a hidden question field, but I think this will be quite complicated.

Would be great if anyone could proof me wrong though...

But this would probably require an additional column in the database for each question and each answer item, which would bring us quickly to the column limits of the database engines, especially for bigger surveys and/or long item lists, where the randomization is most important.

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

Please Log in to join the conversation.

More
3 years 10 months ago #102334 by itsdanwall
itsdanwall replied the topic: Capturing randomization order
Do you know of any resources for me to begin to understand how to use JavaScript to write the random order to a hidden question field?

Please Log in to join the conversation.

More
3 years 10 months ago #102345 by holch
holch replied the topic: Capturing randomization order
Sorry, I am not a Javascript expert.

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

Please Log in to join the conversation.

More
3 years 10 months ago - 3 years 10 months ago #102364 by tpartner
tpartner replied the topic: Capturing randomization order
To record the group display order, you can add a hidden equation type question to each group and load it with the equation below. This records the sequential number of the group (I have added 1 so the sequence starts at 1)
{self.gseq + 1}


Recording the radio answer order is a little trickier...

1) Set up your survey to use JavaScript .

2) Add a short-text question to each group (we'll hide them with JavaScript).

3) Add the following script to the source of each short-text. This script:
- Hides the short-text question
- Loops through the radio options as displayed
- Records a comma-separated list of their answer IDs in the short-text
<script type="text/javascript" charset="utf-8">	
 
	$(document).ready(function(){
 
		// Identify some stuff
		var qHiddenID = {QID}; // The hidden question ID
		var qHidden = $('#question'+qHiddenID); // The hidden question
		var q1 = $('div.list-radio:eq(0)'); // First radio question on the page
		var q1ID = $(q1).attr('id').split('question')[1]; // The first radio question ID
		var gID = $('input.text', qHidden).attr('id').split('X')[1]; // The group ID
 
		// Hide this question
		$(qHidden).hide();
 
		// Build an array of the Q1 answers
		var answersArr = new Array();
		$('input.radio', q1).each(function(i){
			var answerID = $(this).attr('id').split('X'+gID+'X'+q1ID)[1];
			answersArr.push(answerID);
		});
 
		// Load the array into the hidden question
		$('input.text', qHidden).val(answersArr);
	});
</script>


Here's your sample survey back with these modifications:

File Attachment:

File Name: limesurvey...fied.lss
File Size:37 KB

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
Last Edit: 3 years 10 months ago by tpartner.
The following user(s) said Thank You: first

Please Log in to join the conversation.

More
1 month 1 week ago #158449 by Marv12
Marv12 replied the topic: Capturing randomization order
Hi,

what is gseq and what is self in this case?

Please Log in to join the conversation.

More
1 month 1 week ago - 1 month 1 week ago #158464 by Joffm
Joffm replied the topic: Capturing randomization order
Hello, Marv,

no crossposts please.

But to answer:
If your equation has code "eq1", the term "self.gseq" is identical to "eq1.gseq".
This is what you see on the screen and is described in the manual
https://manual.limesurvey.org/Expression_Manager#The_reserved_.27this.27.2C_.27self.27.2C_and_.27that.27_variables

The 'this' variable is used exclusively within the "Whole question validation equation" and "Sub-question validation equation" advanced question options. It expands to the variable names of each of the cells within those questions.


Joffm
Last Edit: 1 month 1 week ago by Joffm.

Please Log in to join the conversation.

More
1 month 1 week ago #158465 by tpartner
tpartner replied the topic: Capturing randomization order
1) self refers to the question.

2) gsec is "the sequential number of the group, starting from 0" - manual.limesurvey.org/Expression_Manager#Access_to_Variables

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
1 month 6 days ago #158492 by DenisChenu
DenisChenu replied the topic: Capturing randomization order
Else : existing plugin framagit.org/SondagePro-LimeSurvey-plugin/getQuestionOrder working on 2.6lts version, not tested with 2.5X but think it can work

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

More
4 weeks 1 day ago - 4 weeks 1 day ago #158771 by markusfluer
markusfluer replied the topic: Capturing randomization order
To capture the sequence it would be better to create a hidden short text question and put {self.gseq}as default value.
Or {self.gseq+1} to have non zero based counting.
Last Edit: 4 weeks 1 day ago by markusfluer.

Please Log in to join the conversation.

More
4 weeks 20 hours ago #158787 by tpartner
tpartner replied the topic: Capturing randomization order
Yep, I believe that's what I said above regarding group randomizations - www.limesurvey.org/forum/can-i-do-this-w...ization-order#102364

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: DenisChenu

Please Log in to join the conversation.

More
4 weeks 18 hours ago #158812 by DenisChenu
DenisChenu replied the topic: Capturing randomization order
My plugin save all in one question : nananananére ;)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

More
4 weeks 4 hours ago #158835 by jelo
jelo replied the topic: Capturing randomization order

markusfluer wrote: To capture the sequence it would be better

Better in comparison to what?
Equation question vs. short text question? Workarounds vs. plugins?

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now