浏览代码

完善开始考试和交卷模拟器类型检查。

tom 1 月之前
父节点
当前提交
04e48456e6
共有 1 个文件被更改,包括 9 次插入1 次删除
  1. 9 1
      ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/RealExamService.java

+ 9 - 1
ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/RealExamService.java

@@ -426,7 +426,7 @@ public class RealExamService {
         Sim sim = simService.selectSimBySimId(re.getSimId());
         Sim sim = simService.selectSimBySimId(re.getSimId());
         // Check:检查模拟器类型
         // Check:检查模拟器类型
         final String targetSimType = re.getSimType();
         final String targetSimType = re.getSimType();
-        if (false) {
+        {
             AjaxResult ar = commCheckService.checkOneSimType(seat, true, targetSimType);
             AjaxResult ar = commCheckService.checkOneSimType(seat, true, targetSimType);
             if (ar.isError()) {
             if (ar.isError()) {
                 return ar;
                 return ar;
@@ -609,6 +609,14 @@ public class RealExamService {
                 return ar;
                 return ar;
             }
             }
         }
         }
+        // Check:检查模拟器类型
+        final String targetSimType = re.getSimType();
+        {
+            AjaxResult ar = commCheckService.checkOneSimType(seatStart, true, targetSimType);
+            if (ar.isError()) {
+                return ar;
+            }
+        }
         // Check:检查是否是出题值使用的模拟器。防止换机器交卷。
         // Check:检查是否是出题值使用的模拟器。防止换机器交卷。
         re = selectRealExamByExamId(examId);
         re = selectRealExamByExamId(examId);
         if (!Objects.equals(re.getSimId(), seatNow.getCurrentSimId())) {
         if (!Objects.equals(re.getSimId(), seatNow.getCurrentSimId())) {