Welcome, Guest
Username: Password: Remember me

TOPIC: change the option label in statistic report

change the option label in statistic report 3 years 3 months ago #64896

  • sofos
  • sofos's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 9
  • Karma: 0
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:

1(1)
2(2)
3(3)
4(4)
5(5)
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
average
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.


captura.jpg
The administrator has disabled public write access.

Re: change the option label in statistic report 3 years 3 months ago #64924

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4372
  • Thank you received: 830
  • Karma: 381
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.

Array:
<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>

Radio:
<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');
 
	});
 
</script>
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: change the option label in statistic report 3 years 3 months ago #64925

  • sofos
  • sofos's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 9
  • Karma: 0
Works perfectly!!! Thanks a lot.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.119 seconds
Donation Image