Check out the LimeSurvey source code on GitHub!

change the option label in statistic report

5 years 6 months ago #64896 by sofos01
Hi, thanks for the suport you provide me, im trying to do a survey that measure the quality of health service, i use 1 to 5 matrix and single 1 to 5 radio button question to do this survey but i need to change the way statistic report show the results, in option label the report show the follow column:

Sin respuesta

i want to change to:

1 bad.
2 average
3 normal
4 good
5 very good
not answer

i tried with and array-flexible-row, but i had an issue that i need the average of a group
and i don't know how to get the value of an array-flexible-row (the survey works perfect, but the presentation of the report needs that labels in order to show better information).

best regards, and thxs for the help you provide me.


Please Log in to join the conversation.

5 years 6 months ago #64924 by tpartner
You will need to create the questions with the labels that you want to see in reporting and the use JavaScript to dynamically change them for the survey respondents.

1) Set up your survey to use JavaScript .

2) Create your array question and radio questions with the labels you want in reporting (bad, average, normal, good, very good).

3) Add the following scripts to the source of the questions (you can place it all in one script if both questions are in the same page). Replace "AA" and "RR" with the array and radio question IDs .

<script type="text/javascript" charset="utf-8">
	$(document).ready(function() {
		// Question ID
		var arrayID = AA;
		// Array labels
		$('#question'+arrayID+' table.question thead th:eq(0)').text('1');
		$('#question'+arrayID+' table.question thead th:eq(1)').text('2');
		$('#question'+arrayID+' table.question thead th:eq(2)').text('3');
		$('#question'+arrayID+' table.question thead th:eq(3)').text('4');
		$('#question'+arrayID+' table.question thead th:eq(4)').text('5');

<script type="text/javascript" charset="utf-8">
	$(document).ready(function() {
		// Question ID
		var radioID = RR;
		// Radio labels
		$('#question'+radioID+' .answertext:eq(0)').text('1');
		$('#question'+radioID+' .answertext:eq(1)').text('2');
		$('#question'+radioID+' .answertext:eq(2)').text('3');
		$('#question'+radioID+' .answertext:eq(3)').text('4');
		$('#question'+radioID+' .answertext:eq(4)').text('5');

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.

5 years 6 months ago #64925 by sofos01
Works perfectly!!! Thanks a lot.

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form