Welcome, Guest
Username: Password: Remember me

TOPIC: Capturing randomization order

Capturing randomization order 11 months 4 weeks ago #102039

  • itsdanwall
  • itsdanwall's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
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:
The administrator has disabled public write access.

Capturing randomization order 11 months 4 weeks ago #102047

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 2956
  • Thank you received: 379
  • Karma: 124
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.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Capturing randomization order 11 months 2 weeks ago #102334

  • itsdanwall
  • itsdanwall's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
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?
The administrator has disabled public write access.

Capturing randomization order 11 months 2 weeks ago #102345

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 2956
  • Thank you received: 379
  • Karma: 124
Sorry, I am not a Javascript expert.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Capturing randomization order 11 months 2 weeks ago #102364

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4364
  • Thank you received: 827
  • Karma: 381
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_survey_186812_modified.lss
File Size: 37 KB
Cheers,
Tony Partner

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

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
Last Edit: 11 months 2 weeks ago by tpartner.
The administrator has disabled public write access.
The following user(s) said Thank You: trivender
Moderators: ITEd
Time to create page: 0.121 seconds
Donation Image