<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib uri="/WEB-INF/taglib/c.tld" prefix="c"%>
<span>文/理科：</span>
<select class="span2 report-parameter" id="class_type" name="class_type">
</select>
<script type="text/javascript">
$(function(){
	$('#exam_id').change(updateClassType);
	$('#subject_id').change(updateClassType);
	updateClassType();
})

function updateClassType(){
	var examId = $('#exam_id option:selected').val();
	var subjectId = $('#subject_id option:selected').val();
	if(examId!=undefined && examId.length>0){
		if(subjectId==undefined || subjectId==''){
			subjectId = 0;
		}
		$.post('${ctx}/analysis/condition/class-types.json',{"examId":examId},function(res){
			$('#class_type').html('');
			$.each(res,function(index,obj){
				var row = $('<option value="'+obj.id+'">'+obj.name+'</option>');
				$('#class_type').append(row);
			});
			$('#class_type').trigger('change');
		});
	}
}
</script>
