From ebf3b2301eef62aaa27ba19479271764762d7eb4 Mon Sep 17 00:00:00 2001 From: wangxy <1481820854@qq.com> Date: Mon, 18 Nov 2024 08:44:49 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E7=94=A8=E6=88=B7=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/web/controller/manager/UserExamManager.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/UserExamManager.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/UserExamManager.java index 79bf1d7..6cf1250 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/UserExamManager.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/UserExamManager.java @@ -75,11 +75,14 @@ public class UserExamManager { record.setExamId(examId); record.setMaxScore(score); record.setPassed(passed); + record.setTryCount(1); elUserExamService.save(record); return; } // 修复低分数不加入统计问题 - record.setTryCount(record.getTryCount()+1); + if(Objects.nonNull(record.getTryCount())){ + record.setTryCount(record.getTryCount()+1); + } record.setUpdateTime(new Date()); if(record.getMaxScore() < score){ record.setMaxScore(score);