|
@@ -21,6 +21,7 @@ import com.qmth.boot.core.concurrent.service.ConcurrentService;
|
|
|
import com.qmth.boot.core.exception.ParameterException;
|
|
|
import com.qmth.teachcloud.common.entity.SysUser;
|
|
|
import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
|
|
|
+import com.qmth.teachcloud.common.enums.ScanStatus;
|
|
|
import com.qmth.teachcloud.common.enums.scan.ConditionType;
|
|
|
import com.qmth.teachcloud.common.enums.scan.OmrField;
|
|
|
import com.qmth.teachcloud.mark.bean.OmrTaskItem;
|
|
@@ -33,6 +34,7 @@ import com.qmth.teachcloud.mark.dto.ScanOmrTaskResultDto;
|
|
|
import com.qmth.teachcloud.mark.dto.ScanOmrTaskResultPageDto;
|
|
|
import com.qmth.teachcloud.mark.dto.ScanOmrTaskSaveDto;
|
|
|
import com.qmth.teachcloud.mark.dto.ScanOmrTaskStatusDto;
|
|
|
+import com.qmth.teachcloud.mark.entity.MarkQuestion;
|
|
|
import com.qmth.teachcloud.mark.entity.MarkStudent;
|
|
|
import com.qmth.teachcloud.mark.entity.ScanOmrTask;
|
|
|
import com.qmth.teachcloud.mark.entity.ScanPaper;
|
|
@@ -40,9 +42,10 @@ import com.qmth.teachcloud.mark.entity.ScanPaperPage;
|
|
|
import com.qmth.teachcloud.mark.entity.ScanStudentPaper;
|
|
|
import com.qmth.teachcloud.mark.enums.LockType;
|
|
|
import com.qmth.teachcloud.mark.enums.OmrTaskStatus;
|
|
|
+import com.qmth.teachcloud.mark.enums.QuestionType;
|
|
|
import com.qmth.teachcloud.mark.mapper.ScanOmrTaskMapper;
|
|
|
+import com.qmth.teachcloud.mark.service.MarkQuestionService;
|
|
|
import com.qmth.teachcloud.mark.service.MarkStudentService;
|
|
|
-import com.qmth.teachcloud.mark.service.ScanAnswerCardService;
|
|
|
import com.qmth.teachcloud.mark.service.ScanOmrTaskService;
|
|
|
import com.qmth.teachcloud.mark.service.ScanPaperPageService;
|
|
|
import com.qmth.teachcloud.mark.service.ScanPaperService;
|
|
@@ -71,7 +74,7 @@ public class ScanOmrTaskServiceImpl extends ServiceImpl<ScanOmrTaskMapper, ScanO
|
|
|
@Autowired
|
|
|
private ConcurrentService concurrentService;
|
|
|
@Autowired
|
|
|
- private ScanAnswerCardService answerCardService;
|
|
|
+ private MarkQuestionService questionService;
|
|
|
|
|
|
private static final String OMR_SUSPECT = "?";
|
|
|
|
|
@@ -153,48 +156,46 @@ public class ScanOmrTaskServiceImpl extends ServiceImpl<ScanOmrTaskMapper, ScanO
|
|
|
// items.add(item);
|
|
|
// }
|
|
|
// }
|
|
|
-// if (ConditionType.QUESTION_MULTI_BLANK.equals(c)) {
|
|
|
-// 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.contains(OMR_BLANK)) {
|
|
|
-// OmrTaskItem item = new OmrTaskItem();
|
|
|
-// item.setIndex(i + 1);
|
|
|
-// item.setField(OmrField.QUESTION);
|
|
|
-// item.setOmrResult(result);
|
|
|
-// pageDto.getPageMultiBlankItems().add(item);
|
|
|
-// multi_blank_count++;
|
|
|
-// if (multi_blank_count > condition.getValue()) {
|
|
|
-// multi_blank = true;
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// if (ConditionType.QUESTION_SINGLE_BLANK.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.contains(OMR_BLANK)) {
|
|
|
-// OmrTaskItem item = new OmrTaskItem();
|
|
|
-// item.setIndex(i + 1);
|
|
|
-// item.setField(OmrField.QUESTION);
|
|
|
-// item.setOmrResult(result);
|
|
|
-// pageDto.getPageSingleBlankItems().add(item);
|
|
|
-// single_blank_count++;
|
|
|
-// multi_blank_count++;
|
|
|
-// if (single_blank_count > condition.getValue()) {
|
|
|
-// single_blank = true;
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
+ if (ConditionType.QUESTION_MULTI_BLANK.equals(c)) {
|
|
|
+ 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.MULTIPLE) && result != null && result.contains(OMR_BLANK)) {
|
|
|
+ OmrTaskItem item = new OmrTaskItem();
|
|
|
+ item.setIndex(i + 1);
|
|
|
+ item.setField(OmrField.QUESTION);
|
|
|
+ item.setOmrResult(result);
|
|
|
+ pageDto.getPageMultiBlankItems().add(item);
|
|
|
+ multi_blank_count++;
|
|
|
+ if (multi_blank_count > 0) {
|
|
|
+ multi_blank = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (ConditionType.QUESTION_SINGLE_BLANK.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) && result != null && result.contains(OMR_BLANK)) {
|
|
|
+ OmrTaskItem item = new OmrTaskItem();
|
|
|
+ item.setIndex(i + 1);
|
|
|
+ item.setField(OmrField.QUESTION);
|
|
|
+ item.setOmrResult(result);
|
|
|
+ pageDto.getPageSingleBlankItems().add(item);
|
|
|
+ single_blank_count++;
|
|
|
+ multi_blank_count++;
|
|
|
+ if (single_blank_count > 0) {
|
|
|
+ single_blank = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
// if (ConditionType.QUESTION_SINGLE_EXCEED.equals(c)
|
|
|
// && ScanStatus.SCANNED.equals(student.getStatus()) && !allObjectiveBlank) {
|
|
|
// for (int i = 0; pageEntity.getQuestion() != null && pageEntity.getQuestion().getResult() != null
|