<%@ 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" %>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/admin/exam/paper">科目管理</a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="subject" action="${ctx}/admin/exam/subject/save" method="post" class="form-horizontal">
		<form:hidden path="code"/>
		<input type="hidden" id="pageNumber" name="pageNumber" value="${query.pageNumber }"/>
	 	<input type="hidden" id="queryCode" name="queryCode" value="${query.code }"/>
	 	<input type="hidden" id="category" name="category" value="${query.category }"/>
	 	<input type="hidden" id="level" name="level" value="${query.level }"/>
	 	<input type="hidden" id="upload" name="upload" value="${upload}"/>
	 	<input type="hidden" id="totalScoreNotEqual" name="totalScoreNotEqual" value="${query.totalScoreNotEqual }"/>
		<tags:message content="${message}"/>
		<div class="control-group">
			<label class="control-label">名称</label>
			<div class="controls">
				${subject.name }
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">代码</label>
			<div class="controls">
				${subject.code }
			</div>
		</div>
		<div class="control-group">
            <label class="control-label">评卷显示题目昵称</label>
            <div class="controls">
                 <input name="displayQuestionName" type="checkbox" <c:if test="${subject.displayQuestionName}">checked</c:if>/>
            </div>
        </div>
		<div class="control-group">
        <label class="control-label">及格分</label>
	        <div class="controls">
	            <input name="passScore" type="number" value="${passScore }" class="required"
	                   oninput="if(value<0)value=0"/>%
	        </div>
	    </div>
	    <div class="control-group">
	        <label class="control-label">优秀分</label>
	        <div class="controls">
	            <input name="excellentScore" type="number" value="${excellentScore }" class="required"
	                   oninput="if(value<0)value=0"/>%
	        </div>
	    </div>
		<div class="control-group">
            <label class="control-label">原图遮盖</label>
            <div class="controls">
                <input name="picList" id="picList"  type="hidden"/>
                <a href="${ctx}/admin/exam/getSheetConfig?examId=${subject.examId}&subjectCode=${subject.code}" target="_blank" class="required" id= "configuration" rel="opener">设置</a>
            </div>
        </div>
        <div class="control-group">
	        <label class="control-label">评卷提交自动定位</label>
	        <div class="controls">
	        <input name="autoScroll" type="radio"  value="" <c:if test="${subject.autoScroll==null}">checked</c:if>/>设置以考试为准&nbsp;
	        <input name="autoScroll" type="radio"  value="true" <c:if test="${subject.autoScroll!=null && subject.autoScroll}">checked</c:if>/>是&nbsp;
	        <input name="autoScroll" type="radio"  value="false" <c:if test="${subject.autoScroll!=null && !subject.autoScroll}">checked</c:if>/>否&nbsp;
	        &nbsp;&nbsp;
	        *开启后，当前试卷评完后，下份试卷自动定位到上份试卷的第一个轨迹点
	        </div>
		</div>
		<div class="control-group">
			<label class="control-label">自动对切题卡</label>
		    <div class="controls">
		    	<input name="enableSplit" type="radio" value="" <c:if test="${subject.enableSplit==null}">checked</c:if>/>设置以考试为准&nbsp;
		        <input name="enableSplit" type="radio" value="true"  <c:if test="${subject.enableSplit!=null && subject.enableSplit}">checked</c:if>/>是&nbsp;
		        <input name="enableSplit" type="radio" value="false" <c:if test="${subject.enableSplit!=null && !subject.enableSplit}">checked</c:if>/>否&nbsp;
		        &nbsp;&nbsp;
		        *选持自动对切题卡后，在阅卷端自动按照题卡的55%的比例进行对切，纸张大小A4时不生效
			</div>
		</div>
		<div class="form-actions">
			<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>
			<a href="javascript:" onclick="history.go(-1);" class="btn"/>返回</a>
		</div>
	</form:form>
<script type="text/javascript">
	$(document).ready(function() {
		//$("#name").focus();
		var pictureConfig = '${pictureConfig}';
		window.localStorage.setItem("pictureConfig",pictureConfig);
			
		$("#inputForm").validate({
			
			submitHandler: function(form){
				//alert("studentId="+$("#studentId").val()+" subjectCode="+$("#subjectCode").val());
				loading('正在提交，请稍等...');
				form.submit();
			},
			errorContainer: "#messageBox",
			errorPlacement: function(error, element) {
				$("#messageBox").text("输入有误，请先更正。");
				if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
					error.appendTo(element.parent().parent());
				} else {
					error.insertAfter(element);
				}
			}
		});
	});
</script>	
</body>
</html>
