Need help with dual Array with question in the middle...

More
8 months 1 day ago #156121 by TerryInLeesburg
TerryInLeesburg created the topic: Need help with dual Array with question in the middle...
We are trying to create a question like the attached picture.
I can get the dual scales, but is there a way to put the actual question in the "middle"?
Attachments:

Please Log in to join the conversation.

More
8 months 1 day ago #156133 by tpartner
tpartner replied the topic: Need help with dual Array with question in the middle...
What LimeSurvey version are you using?

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
8 months 23 hours ago #156149 by TerryInLeesburg
TerryInLeesburg replied the topic: Need help with dual Array with question in the middle...
2.5.4

Please Log in to join the conversation.

More
8 months 22 hours ago #156150 by tpartner
tpartner replied the topic: Need help with dual Array with question in the middle...
Set up your survey to use JavaScript and place the following script in the source of the question:

<script type="text/javascript" charset="utf-8">
	$(document).ready(function(){	
 
		// Identify this question
		var qID = {QID};
		var thisQuestion = $('#question'+qID);
 
		// Remove LS imposed column widths 
		$('colgroup', thisQuestion).remove();
 
		// Move the table cells
		$('table.subquestion-list thead tr', thisQuestion).each(function(i, thisRow) {
			$('td.header_separator', thisRow).after($('th.header_answer_text', thisRow)).remove();
		});
		$('tr.answers-list', thisQuestion).each(function(i, thisRow) {
			$('td.dual_scale_separator', thisRow).after($('th.answertext', thisRow)).remove();
		});
 
		// Insert the center header label
		var centerHeader = 'Learning Methods';
		$('table.subquestion-list thead tr:eq(0) th.header_answer_text', thisQuestion).text(centerHeader);
 
		// Insert some clean-up styles (could be placed in template.css)
		$('<style type="text/css">\
			#question'+qID+' th.header_answer_text, #question'+qID+' th.answertext {\
				width:50%;\
				text-align:center;\
				hyphens: none;\
				overflow-wrap: normal;\
			}\
			#question'+qID+' td.radio-item {\
				padding: 10px;\
			}\
			#question'+qID+' .radio label::before, #question'+qID+' .radio label::after {\
				margin-left: 0;\
			}\
			@media only screen and (max-width: 801px) {\
				#question'+qID+' th.answertext {\
					clear: both;\
					text-align: left;\
				}\
				#question'+qID+' td.radio-item {\
					float: left;\
					width: auto !important;\
				}\
			}\
		</style>').appendTo( "head" )		
	});
</script>



Sample survey attached:

File Attachment:

File Name: limesurvey...6-21.lss
File Size:22 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: TerryInLeesburg

Please Log in to join the conversation.

More
1 month 5 days ago - 1 month 5 days ago #162634 by VAMOS_FHB
VAMOS_FHB replied the topic: Need help with dual Array with question in the middle...
For me, this does not work as it should (see attached screenshot) in LS 3.0.4
Attachments:
Last Edit: 1 month 5 days ago by VAMOS_FHB.

Please Log in to join the conversation.

More
1 month 5 days ago - 1 month 5 days ago #162635 by tpartner
tpartner replied the topic: Need help with dual Array with question in the middle...
That looks like a template problem.

This workaround is for the 2.7.x versions. What template are you using?

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last Edit: 1 month 5 days ago by tpartner.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!