<%@ 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" %>
	<script type="text/javascript">
		$(document).ready(function() {
			window.localStorage.removeItem("pictureConfig");
			$("#number").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					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);
					}
				}
			});
			$(".doubleDiv").hide();
			$("#openDouble").change(function() { 
				if ($("#openDouble").is(':checked')){
					$(".doubleDiv").show();
				}else{
					$(".doubleDiv").hide();
				}

			});
		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="##">新增大题</a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="group" action="${ctx}/admin/exam/group/insert" method="post" class="form-horizontal">
		<tags:message content="${message}"/>
		<form:hidden path="subjectCode"/>
        <div class="control-group">
            <label class="control-label">题号</label>
            <div class="controls">
                <form:input path="number" htmlEscape="false" maxlength="10" class="required"/>
            </div>
        </div>
		<div class="control-group">
			<label class="control-label">名称</label>
			<div class="controls">
				<form:input path="title" htmlEscape="false" maxlength="30" class="required"/>
			</div>
		</div>
        <div class="control-group">
            <label class="control-label">步骤分</label>
            <div class="controls">
                <form:input path="scoreList" htmlEscape="false" maxlength="100" class="required"/>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">图片显示</label>
            <div class="controls">
                <form:input path="picList" class="required" id="picList"  type="hidden"/>
                <a href="${ctx}/admin/exam/group/getPictureConfig?subjectCode=${group.subjectCode}&number=${group.number}" target="_blank" class="required" id= "configuration">设置</a>
            </div>
        </div>
		<div class="control-group">
            <label class="control-label">双评</label>
            <div class="controls">
                <input type="checkbox" id="openDouble">开启
            </div>
        </div>
        <div  class="doubleDiv">
        <div class="control-group">
            <label class="control-label">双评比例</label>
            <div class="controls">
                <form:input path="doubleRate" htmlEscape="false" maxlength="100" class="required" type="number"/>*比例范围为0-1
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">仲裁阀值</label>
            <div class="controls">
                <form:input path="arbitrateThreshold" htmlEscape="false" maxlength="100" class="required" type="number"/>*阈值为分数
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">合分策略</label>
            <div class="controls">
				<select name="scorePolicy">
	                <c:forEach items="${scorePolicyList}" var="item">
	                	 <option value="${item.value}" >${item.name}</option>
	                </c:forEach>
	            </select>
            </div>
        </div>
        </div>
        <div class="form-actions">
            <input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;
            <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
        </div>
	</form:form>
</body>
</html>
