From afc2b4d2800d91c793523d14fbe2d6fbbd319fc0 Mon Sep 17 00:00:00 2001
From: 钟日健 <5689795+arsn@user.noreply.gitee.com>
Date: Fri, 25 Feb 2022 09:02:41 +0800
Subject: [PATCH] 模拟考试开始修改,返回所有题目的所有答题信息

---
 src/main/java/org/springblade/modules/simulateexam/controller/SimulateExamRecordController.java |   42 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 42 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..1b463cb 100644
--- a/src/main/java/org/springblade/modules/simulateexam/controller/SimulateExamRecordController.java
+++ b/src/main/java/org/springblade/modules/simulateexam/controller/SimulateExamRecordController.java
@@ -8,6 +8,7 @@
 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.simulateexam.entity.SimulateExamRecord;
 import org.springblade.modules.simulateexam.service.SimulateExamRecordService;
 import org.springblade.modules.simulateexam.vo.SimulateExamRecordVO;
@@ -85,4 +86,45 @@
 	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));
+	}
+
 }

--
Gitblit v1.9.3