<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>数据检查</title>
	<meta name="decorator" content="default"/>
	<%@include file="/WEB-INF/views/include/head.jsp" %>
	<style type="text/css">.sort{color:#0663A2;cursor:pointer;}</style>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/admin/exam/check/answer">识别结果检查</a></li>
		<li><a href="${ctx}/admin/exam/check/image">图片检查</a></li>
		<li class="active"><a href="${ctx}/admin/exam/check/score">分数检查</a></li>
	</ul>
	<form id="searchForm" action="${ctx}/admin/exam/check/score" method="post" class="breadcrumb form-search">
		<input type="hidden" id="pageNumber" name="pageNumber" value="${query.pageNumber }"/>
		<input type="hidden" id="pageSize" name="pageSize" value="${query.pageSize }"/>
		<div>
			<label>科目</label>
			<select name="subjectCode">
				<option value="">请选择</option>
				<c:forEach items="${subjectList}" var="subject">
				<option value="${subject.code}" <c:if test="${subject.code==query.subjectCode}">selected</c:if>>${subject.code}-${subject.name}</option>
				</c:forEach>
			</select>
			<label>题型</label>
			<select name="objective" class="input-medium">
				<option value="">请选择</option>
				<option value="true" <c:if test="${query.objective!=null && query.objective==true}">selected</c:if>>客观题</option>
				<option value="false" <c:if test="${query.objective!=null && query.objective==false}">selected</c:if>>主观题</option>	
			</select>
			<label>零分比例>=</label>
			<input type="text" name="zeroRateGt" value="${query.zeroRateGt}"  maxlength="4" class="input-mini"/>
			&nbsp;
			<input id="btnSubmit" class="btn btn-primary" type="button" value="查询" onclick="goSearch()"/>
			&nbsp;
			<input id="export-button" class="btn" type="button" value="导出" onclick="goExport()"/>
			<c:if test="${web_user.schoolAdmin==true}">
			&nbsp;
			<c:if test="${running==false}">
			<a href="${ctx}/admin/exam/check/score/run" class="btn">开始检查</a>
			</c:if>
			<c:if test="${running==true}">
			<a href="javascript:void(0)" class="btn" disabled>正在检查</a>
			</c:if>
			</c:if>
		</div>
	</form>
	<tags:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>科目</th>
				<th>大题名称</th>
				<th>大题号</th>
				<th>小题号</th>
				<th>零分比例</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${query.result}" var="question">
			<tr>
				<td>${question.subject.code}_${question.subject.name}</td>
				<td>${question.mainTitle}</td>
				<td>${question.mainNumber}</td>
				<td>${question.subNumber}</td>
				<td><fmt:formatNumber type="percent" maxIntegerDigits="3" value="${question.zeroCount/question.totalCount}" /></td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${query}</div>
<script type="text/javascript">
function page(n,s){
	$("#pageNumber").val(n);
	$("#pageSize").val(s);
	$("#searchForm").attr('action','${ctx}/admin/exam/check/score');
	$("#searchForm").submit();
	return false;
}
function goSearch(){
	$("#pageNumber").val(1);
	$("#pageSize").val('${query.pageSize}');
	$("#searchForm").attr('action','${ctx}/admin/exam/check/score');
	$("#searchForm").submit();
	return false;
}
function goExport(){
	$("#searchForm").attr('action','${ctx}/admin/exam/check/score/export');
	$("#searchForm").submit();
}
</script>	
</body>
</html>