Quantcast
Viewing all articles
Browse latest Browse all 17529

Need help with dual Array with question in the middle... - by: tpartner

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_survey_2148441_2017-06-21.lss
File Size: 22 KB

Viewing all articles
Browse latest Browse all 17529

Trending Articles