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

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