考试增加考试类型

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 String name;
/**
* 考试类型(1-模拟考试2-正式考试)
*/
private String type;
/**
* 考试类型(1-模拟考试2-正式考试)
*/
private String type;
/** 是否控制开始结束时间0-不控制,1-控制) */
private String enableControlTime;
/** 开始时间 */

View File

@ -31,6 +31,16 @@
</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">
<label class="col-sm-3 control-label">是否控制开始结束时间:</label>

View File

@ -1,200 +1,223 @@
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-examExamination-edit" th:object="${examExamination}">
<input id="id" name="id" th:field="*{id}" type="hidden">
<input id="paperId" name="paperId" th:value="${examExamination.examPaperId}" type="hidden">
<div class="form-group">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-examExamination-edit" th:object="${examExamination}">
<input id="id" name="id" th:field="*{id}" type="hidden">
<input id="paperId" name="paperId" th:value="${examExamination.examPaperId}" type="hidden">
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">考试名称:</label>
<div class="col-sm-8">
<input id="name" name="name" th:field="*{name}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">考试名称:</label>
<div class="col-sm-8">
<input id="name" name="name" th:field="*{name}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">考试试卷:</label>
<div class="col-sm-3">
<input id="treeName" name="treeName" value="试卷分类" onclick="selectExamPaperCategoryTree()" class="form-control" type="text" readonly="true">
</div>
<div class="col-sm-5">
<select id="examPaperId" name="examPaperId" class="form-control m-b" >
<option value="">---请选择---</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">是否控制开始结束时间:</label>
<div class="form-group">
<label class="col-sm-3 control-label">考试试卷:</label>
<div class="col-sm-3">
<input id="treeName" name="treeName" value="试卷分类" onclick="selectExamPaperCategoryTree()"
class="form-control" type="text" readonly="true">
</div>
<div class="col-sm-5">
<select id="examPaperId" name="examPaperId" class="form-control m-b">
<option value="">---请选择---</option>
</select>
</div>
</div>
<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')}">
<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="startTime" name="startTime" th:field="*{startTime}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">结束时间:</label>
<div class="col-sm-8">
<input id="endTime" name="endTime" th:field="*{endTime}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">考试时长(分钟):</label>
<div class="col-sm-8">
<input id="timeLength" name="timeLength" th:field="*{timeLength}" class="form-control" type="text">
</div>
</div>
<!--<div class="form-group"> -->
<!--<label class="col-sm-3 control-label">考试次数:</label>-->
<!--<div class="col-sm-8">-->
<!--<input id="examNumber" name="examNumber" class="form-control" type="text">-->
<!--</div>-->
<!--</div>-->
<div class="form-group">
<label class="col-sm-3 control-label">及格分数:</label>
<div class="col-sm-8">
<input id="passMark" name="passMark" th:field="*{passMark}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">题目乱序:</label>
<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')}">
<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">
<select id="finishedPaper" name="finishedPaper" th:field="*{finishedPaper}" class="form-control m-b" th:with="type=${@dict.getType('exam_ination_finishedPaper')}">
<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">
<select id="examEnd" name="examEnd" class="form-control m-b" th:field="*{examEnd}" th:with="type=${@dict.getType('exam_ination_examEnd')}">
<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">
<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},
<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">
<label class="col-sm-3 control-label">是否控制开始结束时间:</label>
<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')}">
<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="startTime" name="startTime" th:field="*{startTime}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">结束时间:</label>
<div class="col-sm-8">
<input id="endTime" name="endTime" th:field="*{endTime}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">考试时长(分钟):</label>
<div class="col-sm-8">
<input id="timeLength" name="timeLength" th:field="*{timeLength}" class="form-control" type="text">
</div>
</div>
<!--<div class="form-group"> -->
<!--<label class="col-sm-3 control-label">考试次数:</label>-->
<!--<div class="col-sm-8">-->
<!--<input id="examNumber" name="examNumber" class="form-control" type="text">-->
<!--</div>-->
<!--</div>-->
<div class="form-group">
<label class="col-sm-3 control-label">及格分数:</label>
<div class="col-sm-8">
<input id="passMark" name="passMark" th:field="*{passMark}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">题目乱序:</label>
<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')}">
<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">
<select id="finishedPaper" name="finishedPaper" th:field="*{finishedPaper}" class="form-control m-b"
th:with="type=${@dict.getType('exam_ination_finishedPaper')}">
<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">
<select id="examEnd" name="examEnd" class="form-control m-b" th:field="*{examEnd}"
th:with="type=${@dict.getType('exam_ination_examEnd')}">
<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">
<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",
success: function(result) {
debugger
var id = $("#paperId").val();
$("#examPaperId").html("<option value=''>---请选择---</option>");
var rows =result.rows;
for(var i in rows){
$("#examPaperId").append("<option value='"+rows[i].id+"'>"+rows[i].name+"</option>");
}
$("#examPaperId").val(id);
success: function (result) {
debugger
var id = $("#paperId").val();
$("#examPaperId").html("<option value=''>---请选择---</option>");
var rows = result.rows;
for (var i in rows) {
$("#examPaperId").append("<option value='" + rows[i].id + "'>" + rows[i].name + "</option>");
}
};
$.ajax(config)
})
$("#form-examExamination-edit").validate({
rules:{
name:{
required:true,
},
examPaperId:{
required:true,
},
startTime:{
required:true,
},
endTime:{
required:true,
},
passMark:{
required:true,
},
timeLength:{
required:true
}
$("#examPaperId").val(id);
}
};
$.ajax(config)
})
$("#form-examExamination-edit").validate({
rules: {
name: {
required: true,
},
examPaperId: {
required: true,
},
startTime: {
required: true,
},
endTime: {
required: true,
},
passMark: {
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){
var body = layer.getChildFrame('body', index);
id = body.find('#treeId').val()
$("#treeName").val(body.find('#treeName').val());
layer.close(index);
function doSubmit(index, layero) {
var body = layer.getChildFrame('body', index);
id = body.find('#treeId').val()
$("#treeName").val(body.find('#treeName').val());
layer.close(index);
var config = {
url: ctx + "exam/examPaper"+ "/list",
type: "post",
dataType: "json",
data: {examPaperCategoryId:id},
var config = {
url: ctx + "exam/examPaper" + "/list",
type: "post",
dataType: "json",
data: {examPaperCategoryId: id},
// contentType:"application/json",
success: function(result) {
$("#examPaperId").html("<option>---请选择---</option>");
var rows =result.rows;
for(var i in rows){
$("#examPaperId").append("<option value='"+rows[i].id+"'>"+rows[i].name+"</option>");
}
success: function (result) {
$("#examPaperId").html("<option>---请选择---</option>");
var rows = result.rows;
for (var i in rows) {
$("#examPaperId").append("<option value='" + rows[i].id + "'>" + rows[i].name + "</option>");
}
};
$.ajax(config)
}
</script>
}
};
$.ajax(config)
}
</script>
</body>
</html>