考试增加考试类型

This commit is contained in:
flower 2019-01-10 23:16:59 +08:00
parent 414690c9bd
commit 1d2b1e62c4
3 changed files with 218 additions and 185 deletions

View File

@ -31,6 +31,16 @@
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-sm-3 control-label">考试类型</label>
<div class="col-sm-8">
<select id="type" name="type" class="form-control m-b" th:with="type=${@dict.getType('exam_ination_type')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">是否控制开始结束时间:</label> <label class="col-sm-3 control-label">是否控制开始结束时间:</label>

View File

@ -3,7 +3,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<head th:include="include :: header"></head> <head th:include="include :: header"></head>
<body class="white-bg"> <body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> <div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-examExamination-edit" th:object="${examExamination}"> <form class="form-horizontal m" id="form-examExamination-edit" th:object="${examExamination}">
<input id="id" name="id" th:field="*{id}" type="hidden"> <input id="id" name="id" th:field="*{id}" type="hidden">
<input id="paperId" name="paperId" th:value="${examExamination.examPaperId}" type="hidden"> <input id="paperId" name="paperId" th:value="${examExamination.examPaperId}" type="hidden">
@ -19,20 +19,34 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">考试试卷:</label> <label class="col-sm-3 control-label">考试试卷:</label>
<div class="col-sm-3"> <div class="col-sm-3">
<input id="treeName" name="treeName" value="试卷分类" onclick="selectExamPaperCategoryTree()" class="form-control" type="text" readonly="true"> <input id="treeName" name="treeName" value="试卷分类" onclick="selectExamPaperCategoryTree()"
class="form-control" type="text" readonly="true">
</div> </div>
<div class="col-sm-5"> <div class="col-sm-5">
<select id="examPaperId" name="examPaperId" class="form-control m-b" > <select id="examPaperId" name="examPaperId" class="form-control m-b">
<option value="">---请选择---</option> <option value="">---请选择---</option>
</select> </select>
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-sm-3 control-label">考试类型</label>
<div class="col-sm-8">
<select id="type" name="type" class="form-control m-b" th:field="*{type}" th:with="type=${@dict.getType('exam_ination_type')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">是否控制开始结束时间:</label> <label class="col-sm-3 control-label">是否控制开始结束时间:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select id="enableControlTime" name="enableControlTime" th:field="*{enableControlTime}" class="form-control m-b" th:with="type=${@dict.getType('exam_ination_enableControlTime')}"> <select id="enableControlTime" name="enableControlTime" th:field="*{enableControlTime}"
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> class="form-control m-b" th:with="type=${@dict.getType('exam_ination_enableControlTime')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select> </select>
</div> </div>
</div> </div>
@ -69,32 +83,41 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">题目乱序:</label> <label class="col-sm-3 control-label">题目乱序:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select id="questionDisorder" name="questionDisorder" th:field="*{questionDisorder}" class="form-control m-b" th:with="type=${@dict.getType('exam_ination_questionDisorder')}"> <select id="questionDisorder" name="questionDisorder" th:field="*{questionDisorder}"
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> class="form-control m-b" th:with="type=${@dict.getType('exam_ination_questionDisorder')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select> </select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">交卷后:</label> <label class="col-sm-3 control-label">交卷后:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select id="finishedPaper" name="finishedPaper" th:field="*{finishedPaper}" class="form-control m-b" th:with="type=${@dict.getType('exam_ination_finishedPaper')}"> <select id="finishedPaper" name="finishedPaper" th:field="*{finishedPaper}" class="form-control m-b"
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> th:with="type=${@dict.getType('exam_ination_finishedPaper')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select> </select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">考试结束后:</label> <label class="col-sm-3 control-label">考试结束后:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select id="examEnd" name="examEnd" class="form-control m-b" th:field="*{examEnd}" th:with="type=${@dict.getType('exam_ination_examEnd')}"> <select id="examEnd" name="examEnd" class="form-control m-b" th:field="*{examEnd}"
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> th:with="type=${@dict.getType('exam_ination_examEnd')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select> </select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">考试对象:</label> <label class="col-sm-3 control-label">考试对象:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select id="examinationUserLimit" name="examinationUserLimit" th:field="*{examinationUserLimit}" class="form-control m-b" th:with="type=${@dict.getType('exam_ination_examinationUserLimit')}"> <select id="examinationUserLimit" name="examinationUserLimit" th:field="*{examinationUserLimit}"
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> class="form-control m-b"
th:with="type=${@dict.getType('exam_ination_examinationUserLimit')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select> </select>
</div> </div>
</div> </div>
@ -105,24 +128,24 @@
</div> </div>
</div> </div>
</form> </form>
</div> </div>
<div th:include="include::footer"></div> <div th:include="include::footer"></div>
<script type="text/javascript"> <script type="text/javascript">
var prefix = ctx + "exam/examExamination" var prefix = ctx + "exam/examExamination"
$(function () { $(function () {
var config = { var config = {
url: ctx + "exam/examPaper"+ "/list", url: ctx + "exam/examPaper" + "/list",
type: "post", type: "post",
dataType: "json", dataType: "json",
data: {examPaperCategoryId:1}, data: {examPaperCategoryId: 1},
// contentType:"application/json", // contentType:"application/json",
success: function(result) { success: function (result) {
debugger debugger
var id = $("#paperId").val(); var id = $("#paperId").val();
$("#examPaperId").html("<option value=''>---请选择---</option>"); $("#examPaperId").html("<option value=''>---请选择---</option>");
var rows =result.rows; var rows = result.rows;
for(var i in rows){ for (var i in rows) {
$("#examPaperId").append("<option value='"+rows[i].id+"'>"+rows[i].name+"</option>"); $("#examPaperId").append("<option value='" + rows[i].id + "'>" + rows[i].name + "</option>");
} }
$("#examPaperId").val(id); $("#examPaperId").val(id);
} }
@ -132,24 +155,24 @@
$("#form-examExamination-edit").validate({ $("#form-examExamination-edit").validate({
rules:{ rules: {
name:{ name: {
required:true, required: true,
}, },
examPaperId:{ examPaperId: {
required:true, required: true,
}, },
startTime:{ startTime: {
required:true, required: true,
}, },
endTime:{ endTime: {
required:true, required: true,
}, },
passMark:{ passMark: {
required:true, required: true,
}, },
timeLength:{ timeLength: {
required:true required: true
} }
} }
@ -166,35 +189,35 @@
var options = { var options = {
title: '分类选择', title: '分类选择',
width: "380", width: "380",
url: ctx + "exam/examPaperCategory" + "/selectExamPaperCategoryTree/"+id, url: ctx + "exam/examPaperCategory" + "/selectExamPaperCategoryTree/" + id,
callBack: doSubmit callBack: doSubmit
}; };
$.modal.openOptions(options); $.modal.openOptions(options);
} }
function doSubmit(index, layero){ function doSubmit(index, layero) {
var body = layer.getChildFrame('body', index); var body = layer.getChildFrame('body', index);
id = body.find('#treeId').val() id = body.find('#treeId').val()
$("#treeName").val(body.find('#treeName').val()); $("#treeName").val(body.find('#treeName').val());
layer.close(index); layer.close(index);
var config = { var config = {
url: ctx + "exam/examPaper"+ "/list", url: ctx + "exam/examPaper" + "/list",
type: "post", type: "post",
dataType: "json", dataType: "json",
data: {examPaperCategoryId:id}, data: {examPaperCategoryId: id},
// contentType:"application/json", // contentType:"application/json",
success: function(result) { success: function (result) {
$("#examPaperId").html("<option>---请选择---</option>"); $("#examPaperId").html("<option>---请选择---</option>");
var rows =result.rows; var rows = result.rows;
for(var i in rows){ for (var i in rows) {
$("#examPaperId").append("<option value='"+rows[i].id+"'>"+rows[i].name+"</option>"); $("#examPaperId").append("<option value='" + rows[i].id + "'>" + rows[i].name + "</option>");
} }
} }
}; };
$.ajax(config) $.ajax(config)
} }
</script> </script>
</body> </body>
</html> </html>