<?xml version="1.0" encoding="UTF-8"?>
<document>
 <LimeSurveyDocType>Question</LimeSurveyDocType>
 <DBVersion>176</DBVersion>
 <languages>
  <language>en</language>
 </languages>
 <questions>
  <fields>
   <fieldname>qid</fieldname>
   <fieldname>parent_qid</fieldname>
   <fieldname>sid</fieldname>
   <fieldname>gid</fieldname>
   <fieldname>type</fieldname>
   <fieldname>title</fieldname>
   <fieldname>question</fieldname>
   <fieldname>preg</fieldname>
   <fieldname>help</fieldname>
   <fieldname>other</fieldname>
   <fieldname>mandatory</fieldname>
   <fieldname>question_order</fieldname>
   <fieldname>language</fieldname>
   <fieldname>scale_id</fieldname>
   <fieldname>same_default</fieldname>
   <fieldname>relevance</fieldname>
  </fields>
  <rows>
   <row>
    <qid><![CDATA[1205]]></qid>
    <parent_qid><![CDATA[0]]></parent_qid>
    <sid><![CDATA[864437]]></sid>
    <gid><![CDATA[180]]></gid>
    <type><![CDATA[:]]></type>
    <title><![CDATA[Q2]]></title>
    <question><![CDATA[<script type="text/javascript" charset="utf-8">	
 
	$(document).ready(function(){
		var thisQuestion = $('#question{QID}');
		var qID = {QID};


		// Add some classes for manipulation
		$('tr.subquestions-list', thisQuestion).each(function(i){
			$('> *', this).each(function(i){
				$(this).addClass('col-'+i+'');
			});
		});

		$('tr.subquestions-list:last', thisQuestion).addClass('last');
		$('tr.subquestions-list:not(.last) .col-2 input[type="text"]', thisQuestion).addClass('final');
		$('tr.subquestions-list:not(.last) .col-3 input[type="text"]', thisQuestion).addClass('percent');
		$('tr.subquestions-list:not(.last) .col-4 input[type="text"]', thisQuestion).addClass('rating');
 
		// Disable the "Rating" inputs
		$('input.rating', thisQuestion).prop('disabled', true);
 
		// Hide the unwanted total inputs
		//$('tr.subquestions-list.last input[type="text"]:not(:last)', thisQuestion).hide();//
 
		// Initial totals
		$('tr.subquestions-list.last input[type="text"]', thisQuestion).val(0).prop('disabled', true);
		var lastRowCode = $('tr.subquestions-list:last', thisQuestion).attr('id').split('X'+qID)[1];
 
		// Listeners on the "Final" and "Percent" inputs
		$('input.final, input.percent', thisQuestion).change(function(event) {
			handleRating(this);
		});
		$('input.final, input.percent', thisQuestion).keyup(function(event) {
			handleRating(this);
		});
		//$('input.rating', thisRow).val(222)

		
		function handleRating(thisInput) {
			var thisRow = $(thisInput).closest('tr.subquestions-list');
			var thisFinal = $('input.final', thisRow).val();
			var thisPercent = $('input.percent', thisRow).val();
			//if(thisFinal != '' && thisPercent != '') {
			//	$('input.rating', thisRow).val(thisFinal * 1)
			//}
			//else {
				$('input.rating', thisRow).val('');
			//}
		}
 
		// Listeners on the inputs to load totals
		$('tr.subquestions-list:not(.last) input[type="text"]:not(.rating)', thisQuestion).change(function(event) {
			handleTotals();
		});
		$('tr.subquestions-list:not(.last) input[type="text"]:not(.rating)', thisQuestion).keyup(function(event) {
			handleTotals();
		});	
		function handleTotals() {
			$('tr.subquestions-list.last input[type="text"]', thisQuestion).each(function(i) {
				var thisCode = $(this).attr('id').split('X'+qID+lastRowCode+'_')[1];
				var newTotal = 0;
				$('tr.subquestions-list:not(.last) input[type="text"][id$="_'+thisCode+'"]', thisQuestion).each(function(i) {
					if($.isNumeric($(this).val())) {
						newTotal = newTotal + Number($(this).val());
					}
				});
				$(this).val(newTotal);
			});
		}
 
		// Re-enable the "Rating" inputs on submit
		$('form#limesurvey').submit(function(){			
			$('input.rating, tr.subquestions-list.last input[type="text"]', thisQuestion).prop('disabled', false);
		});
	});
 
</script>]]></question>
    <preg/>
    <help/>
    <other><![CDATA[N]]></other>
    <mandatory><![CDATA[N]]></mandatory>
    <question_order><![CDATA[10]]></question_order>
    <language><![CDATA[en]]></language>
    <scale_id><![CDATA[0]]></scale_id>
    <same_default><![CDATA[0]]></same_default>
    <relevance><![CDATA[1]]></relevance>
   </row>
  </rows>
 </questions>
 <subquestions>
  <fields>
   <fieldname>qid</fieldname>
   <fieldname>parent_qid</fieldname>
   <fieldname>sid</fieldname>
   <fieldname>gid</fieldname>
   <fieldname>type</fieldname>
   <fieldname>title</fieldname>
   <fieldname>question</fieldname>
   <fieldname>preg</fieldname>
   <fieldname>help</fieldname>
   <fieldname>other</fieldname>
   <fieldname>mandatory</fieldname>
   <fieldname>question_order</fieldname>
   <fieldname>language</fieldname>
   <fieldname>scale_id</fieldname>
   <fieldname>same_default</fieldname>
   <fieldname>relevance</fieldname>
  </fields>
  <rows>
   <row>
    <qid><![CDATA[1206]]></qid>
    <parent_qid><![CDATA[1205]]></parent_qid>
    <sid><![CDATA[864437]]></sid>
    <gid><![CDATA[180]]></gid>
    <type><![CDATA[:]]></type>
    <title><![CDATA[SQ001]]></title>
    <question><![CDATA[KRA1  (5)]]></question>
    <help/>
    <other><![CDATA[N]]></other>
    <question_order><![CDATA[1]]></question_order>
    <language><![CDATA[en]]></language>
    <scale_id><![CDATA[0]]></scale_id>
    <same_default><![CDATA[0]]></same_default>
   </row>
   <row>
    <qid><![CDATA[1207]]></qid>
    <parent_qid><![CDATA[1205]]></parent_qid>
    <sid><![CDATA[864437]]></sid>
    <gid><![CDATA[180]]></gid>
    <type><![CDATA[T]]></type>
    <title><![CDATA[SQ002]]></title>
    <question><![CDATA[KRA2  (6)]]></question>
    <other><![CDATA[N]]></other>
    <question_order><![CDATA[2]]></question_order>
    <language><![CDATA[en]]></language>
    <scale_id><![CDATA[0]]></scale_id>
    <same_default><![CDATA[0]]></same_default>
   </row>
   <row>
    <qid><![CDATA[1208]]></qid>
    <parent_qid><![CDATA[1205]]></parent_qid>
    <sid><![CDATA[864437]]></sid>
    <gid><![CDATA[180]]></gid>
    <type><![CDATA[T]]></type>
    <title><![CDATA[SQ003]]></title>
    <question><![CDATA[KRA3  (3)]]></question>
    <other><![CDATA[N]]></other>
    <question_order><![CDATA[3]]></question_order>
    <language><![CDATA[en]]></language>
    <scale_id><![CDATA[0]]></scale_id>
    <same_default><![CDATA[0]]></same_default>
   </row>
   <row>
    <qid><![CDATA[1209]]></qid>
    <parent_qid><![CDATA[1205]]></parent_qid>
    <sid><![CDATA[864437]]></sid>
    <gid><![CDATA[180]]></gid>
    <type><![CDATA[T]]></type>
    <title><![CDATA[SQ004]]></title>
    <question><![CDATA[KRA  (4)]]></question>
    <other><![CDATA[N]]></other>
    <question_order><![CDATA[4]]></question_order>
    <language><![CDATA[en]]></language>
    <scale_id><![CDATA[0]]></scale_id>
    <same_default><![CDATA[0]]></same_default>
   </row>
   <row>
    <qid><![CDATA[1210]]></qid>
    <parent_qid><![CDATA[1205]]></parent_qid>
    <sid><![CDATA[864437]]></sid>
    <gid><![CDATA[180]]></gid>
    <type><![CDATA[T]]></type>
    <title><![CDATA[SQ009]]></title>
    <question><![CDATA[KRA  (5)]]></question>
    <other><![CDATA[N]]></other>
    <question_order><![CDATA[5]]></question_order>
    <language><![CDATA[en]]></language>
    <scale_id><![CDATA[0]]></scale_id>
    <same_default><![CDATA[0]]></same_default>
   </row>
   <row>
    <qid><![CDATA[1211]]></qid>
    <parent_qid><![CDATA[1205]]></parent_qid>
    <sid><![CDATA[864437]]></sid>
    <gid><![CDATA[180]]></gid>
    <type><![CDATA[T]]></type>
    <title><![CDATA[SQ008]]></title>
    <question><![CDATA[KRA  (7)]]></question>
    <other><![CDATA[N]]></other>
    <question_order><![CDATA[6]]></question_order>
    <language><![CDATA[en]]></language>
    <scale_id><![CDATA[0]]></scale_id>
    <same_default><![CDATA[0]]></same_default>
   </row>
   <row>
    <qid><![CDATA[1212]]></qid>
    <parent_qid><![CDATA[1205]]></parent_qid>
    <sid><![CDATA[864437]]></sid>
    <gid><![CDATA[180]]></gid>
    <type><![CDATA[T]]></type>
    <title><![CDATA[SQ007]]></title>
    <question><![CDATA[KRA  (6)]]></question>
    <other><![CDATA[N]]></other>
    <question_order><![CDATA[7]]></question_order>
    <language><![CDATA[en]]></language>
    <scale_id><![CDATA[0]]></scale_id>
    <same_default><![CDATA[0]]></same_default>
   </row>
   <row>
    <qid><![CDATA[1213]]></qid>
    <parent_qid><![CDATA[1205]]></parent_qid>
    <sid><![CDATA[864437]]></sid>
    <gid><![CDATA[180]]></gid>
    <type><![CDATA[T]]></type>
    <title><![CDATA[SQ006]]></title>
    <question><![CDATA[KRA  (6)]]></question>
    <other><![CDATA[N]]></other>
    <question_order><![CDATA[8]]></question_order>
    <language><![CDATA[en]]></language>
    <scale_id><![CDATA[0]]></scale_id>
    <same_default><![CDATA[0]]></same_default>
   </row>
   <row>
    <qid><![CDATA[1214]]></qid>
    <parent_qid><![CDATA[1205]]></parent_qid>
    <sid><![CDATA[864437]]></sid>
    <gid><![CDATA[180]]></gid>
    <type><![CDATA[T]]></type>
    <title><![CDATA[SQ005]]></title>
    <question><![CDATA[Total]]></question>
    <other><![CDATA[N]]></other>
    <question_order><![CDATA[9]]></question_order>
    <language><![CDATA[en]]></language>
    <scale_id><![CDATA[0]]></scale_id>
    <same_default><![CDATA[0]]></same_default>
   </row>
   <row>
    <qid><![CDATA[1216]]></qid>
    <parent_qid><![CDATA[1205]]></parent_qid>
    <sid><![CDATA[864437]]></sid>
    <gid><![CDATA[180]]></gid>
    <type><![CDATA[T]]></type>
    <title><![CDATA[SQ002]]></title>
    <question><![CDATA[Self]]></question>
    <other><![CDATA[N]]></other>
    <question_order><![CDATA[1]]></question_order>
    <language><![CDATA[en]]></language>
    <scale_id><![CDATA[1]]></scale_id>
    <same_default><![CDATA[0]]></same_default>
   </row>
   <row>
    <qid><![CDATA[1217]]></qid>
    <parent_qid><![CDATA[1205]]></parent_qid>
    <sid><![CDATA[864437]]></sid>
    <gid><![CDATA[180]]></gid>
    <type><![CDATA[T]]></type>
    <title><![CDATA[SQ003]]></title>
    <question><![CDATA[Supervisor's Rating]]></question>
    <other><![CDATA[N]]></other>
    <question_order><![CDATA[2]]></question_order>
    <language><![CDATA[en]]></language>
    <scale_id><![CDATA[1]]></scale_id>
    <same_default><![CDATA[0]]></same_default>
   </row>
   <row>
    <qid><![CDATA[1218]]></qid>
    <parent_qid><![CDATA[1205]]></parent_qid>
    <sid><![CDATA[864437]]></sid>
    <gid><![CDATA[180]]></gid>
    <type><![CDATA[T]]></type>
    <title><![CDATA[SQ004]]></title>
    <question><![CDATA[Comments]]></question>
    <other><![CDATA[N]]></other>
    <question_order><![CDATA[3]]></question_order>
    <language><![CDATA[en]]></language>
    <scale_id><![CDATA[1]]></scale_id>
    <same_default><![CDATA[0]]></same_default>
   </row>
  </rows>
 </subquestions>
 <question_attributes>
  <fields>
   <fieldname>qid</fieldname>
   <fieldname>attribute</fieldname>
   <fieldname>value</fieldname>
   <fieldname>language</fieldname>
  </fields>
  <rows>
   <row>
    <qid><![CDATA[1205]]></qid>
    <attribute><![CDATA[input_boxes]]></attribute>
    <value><![CDATA[1]]></value>
   </row>
  </rows>
 </question_attributes>
</document>
