Dual Scale Array to Multiple Scale Array Possibility?

More
5 years 5 months ago #76629 by Newbeedu
Newbeedu created the topic: Dual Scale Array to Multiple Scale Array Possibility?
Hello there,

I have a question where 10 items are to be rated on 3 - 4 parameters on a scale of 1 to 5 in one question.

The requirement looks like this.

Can we create this on LimeSurvey?

Thanks,
Attachments:

Please Log in to join the conversation.

More
5 years 5 months ago #76644 by tpartner
tpartner replied the topic: Dual Scale Array to Multiple Scale Array Possibility?
You can use 4 array questions. CSS (and maybe a little JavaScript) can then be used to align them side by side and hide the row labels for questions 2, 3 and 4.

The CSS details would depend on the template you are using.

If you can attach a sample survey with the 4 questions and your template (or tell us which template you prefer), I can give some CSS tips.

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
5 years 5 months ago #76682 by DenisChenu
DenisChenu replied the topic: Dual Scale Array to Multiple Scale Array Possibility?
And without CSS/javascript but with little modification : select/option 1 to 5 for notation.

Use array / number : min value : 1 / Max value : 1 ( step: 1).

Remark: the array take a long place : use selectbox or use 4 array can be more simple and more effective for user.

Denis

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
5 years 5 months ago #76736 by Newbeedu
Newbeedu replied the topic: Dual Scale Array to Multiple Scale Array Possibility?
Hi,

I have put in check box as sample but i need radio buttons as the parameters will be rated on a scale of 5 and only one rate for each parameter need to be selected.

I am using default template an i am fine with any template.

Please help.

Thanks,

Please Log in to join the conversation.

More
5 years 5 months ago #76738 by tpartner
tpartner replied the topic: Dual Scale Array to Multiple Scale Array Possibility?
Sure, but please attach a sample survey with the 4 questions so we don't have to spend time creating them.

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
5 years 5 months ago #76742 by Newbeedu
Newbeedu replied the topic: Dual Scale Array to Multiple Scale Array Possibility?
As I have 2 different questions one with 3 and another with 4 options, i have put up 3 questions in this survey.
Attachments:

Please Log in to join the conversation.

More
5 years 5 months ago #76778 by tpartner
tpartner replied the topic: Dual Scale Array to Multiple Scale Array Possibility?
Since you need to do this with several questions, I have opted for a JavaScript approach instead of CSS. It can be used in any group with the following conditions/caveates:
- The survey is in group by group mode
- There can only be array questions or text display questions in the group
- All Arrays will be aligned side-by side

1) Set up your survey to use JavaScript .

2) Add the following script to the source of one of the questions in a group.

The script wraps all questions that are not text-displays in a div element and aligns them side-by-side. There are some styles applied to the questions - these are for the default template but can be modified for other templates.
<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function() {
		// Loop through all questions (except boilerplates) and add some classes
		$('div[id^="question"]').each(function(i){
			if (!$(this).hasClass('boilerplate')) {
				$(this).addClass('inlineQuestion');
				if(i < 1) {
					$(this).addClass('inlineQuestionPrime');
				}
				else {
					$(this).addClass('inlineQuestionSub');
				}
			}
		});
 
		// Wrap the questions in a div
		$('.inlineQuestion').wrapAll('<div class="inlineWrapper" />');
 
		// Remove the text from the secondary questions
		$('.inlineQuestionSub th.answertext').text('');
 
		// Apply some styles (these are for the default template)
		$('.inlineQuestion').css({ 'float': 'left' });
		$('.inlineQuestion col, .inlineQuestion th.answertext').css({ 'width': 'auto' });
		$('.inlineQuestion .question-wrapper').css({ 'width': '100%' });
		$('.inlineQuestion td.answer').css({ 'padding': '0.5em 0' });
		$('.inlineQuestion td.questiontext').css({ 'text-align': 'center' });
 
		// Center the wrapper div
		var wrapperWidth = 0;
		$('.inlineQuestion').each(function(i){ 
			wrapperWidth = wrapperWidth + $(this).width();
			var padLeft = $('.answertext:eq(0)', this).width() + 3;
			$('.questiontext', this).css({ 'padding-left':padLeft+'px', 'padding-right':'3px' });
		});
		$('.inlineWrapper').css({ 'width':wrapperWidth+'px', 'margin': '0 auto' });
	});
 
</script>

Here is your sample survey with 2 groups. The script is in the source of the first array in each group.

File Attachment:

File Name: limesurvey...4194.lss
File Size:82 KB


And the result...

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

Please Log in to join the conversation.

More
5 years 5 months ago #76810 by tpartner
tpartner replied the topic: Dual Scale Array to Multiple Scale Array Possibility?
Duh...just noticed that the row labels are dropped...

Use this script:
<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function() {
		// Loop through all questions (except boilerplates) and add some classes
		$('div[id^="question"]').each(function(i){
			if (!$(this).hasClass('boilerplate')) {
				$(this).addClass('inlineQuestion inlineQuestionSub');
			}
		});
		$('.inlineQuestionSub:first').removeClass('inlineQuestionSub').addClass('inlineQuestionPrime');
 
		// Wrap the questions in a div
		$('.inlineQuestion').wrapAll('<div class="inlineWrapper" />');
 
		// Remove the text from the secondary questions
		$('.inlineQuestionSub th.answertext').text('');
 
		// Apply some styles (these are for the default template)
		$('.inlineQuestion').css({ 'float': 'left' });
		$('.inlineQuestion col, .inlineQuestion th.answertext').css({ 'width': 'auto' });
		$('.inlineQuestion .question-wrapper').css({ 'width': '100%' });
		$('.inlineQuestion td.answer').css({ 'padding': '0.5em 0' });
		$('.inlineQuestion td.questiontext').css({ 'text-align': 'center' });
 
		// Center the wrapper div
		var wrapperWidth = 0;
		$('.inlineQuestion').each(function(i){ 
			wrapperWidth = wrapperWidth + $(this).width();
			var padLeft = $('.answertext:eq(0)', this).width() + 3;
			$('.questiontext', this).css({ 'padding-left':padLeft+'px', 'padding-right':'3px' });
		});
		$('.inlineWrapper').css({ 'width':wrapperWidth+'px', 'margin': '0 auto' });
	});
 
</script>

And this survey:

File Attachment:

File Name: limesurvey...1941.lss
File Size:82 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: Newbeedu

Please Log in to join the conversation.

More
5 years 5 months ago #76837 by Newbeedu
Newbeedu replied the topic: Dual Scale Array to Multiple Scale Array Possibility?
This is Magic! Amazing Tony.

There is a little problem.

The format looks fine in Mozilla FireFox, but in Chrome and Safari there is a little problem. Images below:



Could you please help.

Thanks,
Attachments:

Please Log in to join the conversation.

More
5 years 5 months ago #76853 by tpartner
tpartner replied the topic: Dual Scale Array to Multiple Scale Array Possibility?
Ah, okay, use this:
<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function() {
		// Loop through all questions (except boilerplates) and add some classes
		$('div[id^="question"]').each(function(i){
			if (!$(this).hasClass('boilerplate')) {
				$(this).addClass('inlineQuestion inlineQuestionSub');
			}
		});
		$('.inlineQuestionSub:first').removeClass('inlineQuestionSub').addClass('inlineQuestionPrime');
 
		// Wrap the questions in a div
		$('.inlineQuestion').wrapAll('<div class="inlineWrapper" />');
 
		// Remove the text from the secondary questions
		$('.inlineQuestionSub th.answertext').text('');
 
		// Apply some styles (these are for the default template)
		$('.inlineQuestion').css({ 'float': 'left' });
		$('.inlineQuestion col, .inlineQuestion th.answertext').css({ 'width': 'auto' });
		$('.inlineQuestion .question-wrapper').css({ 'width': '100%' });
		$('.inlineQuestion td.answer').css({ 'padding': '0.5em 0' });
		$('.inlineQuestion td.questiontext').css({ 'text-align': 'center' });
 
		// Center the wrapper div
		var wrapperWidth = 0;
		$('.inlineQuestion').each(function(i){ 
			wrapperWidth = wrapperWidth + $(this).width();
			var padLeft = $('.answertext:eq(0)', this).width() + 3;
			$('.questiontext', this).css({ 'padding-left':padLeft+'px', 'padding-right':'3px' });
		});
		$('.inlineWrapper').css({ 'width':wrapperWidth+'px', 'margin': '0 auto' });
 
		// Set the row heights
		var wrapperWidth = 0;
		$('.inlineQuestionSub').each(function(i){
			$('tbody[id^="javatbd"]', this).each(function(i){ 
				var ansHeight = $('.inlineQuestionPrime th.answertext:eq('+i+')').innerHeight();
				//$('th.answertext', this).css({ 'height':ansHeight+'px' });
 
				if($.browser.mozilla) {
					$('th.answertext', this).height(ansHeight);
				}
				else {
					$('th.answertext', this).innerHeight(ansHeight);
				}
			});
		});
	});
 
</script>


File Attachment:

File Name: limesurvey...1942.lss
File Size:83 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: Newbeedu

Please Log in to join the conversation.

More
5 years 5 months ago #76869 by Newbeedu
Newbeedu replied the topic: Dual Scale Array to Multiple Scale Array Possibility?
I am sorry for not making my requirement list clear the previous time.

Before we get in to the multiple rating questions, I have a multiple choice question that asks the respondent to select the parameters that he is considering.

So, after the parameters are selected (starting from 1 to 10 any number of parameters can be selected from the respondent as it is multiple choice) the parameters are to be listed in the next page where the respondent will be rating it on a scale of 5 for 3 or 4 different parameters.

I have attached a copy of the test survey.

Thanks,
Attachments:

Please Log in to join the conversation.

More
5 years 5 months ago #76871 by tpartner
tpartner replied the topic: Dual Scale Array to Multiple Scale Array Possibility?

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
5 years 5 months ago #76872 by Newbeedu
Newbeedu replied the topic: Dual Scale Array to Multiple Scale Array Possibility?
Hi,

If I put the question code as suggested in the link, it is hiding all the 10 parameters.

I even tried with a new page, still it hides it all. :(

Please Log in to join the conversation.

More
5 years 5 months ago #76878 by tpartner
tpartner replied the topic: Dual Scale Array to Multiple Scale Array Possibility?

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

Please Log in to join the conversation.

More
5 years 5 months ago #76881 by Newbeedu
Newbeedu replied the topic: Dual Scale Array to Multiple Scale Array Possibility?
Sorry Tony its still not working.

it is displaying either all the options if I put the code in Array filter or none of the options if the put the question code in Array filter exclusion.

:(

Please Log in to join the conversation.

Did you already participate in our customer survey?

Don't miss your chance for great prices.

Please click here to participate:

Start now

Start now!

Just create your account and start using Limesurvey today.

Register now