xiatian 5 年之前
父节点
当前提交
0493de5ee5

+ 9 - 0
examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/ImportPaperService.java

@@ -1011,6 +1011,15 @@ public class ImportPaperService {
                 String tmpWordMl = DocxProcessUtil.getPWordMl(pAnswer);
                 answerWordML.append(DocxProcessUtil.formatPWordMl(tmpWordMl));
                 answerHTML.append(DocxProcessUtil.docx2Html(tmpWordMl, wordMLPackage));
+                if (question.getQuestionType() == QuesStructType.SINGLE_ANSWER_QUESTION
+                        || question.getQuestionType() == QuesStructType.MULTIPLE_ANSWER_QUESTION) {
+                    importPaperCheck.setErrorInfo(
+                            getQuesNumInfo(importPaperCheck.getQuesName(), subQuesNum) + "中,答案格式不正确,答案为:" + answerHTML);
+                    throw new PaperException(importPaperCheck.getErrorInfo());
+                }else if(question.getQuestionType() == QuesStructType.BOOL_ANSWER_QUESTION){
+                    importPaperCheck.setErrorInfo(
+                            getQuesNumInfo(importPaperCheck.getQuesName(), subQuesNum) + "中,答案格式不正确,应为:正确或错误");
+                }
             } else {
                 break;
             }