|
@@ -414,57 +414,6 @@ public class ExamRecordCloudServiceProvider extends ControllerSupport implements
|
|
return resultList;
|
|
return resultList;
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 获取套题的主题干
|
|
|
|
- *
|
|
|
|
- * @param cachedQues
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- private String getParentBody(QuestionCacheBean cachedQues) {
|
|
|
|
-
|
|
|
|
- DefaultQuestionStructure questionStructure = cachedQues.getDefaultQuestion().getMasterVersion();
|
|
|
|
-
|
|
|
|
- //如果主题干不为空,则认为是套题
|
|
|
|
- return questionStructure.getBody();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 获取当前小题的题干
|
|
|
|
- *
|
|
|
|
- * @param curSubNumber 当前小题号
|
|
|
|
- * @param questionId 原小题id
|
|
|
|
- * @param cachedQues 带题干的试卷结构
|
|
|
|
- * @param subjectiveQuesList 主观题集合
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- private String getBody(Integer curSubNumber, String questionId,
|
|
|
|
- QuestionCacheBean cachedQues, List<ExamQuestionEntity> subjectiveQuesList) {
|
|
|
|
- DefaultQuestionStructure questionStructure = cachedQues.getDefaultQuestion().getMasterVersion();
|
|
|
|
-
|
|
|
|
- //body为空,则说明当前小题为非套题(即questionUnitList集合大小为1),可直接返回小题题干
|
|
|
|
- if (StringUtils.isNullOrEmpty(questionStructure.getBody())) {
|
|
|
|
- return questionStructure.getQuestionUnitList().get(0).getBody();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //同一questionId的主观题集合(不带题干)
|
|
|
|
- List<ExamQuestionEntity> noBodySubjectiveQuesList = subjectiveQuesList.stream().
|
|
|
|
- filter(p -> p.getQuestionId().equals(questionId)).collect(Collectors.toList());
|
|
|
|
-
|
|
|
|
- //同一questionId的主观题集合(带题干)
|
|
|
|
- List<DefaultQuestionUnit> haveBodySubjectiveQuesList = questionStructure.getQuestionUnitList().stream()
|
|
|
|
- .filter(p -> QuestionType.FILL_UP == p.getQuestionType() || QuestionType.ESSAY == p.getQuestionType())
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
-
|
|
|
|
- for (int i = 0; i < noBodySubjectiveQuesList.size(); i++) {
|
|
|
|
- //如果小题号相同,则根据相同索引从带题干的集合中取出对应的小题题干
|
|
|
|
- if (noBodySubjectiveQuesList.get(i).getOrder().intValue() == curSubNumber.intValue()) {
|
|
|
|
- return haveBodySubjectiveQuesList.get(i).getBody();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return "";
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 校验待阅卷数据
|
|
* 校验待阅卷数据
|
|
*
|
|
*
|
|
@@ -693,4 +642,14 @@ public class ExamRecordCloudServiceProvider extends ControllerSupport implements
|
|
return res;
|
|
return res;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ @ApiOperation(value = "检查试卷是否已使用")
|
|
|
|
+ @PostMapping("/checkPaperInExam")
|
|
|
|
+ public CheckPaperInExamResp checkPaperInExam(@RequestBody CheckPaperInExamReq req) {
|
|
|
|
+ if (org.apache.commons.lang3.StringUtils.isBlank(req.getBasePaperId())) {
|
|
|
|
+ throw new StatusException("500", "basePaperId不允许为空");
|
|
|
|
+ }
|
|
|
|
+ return examRecordDataService.checkPaperInExam(req);
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|