Merge remote-tracking branch 'origin/master'

This commit is contained in:
zhujunjieit 2019-01-10 23:45:07 +08:00
commit f548eb7fa1
13 changed files with 279 additions and 362 deletions

View File

@ -59,8 +59,8 @@ spring:
# 文件上传
servlet:
multipart:
max-file-size: 30MB
max-request-size: 30MB
max-file-size: 300MB
max-request-size: 300MB
# 服务模块
devtools:
restart:

View File

@ -13,7 +13,23 @@
// 初始化表格参数
init: function(options) {
$.table._option = options;
$.table._params = $.common.isEmpty(options.queryParams) ? $.table.queryParams : options.queryParams;
//和search查询时条件保持一直
var currentId = $.common.isEmpty(options.formId) ? $('form').attr('id') : options.formId;
$.table._params = function(params) {
var search = {};
$.each($("#" + currentId).serializeArray(), function(i, field) {
search[field.name] = field.value;
});
search.pageSize = params.limit;
search.pageNum = params.offset / params.limit + 1;
search.searchValue = params.search;
search.orderByColumn = params.sort;
search.isAsc = params.order;
return search;
}
// $.table._params = $.common.isEmpty(options.queryParams) ? $.table.queryParams : options.queryParams;
_sortOrder = $.common.isEmpty(options.sortOrder) ? "asc" : options.sortOrder;
_sortName = $.common.isEmpty(options.sortName) ? "" : options.sortName;
_striped = $.common.isEmpty(options.striped) ? false : options.striped;

View File

@ -1,125 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="Spring" name="Spring">
<configuration />
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="ruoyi-framework" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.0.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.0.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.6" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.6" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.9.6" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.0.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:8.5.34" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:8.5.34" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:8.5.34" level="project" />
<orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.0.12.Final" level="project" />
<orderEntry type="library" name="Maven: javax.validation:validation-api:2.0.1.Final" level="project" />
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.3.2.Final" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.3.4" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:2.0.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.8.13" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.1.10" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:druid:1.1.10" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.0.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.github.penggle:kaptcha:2.3.2" level="project" />
<orderEntry type="library" name="Maven: com.jhlabs:filters:2.0.235-1" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-thymeleaf:2.0.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.thymeleaf:thymeleaf-spring5:3.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.thymeleaf:thymeleaf:3.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.attoparser:attoparser:2.0.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.unbescape:unbescape:1.1.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.thymeleaf.extras:thymeleaf-extras-java8time:3.0.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-core:1.4.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-lang:1.4.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-cache:1.4.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-crypto-hash:1.4.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-crypto-core:1.4.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-crypto-cipher:1.4.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-config-core:1.4.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-config-ogdl:1.4.0" level="project" />
<orderEntry type="library" name="Maven: commons-beanutils:commons-beanutils:1.9.3" level="project" />
<orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-event:1.4.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-spring:1.4.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-web:1.4.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-ehcache:1.4.0" level="project" />
<orderEntry type="library" name="Maven: net.sf.ehcache:ehcache-core:2.6.11" level="project" />
<orderEntry type="library" name="Maven: com.github.theborakompanioni:thymeleaf-extras-shiro:2.0.0" level="project" />
<orderEntry type="library" name="Maven: eu.bitwalker:UserAgentUtils:1.19" level="project" />
<orderEntry type="module" module-name="ruoyi-common" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.7" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.9.6" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.9.0" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.9.6" level="project" />
<orderEntry type="library" name="Maven: commons-io:commons-io:2.5" level="project" />
<orderEntry type="library" name="Maven: commons-fileupload:commons-fileupload:1.3.3" level="project" />
<orderEntry type="library" name="Maven: org.jsoup:jsoup:1.11.3" level="project" />
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml:3.17" level="project" />
<orderEntry type="library" name="Maven: org.apache.poi:poi:3.17" level="project" />
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.11" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml-schemas:3.17" level="project" />
<orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:2.6.0" level="project" />
<orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
<orderEntry type="library" name="Maven: com.github.virtuald:curvesapi:1.04" level="project" />
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.19" level="project" />
<orderEntry type="library" name="Maven: cn.hutool:hutool-all:4.2.1" level="project" />
<orderEntry type="library" name="Maven: tk.mybatis:mapper-spring-boot-starter:2.1.0" level="project" />
<orderEntry type="library" name="Maven: tk.mybatis:mapper-core:1.1.0" level="project" />
<orderEntry type="library" name="Maven: javax.persistence:persistence-api:1.0" level="project" />
<orderEntry type="library" name="Maven: tk.mybatis:mapper-base:1.1.0" level="project" />
<orderEntry type="library" name="Maven: tk.mybatis:mapper-weekend:1.1.4.2" level="project" />
<orderEntry type="library" name="Maven: tk.mybatis:mapper-spring:1.1.0" level="project" />
<orderEntry type="library" name="Maven: tk.mybatis:mapper-extra:1.1.0" level="project" />
<orderEntry type="library" name="Maven: tk.mybatis:mapper-spring-boot-autoconfigure:2.1.0" level="project" />
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.2.5" level="project" />
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.2.5" level="project" />
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.1.4" level="project" />
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:1.0" level="project" />
<orderEntry type="library" name="Maven: com.github.oshi:oshi-core:3.9.1" level="project" />
<orderEntry type="library" name="Maven: net.java.dev.jna:jna:4.5.2" level="project" />
<orderEntry type="library" name="Maven: net.java.dev.jna:jna-platform:4.5.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:1.3.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.0.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.0.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.0.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.10.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.10.0" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.25" level="project" />
<orderEntry type="library" name="Maven: javax.annotation:javax.annotation-api:1.3.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.0.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:2.7.9" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:1.3.2" level="project" />
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.4.6" level="project" />
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:1.3.2" level="project" />
<orderEntry type="library" name="Maven: mysql:mysql-connector-java:5.1.47" level="project" />
<orderEntry type="library" name="Maven: javax.servlet:javax.servlet-api:3.1.0" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.25" level="project" />
</component>
</module>

View File

@ -20,7 +20,7 @@ import java.util.*;
*/
@Api("练习")
@RestController
@RequestMapping("/api/v1/practice")
@RequestMapping("/api")
public class ApiPracticeController extends BaseController {
@Autowired
@ -36,82 +36,81 @@ public class ApiPracticeController extends BaseController {
private IExamUserErrorQuestionService examUserErrorQuestionService;
@GetMapping("/list")
@GetMapping("/v1/practice/list")
public AjaxResult list(ExamPractice examPractice) {
List<ExamPractice> list = examPracticeService.selectListFromWeb(examPractice);
AjaxResult success = success("查询成功");
success.put("data",list);
success.put("data", list);
return success;
}
/**
* 查询练习具体的问题列表
*
* @param map
* @return
*/
@GetMapping("/info")
public AjaxResult queryOne(@RequestParam Map<String,Object> map) {
@GetMapping("/v1/practice/info")
public AjaxResult queryOne(@RequestParam Map<String, Object> map) {
List<ExamQuestionVO> result = examQuestionService.selectQuestionListByPracticeId(map);
if(map.containsKey("disorder")&&map.get("disorder").toString().equals("1")){
if (map.containsKey("disorder") && map.get("disorder").toString().equals("1")) {
Collections.shuffle(result);
}
AjaxResult success = success("查询成功");
success.put("data",result);
success.put("data", result);
return success;
}
/**
* 回答问题
* @param answers
* 保存错题记录
*
* @param questionId
* @return
* @description 练习时答错题就保存到错题记录中
* 传入问题id
*/
@PostMapping("/answer")
public AjaxResult answer(@RequestBody List<Map<String,Object>> answers) {
int error = 0;
for (Map<String, Object> answer : answers) {
String questionId = answer.get("questionId").toString();
String userAnswer = answer.get("userAnswer").toString();
ExamQuestion examQuestion = examQuestionService.selectById(questionId);
if(!examQuestion.getAnswer().equals(userAnswer)){
ExamUserErrorQuestion examUserErrorQuestion = new ExamUserErrorQuestion();
examUserErrorQuestion.setExamQuestionId(Integer.parseInt(questionId));
examUserErrorQuestion.setVipUserId(Integer.parseInt(ShiroUtils.getUserId().toString()));
examUserErrorQuestion.setCreateBy(ShiroUtils.getLoginName());
examUserErrorQuestion.setCreateDate(new Date());
examUserErrorQuestion.setDelFlag("0");
examUserErrorQuestionService.insert(examUserErrorQuestion);
error++;
}
}
AjaxResult success = success(error+"题进入错题本");
@PostMapping("/v1/practice/answer")
public AjaxResult answer(String questionId) {
ExamUserErrorQuestion examUserErrorQuestion = new ExamUserErrorQuestion();
examUserErrorQuestion.setExamQuestionId(Integer.parseInt(questionId));
examUserErrorQuestion.setVipUserId(Integer.parseInt(ShiroUtils.getUserId().toString()));
examUserErrorQuestion.setCreateBy(ShiroUtils.getLoginName());
examUserErrorQuestion.setCreateDate(new Date());
examUserErrorQuestion.setDelFlag("0");
examUserErrorQuestionService.insert(examUserErrorQuestion);
AjaxResult success = success("插入错题本成功");
return success;
}
/**
* 查询错题本列表
* 查询我的错题列表
*
* @return
*/
@GetMapping("/queryerror")
public AjaxResult answer() {
@GetMapping("/v1/practice/{userId}/error")
public AjaxResult queryError(@PathVariable("userId") String userId) {
ExamUserErrorQuestion examUserErrorQuestion = new ExamUserErrorQuestion();
examUserErrorQuestion.setVipUserId(Integer.parseInt(ShiroUtils.getUserId().toString()));
List<ExamUserErrorQuestionVO> list = examUserErrorQuestionService.selectExamUserErrorQuestionDetailPage(examUserErrorQuestion);
AjaxResult success = success("查询成功");
success.put("data",list);
success.put("data", list);
return success;
}
/**
* 查询问题详情
* @param questionId
*
* @param id
* @return
*/
@GetMapping("/queryquestion/{id}")
public AjaxResult queryQuestion(@PathVariable("id") String questionId) {
ExamQuestionVO result = examQuestionService.selectQuestionDetail(questionId);
@GetMapping("/v1/practice/question/{id}")
public AjaxResult queryQuestion(@PathVariable("id") String id) {
ExamQuestionVO result = examQuestionService.selectQuestionDetail(id);
AjaxResult success = success("查询成功");
success.put("data",result);
success.put("data", result);
return success;
}

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>

View File

@ -65,7 +65,7 @@ public abstract class AbstractBaseServiceImpl<M extends MyMapper<T>, T> implemen
@Override
public int insertSelective(T entity) {
EntityUtils.setUpdatedInfo(entity);
EntityUtils.setCreateAndUpdateInfo(entity);
return mapper.insertSelective(entity);
}

View File

@ -97,7 +97,7 @@ public class FileUploadUtils {
FileUploadUtils.DEFAULT_FILE_NAME_LENGTH );
}
assertAllowed( file );
// assertAllowed( file );
String fileName = extension;
if(needDatePathAndRandomName){

View File

@ -55,9 +55,6 @@
<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="train:trainCourse:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="train:trainCourse:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" data-mobile-responsive="true"></table>

View File

@ -7,10 +7,10 @@
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-trainCourseSection-add">
<div class="form-group">
<label class="col-sm-3 control-label">课程ID</label>
<label class="col-sm-3 control-label">课程名称</label>
<div class="col-sm-8">
<input id="trainCourseId" name="trainCourseId" th:value="${trainCourse.id}" class="form-control" type="hidden">
<input th:value="${trainCourse.name}" class="form-control" type="text">
<input th:value="${trainCourse.name}" class="form-control" type="text" disabled="disabled">
</div>
</div>
<div class="form-group">

View File

@ -10,9 +10,9 @@
<input id="trainCourseId" name="trainCourseId" th:value="${trainCourse.id}" class="form-control" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">课程ID</label>
<label class="col-sm-3 control-label">课程名称</label>
<div class="col-sm-8">
<input th:value="${trainCourse.name}" class="form-control" type="text">
<input th:value="${trainCourse.name}" class="form-control" type="text" disabled="disabled">
</div>
</div>
<div class="form-group">

View File

@ -31,9 +31,6 @@
<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="train:trainCourseSection:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="train:trainCourseSection:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" data-mobile-responsive="true"></table>