|
@@ -467,7 +467,7 @@ public class ImportPaperService {
|
|
tmpWordMl = DocxProcessUtil.formatPWordMl(tmpWordMl);
|
|
tmpWordMl = DocxProcessUtil.formatPWordMl(tmpWordMl);
|
|
quesBodyWordMl.append(tmpWordMl);
|
|
quesBodyWordMl.append(tmpWordMl);
|
|
quesBodyHtml.append(DocxProcessUtil.docx2Html(tmpWordMl, wordMLPackage));
|
|
quesBodyHtml.append(DocxProcessUtil.docx2Html(tmpWordMl, wordMLPackage));
|
|
- } else if (tmpText.matches("^[a-zA-Z]\\.[\\s\\S]*") || tmpText.startsWith("[")) {
|
|
|
|
|
|
+ } else if (tmpText.matches("^[a-zA-Z]\\.[\\s\\S]*") || tmpText.startsWith(ImportPaperMsg.left_bracket)) {
|
|
// 检测到选项或其他特殊段落直接退出
|
|
// 检测到选项或其他特殊段落直接退出
|
|
break;
|
|
break;
|
|
} else{
|
|
} else{
|
|
@@ -959,7 +959,7 @@ public class ImportPaperService {
|
|
}
|
|
}
|
|
for(String answer:pAnswerArray){
|
|
for(String answer:pAnswerArray){
|
|
answer = answer.trim();
|
|
answer = answer.trim();
|
|
- String pattern = "\\s*([A-Z]|[a-z])\\s*";
|
|
|
|
|
|
+ String pattern = "[A-Z]|[a-z]";
|
|
if(!Pattern.matches(pattern,answer)){
|
|
if(!Pattern.matches(pattern,answer)){
|
|
importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, subQuesNum)+
|
|
importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, subQuesNum)+
|
|
"中,答案格式不正确,答案为:"+answerWord);
|
|
"中,答案格式不正确,答案为:"+answerWord);
|
|
@@ -1024,5 +1024,9 @@ public class ImportPaperService {
|
|
String word = replaceContent.replace("[", "").replace("]", "");
|
|
String word = replaceContent.replace("[", "").replace("]", "");
|
|
return pText.replaceAll("\\["+word+"\\]","").replaceAll("[:|:]", "").trim();
|
|
return pText.replaceAll("\\["+word+"\\]","").replaceAll("[:|:]", "").trim();
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ public static void main(String[] args){
|
|
|
|
+ String answer = "a";
|
|
|
|
+ String pattern = "[A-Z]|[a-z]";
|
|
|
|
+ System.out.println(Pattern.matches(pattern,answer));
|
|
|
|
+ }
|
|
}
|
|
}
|