Welcome, Guest
Username: Password: Remember me

TOPIC: Array dual scale with each scale in separate rows

Array dual scale with each scale in separate rows 1 year 5 months ago #87594

Is it possible to make an array dual scale appear in such a way that the second scale is shown in a second row below the first scale, to avoid having a rather long single row?
I.e., can you make a kind of linebreak between the two scales of the array dual scale?

I use array dual scale questions, which are randomized in order, and they each begin with an embedded sound file, which people should rate using two different rather long 7 points Likert scales with different labels (the first ranging from 1-7 and the second from -3 - +3). In this case, it was not necessary to use subquestions.
The administrator has disabled public write access.

Re: Array dual scale with each scale in separate rows 1 year 5 months ago #87663

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 3813
  • Thank you received: 683
  • Karma: 328
That would take some very tricky JavaScript/jQuery manipulation.

Can't you just use two separate questions?
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.
The administrator has disabled public write access.

Re: Array dual scale with each scale in separate rows 1 year 5 months ago #87693

tpartner wrote:
That would take some very tricky JavaScript/jQuery manipulation.

Can't you just use two separate questions?


Yes, it might be possible to use two questions.
Though, the current dual scale questions has an embedded sound file in the beginning, and the questions are set to be presented in random order (to avoid possible effects of the order of presenting the sound files that people are asked to rate).

Is it possible to make pairs of two questions, which can be presented in random order, but which are also paired?
The administrator has disabled public write access.

Re: Array dual scale with each scale in separate rows 1 year 5 months ago #87695

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 3813
  • Thank you received: 683
  • Karma: 328
Assuming all questions are on the same page and they are all arrays, you can set up your survey to use JavaScript and add the following script to the source of one of the questions.

The script will wrap sequential pairs of array questions in <div> elements and then randomize the display of those <div> elements.
<script type="text/javascript" charset="utf-8">
	$(document).ready(function(){
 
		// Wrap question pairs in div elements
		$('.array-flexible-row').each(function(i){
			if(i%2 == 0) {
				$(this).next('.array-flexible-row').add(this).wrapAll('<div id="questionPair-'+(i)+'" class="questionPair" />');
			}
		});
 
		// Randomize the question pairs
		var pairIdArray = new Array();
		$('.questionPair').each(function(i){
			pairIdArray.push($(this).attr('id'));
		});
		function shuffle(o){
			for(var j, x, i = o.length; i; j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);
			return o;
		}
		shuffle(pairIdArray);
 
		// Show the pairs in the randomized order
		var parentEl = $('.questionPair:eq(0)').parent();
		$(pairIdArray).each(function(i){
			$(parentEl).append($('#'+this+''));
		});
 
	});
 
</script>
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.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.135 seconds
Donation Image