考试增加考试类型

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

@ -25,10 +25,10 @@ private static final long serialVersionUID = 1L;
private Integer examPaperId; private Integer examPaperId;
/** 试卷名称 */ /** 试卷名称 */
private String name; private String name;
/** /**
* 考试类型(1-模拟考试2-正式考试) * 考试类型(1-模拟考试2-正式考试)
*/ */
private String type; private String type;
/** 是否控制开始结束时间0-不控制,1-控制) */ /** 是否控制开始结束时间0-不控制,1-控制) */
private String enableControlTime; private String enableControlTime;
/** 开始时间 */ /** 开始时间 */

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

@ -1,200 +1,223 @@
<!DOCTYPE HTML> <!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org"> <html lang="zh" xmlns:th="http://www.thymeleaf.org">
<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">
<div class="form-group"> <div class="form-group">
<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">
<input id="name" name="name" th:field="*{name}" class="form-control" type="text"> <input id="name" name="name" th:field="*{name}" class="form-control" type="text">
</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-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()"
</div> class="form-control" type="text" readonly="true">
<div class="col-sm-5"> </div>
<select id="examPaperId" name="examPaperId" class="form-control m-b" > <div class="col-sm-5">
<option value="">---请选择---</option> <select id="examPaperId" name="examPaperId" class="form-control m-b">
</select> <option value="">---请选择---</option>
</div> </select>
</div> </div>
<div class="form-group"> </div>
<label class="col-sm-3 control-label">是否控制开始结束时间:</label>
<div class="col-sm-8"> <div class="form-group">
<select id="enableControlTime" name="enableControlTime" th:field="*{enableControlTime}" class="form-control m-b" th:with="type=${@dict.getType('exam_ination_enableControlTime')}"> <label class="col-sm-3 control-label">考试类型</label>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select> <div class="col-sm-8">
</div> <select id="type" name="type" class="form-control m-b" th:field="*{type}" th:with="type=${@dict.getType('exam_ination_type')}">
</div> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
<div class="form-group"> </select>
<label class="col-sm-3 control-label">开始时间:</label> </div>
<div class="col-sm-8"> </div>
<input id="startTime" name="startTime" th:field="*{startTime}" class="form-control" type="text">
</div> <div class="form-group">
</div> <label class="col-sm-3 control-label">是否控制开始结束时间:</label>
<div class="form-group">
<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}"
<input id="endTime" name="endTime" th:field="*{endTime}" class="form-control" type="text"> class="form-control m-b" th:with="type=${@dict.getType('exam_ination_enableControlTime')}">
</div> <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
</div> th:value="${dict.dictValue}"></option>
<div class="form-group"> </select>
<label class="col-sm-3 control-label">考试时长(分钟):</label> </div>
<div class="col-sm-8"> </div>
<input id="timeLength" name="timeLength" th:field="*{timeLength}" class="form-control" type="text"> <div class="form-group">
</div> <label class="col-sm-3 control-label">开始时间:</label>
</div> <div class="col-sm-8">
<!--<div class="form-group"> --> <input id="startTime" name="startTime" th:field="*{startTime}" class="form-control" type="text">
<!--<label class="col-sm-3 control-label">考试次数:</label>--> </div>
<!--<div class="col-sm-8">--> </div>
<!--<input id="examNumber" name="examNumber" class="form-control" type="text">--> <div class="form-group">
<!--</div>--> <label class="col-sm-3 control-label">结束时间:</label>
<!--</div>--> <div class="col-sm-8">
<div class="form-group"> <input id="endTime" name="endTime" th:field="*{endTime}" class="form-control" type="text">
<label class="col-sm-3 control-label">及格分数:</label> </div>
<div class="col-sm-8"> </div>
<input id="passMark" name="passMark" th:field="*{passMark}" class="form-control" type="text"> <div class="form-group">
</div> <label class="col-sm-3 control-label">考试时长(分钟):</label>
</div> <div class="col-sm-8">
<div class="form-group"> <input id="timeLength" name="timeLength" th:field="*{timeLength}" class="form-control" type="text">
<label class="col-sm-3 control-label">题目乱序:</label> </div>
<div class="col-sm-8"> </div>
<select id="questionDisorder" name="questionDisorder" th:field="*{questionDisorder}" class="form-control m-b" th:with="type=${@dict.getType('exam_ination_questionDisorder')}"> <!--<div class="form-group"> -->
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> <!--<label class="col-sm-3 control-label">考试次数:</label>-->
</select> <!--<div class="col-sm-8">-->
</div> <!--<input id="examNumber" name="examNumber" class="form-control" type="text">-->
</div> <!--</div>-->
<div class="form-group"> <!--</div>-->
<label class="col-sm-3 control-label">交卷后:</label> <div class="form-group">
<div class="col-sm-8"> <label class="col-sm-3 control-label">及格分数:</label>
<select id="finishedPaper" name="finishedPaper" th:field="*{finishedPaper}" class="form-control m-b" th:with="type=${@dict.getType('exam_ination_finishedPaper')}"> <div class="col-sm-8">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> <input id="passMark" name="passMark" th:field="*{passMark}" class="form-control" type="text">
</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="questionDisorder" name="questionDisorder" th:field="*{questionDisorder}"
<select id="examEnd" name="examEnd" class="form-control m-b" th:field="*{examEnd}" th:with="type=${@dict.getType('exam_ination_examEnd')}"> 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> <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
</select> th:value="${dict.dictValue}"></option>
</div> </select>
</div> </div>
<div class="form-group"> </div>
<label class="col-sm-3 control-label">考试对象:</label> <div class="form-group">
<div class="col-sm-8"> <label class="col-sm-3 control-label">交卷后:</label>
<select id="examinationUserLimit" name="examinationUserLimit" th:field="*{examinationUserLimit}" class="form-control m-b" th:with="type=${@dict.getType('exam_ination_examinationUserLimit')}"> <div class="col-sm-8">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> <select id="finishedPaper" name="finishedPaper" th:field="*{finishedPaper}" class="form-control m-b"
</select> th:with="type=${@dict.getType('exam_ination_finishedPaper')}">
</div> <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
</div> th:value="${dict.dictValue}"></option>
<div class="form-group"> </select>
<label class="col-sm-3 control-label">考试说明:</label> </div>
<div class="col-sm-8"> </div>
<input id="remarks" name="remarks" th:field="*{remarks}" class="form-control" type="text"> <div class="form-group">
</div> <label class="col-sm-3 control-label">考试结束后:</label>
</div> <div class="col-sm-8">
</form> <select id="examEnd" name="examEnd" class="form-control m-b" th:field="*{examEnd}"
</div> th:with="type=${@dict.getType('exam_ination_examEnd')}">
<div th:include="include::footer"></div> <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
<script type="text/javascript"> th:value="${dict.dictValue}"></option>
var prefix = ctx + "exam/examExamination" </select>
$(function () { </div>
var config = { </div>
url: ctx + "exam/examPaper"+ "/list", <div class="form-group">
type: "post", <label class="col-sm-3 control-label">考试对象:</label>
dataType: "json", <div class="col-sm-8">
data: {examPaperCategoryId:1}, <select id="examinationUserLimit" name="examinationUserLimit" th:field="*{examinationUserLimit}"
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>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">考试说明:</label>
<div class="col-sm-8">
<input id="remarks" name="remarks" th:field="*{remarks}" class="form-control" type="text">
</div>
</div>
</form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
var prefix = ctx + "exam/examExamination"
$(function () {
var config = {
url: ctx + "exam/examPaper" + "/list",
type: "post",
dataType: "json",
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);
$.ajax(config) }
}) };
$.ajax(config)
})
$("#form-examExamination-edit").validate({
rules:{
name:{ $("#form-examExamination-edit").validate({
required:true, rules: {
}, name: {
examPaperId:{ required: true,
required:true, },
}, examPaperId: {
startTime:{ required: true,
required:true, },
}, startTime: {
endTime:{ required: true,
required:true, },
}, endTime: {
passMark:{ required: true,
required:true, },
}, passMark: {
timeLength:{ required: true,
required:true },
} timeLength: {
required: true
} }
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-examExamination-edit').serialize());
}
}
var id = 1;
function selectExamPaperCategoryTree() {
var options = {
title: '分类选择',
width: "380",
url: ctx + "exam/examPaperCategory" + "/selectExamPaperCategoryTree/"+id,
callBack: doSubmit
};
$.modal.openOptions(options);
} }
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-examExamination-edit').serialize());
}
}
var id = 1;
function selectExamPaperCategoryTree() {
var options = {
title: '分类选择',
width: "380",
url: ctx + "exam/examPaperCategory" + "/selectExamPaperCategoryTree/" + id,
callBack: doSubmit
};
$.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>