<%@ 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" %>
	<%@include file="/WEB-INF/views/include/dialog.jsp" %>
	<style type="text/css">.sort{color:#0663A2;cursor:pointer;}</style>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/admin/exam/statistics">分段统计</a></li>
		<li class="active"><a href="${ctx}/admin/exam/rate">得分率</a></li>
	</ul>
	<form id="searchForm" action="${ctx}/admin/exam/rate" 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" id="campusName" name="campusName">
				<option value="">请选择...</option>
				<c:forEach items="${campusList }" var="campus">
					<option value="${campus}" <c:if test="${query.campusName eq campus }">selected</c:if>>${campus}</option>
				</c:forEach>
			</select>
			<label>科目</label>
			<select class="input-large" name="subjectCode" id="subject-select">
				<option value="">请选择</option>
				<c:forEach items="${subjectList}" var="subject">
				<option value="${subject.code}" data-level="${subject.level}" <c:if test="${subject.code==query.subjectCode}">selected</c:if>>${subject.code}-${subject.name}</option>
				</c:forEach>
			</select>
			&nbsp;
			<input id="btnSubmit" class="btn btn-primary" type="button" value="查询" onclick="goSearch()"/>
			&nbsp;
			<input id="export-button" class="btn" type="button" value="导出"/> 
		</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>
				<th>平均分</th>
				<th>应得分</th>
				<th>得分率</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${query.result}" var="scoreRate">
			<tr>
				<td>${scoreRate.campusName }</td>
				<td>
					${scoreRate.subject.code}-${scoreRate.subject.name}&nbsp;${scoreRate.subject.remark}
				</td>
				<td>${scoreRate.subject.level }</td>
				<td>${scoreRate.questionNumber}</td>
				<td>${scoreRate.mainTitle }</td>
				<td>${scoreRate.avgScore }</td>
				<td>${scoreRate.totalScore}</td>
				<td>${scoreRate.rate }%</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/rate');
	$("#searchForm").submit();
	return false;
}
function goSearch(){
	$("#pageNumber").val(1);
	$("#pageSize").val('${query.pageSize}');
	$("#searchForm").attr('action','${ctx}/admin/exam/rate');
	$("#searchForm").submit();
	return false;
}
$("#export-button").click(function(){
	$("#searchForm").attr("action","${ctx}/admin/exam/rate/export");
	$("#searchForm").submit();
});
</script>	
</body>
</html>