<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib uri="/WEB-INF/taglib/c.tld" prefix="c"%>
<%@ include file="../common/init.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@ include file="../common/top.jsp"%>
<link rel="stylesheet" type="text/css" href="${ctx}/static/admin/style/bootstrapSwitch.css">
<script type="text/javascript" src="${ctx}/static/admin/js/bootstrap.min.js"></script> 
<script type="text/javascript" src="${ctx}/static/admin/js/jquery.edatagrid.js"></script>
<script type="text/javascript" src="${ctx}/static/admin/js/easyui-lang-zh_CN.js"></script>
</head>
<body class="easyui-layout">
	<%@ include file="../common/header.jsp"%>
	<%@ include file="../leftMenu/exam-admin.jsp"%>
	<div data-options="region:'center',title:'首页 -【考试管理】- 考试列表'">
		<div class="easyui-layout" data-options="fit:true,border:false">
			<div class="border" data-options="region:'center'">
				<div class="copy-exam">
				  <input type="hidden" id="sourceExamId" name="sourceExamId" value="${sourceExamId}" /> 
				  <input type="hidden" id="newExamId" name="newExamId" value="${newExamId}" />
	              <div id="iconOK" style="display:none" class="exam-header"><img src="${ctx}/static/admin/images/copy-ok.png">已更新新完成<span>6</span>项！</div>
	              <div class="exam-body">
	               <ul id="copyStatus">
	               </ul>
	              </div>
	             </div>
	             <div id="objectiveButton" style="display:none;text-align:center">
	             	<a href="${ctx}/admin/exam-param/objective/add/${newExamId}" class="btn">设置客观题</a>
	             </div>
			</div>
		</div>
	</div>
</body>
<script type="text/javascript">
	$(document).ready(function() {
		queryExam();
	});
	
	function queryExam(){
		var sourceExamId=$('#sourceExamId').val();
		var newExamId=$('#newExamId').val();
		$.post('${ctx}/admin/exam/copyexamstatus.json', {sourceExamId:sourceExamId,newExamId:newExamId}, function(result){
			var str;
			str='<li>复制学校<span class="text-r"><i class="blue">'+result.copySchoolCount+'</i>/'+result.schoolCount+'个</span></li>'+
               	'<li>复制考生<span class="text-r"><i class="blue">'+result.copyStudentCount+'</i>/'+result.studentCount+'个</span></li>'+
               	'<li>复制评卷员<span class="text-r"><i class="blue">'+result.copyMarkerCount+'</i>/'+result.markerCount+'个</span></li>'+
               	'<li>复制科组长<span class="text-r"><i class="blue">'+result.copySubjectHeaderCount+'</i>/'+result.subjectHeaderCount+'个</span></li>'+
               	'<li>复制客观题<span class="text-r"><i class="blue">'+result.copyObjectiveCount+'</i>/'+result.objectiveCount+'个</span></li>'+
               	'<li>复制主观题<span class="text-r"><i class="blue">'+result.copySubjectiveCount+'</i>/'+result.subjectiveCount+'个</span></li>';
			if(result.isOK){
				$("#iconOK").css("display","block");
				$("#objectiveButton").css("display","block");
				$("#copyStatus").html(str);
				return null;
			}else{
				$("#iconOK").css("display","none");
				$("#copyStatus").html(str);
				queryExam();
				return null;
			}
		});
	}
</script>
</html>
