ting.yin 2 tahun lalu
induk
melakukan
cf25a5b639

+ 6 - 0
stmms-web/src/main/java/cn/com/qmth/stmms/admin/exam/PaperController.java

@@ -413,6 +413,12 @@ public class PaperController extends BaseExamController {
                         error.add("[" + subject.getCode() + "] 已存在分组");
                         continue;
                     }
+                    long selectiveGroupCount = selectiveGroupService.countByExamIdAndSubjectCode(examId,
+                            subject.getCode());
+                    if (selectiveGroupCount > 0) {
+                        error.add("[" + subject.getCode() + "] 已存在选做题分组");
+                        continue;
+                    }
                     Map<Integer, String> titleMap = new HashMap<>();
                     List<ExamQuestion> current = questionService.findByExamAndSubjectAndObjective(examId,
                             subject.getCode(), false);