|
@@ -1027,8 +1027,8 @@ public class SystemConstant {
|
|
|
public static OpenRecordNeedMarkBean filterAnswer(OpenRecordNeedMarkBean openRecordNeedMarkBean,
|
|
|
List<OpenRecordAnswerTempBean> answersTemp,
|
|
|
Map<Long, Map<String, Integer>> paperStructMap) {
|
|
|
+ TEExamPaperService teExamPaperService = SpringContextHolder.getBean(TEExamPaperService.class);
|
|
|
if (!CollectionUtils.isEmpty(answersTemp)) {
|
|
|
- TEExamPaperService teExamPaperService = SpringContextHolder.getBean(TEExamPaperService.class);
|
|
|
List<OpenRecordAnswerBean> answers = new ArrayList<>(answersTemp.size());
|
|
|
List<OpenRecordAnswerBean> finalAnswers = answers;
|
|
|
answersTemp.forEach(s -> {
|
|
@@ -1059,6 +1059,40 @@ public class SystemConstant {
|
|
|
return type != null && type != 1 && type != 2 && type != 3;
|
|
|
}).collect(Collectors.toList()));
|
|
|
}
|
|
|
+ //考生未答题或未答主观题
|
|
|
+ if (CollectionUtils.isEmpty(openRecordNeedMarkBean.getAnswers()) || CollectionUtils.isEmpty(answersTemp)) {
|
|
|
+ Map<String, Integer> struct = paperStructMap.get(openRecordNeedMarkBean.getPaperId());
|
|
|
+ if (struct == null) {
|
|
|
+ struct = teExamPaperService.getPaperStructCacheBean(openRecordNeedMarkBean.getPaperId());
|
|
|
+ if (struct != null) {
|
|
|
+ paperStructMap.put(openRecordNeedMarkBean.getPaperId(), struct);
|
|
|
+ } else {
|
|
|
+ log.error("找不到对应的试卷结构,paperId=" + openRecordNeedMarkBean.getPaperId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<OpenRecordAnswerBean> answers = new ArrayList<>();
|
|
|
+ for (Map.Entry<String, Integer> entry : struct.entrySet()) {
|
|
|
+ if (entry.getValue() >= 4 && entry.getValue() <= 8) {
|
|
|
+ String[] strs = entry.getKey().split("_");
|
|
|
+ OpenRecordAnswerBean openRecordAnswerBean = null;
|
|
|
+ if (strs.length == 3) {
|
|
|
+ openRecordAnswerBean = new OpenRecordAnswerBean(Integer.parseInt(strs[0]), Integer.parseInt(strs[1]), Integer.parseInt(strs[2]));
|
|
|
+ } else {
|
|
|
+ openRecordAnswerBean = new OpenRecordAnswerBean(Integer.parseInt(strs[0]), Integer.parseInt(strs[1]));
|
|
|
+ }
|
|
|
+ String answer = "[{\"index\":1,\"sections\":[{\"blocks\":[{\"type\":\"text\",\"value\":\"\"}]}]}]";
|
|
|
+ try {
|
|
|
+ openRecordAnswerBean.setAnswer(GsonUtil.fromJson(answer, new TypeToken<List<OpenRecordAnswerStructBean>>() {
|
|
|
+ }.getType()));
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("错误答案:{}", answer, e);
|
|
|
+ }
|
|
|
+ answers.add(openRecordAnswerBean);
|
|
|
+ openRecordNeedMarkBean.setAnswers(answers);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
return openRecordNeedMarkBean;
|
|
|
}
|
|
|
|