From 8b375fe00a241b3a769b82fe3dac8d1c9dce8a02 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Thu, 16 Jun 2022 14:36:07 +0800
Subject: [PATCH] 模拟考试修改
---
src/main/java/org/springblade/modules/simulateexam/controller/SimulateExamRecordController.java | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 54 insertions(+), 0 deletions(-)
diff --git a/src/main/java/org/springblade/modules/simulateexam/controller/SimulateExamRecordController.java b/src/main/java/org/springblade/modules/simulateexam/controller/SimulateExamRecordController.java
index b71941d..ea346ec 100644
--- a/src/main/java/org/springblade/modules/simulateexam/controller/SimulateExamRecordController.java
+++ b/src/main/java/org/springblade/modules/simulateexam/controller/SimulateExamRecordController.java
@@ -8,9 +8,12 @@
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.exam.vo.ExamPaperVO;
+import org.springblade.modules.exam.vo.ExamScoreVO;
import org.springblade.modules.simulateexam.entity.SimulateExamRecord;
import org.springblade.modules.simulateexam.service.SimulateExamRecordService;
import org.springblade.modules.simulateexam.vo.SimulateExamRecordVO;
+import org.springblade.modules.simulateexam.vo.SimulateExamScoreVO;
import org.springframework.web.bind.annotation.*;
/**
@@ -85,4 +88,55 @@
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(simulateExamRecordService.removeByIds(Func.toLongList(ids)));
}
+
+ /**
+ * 首次点击开始考试,创建模拟考试
+ * @param simulateExamRecord 模拟考试记录对象信息
+ * @return
+ */
+ @PostMapping("/beginExam")
+ public R beginExam(@RequestBody SimulateExamRecord simulateExamRecord) {
+ return R.data(simulateExamRecordService.insertSimulateExamRecord(simulateExamRecord));
+ }
+
+ /**
+ * 考试暂停后继续,1查询所有的答题信息,2查询所有的已答信息 3其他信息
+ * @param simulateExamRecord 必须包含 模拟考试id, type 1: 继续考试 2: 放弃之前的考试,重新生成题目考试
+ * @return
+ */
+ @GetMapping("/getSimulateExamRefreshInfo")
+ public R getSimulateExamRefreshInfo(SimulateExamRecordVO simulateExamRecord){
+ return R.data(simulateExamRecordService.getSimulateExamRefreshInfo(simulateExamRecord));
+ }
+
+ /**
+ * 答题途中暂停考试
+ * @param simulateExamRecord 模拟考试记录对象信息
+ * @return
+ */
+ @PostMapping("/pauseExam")
+ public R pauseExam(@RequestBody SimulateExamRecord simulateExamRecord) {
+ return R.data(simulateExamRecordService.pauseExam(simulateExamRecord));
+ }
+
+ /**
+ * 模拟考试开始页面,查询是否有暂停中的模拟考试
+ * @param simulateExamRecord 模拟考试记录对象信息(必须包含 idCardNo)
+ * @return
+ */
+ @GetMapping("/getSimulateExamRecordInfo")
+ public R getSimulateExamRecordInfo(SimulateExamRecord simulateExamRecord) {
+ return R.data(simulateExamRecordService.getSimulateExamRecordInfo(simulateExamRecord));
+ }
+
+ /**
+ * 提交考试
+ *
+ * @param simulateExamScore 模拟考试成绩信息对象
+ * @return
+ */
+ @PostMapping("/saveSimulateExam")
+ public R saveSimulateExam(@RequestBody SimulateExamScoreVO simulateExamScore) {
+ return R.data(simulateExamRecordService.saveSimulateExam(simulateExamScore));
+ }
}
--
Gitblit v1.9.3