|
@@ -282,15 +282,17 @@ public class ExamPaperStructureServiceImpl extends ServiceImpl<ExamPaperStructur
|
|
|
public ExamPaperStructure submitExamPaperParams(String evaluationParameterStr, SysUser requestUser) {
|
|
|
// 1.判断试卷中主观题是否全部完成分组
|
|
|
EvaluationParameters evaluationParameters = JSON.parseObject(evaluationParameterStr, EvaluationParameters.class);
|
|
|
-// Question.matchTwoQuestionList(evaluationParameters.getPaperStructureInfo().getSubjectiveQuestionList(),
|
|
|
-// evaluationParameters.getGroupInfo().stream().flatMap(e -> {
|
|
|
-// List<Question> questionList = e.getQuestions();
|
|
|
-//
|
|
|
-// }).collect(Collectors.toList()));
|
|
|
+ boolean matchSubAndGroup = Question.matchTwoQuestionList(evaluationParameters.getPaperStructureInfo().getSubjectiveQuestionList(),
|
|
|
+ evaluationParameters.getGroupInfo().stream().flatMap(e -> {
|
|
|
+ List<Question> questionList = e.getQuestions();
|
|
|
+ return questionList.stream();
|
|
|
+ }).collect(Collectors.toList()));
|
|
|
+ if (!matchSubAndGroup) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("题目没有全部完成分组或者试卷机构中的主观题结构和分组中主观题结构不一致");
|
|
|
+ }
|
|
|
// 2.保存试卷结构
|
|
|
ExamPaperStructure examPaperStructure = this.saveExamPaperStructure(evaluationParameterStr, requestUser);
|
|
|
// 3.保存分组和分组关系信息
|
|
|
-
|
|
|
examPaperGroupService.saveExamPaperGroupInfo(examPaperStructure.getId(), evaluationParameters.getGroupInfo());
|
|
|
// 返回试卷结构信息
|
|
|
return examPaperStructure;
|