|
@@ -201,23 +201,24 @@ public class ScanOmrTaskServiceImpl extends ServiceImpl<ScanOmrTaskMapper, ScanO
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-// if (ConditionType.QUESTION_SINGLE_EXCEED.equals(c)
|
|
|
-// && ScanStatus.SCANNED.equals(student.getStatus()) && !allObjectiveBlank) {
|
|
|
-// for (int i = 0; pageEntity.getQuestion() != null && pageEntity.getQuestion().getResult() != null
|
|
|
-// && i < pageEntity.getQuestion().getResult().size(); i++) {
|
|
|
-// String result = pageEntity.getQuestion().getResult().get(i);
|
|
|
-// PaperStructure question = structureService.getPaperStructure(paper.getExamId(),
|
|
|
-// paper.getCardNumber(), spe.getPaperNumber(), pageEntity.getPageIndex(), i + 1,
|
|
|
-// OmrField.QUESTION);
|
|
|
-// if (question.getSingle() && result != null && result.length() > 1) {
|
|
|
-// OmrTaskItem item = new OmrTaskItem();
|
|
|
-// item.setIndex(i + 1);
|
|
|
-// item.setField(OmrField.QUESTION);
|
|
|
-// item.setOmrResult(result);
|
|
|
-// items.add(item);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
+ if (ConditionType.QUESTION_SINGLE_EXCEED.equals(c)
|
|
|
+ && ScanStatus.SCANNED.equals(student.getScanStatus()) && !allObjectiveBlank) {
|
|
|
+ List<MarkQuestion> questiongList = questionService
|
|
|
+ .listByExamIdAndPaperNumberAndPaperIndexAndPageIndex(student.getExamId(),
|
|
|
+ student.getPaperNumber(), spe.getPaperIndex(), pageEntity.getPageIndex());
|
|
|
+ for (int i = 0; pageEntity.getQuestion() != null && pageEntity.getQuestion().getResult() != null
|
|
|
+ && i < pageEntity.getQuestion().getResult().size(); i++) {
|
|
|
+ String result = pageEntity.getQuestion().getResult().get(i);
|
|
|
+ MarkQuestion question = questiongList.get(i);
|
|
|
+ if (question.getQuestionType().equals(QuestionType.SINGLE.getValue()) && result != null && result.length() > 1) {
|
|
|
+ OmrTaskItem item = new OmrTaskItem();
|
|
|
+ item.setIndex(i + 1);
|
|
|
+ item.setField(OmrField.QUESTION);
|
|
|
+ item.setOmrResult(result);
|
|
|
+ items.add(item);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
if (retList.size() == 0) {
|
|
@@ -588,21 +589,14 @@ public class ScanOmrTaskServiceImpl extends ServiceImpl<ScanOmrTaskMapper, ScanO
|
|
|
@Override
|
|
|
public void saveTask(Long studentId) {
|
|
|
List<ScanOmrTask> omrTaskList = new ArrayList<ScanOmrTask>();
|
|
|
- ScanOmrTask omrTask = this.buildTask(ConditionType.FILL_SUSPECT, studentId);
|
|
|
- if (omrTask != null) {
|
|
|
- omrTaskList.add(omrTask);
|
|
|
- }
|
|
|
- omrTask = this.buildTask(ConditionType.QUESTION_MULTI_BLANK, studentId);
|
|
|
- if (omrTask != null) {
|
|
|
- omrTaskList.add(omrTask);
|
|
|
- }
|
|
|
- omrTask = this.buildTask(ConditionType.QUESTION_SINGLE_BLANK, studentId);
|
|
|
- if (omrTask != null) {
|
|
|
- omrTaskList.add(omrTask);
|
|
|
+ for (ConditionType c : ConditionType.values()) {
|
|
|
+ ScanOmrTask omrTask = this.buildTask(c, studentId);
|
|
|
+ if (omrTask != null) {
|
|
|
+ omrTaskList.add(omrTask);
|
|
|
+ }
|
|
|
}
|
|
|
if (!omrTaskList.isEmpty()) {
|
|
|
this.saveBatch(omrTaskList);
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|