Check out the LimeSurvey source code on GitHub!

Special student evaluation survey needed

More
5 years 8 months ago #62185 by jfreak53
We currently have a paper student evaluation form that we use at the end of each school year for our small number of students. One form per student type deal. The evaluation is a Qualitative - Quantitative type evaluation system. There are 12 sections to the evaluation and each section has 4 to 5 questions that are ranked from 1 to 10 (1 being horrible and 10 being perfect). Then the total is added up to form a grade for that section. This is what it looks like:

#1.
AREA: Related school time

a. Committed member of the school
b. Subject to the authority of the school
c. Fulfilled their goal here
d. Maintained a good communication with other students
e. Maintained a good testimony

Grade


At the end you grade each line and total it up, so if all were a 10 you would have 50 total grade for that section. Is there a way to do this with LimeSurvey?

Please Log in to join the conversation.

More
5 years 8 months ago #62203 by tpartner
Yes you can place your questions in groups and use assessments - docs.limesurvey.org/Assessments&structur...tions+for+LimeSurvey .

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
5 years 8 months ago #62208 by jfreak53
Ok, I got that working now. But how do I use those assessments afterwords? I mean the user doing the survey doesn't really care about those assessments, they are for us afterwords. Actually, I would rather see each groups total in admin than to see the answer for each question.

Please Log in to join the conversation.

More
5 years 8 months ago #62216 by tpartner
Ah, in that case you will need to use JavaScript to tally all of the answers on a page and populate a hidden question.

I assume that you're using arrays for the questions. If so, I would use the "scores" for answer codes so you could do the math with them. You could then add a short-text question to the group that could be hidden and populated with JavaScript.

If you attach a small survey with a sample group, I'll give you a JS snippet you can copy to other groups.

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
5 years 8 months ago #62219 by jfreak53
Awesome, thanks for the help. I am attaching the way I would like to make it work, which is without the assessments and just an array (10 points), from 1 to 10 answer. Would this work since it is still just populating a hidden field?

Thanks for your help.
Attachments:

Please Log in to join the conversation.

More
5 years 8 months ago - 5 years 8 months ago #62233 by tpartner
Yup, that will work.

1) Place each 10-point-array question in its own group.

2) Add a short-text question to each group (we'll hide them with JavScript).

3) Set up your survey to use JavaScript .

3) If you are using one of the shipped templates, add the following script to the source of each group description. The script hides the short-text, interrupts the Next/Submit function, adds up the vaues of all checked radios and populates the short-text with the total.
<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function(){
 
		// Fire the function to total the page score
		addScore();
 
		function addScore() {
 
			// Hide the short-text question
			$('.text-short').hide();
 
			// Interrupt the Next/Submit function
			$('form#limesurvey').submit(function(){	
 
				// Override the built-in "disable navigation buttons" feature
				$('#moveprevbtn, #movenextbtn, #movesubmitbtn').attr('disabled', '');
 
				var pagetotal = 0;
 
				// Loop through all checked radio buttons and add up the total score
				$('.array-10-pt input.radio:checked').each(function(i){
					pagetotal = Number(pagetotal) + Number($(this).attr('value'));
				});
 
				// Load the hidden short-text with the score
				$('.text-short input.text').val(pagetotal);
 
				// Continue with Next/Submit function
				return true;
 
			});
		}
	});
 
</script>

4) If you are using a custom template you can add the following to the end of template.js:
function addScore() {
 
	// Hide the short-text question
	$('.text-short').hide();
 
	// Interrupt the Next/Submit function
	$('form#limesurvey').submit(function(){	
 
		// Override the built-in "disable navigation buttons" feature
		$('#moveprevbtn, #movenextbtn, #movesubmitbtn').attr('disabled', '');
 
		var pagetotal = 0;
 
		// Loop through all checked radio buttons and add up the total score
		$('.array-10-pt input.radio:checked').each(function(i){
			pagetotal = Number(pagetotal) + Number($(this).attr('value'));
		});
 
		// Load the hidden short-text with the score
		$('.text-short input.text').val(pagetotal);
 
		// Continue with Next/Submit function
		return true;
 
	});
}
And then just add this to each group description:
<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function(){
 
		// Fire the function to total the page score
		addScore();
	});
 
</script>

Note that this code is for use with a single 10-point-array and a single short-text on a page but could be modified for other array types and multiple questions per page.

To test, you can leave the short-text visible. Change:
$('.text-short').hide();
To:
//$('.text-short').hide();

Here's a sample survey using your question. You'll find the script in the description of group "P1".

File Attachment:

File Name: limesurvey...6454.zip
File Size:4 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
Last Edit: 5 years 8 months ago by tpartner.
The following user(s) said Thank You: jfreak53

Please Log in to join the conversation.

More
5 years 8 months ago #62256 by jfreak53
SWEET!! Thank you so very much. I thought that was the way you were going but I couldn't get it to work myself. I tried iterating through the inputs but it just wouldn't do it for me. But now that I see what you did it's simple. Thanks for the help.

Please Log in to join the conversation.

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