<%@ 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>
	<form id="searchForm" action="${ctx}/admin/exam/mark" 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 class="input-large" name="code">
				<option value="">请选择</option>
				<c:forEach items="${subjectList}" var="subject">
				<option value="${subject.code}" <c:if test="${subject.code==query.code}">selected</c:if>>${subject.code}-${subject.name}</option>
				</c:forEach>
			</select>
			<label>层次</label>
			<select class="input-small" name="level" id="level-select">
				<option value="">请选择</option>
				<c:forEach items="${levelList}" var="level">
				<option value="${level}" data-level="${level}" <c:if test="${level==query.level}">selected</c:if>>${level}</option>
				</c:forEach>
			</select>
			<label>专业类型</label>
			<select class="input-small" name="category" id="category-select">
				<option value="">请选择</option>
				<c:forEach items="${categoryList}" var="category">
				<option value="${category}" <c:if test="${category==query.category}">selected</c:if>>${category}</option>
				</c:forEach>
			</select>
			&nbsp;
			<input id="btnSubmit" class="btn btn-primary" type="button" value="查询" onclick="goSearch()"/>
			&nbsp;
			<div class="btn-group">
				<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
					导出<span class="caret"></span>
				</a>
				<ul class="dropdown-menu">
					<li><a href="##" onclick="goExportProgress()">整体评卷进度</a></li>
					<li><a href="##" onclick="goExportMarker()">评卷员工作量</a></li>
				</ul>
			</div>
			&nbsp;
			<input id="btnProgress" class="btn" type="button" value="总进度：${percent}%"/>
		</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>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${resultList}" var="result">
			<tr>
				<td>
					<a href="${ctx}/admin/exam/group?subjectCode=${result.subject.code}">
					${result.subject.code}-${result.subject.name}&nbsp;${result.subject.remark}</a>
				</td>
				<td>${result.subject.uploadCount}</td>
				<td>
				    <fmt:formatNumber type="number" value="${result.subject.subjectiveScore}" pattern="###.#"/>
				</td>
				<td>${result.groupCount}</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${query}</div>
<script type="text/javascript">
function page(n,s){
	$("#pageNumber").val(n);
	$("#searchForm").attr('action', '${ctx}/admin/exam/mark');
	$("#searchForm").submit();
	return false;
}
function goSearch(){
	$("#pageNumber").val(1);
	$("#searchForm").attr('action', '${ctx}/admin/exam/mark');
	$("#searchForm").submit();
	return false;
}
function goExportProgress(){
	$("#searchForm").attr('action', '${ctx}/admin/exam/mark/export-progress');
	$("#searchForm").submit();
	return false;
}
function goExportMarker(){
	$("#searchForm").attr('action', '${ctx}/admin/exam/mark/export-marker');
	$("#searchForm").submit();
	return false;
}
</script>	
</body>
</html>