From a068d0a086bcd6a0c01cdcd5854b6312f1f5c936 Mon Sep 17 00:00:00 2001 From: shijie <648688341@qq.com> Date: Mon, 31 Aug 2020 16:56:54 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=B5=8B=E8=AF=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/EvaluationRecordControllerApi.java | 76 ++++ .../msdw/tms/api/QuestionsControllerApi.java | 12 - .../com/msdw/tms/common/utils/Constant.java | 89 ++++- .../EvaluationRecordController.java | 108 ++++++ .../tms/controller/QuestionsController.java | 14 - .../msdw/tms/dao/EvaluationQuestionDao.java | 31 ++ .../com/msdw/tms/dao/EvaluationRecordDao.java | 22 ++ .../java/com/msdw/tms/dao/QuestionsDao.java | 4 + .../tms/entity/EvaluationQuestionEntity.java | 59 +++ .../tms/entity/EvaluationRecordEntity.java | 52 +++ .../msdw/tms/entity/response/CommonCode.java | 1 + .../tms/entity/vo/EvaluationDetailVO.java | 40 +++ .../tms/entity/vo/EvaluationQuestionVO.java | 38 ++ .../entity/vo/EvaluationRecordDetailVO.java | 25 ++ .../entity/vo/EvaluationRecordSubmitVO.java | 44 +++ .../tms/entity/vo/EvaluationRecordVO.java | 72 ++++ .../com/msdw/tms/entity/vo/EvaluationVO.java | 2 +- .../service/EvaluationQuestionService.java | 18 + .../tms/service/EvaluationRecordService.java | 40 +++ .../msdw/tms/service/QuestionsService.java | 2 +- .../impl/EvaluationQuestionServiceImpl.java | 18 + .../impl/EvaluationRecordServiceImpl.java | 338 ++++++++++++++++++ .../impl/EvaluationRulesServiceImpl.java | 8 + .../service/impl/QuestionsServiceImpl.java | 84 +++-- .../试题导入失败数据导出模板.xlsx | Bin 10178 -> 10358 bytes .../mapper/tms/EvaluationQuestionDao.xml | 108 ++++++ .../mapper/tms/EvaluationRecordDao.xml | 47 +++ .../resources/mapper/tms/QuestionsDao.xml | 14 + src/main/resources/sql/data.sql | 36 +- .../com/msdw/tms/TmsApplicationTests.java | 30 ++ .../service/EvaluationRecordServiceTest.java | 31 ++ .../tms/service/QuestionsServiceTest.java | 12 +- 32 files changed, 1391 insertions(+), 84 deletions(-) create mode 100644 src/main/java/com/msdw/tms/api/EvaluationRecordControllerApi.java create mode 100644 src/main/java/com/msdw/tms/controller/EvaluationRecordController.java create mode 100644 src/main/java/com/msdw/tms/dao/EvaluationQuestionDao.java create mode 100644 src/main/java/com/msdw/tms/dao/EvaluationRecordDao.java create mode 100644 src/main/java/com/msdw/tms/entity/EvaluationQuestionEntity.java create mode 100644 src/main/java/com/msdw/tms/entity/EvaluationRecordEntity.java create mode 100644 src/main/java/com/msdw/tms/entity/vo/EvaluationDetailVO.java create mode 100644 src/main/java/com/msdw/tms/entity/vo/EvaluationQuestionVO.java create mode 100644 src/main/java/com/msdw/tms/entity/vo/EvaluationRecordDetailVO.java create mode 100644 src/main/java/com/msdw/tms/entity/vo/EvaluationRecordSubmitVO.java create mode 100644 src/main/java/com/msdw/tms/entity/vo/EvaluationRecordVO.java create mode 100644 src/main/java/com/msdw/tms/service/EvaluationQuestionService.java create mode 100644 src/main/java/com/msdw/tms/service/EvaluationRecordService.java create mode 100644 src/main/java/com/msdw/tms/service/impl/EvaluationQuestionServiceImpl.java create mode 100644 src/main/java/com/msdw/tms/service/impl/EvaluationRecordServiceImpl.java create mode 100644 src/main/resources/mapper/tms/EvaluationQuestionDao.xml create mode 100644 src/main/resources/mapper/tms/EvaluationRecordDao.xml create mode 100644 src/test/java/com/msdw/tms/service/EvaluationRecordServiceTest.java diff --git a/src/main/java/com/msdw/tms/api/EvaluationRecordControllerApi.java b/src/main/java/com/msdw/tms/api/EvaluationRecordControllerApi.java new file mode 100644 index 0000000..9e97f95 --- /dev/null +++ b/src/main/java/com/msdw/tms/api/EvaluationRecordControllerApi.java @@ -0,0 +1,76 @@ +package com.msdw.tms.api; + +import com.msdw.tms.common.utils.R; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; + + +/** + * 记录用户测评信息 + * + * @author gongsj + * @email gongsj@gmail.com + * @date 2020-08-28 10:15:48 + */ +@Api(value = "用户测评信息记录与操作", tags = "提供用户测评信息增删改查等相关方法") +public interface EvaluationRecordControllerApi { +// /** +// * 查询是否有为作完的测评 +// */ +// @ApiOperation(value = "查询是否有为作完的测评", notes = "查询是否有为作完的测评") +// R hasNotMadeEvaluation(Integer userId); + +// /** +// * 清空倒计时 +// */ +// @ApiOperation(value = "清空倒计时", notes = "清空倒计时") +// R cleanRemainingTime(Integer userId); + + /** + * 获取测评剩余时间 + */ + @ApiOperation(value = "获取测评剩余时间", notes = "获取测评剩余时间") + R getEvaluationRemainingTime(Integer userId); + + /** + * 开始测评,返回第一题的数据 + */ + @ApiOperation(value = "开始测评", notes = "开始测评") + R startEvaluation(Integer userId); + + /** + * 上一题 + */ + @ApiOperation(value = "上一题", notes = "上一题") + R previousQuestion(Integer evaluationRecordId, Integer currentQuestionSortNo, String userAnswer); + + /** + * 下一题 + */ + @ApiOperation(value = "下一题", notes = "下一题") + R nextQuestion(Integer evaluationRecordId, Integer currentQuestionSortNo, String userAnswer); + + /** + * 提交之前查询是否还有未做完的试题 + */ + @ApiOperation(value = "提交之前查询是否还有未做完的试题", notes = "提交之前查询是否还有未做完的试题") + R selectNotMade(Integer evaluationRecordId); + + /** + * 提交测评 + */ + @ApiOperation(value = "提交测评", notes = "提交测评") + R submitEvaluation(Integer evaluationRecordId, Integer currentQuestionSortNo, String userAnswer, Integer userId); + + /** + * 成绩详情 + */ + @ApiOperation(value = "成绩详情", notes = "成绩详情") + R evaluationScoreDetail(Integer evaluationRecordId); + + /** + * 查询是否能够开启实验 + */ + @ApiOperation(value = "查询是否能够开启实验", notes = "查询是否能够开启实验") + R isOpenExperiment(Integer userId); +} diff --git a/src/main/java/com/msdw/tms/api/QuestionsControllerApi.java b/src/main/java/com/msdw/tms/api/QuestionsControllerApi.java index 7ebee11..bc234ab 100644 --- a/src/main/java/com/msdw/tms/api/QuestionsControllerApi.java +++ b/src/main/java/com/msdw/tms/api/QuestionsControllerApi.java @@ -77,18 +77,6 @@ public interface QuestionsControllerApi { @ApiOperation(value = "excel模板文件下载", notes = "excel模板文件下载") R downloadFiles(HttpServletResponse response) throws IOException; - /** - * 抽题测评 - */ - @ApiOperation(value = "抽题测评", notes = "抽题测评") - R evaluation (); - - /** - * 抽题测评 - */ - @ApiOperation(value = "获取测评剩余时间", notes = "获取测评剩余时间") - R getEvaluationRemainingTime (Integer userId); - /** * 通过excel批量导出 */ diff --git a/src/main/java/com/msdw/tms/common/utils/Constant.java b/src/main/java/com/msdw/tms/common/utils/Constant.java index bd399bf..96214b0 100644 --- a/src/main/java/com/msdw/tms/common/utils/Constant.java +++ b/src/main/java/com/msdw/tms/common/utils/Constant.java @@ -98,6 +98,19 @@ public class Constant { * excel后缀 */ public static final String EXCEL_SUFFIX = ".xlsx"; + /** + * 测评总分 + */ + public static final int EVALUATION_SCORE = 100; + /** + * 及格分数 + */ + public static final int PASSING_SCORE = 60; + /** + * 测评是否通过 1、通过/0、未通过 + */ + public static final String EVALUATIONN_PASSED = "通过"; + public static final String EVALUATIONN_NOT_PASSED = "未通过"; /** * 菜单类型 * @@ -270,11 +283,11 @@ public class Constant { /** * 随机 */ - RANDOM(0, "随机"), + RANDOM(1, "随机"), /** * 自定义 */ - CUSTOMIZE(1, "自定义"); + CUSTOMIZE(0, "自定义"); private Integer type; //类型 private String desc; //描述 @@ -345,7 +358,7 @@ public class Constant { } /** - * 项目是否提交 + * 项目是否提交1:已提交/0:未提交 */ public enum Submit { @@ -361,8 +374,6 @@ public class Constant { this.desc = desc; } - ; - public Integer getType() { return type; } @@ -391,7 +402,73 @@ public class Constant { Ascription(Integer type, String desc) { this.type = type; this.desc = desc; - }; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + } + + /** + * 当前题目答案是否正确 1、正确/0、错误 + */ + public enum QuestionIsTure { + + TRUE(1, "正确"), + FALSE(0, "错误"); + + private Integer type; + private String desc; + + QuestionIsTure(Integer type, String desc) { + this.type = type; + this.desc = desc; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + } + + /** + * 当前题目状态 1、已作/0、未作 + */ + public enum QuestionStatus { + + MADE(1, "已作"), + NOT_MADE(0, "未作"); + + private Integer type; + private String desc; + + QuestionStatus(Integer type, String desc) { + this.type = type; + this.desc = desc; + } public Integer getType() { return type; diff --git a/src/main/java/com/msdw/tms/controller/EvaluationRecordController.java b/src/main/java/com/msdw/tms/controller/EvaluationRecordController.java new file mode 100644 index 0000000..282010a --- /dev/null +++ b/src/main/java/com/msdw/tms/controller/EvaluationRecordController.java @@ -0,0 +1,108 @@ +package com.msdw.tms.controller; + +import com.msdw.tms.api.EvaluationRecordControllerApi; +import com.msdw.tms.common.utils.R; +import com.msdw.tms.entity.vo.EvaluationRecordDetailVO; +import com.msdw.tms.entity.vo.EvaluationRecordSubmitVO; +import com.msdw.tms.entity.vo.EvaluationRecordVO; +import com.msdw.tms.service.EvaluationRecordService; +import com.msdw.tms.service.QuestionsService; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; + + +/** + * 记录用户测评信息 + * + * @author gongsj + * @email gongsj@gmail.com + * @date 2020-08-28 10:15:48 + */ +@RestController +@RequestMapping("tms/evaluationrecord") +public class EvaluationRecordController implements EvaluationRecordControllerApi { + @Resource + private EvaluationRecordService evaluationRecordService; + + @Resource + private QuestionsService questionsService; + +// @Override +// @GetMapping("/has_notmade") +// public R hasNotMadeEvaluation(Integer userId) { +// boolean b = evaluationRecordService.hasNotMadeEvaluation(userId); +// return R.ok().put("data", b); +// } + +// @Override +// @GetMapping("/clean_time") +// public R cleanRemainingTime(Integer userId) { +// evaluationRecordService.cleanRemainingTime(userId); +// return R.ok(); +// } + + @Override + @GetMapping("/remaining") + public R getEvaluationRemainingTime(Integer userId) { + String remainingTime = questionsService.getEvaluationRemainingTime(userId); + return R.ok().put("data", remainingTime); + } + + @Override + @GetMapping("/start") + public R startEvaluation(@RequestParam(value = "userId") Integer userId) { + EvaluationRecordVO evaluationRecordVO = evaluationRecordService.startEvaluation(userId); + return R.ok().put("data", evaluationRecordVO); + } + + @Override + @PostMapping("/previous") + public R previousQuestion(@RequestParam("evaluationRecordId") Integer evaluationRecordId, + @RequestParam("currentQuestionSortNo") Integer currentQuestionSortNo, + @RequestParam(value = "userAnswer", required = false) String userAnswer) { + EvaluationRecordVO evaluationRecordVO = evaluationRecordService.convertQuestion(evaluationRecordId, currentQuestionSortNo, userAnswer, currentQuestionSortNo - 1); + return R.ok().put("data", evaluationRecordVO); + } + + @Override + @PostMapping("/next") + public R nextQuestion(@RequestParam("evaluationRecordId") Integer evaluationRecordId, + @RequestParam("currentQuestionSortNo") Integer currentQuestionSortNo, + @RequestParam(value = "userAnswer", required = false) String userAnswer) { + EvaluationRecordVO evaluationRecordVO = evaluationRecordService.convertQuestion(evaluationRecordId, currentQuestionSortNo, userAnswer, currentQuestionSortNo + 1); + return R.ok().put("data", evaluationRecordVO); + } + + @Override + @GetMapping("/not_made") + public R selectNotMade(@RequestParam("evaluationRecordId") Integer evaluationRecordId) { + String result = evaluationRecordService.selectNotMade(evaluationRecordId); + return R.ok().put("data", result); + } + + @Override + @PostMapping("/submit") + public R submitEvaluation(@RequestParam("evaluationRecordId") Integer evaluationRecordId, + @RequestParam("currentQuestionSortNo") Integer currentQuestionSortNo, + @RequestParam(value = "userAnswer", required = false) String userAnswer, + @RequestParam("userId") Integer userId) { + EvaluationRecordSubmitVO recordSubmitVO = evaluationRecordService.submitEvaluation(evaluationRecordId, currentQuestionSortNo, userAnswer, userId); + return R.ok().put("data", recordSubmitVO); + } + + @Override + @GetMapping("/detail") + public R evaluationScoreDetail(Integer evaluationRecordId) { + EvaluationRecordDetailVO detailVO = evaluationRecordService.evaluationDetail(evaluationRecordId); + return R.ok().put("data", detailVO); + } + + @Override + @GetMapping("/can_experiment") + public R isOpenExperiment(Integer userId) { + boolean openExperiment = evaluationRecordService.isOpenExperiment(userId); + return R.ok().put("data", openExperiment); + } + +} diff --git a/src/main/java/com/msdw/tms/controller/QuestionsController.java b/src/main/java/com/msdw/tms/controller/QuestionsController.java index 73f515d..f4c0cef 100644 --- a/src/main/java/com/msdw/tms/controller/QuestionsController.java +++ b/src/main/java/com/msdw/tms/controller/QuestionsController.java @@ -144,20 +144,6 @@ public class QuestionsController implements QuestionsControllerApi { return R.ok(); } - @Override - @GetMapping("/evaluation") - public R evaluation() { - EvaluationVO evaluation = questionsService.evaluation(); - return R.ok().put("data", evaluation); - } - - @Override - @GetMapping("/remaining") - public R getEvaluationRemainingTime(Integer userId) { - String remainingTime = questionsService.getEvaluationRemainingTime(userId); - return R.ok().put("data", remainingTime); - } - @Override @GetMapping("/export") public void exportQuestion(HttpServletResponse response) throws Exception { diff --git a/src/main/java/com/msdw/tms/dao/EvaluationQuestionDao.java b/src/main/java/com/msdw/tms/dao/EvaluationQuestionDao.java new file mode 100644 index 0000000..8387ff1 --- /dev/null +++ b/src/main/java/com/msdw/tms/dao/EvaluationQuestionDao.java @@ -0,0 +1,31 @@ +package com.msdw.tms.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.msdw.tms.entity.EvaluationQuestionEntity; +import com.msdw.tms.entity.vo.EvaluationDetailVO; +import com.msdw.tms.entity.vo.EvaluationQuestionVO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 测评试题表,记录每次测评的试题,与测评记录表相关联 + * + * @author gongsj + * @email gongsj@gmail.com + * @date 2020-08-28 10:15:49 + */ +@Mapper +public interface EvaluationQuestionDao extends BaseMapper { + int updateById(EvaluationQuestionEntity evaluationQuestion); + + EvaluationQuestionVO selectByInfo(@Param("evaluationRecordId") Integer evaluationRecordId, + @Param("questionSortNo") Integer questionSortNo); + + List selectDetailByInfo(@Param("evaluationRecordId") Integer evaluationRecordId); + + int sumScore(@Param("evaluationRecordId") Integer evaluationRecordId); + + List sumScoreListByUserId(@Param("userId") Integer userId); +} diff --git a/src/main/java/com/msdw/tms/dao/EvaluationRecordDao.java b/src/main/java/com/msdw/tms/dao/EvaluationRecordDao.java new file mode 100644 index 0000000..42acc4a --- /dev/null +++ b/src/main/java/com/msdw/tms/dao/EvaluationRecordDao.java @@ -0,0 +1,22 @@ +package com.msdw.tms.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.msdw.tms.entity.EvaluationRecordEntity; +import com.msdw.tms.entity.vo.EvaluationRecordVO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 记录用户测评信息 + * + * @author gongsj + * @email gongsj@gmail.com + * @date 2020-08-28 10:15:48 + */ +@Mapper +public interface EvaluationRecordDao extends BaseMapper { + EvaluationRecordVO selectVOByInfo(@Param("evaluationRecordId") Integer evaluationRecordId, + @Param("questionSortNo") Integer questionSortNo); +} diff --git a/src/main/java/com/msdw/tms/dao/QuestionsDao.java b/src/main/java/com/msdw/tms/dao/QuestionsDao.java index 036c9e6..7f8c369 100644 --- a/src/main/java/com/msdw/tms/dao/QuestionsDao.java +++ b/src/main/java/com/msdw/tms/dao/QuestionsDao.java @@ -3,6 +3,9 @@ package com.msdw.tms.dao; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.msdw.tms.entity.QuestionsEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 记录试题信息 @@ -13,4 +16,5 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface QuestionsDao extends BaseMapper { + List selectIds(@Param("questionType") Integer questionType); } diff --git a/src/main/java/com/msdw/tms/entity/EvaluationQuestionEntity.java b/src/main/java/com/msdw/tms/entity/EvaluationQuestionEntity.java new file mode 100644 index 0000000..e69c1ee --- /dev/null +++ b/src/main/java/com/msdw/tms/entity/EvaluationQuestionEntity.java @@ -0,0 +1,59 @@ +package com.msdw.tms.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; + +/** + * 测评试题表,记录每次测评的试题,与测评记录表相关联 + * + * @author gongsj + * @email gongsj@gmail.com + * @date 2020-08-28 10:15:49 + */ +@Data +@TableName("tms_evaluation_question") +public class EvaluationQuestionEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 自增主键 + */ + @TableId + private Integer id; + /** + * 测评记录表id + */ + private Integer evaluationRecordId; + /** + * 试题id + */ + private Integer questionId; + /** + * 试题顺序号 + */ + private Integer questionSortNo; + /** + * 试题状态:是否已被作过:1、已作/0、未作 + */ + private Integer questionStatus; + /** + * 用户填写的答案 + */ + private String userAnswer; + /** + * 是否正确:1、正确/0、错误 + */ + private Integer isTure; + /** + * 试题分值 + */ + private Integer questionPoints; + /** + * 试题得分 + */ + private Integer questionScore; + +} diff --git a/src/main/java/com/msdw/tms/entity/EvaluationRecordEntity.java b/src/main/java/com/msdw/tms/entity/EvaluationRecordEntity.java new file mode 100644 index 0000000..d234793 --- /dev/null +++ b/src/main/java/com/msdw/tms/entity/EvaluationRecordEntity.java @@ -0,0 +1,52 @@ +package com.msdw.tms.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 记录用户测评信息 + * + * @author gongsj + * @email gongsj@gmail.com + * @date 2020-08-28 10:15:48 + */ +@Data +@TableName("tms_evaluation_record") +public class EvaluationRecordEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 自增主键 + */ + @TableId + private Integer id; + /** + * 当前测评的用户的id + */ + private Integer userId; + /** + * 记录当前做到第几题,用于刷新页面以后保持在当前题目,默认开始时是第一题 + */ + private Integer currentQuestionSortNo; + /** + * 总题目数量 + */ + private Integer totalQuestionNum; + /** + * 当前测评状态:1:已提交/0:未提交 + */ + private Integer evaluationStatus; + /** + * 开始时间 + */ + private Date startTime; + /** + * 提交时间 + */ + private Date submitTime; + +} diff --git a/src/main/java/com/msdw/tms/entity/response/CommonCode.java b/src/main/java/com/msdw/tms/entity/response/CommonCode.java index 6003682..d3374b6 100644 --- a/src/main/java/com/msdw/tms/entity/response/CommonCode.java +++ b/src/main/java/com/msdw/tms/entity/response/CommonCode.java @@ -16,6 +16,7 @@ public enum CommonCode implements ResultCode { EVALUATION_TIME_INVALID(false, 10008, "测评时间错误!"), EXCEL_FILE_INVALID(false, 10009, "上传excel文件错误!"), REPEAT_INEXCEL(false, 10010, "试题在excel表中重复!"), + EVALUATION_QUESTION_NUM_INVALID(false, 10011, "当前测评题数设置为0,请先设置测评题数!"), FAIL(false, 11111, "操作失败!"), SERVER_ERROR(false, 99999, "抱歉,系统繁忙,请稍后重试!"); //操作是否成功 diff --git a/src/main/java/com/msdw/tms/entity/vo/EvaluationDetailVO.java b/src/main/java/com/msdw/tms/entity/vo/EvaluationDetailVO.java new file mode 100644 index 0000000..cd7c916 --- /dev/null +++ b/src/main/java/com/msdw/tms/entity/vo/EvaluationDetailVO.java @@ -0,0 +1,40 @@ +package com.msdw.tms.entity.vo; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 测评试题表,记录每次测评的试题,与测评记录表相关联 + * + * @author gongsj + * @email gongsj@gmail.com + * @date 2020-08-28 10:15:49 + */ +@Data +public class EvaluationDetailVO implements Serializable { + /** + * 序号 + */ + private Integer questionSortNo; + /** + * 是否正确 + */ + private Integer isTrue; + /** + * 试题得分 + */ + private Integer questionScore; + /** + * 用户填写的答案 + */ + private String userAnswer; + /** + * 正确答案 + */ + private String answer; + /** + * 解析 + */ + private String answerAnalysis; +} diff --git a/src/main/java/com/msdw/tms/entity/vo/EvaluationQuestionVO.java b/src/main/java/com/msdw/tms/entity/vo/EvaluationQuestionVO.java new file mode 100644 index 0000000..692c6b7 --- /dev/null +++ b/src/main/java/com/msdw/tms/entity/vo/EvaluationQuestionVO.java @@ -0,0 +1,38 @@ +package com.msdw.tms.entity.vo; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 测评试题表,记录每次测评的试题,与测评记录表相关联 + * + * @author gongsj + * @email gongsj@gmail.com + * @date 2020-08-28 10:15:49 + */ +@Data +public class EvaluationQuestionVO implements Serializable { + + /** + * 主键 + */ + private Integer id; + /** + * 试题id + */ + private Integer questionId; + /** + * 试题分值 + */ + private Integer questionPoints; + /** + * 用户填写的答案 + */ + private String userAnswer; + /** + * 正确答案 + */ + private String answer; + +} diff --git a/src/main/java/com/msdw/tms/entity/vo/EvaluationRecordDetailVO.java b/src/main/java/com/msdw/tms/entity/vo/EvaluationRecordDetailVO.java new file mode 100644 index 0000000..ebb9afa --- /dev/null +++ b/src/main/java/com/msdw/tms/entity/vo/EvaluationRecordDetailVO.java @@ -0,0 +1,25 @@ +package com.msdw.tms.entity.vo; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 记录用户测评信息 + * + * @author gongsj + * @email gongsj@gmail.com + * @date 2020-08-28 10:15:48 + */ +@Data +public class EvaluationRecordDetailVO implements Serializable { + /** + * 总得分 + */ + private Integer totalScore; + /** + * 详情列表 + */ + private List evaluationDetailVOS; +} diff --git a/src/main/java/com/msdw/tms/entity/vo/EvaluationRecordSubmitVO.java b/src/main/java/com/msdw/tms/entity/vo/EvaluationRecordSubmitVO.java new file mode 100644 index 0000000..7fc0d5f --- /dev/null +++ b/src/main/java/com/msdw/tms/entity/vo/EvaluationRecordSubmitVO.java @@ -0,0 +1,44 @@ +package com.msdw.tms.entity.vo; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 记录用户测评信息 + * + * @author gongsj + * @email gongsj@gmail.com + * @date 2020-08-28 10:15:48 + */ +@Data +public class EvaluationRecordSubmitVO implements Serializable { + /** + * 主键 + */ + private Integer id; + /** + * 当前测评的用户的id + */ + private Integer userId; + /** + * 总题目数量 + */ + private Integer totalQuestionNum; + /** + * 是否通过 + */ + private String isPassed; + /** + * 总得分 + */ + private Integer totalScore; + /** + * 答对几题 + */ + private Integer correctQuestionNum; + /** + * 正确率 + */ + private String correctRate; +} diff --git a/src/main/java/com/msdw/tms/entity/vo/EvaluationRecordVO.java b/src/main/java/com/msdw/tms/entity/vo/EvaluationRecordVO.java new file mode 100644 index 0000000..37a2a45 --- /dev/null +++ b/src/main/java/com/msdw/tms/entity/vo/EvaluationRecordVO.java @@ -0,0 +1,72 @@ +package com.msdw.tms.entity.vo; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 记录用户测评信息 + * + * @author gongsj + * @email gongsj@gmail.com + * @date 2020-08-28 10:15:48 + */ +@Data +public class EvaluationRecordVO implements Serializable { + /** + * 主键 + */ + private Integer id; + /** + * 当前测评的用户的id + */ + private Integer userId; + /** + * 记录当前做到第几题,用于刷新页面以后保持在当前题目,默认开始时是第一题 + */ + private Integer currentQuestionSortNo; + /** + * 总题目数量 + */ + private Integer totalQuestionNum; + /** + * 题型 + */ + private Integer questionType; + /** + * 题型名称 + */ + private String questionTypeName; + /** + * 题干信息 + */ + private String questionStem; + /** + * A选项内容 + */ + private String optionA; + /** + * B选项内容 + */ + private String optionB; + /** + * C选项内容 + */ + private String optionC; + /** + * D选项内容 + */ + private String optionD; + /** + * E选项内容 + */ + private String optionE; + /** + * F选项内容 + */ + private String optionF; + /** + * 用户答案 + */ + private String userAnswer; +} diff --git a/src/main/java/com/msdw/tms/entity/vo/EvaluationVO.java b/src/main/java/com/msdw/tms/entity/vo/EvaluationVO.java index 68a8172..c770330 100644 --- a/src/main/java/com/msdw/tms/entity/vo/EvaluationVO.java +++ b/src/main/java/com/msdw/tms/entity/vo/EvaluationVO.java @@ -58,5 +58,5 @@ public class EvaluationVO implements Serializable { /** *试题列表 */ - private Set Questions; + private Set Questions; } diff --git a/src/main/java/com/msdw/tms/service/EvaluationQuestionService.java b/src/main/java/com/msdw/tms/service/EvaluationQuestionService.java new file mode 100644 index 0000000..8ebc1ce --- /dev/null +++ b/src/main/java/com/msdw/tms/service/EvaluationQuestionService.java @@ -0,0 +1,18 @@ +package com.msdw.tms.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msdw.tms.common.utils.PageUtils; +import com.msdw.tms.entity.EvaluationQuestionEntity; + +import java.util.Map; + +/** + * 测评试题表,记录每次测评的试题,与测评记录表相关联 + * + * @author gongsj + * @email gongsj@gmail.com + * @date 2020-08-28 10:15:49 + */ +public interface EvaluationQuestionService extends IService { +} + diff --git a/src/main/java/com/msdw/tms/service/EvaluationRecordService.java b/src/main/java/com/msdw/tms/service/EvaluationRecordService.java new file mode 100644 index 0000000..e660664 --- /dev/null +++ b/src/main/java/com/msdw/tms/service/EvaluationRecordService.java @@ -0,0 +1,40 @@ +package com.msdw.tms.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msdw.tms.entity.EvaluationRecordEntity; +import com.msdw.tms.entity.vo.EvaluationRecordDetailVO; +import com.msdw.tms.entity.vo.EvaluationRecordSubmitVO; +import com.msdw.tms.entity.vo.EvaluationRecordVO; + +/** + * 记录用户测评信息 + * + * @author gongsj + * @email gongsj@gmail.com + * @date 2020-08-28 10:15:48 + */ +public interface EvaluationRecordService extends IService { + + EvaluationRecordVO startEvaluation(Integer userId); + + EvaluationRecordVO convertQuestion(Integer evaluationRecordId, + Integer currentQuestionSortNo, + String userAnswer, + Integer changeSortNo); + + EvaluationRecordSubmitVO submitEvaluation(Integer evaluationRecordId, + Integer currentQuestionSortNo, + String userAnswer, + Integer userId); + + EvaluationRecordDetailVO evaluationDetail(Integer evaluationRecordId); + + String selectNotMade(Integer evaluationRecordId); + + void cleanRemainingTime(Integer userId); + + boolean isOpenExperiment(Integer userId); + + // boolean hasNotMadeEvaluation(Integer userId); +} + diff --git a/src/main/java/com/msdw/tms/service/QuestionsService.java b/src/main/java/com/msdw/tms/service/QuestionsService.java index f791ba5..d8bf9b3 100644 --- a/src/main/java/com/msdw/tms/service/QuestionsService.java +++ b/src/main/java/com/msdw/tms/service/QuestionsService.java @@ -43,7 +43,7 @@ public interface QuestionsService extends IService { void downloadFiles(HttpServletResponse response) throws IOException; - EvaluationVO evaluation(); + EvaluationVO randomQuestions(); void exportQuestion(HttpServletResponse response) throws Exception; diff --git a/src/main/java/com/msdw/tms/service/impl/EvaluationQuestionServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/EvaluationQuestionServiceImpl.java new file mode 100644 index 0000000..15afd92 --- /dev/null +++ b/src/main/java/com/msdw/tms/service/impl/EvaluationQuestionServiceImpl.java @@ -0,0 +1,18 @@ +package com.msdw.tms.service.impl; + +import org.springframework.stereotype.Service; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msdw.tms.common.utils.PageUtils; +import com.msdw.tms.common.utils.Query; + +import com.msdw.tms.dao.EvaluationQuestionDao; +import com.msdw.tms.entity.EvaluationQuestionEntity; +import com.msdw.tms.service.EvaluationQuestionService; + + +@Service("evaluationQuestionService") +public class EvaluationQuestionServiceImpl extends ServiceImpl implements EvaluationQuestionService { +} \ No newline at end of file diff --git a/src/main/java/com/msdw/tms/service/impl/EvaluationRecordServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/EvaluationRecordServiceImpl.java new file mode 100644 index 0000000..e7869ba --- /dev/null +++ b/src/main/java/com/msdw/tms/service/impl/EvaluationRecordServiceImpl.java @@ -0,0 +1,338 @@ +package com.msdw.tms.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msdw.tms.common.exception.ExceptionCast; +import com.msdw.tms.common.utils.Constant; +import com.msdw.tms.dao.EvaluationQuestionDao; +import com.msdw.tms.dao.EvaluationRecordDao; +import com.msdw.tms.entity.EvaluationQuestionEntity; +import com.msdw.tms.entity.EvaluationRecordEntity; +import com.msdw.tms.entity.response.CommonCode; +import com.msdw.tms.entity.vo.*; +import com.msdw.tms.service.EvaluationQuestionService; +import com.msdw.tms.service.EvaluationRecordService; +import com.msdw.tms.service.QuestionsService; +import org.apache.commons.lang.StringUtils; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.text.NumberFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + + +@Service("evaluationRecordService") +public class EvaluationRecordServiceImpl extends ServiceImpl implements EvaluationRecordService { + + @Resource + QuestionsService questionsService; + + @Resource + EvaluationQuestionService evaluationQuestionService; + + @Resource + EvaluationQuestionDao evaluationQuestionDao; + + @Autowired + StringRedisTemplate redisTemplate; + + private String REMAINING_TINE_KEY = "REMAINING_TINE"; + + @Override + @Transactional + public EvaluationRecordVO startEvaluation(Integer userId) { + //TODO 接口幂等性处理 + //根据用户id和是否提交,查询测评记录信息 + EvaluationRecordEntity one = this.getOne(new QueryWrapper().eq("user_id", userId) + .eq("evaluation_status", Constant.Submit.SUBMIT.getType())); + + if (one == null) { + //随机抽取试题数据 + EvaluationVO evaluation = questionsService.randomQuestions(); + + //保存测评记录 + EvaluationRecordEntity evaluationRecord = new EvaluationRecordEntity(); + evaluationRecord.setUserId(userId); + evaluationRecord.setEvaluationStatus(Constant.Submit.NOT_SUBMIT.getType()); + evaluationRecord.setTotalQuestionNum(evaluation.getQuestionNum()); + evaluationRecord.setCurrentQuestionSortNo(1); + evaluationRecord.setStartTime(new Date()); + this.save(evaluationRecord); + + List evaluationQuestionList = evaluation.getQuestions().stream().map(question -> { + EvaluationQuestionEntity evaluationQuestionEntity = new EvaluationQuestionEntity(); + evaluationQuestionEntity.setEvaluationRecordId(evaluationRecord.getId()); + evaluationQuestionEntity.setQuestionId(question); + // evaluationQuestionEntity.setIsTure(Constant.QuestionIsTure.FALSE.getType()); + // evaluationQuestionEntity.setQuestionStatus(Constant.QuestionStatus.NOT_MADE.getType()); + return evaluationQuestionEntity; + }).collect(Collectors.toList()); + + List list = averageValue(evaluation.getQuestionNum()); + for (int i = 0; i < list.size(); i++) { + evaluationQuestionList.get(i).setQuestionSortNo(i + 1); + evaluationQuestionList.get(i).setQuestionPoints(list.get(i)); + } + evaluationQuestionService.saveBatch(evaluationQuestionList); + + one = evaluationRecord; + } + + EvaluationRecordVO evaluationRecordVO = this.getBaseMapper() + .selectVOByInfo(one.getId(), one.getCurrentQuestionSortNo()); + evaluationRecordVO.setQuestionTypeName(getQuestionTypeName(evaluationRecordVO.getQuestionType())); + return evaluationRecordVO; + } + + private String getQuestionTypeName(Integer questionType) { + String questionTypeName = ""; + //处理试题类型 + if (questionType.equals(Constant.QuestionType.SINGLE_CHOICE.getType())) { + //单选题 + questionTypeName = Constant.QuestionType.SINGLE_CHOICE.getDesc(); + } else if (questionType.equals(Constant.QuestionType.MULTIPLE_CHOICE.getType())) { + //多选题 + questionTypeName = Constant.QuestionType.MULTIPLE_CHOICE.getDesc(); + } else if (questionType.equals(Constant.QuestionType.TRUE_OR_FALSE.getType())) { + //判断题 + questionTypeName = Constant.QuestionType.TRUE_OR_FALSE.getDesc(); + } else { + ExceptionCast.cast(CommonCode.QUESTIONTYPE_INVALID); + } + return questionTypeName; + } + + /** + * 平均分配分值 + * + * @param number 判分点数量 + * @return + */ + private List averageValue(Integer number) { + if (number == null || number == 0) { + ExceptionCast.cast(CommonCode.EVALUATION_QUESTION_NUM_INVALID); + } + Integer score = 100 / number; + List list = new ArrayList<>(); + if (100 % number == 0) { + for (int i = 0; i < number; i++) { + list.add(score); + } + } else { + int n; + for (int i = 0; i < number; i++) { + list.add(score); + } + for (int i = 100 % number; i > 0; i--) { + n = score + 1; + list.set(i, n); + } + } + return list; + } + + @Override + public EvaluationRecordVO convertQuestion(Integer evaluationRecordId, + Integer currentQuestionSortNo, + String userAnswer, + Integer changeSortNo) { + if (currentQuestionSortNo < 1 + || currentQuestionSortNo > this.getById(evaluationRecordId).getTotalQuestionNum() + || changeSortNo < 1 + || changeSortNo > this.getById(evaluationRecordId).getTotalQuestionNum()) { + ExceptionCast.cast(CommonCode.INVALID_PARAM); + } + + //TODO 异步调用。。。 + //提交当前试题信息 + boolean result = submitCurrentQuestion(evaluationRecordId, + currentQuestionSortNo, + userAnswer, + changeSortNo); + if (!result) { + ExceptionCast.cast(CommonCode.FAIL); + } + + //查询下一题信息 + EvaluationRecordVO evaluationRecordVO = this.getBaseMapper().selectVOByInfo(evaluationRecordId, changeSortNo); + evaluationRecordVO.setQuestionTypeName(getQuestionTypeName(evaluationRecordVO.getQuestionType())); + return evaluationRecordVO; + } + + @Override + public EvaluationRecordSubmitVO submitEvaluation(Integer evaluationRecordId, + Integer currentQuestionSortNo, + String userAnswer, + Integer userId) { + //清除redis中的倒计时 + String key = REMAINING_TINE_KEY + userId; + redisTemplate.delete(key); + + boolean result = submitCurrentQuestion(evaluationRecordId, + currentQuestionSortNo, + userAnswer, + null); + if (!result) { + ExceptionCast.cast(CommonCode.FAIL); + } + + //TODO 优化,使用多线程异步调用 + //修改提交时间 + EvaluationRecordEntity entity = new EvaluationRecordEntity(); + entity.setId(evaluationRecordId); + entity.setEvaluationStatus(Constant.Submit.SUBMIT.getType()); + entity.setSubmitTime(new Date()); + this.updateById(entity); + + //查询总成绩 + int sumScore = evaluationQuestionDao.sumScore(evaluationRecordId); + + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("evaluation_record_id", evaluationRecordId) + .eq("is_ture", Constant.QuestionIsTure.TRUE.getType()); + + //查询答对几题 + int count = evaluationQuestionService.count(queryWrapper); + + EvaluationRecordEntity evaluationRecord = this.getById(evaluationRecordId); + + EvaluationRecordSubmitVO submitVO = new EvaluationRecordSubmitVO(); + BeanUtils.copyProperties(evaluationRecord, submitVO); + //正确率 + // 创建一个数值格式化对象 + NumberFormat numberFormat = NumberFormat.getInstance(); + // 设置精确到小数点后2位 + numberFormat.setMaximumFractionDigits(2); + submitVO.setCorrectRate(numberFormat.format((float) count / (float) evaluationRecord.getTotalQuestionNum() * 100) + "%"); + //是否通过 + submitVO.setIsPassed(sumScore > Constant.PASSING_SCORE ? Constant.EVALUATIONN_PASSED : Constant.EVALUATIONN_NOT_PASSED); + //得分 + submitVO.setTotalScore(sumScore); + //答对几道 + submitVO.setCorrectQuestionNum(count); + + return submitVO; + } + + @Override + public EvaluationRecordDetailVO evaluationDetail(Integer evaluationRecordId) { + //TODO 异步查询 + //查询总成绩 + int sumScore = evaluationQuestionDao.sumScore(evaluationRecordId); + List evaluationDetailVOS = evaluationQuestionDao.selectDetailByInfo(evaluationRecordId); + + EvaluationRecordDetailVO evaluationRecordDetailVO = new EvaluationRecordDetailVO(); + evaluationRecordDetailVO.setTotalScore(sumScore); + evaluationRecordDetailVO.setEvaluationDetailVOS(evaluationDetailVOS); + return evaluationRecordDetailVO; + } + + @Override + public String selectNotMade(Integer evaluationRecordId) { + + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("evaluation_record_id", evaluationRecordId) + .eq("question_status", Constant.QuestionStatus.NOT_MADE.getType()); + + List list = evaluationQuestionService.list(queryWrapper); + List collect = list.stream().map(item -> item.getQuestionSortNo()).collect(Collectors.toList()); + if (collect.size() == 0) { + return "已完成全部题目"; + } + return "还有以下题目未完成" + collect.toString(); + } + + @Override + public void cleanRemainingTime(Integer userId) { + //清除redis中的倒计时 + String key = REMAINING_TINE_KEY + userId; + redisTemplate.delete(key); + } + + @Override + public boolean isOpenExperiment(Integer userId) { + List list = evaluationQuestionDao.sumScoreListByUserId(userId); + if (list != null && list.size() > 0) { + for (Integer integer : list) { + if (integer > Constant.PASSING_SCORE) { + return true; + } + } + } + return false; + } + +// @Override +// public boolean hasNotMadeEvaluation(Integer userId) { +// //先判断数据库是否已经有了此次测评 +// //如果有,继续,如果没有,重新开始 +// ValueOperations ops = redisTemplate.opsForValue(); +// String key = REMAINING_TINE_KEY + userId; +// if (StringUtils.isNotEmpty(ops.get(key))) { +// //继续上次 +// +// } +// +// return false; +// } + + //提交当前试题,并修改当前测评记录表 + @Transactional + public boolean submitCurrentQuestion(Integer evaluationRecordId, + Integer currentQuestionSortNo, + String userAnswer, + Integer changeSortNo) { + //1、根据当前传递的evaluationRecordId和currentQuestionSortNo查询当前试题 + EvaluationQuestionVO evaluationQuestionVO = evaluationQuestionDao.selectByInfo(evaluationRecordId, currentQuestionSortNo); + if (evaluationQuestionVO == null) { + ExceptionCast.cast(CommonCode.INVALID_PARAM); + } + // 题目分值 + Integer questionPoints = evaluationQuestionVO.getQuestionPoints(); + //正确答案 + String answer = evaluationQuestionVO.getAnswer(); + //修改当前试题状态 + //记录用户的答案 + //判断当前试题正误 + //记录试题得分 + EvaluationQuestionEntity evaluationQuestion = new EvaluationQuestionEntity(); + evaluationQuestion.setId(evaluationQuestionVO.getId()); + evaluationQuestion.setUserAnswer(userAnswer); + //如果用户答案为空,则设置状态为未作,设为错,得分设为0 + if (StringUtils.isEmpty(userAnswer)) { + evaluationQuestion.setQuestionStatus(Constant.QuestionStatus.NOT_MADE.getType()); + evaluationQuestion.setIsTure(Constant.QuestionIsTure.FALSE.getType()); + evaluationQuestion.setQuestionScore(0); + } else { + evaluationQuestion.setQuestionStatus(Constant.QuestionStatus.MADE.getType()); + if (!answer.equals(userAnswer)) { + evaluationQuestion.setIsTure(Constant.QuestionIsTure.FALSE.getType()); + evaluationQuestion.setQuestionScore(0); + } else { + evaluationQuestion.setIsTure(Constant.QuestionIsTure.TRUE.getType()); + evaluationQuestion.setQuestionScore(questionPoints); + } + } + int updateQuestion = evaluationQuestionDao.updateById(evaluationQuestion); + + //修改测评记录表 + if (changeSortNo != null) { + EvaluationRecordEntity evaluationRecordEntity = new EvaluationRecordEntity(); + evaluationRecordEntity.setCurrentQuestionSortNo(changeSortNo); + evaluationRecordEntity.setId(evaluationRecordId); + boolean updateRecord = this.updateById(evaluationRecordEntity); + return updateQuestion > 0 && updateRecord; + } + + return updateQuestion > 0; + } + + +} \ No newline at end of file diff --git a/src/main/java/com/msdw/tms/service/impl/EvaluationRulesServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/EvaluationRulesServiceImpl.java index dd10e50..e2e8f80 100644 --- a/src/main/java/com/msdw/tms/service/impl/EvaluationRulesServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/EvaluationRulesServiceImpl.java @@ -71,6 +71,14 @@ public class EvaluationRulesServiceImpl extends ServiceImpl 100 + || evaluationRules.getQuestionNum() < 0) { + ExceptionCast.cast(CommonCode.QUESTION_NUM_INVALID); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.eq("is_del", Constant.IsDel.NOT_DEL.getType()) //未删除 .eq("is_enable", Constant.IsEnable.ENABLE.getType()); //启用 diff --git a/src/main/java/com/msdw/tms/service/impl/QuestionsServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/QuestionsServiceImpl.java index 78e9dad..025a648 100644 --- a/src/main/java/com/msdw/tms/service/impl/QuestionsServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/QuestionsServiceImpl.java @@ -449,6 +449,10 @@ public class QuestionsServiceImpl extends ServiceImpl queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("is_del", Constant.IsDel.NOT_DEL.getType()) //未删除 - .eq("is_enable", Constant.IsEnable.ENABLE.getType()); //启用 - + public EvaluationVO randomQuestions() { // 查询测评规则类型 EvaluationRulesVO evaluationRules = evaluationRulesService.getEvaluationRules(); - EvaluationVO evaluation = new EvaluationVO(); - BeanUtils.copyProperties(evaluationRules, evaluation); - - //TODO 提交测评时删除redis中的该条数据 - - //搜集随机抽取的试题 - Set set = new HashSet<>(); + Set set = new HashSet<>(); //根据测评规则的类型不同 Integer evaluationType = evaluationRules.getEvaluationType(); if (evaluationType.equals(Constant.RulesType.RANDOM.getType())) {//随机 // 类型为随机,直接用题目数量 Integer questionNum = evaluationRules.getQuestionNum(); + if (questionNum == null || questionNum == 0) { + ExceptionCast.cast(CommonCode.EVALUATION_QUESTION_NUM_INVALID); + } // 查询题库所有未删除,未禁用的题目id - List questions = this.list(queryWrapper); - set = getRandomList(questionNum, questions); + List ids = this.getBaseMapper().selectIds(null); + set = getRandomList(questionNum, ids); } else if (evaluationType.equals(Constant.RulesType.CUSTOMIZE.getType())) {//自定义 // 单选题数量 int singleNum = 0; @@ -511,24 +507,27 @@ public class QuestionsServiceImpl extends ServiceImpl singleChoice = this.list(queryWrapper.eq("question_type", - Constant.QuestionType.SINGLE_CHOICE.getType())); - set.addAll(getRandomList(singleNum, singleChoice)); + if (singleNum == 0) { + ExceptionCast.cast(CommonCode.EVALUATION_QUESTION_NUM_INVALID); + } + List ids = this.getBaseMapper().selectIds(Constant.QuestionType.SINGLE_CHOICE.getType()); + set.addAll(getRandomList(singleNum, ids)); } if (evaluationRules.getIsMultipleEnable().equals(Constant.IsEnable.ENABLE.getType())) { multipleNum = evaluationRules.getMultipleNum(); - - List multipleChoice = this.list(queryWrapper.eq("question_type", - Constant.QuestionType.MULTIPLE_CHOICE.getType())); - set.addAll(getRandomList(multipleNum, multipleChoice)); + if (multipleNum == 0) { + ExceptionCast.cast(CommonCode.EVALUATION_QUESTION_NUM_INVALID); + } + List ids = this.getBaseMapper().selectIds(Constant.QuestionType.MULTIPLE_CHOICE.getType()); + set.addAll(getRandomList(multipleNum, ids)); } if (evaluationRules.getIsJudgmentEnable().equals(Constant.IsEnable.ENABLE.getType())) { judgmentNum = evaluationRules.getJudgmentNum(); - - List judgments = this.list(queryWrapper.eq("question_type", - Constant.QuestionType.TRUE_OR_FALSE.getType())); - set.addAll(getRandomList(judgmentNum, judgments)); + if (judgmentNum == 0) { + ExceptionCast.cast(CommonCode.EVALUATION_QUESTION_NUM_INVALID); + } + List ids = this.getBaseMapper().selectIds(Constant.QuestionType.TRUE_OR_FALSE.getType()); + set.addAll(getRandomList(judgmentNum, ids)); } // 总题数等于各类题目数量之和 evaluation.setQuestionNum(singleNum + multipleNum + judgmentNum); @@ -538,6 +537,20 @@ public class QuestionsServiceImpl extends ServiceImpl Set getRandomList(int len, List list) { + Set set = new HashSet<>(); + Random random = new Random(); + int i; + while (true) { + i = random.nextInt(list.size()); + set.add(list.get(i)); + if (set.size() >= len) { + break; + } + } + return set; + } + @Override public void exportQuestion(HttpServletResponse response) throws Exception { // 请求包装类 @@ -616,21 +629,4 @@ public class QuestionsServiceImpl extends ServiceImpl getRandomList(int len, List list) { - Set set = new HashSet<>(); - Random random = new Random(); - int i; - while (true) { - i = random.nextInt(list.size()); - QuestionsVO questionsVO = new QuestionsVO(); - BeanUtils.copyProperties(list.get(i), questionsVO); - questionsVO.setQuestionTypeName(getQuestionTypeName(list.get(i).getQuestionType())); - set.add(questionsVO); - if (set.size() >= len) { - break; - } - } - return set; - } } \ No newline at end of file diff --git a/src/main/resources/excel-template/试题导入失败数据导出模板.xlsx b/src/main/resources/excel-template/试题导入失败数据导出模板.xlsx index 9bea0c39e7c9895d969e457f0bd00317bb6a1744..042244a71e2163d493e44eb7f863d06ac212c811 100644 GIT binary patch delta 3548 zcmZ9PcQo4#7snH;f+}fhs|te9TCJMFW3L$HA;cb~VrwYs*IKozl^CtPM~o`kT2;hW zqiC&Kj}fCqDQdrcp7)&hIp@89-E;2v=ic-A-rH`pZ(Kb^2jG!4CkIp@&;lI@bO{6k z1>qzDz5P5Ky}dnd1bN~r%%{ByBv~HXxu1g%v%(ve!u3dBNl)vV;-kM_Y=~&u($9O?Fz`2&)&diW^Pm6qE8CF6m3~4=WCo=^7l$dRKJs}dkYQY{pG|C(7if^)}v7={>Uh(*h9KuwEB@? z*f#|Zz9RdO^oRp~+C=APU&nlg^zf)2Qf>D-PiytD`%R`1(i^DS4l0Iiv*Cf8Ps?AN zO`e4wNi`?Bes{{4Fq|gA={^Glj{9veZhR2Pq?g2Fu0;Kc(qzjgAMrku0%a;al^iu- z)2Ibri`>-l)IP1PA-(P{1F>3Ld<*OpikJmM)Z`?gTuDXgm$R%=K04lvWh)*s(-pD) z2-VtbZL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TfWFBtDMK}m z8u77|neddN7w%sO$Rh%;4~LhK7u;vBuQPQl(g6DnTzq_E@uYiw@^^NuKC%hz=C~{O zpN;EY0~~*Ao6QN-=>#QKhOjE>{cM^^+A&v%-X)vfyKLR7ZU4p| z^8_TbE39n@*B^m{IG6`d3T5o_kyAPbQRR|9Ec%H84dKoX(*7neOfpcEGk2vk5U`RM zTFF2DS4*+>mv7AP1ce#`iNs0n%=aP~mDn$>;;`D}H;kWq?zTY{evezh3?T>m(rkDw z-_+T(IOoM&?3t4tRj+@Nxq-q8y}G*8e=4TWxYZB=+Z5I_&TK}j7fSg(TI5|@jmHKCQJor(<_0=ZpwFFHB*4%6a< zmdJu{nCyFdyfhzK>5+eB77?pcO0c{@vtu}D77yQjyhT~D(V@t=!PT8C!UTk`KZFrz zSO11U@sJkJJA`SwmIzyv`(9_{dm+hPL3|w`P%vFr{fBwiQ3*lynz?#O*ZSF<^VHWv z*9%@k>dBW?#LcZn`rEXlk=cNnPx)hWw6dF}?m@uahGfhqvHUFnyb36b|Z@1CUv$?4S+hyPuoKA_V`dUA72@MScVnLTC{yOy?l@K4EBn&5YZDFmU zR7Jezuk|BlXeKcxl3QVFL++MxM)L1e<#$g5pX8sv12xE{g@;42LIqj>Nm_qc$@qtr z{}vZHN}ikc68Bs9oq|-~ls=n_B@`#foy|)&|zFp&Gd#vHb6% icmTkQKmQKZzZ-u#VH5?A9I%c9rNwiPDE$6^wf_Jj^iSFV diff --git a/src/main/resources/mapper/tms/EvaluationQuestionDao.xml b/src/main/resources/mapper/tms/EvaluationQuestionDao.xml new file mode 100644 index 0000000..eab21eb --- /dev/null +++ b/src/main/resources/mapper/tms/EvaluationQuestionDao.xml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + UPDATE + tms_evaluation_question + + + question_status=#{questionStatus, jdbcType=INTEGER}, + + + user_answer=#{userAnswer, jdbcType=VARCHAR}, + + + is_ture=#{isTure, jdbcType=INTEGER}, + + + question_score=#{questionScore, jdbcType=INTEGER}, + + + WHERE + id = #{id, jdbcType=INTEGER} + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/tms/EvaluationRecordDao.xml b/src/main/resources/mapper/tms/EvaluationRecordDao.xml new file mode 100644 index 0000000..be180d8 --- /dev/null +++ b/src/main/resources/mapper/tms/EvaluationRecordDao.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/tms/QuestionsDao.xml b/src/main/resources/mapper/tms/QuestionsDao.xml index aa23977..31b9656 100644 --- a/src/main/resources/mapper/tms/QuestionsDao.xml +++ b/src/main/resources/mapper/tms/QuestionsDao.xml @@ -23,4 +23,18 @@ + + \ No newline at end of file diff --git a/src/main/resources/sql/data.sql b/src/main/resources/sql/data.sql index f40c053..410d162 100644 --- a/src/main/resources/sql/data.sql +++ b/src/main/resources/sql/data.sql @@ -78,4 +78,38 @@ CREATE TABLE `tms_xlsx_template` ( -- ---------------------------- -- Records of tms_xlsx_template -- ---------------------------- -INSERT INTO `tms_xlsx_template` VALUES ('1', 'xlsx/20200826/1598430904075.xlsx', 'http://liuwanr.oss-cn-shenzhen.aliyuncs.com/xlsx/20200826/1598430904075.xlsx', null); \ No newline at end of file +INSERT INTO `tms_xlsx_template` VALUES ('1', 'xlsx/20200826/1598430904075.xlsx', 'http://liuwanr.oss-cn-shenzhen.aliyuncs.com/xlsx/20200826/1598430904075.xlsx', null); + +-- ---------------------------- +-- Table structure for tms_evaluation_question +-- ---------------------------- +DROP TABLE IF EXISTS `tms_evaluation_question`; +CREATE TABLE `tms_evaluation_question` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增主键', + `evaluation_record_id` int(11) DEFAULT NULL COMMENT '测评记录表id', + `question_id` int(11) DEFAULT NULL COMMENT '试题id', + `question_sort_no` int(11) DEFAULT NULL COMMENT '试题顺序号', + `question_status` int(11) DEFAULT '0' COMMENT '试题状态:是否已被作过:1、已作/0、未作', + `user_answer` varchar(32) DEFAULT NULL COMMENT '用户填写的答案', + `is_ture` int(11) DEFAULT '0' COMMENT '是否正确:1、正确/0、错误', + `question_points` int(11) DEFAULT NULL COMMENT '试题分值', + `question_score` int(11) DEFAULT NULL COMMENT '试题得分', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8 COMMENT='测评试题表,记录每次测评的试题,与测评记录表相关联'; + +-- ---------------------------- +-- Table structure for tms_evaluation_record +-- ---------------------------- +DROP TABLE IF EXISTS `tms_evaluation_record`; +CREATE TABLE `tms_evaluation_record` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增主键', + `user_id` int(11) DEFAULT NULL COMMENT '当前测评的用户的id', + `current_question_sort_no` int(11) DEFAULT '1' COMMENT '记录当前做到第几题,用于刷新页面以后保持在当前题目,默认开始时是第一题', + `total_question_num` int(11) DEFAULT NULL COMMENT '总题目数量', + `evaluation_status` int(11) DEFAULT '0' COMMENT '当前测评状态:1:已提交/0:未提交', + `start_time` datetime DEFAULT NULL COMMENT '开始时间', + `submit_time` datetime DEFAULT NULL COMMENT '提交时间', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='记录用户测评信息'; + + diff --git a/src/test/java/com/msdw/tms/TmsApplicationTests.java b/src/test/java/com/msdw/tms/TmsApplicationTests.java index 7ec0c78..cc8570c 100644 --- a/src/test/java/com/msdw/tms/TmsApplicationTests.java +++ b/src/test/java/com/msdw/tms/TmsApplicationTests.java @@ -10,6 +10,8 @@ import org.springframework.data.redis.core.ValueOperations; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; +import java.text.DecimalFormat; +import java.text.NumberFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.time.Instant; @@ -415,4 +417,32 @@ class TmsApplicationTests { stringRedisTemplate.opsForList().leftPush("sss", list.toString()); } + @Test + void t12() { +// System.out.println(((float) 3 / (float) 10) * 100 + "%"); + + int diliverNum = 3;//举例子的变量 + int queryMailNum = 10;//举例子的变量 +// 创建一个数值格式化对象 + NumberFormat numberFormat = NumberFormat.getInstance(); +// 设置精确到小数点后2位 + numberFormat.setMaximumFractionDigits(2); + String result = numberFormat.format((float) diliverNum / (float) queryMailNum * 100); + System.out.println("diliverNum和queryMailNum的百分比为:" + result + "%"); + } + + + public String getPercent(int x, int total) { + String result = "";//接受百分比的值 + double x_double = x * 1.0; + double tempresult = x / total; + //NumberFormat nf = NumberFormat.getPercentInstance(); 注释掉的也是一种方法 + //nf.setMinimumFractionDigits( 2 ); 保留到小数点后几位 + DecimalFormat df1 = new DecimalFormat("0.00%"); //##.00% 百分比格式,后面不足2位的用0补齐 + //result=nf.format(tempresult); + result = df1.format(tempresult); + return result; + } + + } diff --git a/src/test/java/com/msdw/tms/service/EvaluationRecordServiceTest.java b/src/test/java/com/msdw/tms/service/EvaluationRecordServiceTest.java new file mode 100644 index 0000000..a801d17 --- /dev/null +++ b/src/test/java/com/msdw/tms/service/EvaluationRecordServiceTest.java @@ -0,0 +1,31 @@ +package com.msdw.tms.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msdw.tms.common.utils.PageUtils; +import com.msdw.tms.entity.EvaluationRecordEntity; +import com.msdw.tms.entity.vo.EvaluationRulesVO; +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +import javax.annotation.Resource; +import java.util.Map; + +/** + * 记录用户测评信息 + * + * @author gongsj + * @email gongsj@gmail.com + * @date 2020-08-28 10:15:48 + */ +@SpringBootTest +public class EvaluationRecordServiceTest { + + @Resource + EvaluationRecordService evaluationRecordService; + + @Test + void getEvaluationRules() { + evaluationRecordService.startEvaluation(1); + } +} + diff --git a/src/test/java/com/msdw/tms/service/QuestionsServiceTest.java b/src/test/java/com/msdw/tms/service/QuestionsServiceTest.java index 31729c3..e8aa298 100644 --- a/src/test/java/com/msdw/tms/service/QuestionsServiceTest.java +++ b/src/test/java/com/msdw/tms/service/QuestionsServiceTest.java @@ -120,10 +120,12 @@ class QuestionsServiceTest { questionsService.downloadFiles(response); } - @Test - void evaluation() { - EvaluationVO evaluation = questionsService.evaluation(); - System.out.println(evaluation.toString()); - } +// @Test +// void evaluation() { +// EvaluationVO evaluation = questionsService.evaluation(); +// System.out.println(evaluation.toString()); +// } + + }