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);