One answer option for two / three answer codes

More
1 month 1 week ago #159400 by NielsFro
NielsFro created the topic: One answer option for two / three answer codes
Hi all,

I hope this question has not been asked multiple times before, but I was not able to find anything in the forum or the workarounds...

I have a survey with answer options from 1 to 7 and a No answer

With the normal LS features, I can add text to each of the answer options and right now I have

1 = below the expectations
4 = fulfils the expecations
7 = above the expecations

however, I would like to have
1 & 2 = below the expectations
3 & 4 & 5 = fulfils the expectations
6 & 7 = above the expectations

in a way that centers the text above 1&2 / 3&4&5 / 6&7

I hope I was able to make my question clear - if not, please let me know and I can put a graphic together in PowerPoint or Paint ... :D

thanks a lot!
Niels

Please Log in to join the conversation.

More
1 month 1 week ago - 1 month 1 week ago #159406 by tpartner
tpartner replied the topic: One answer option for two / three answer codes
Placing a script like this in the question source will manipulate the column labels as described on desktop devices:

<script type="text/javascript" charset="utf-8">
	$(document).on('ready pjax:complete',function() {
 
		// Identify this question
		var thisQuestion = $('#question{QID}');
 
		// Label for columns 6-7 (column-7 label spans 2 columns)
		$('thead th:eq(7)', thisQuestion).prop('colspan', 2).prev().remove();
 
		// Label for columns 3-5 (column-4 label spans 3 columns)
		$('thead th:eq(4)', thisQuestion).prop('colspan', 3).next().remove();
		$('thead th:eq(4)', thisQuestion).prev().remove();
 
		// Label for columns 1-2 (column-1 label spans 2 columns)
		$('thead th:eq(1)', thisQuestion).prop('colspan', 2).next().remove();
	});
</script>


Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
Last Edit: 1 month 1 week 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!