|
@@ -472,6 +472,8 @@ public class ImportPaperService {
|
|
|
public void initPaperDetail(Paper paper, PaperDetail paperDetail, PaperDetailUnit paperDetailUnit,
|
|
|
Question question, int subQuesNum, ImportPaperCheck importPaperCheck) {
|
|
|
|
|
|
+ //重置importPaperCheck
|
|
|
+ importPaperCheck.nestedHeadNumber = 0;
|
|
|
question.setQuestionType(getQuesStructType(importPaperCheck.quesType));
|
|
|
question.setScore(Double.parseDouble(importPaperCheck.quesScore));
|
|
|
paperDetailUnit.setNumber(subQuesNum);
|
|
@@ -1782,14 +1784,17 @@ public class ImportPaperService {
|
|
|
String[] quesAnwser = question.getQuesAnswer().split("<span>##");
|
|
|
//如果有答案,进行判断
|
|
|
if(quesAnwser.length>0){
|
|
|
- //判断题干空格和答案空格是否相等
|
|
|
- if((quesBody.length -1) != quesAnwser.length){
|
|
|
- if(importPaperCheck.nestedHeadNumber == 0){
|
|
|
- importPaperCheck.setErrorInfo("[大题名称]:"+importPaperCheck.quesName+"第"+subQuesNum+"题中,题干与答案的空格数量不一样");
|
|
|
- }else {
|
|
|
- importPaperCheck.setErrorInfo("[大题名称]:"+importPaperCheck.quesName+"第"+importPaperCheck.nestedHeadNumber+"个套题中,第"+subQuesNum+"题中,题干与答案的空格数量不一样");
|
|
|
+ String str = quesAnwser[0].replaceAll("<p>", "").replaceAll("</p>", "").replaceAll("<span>", "").replaceAll("</span>", "");
|
|
|
+ if(quesAnwser.length == 1 && !StringUtils.isBlank(str) || quesAnwser.length >2){
|
|
|
+ //判断题干空格和答案空格是否相等
|
|
|
+ if((quesBody.length -1) != quesAnwser.length){
|
|
|
+ if(importPaperCheck.nestedHeadNumber == 0){
|
|
|
+ importPaperCheck.setErrorInfo("[大题名称]:"+importPaperCheck.quesName+"第"+subQuesNum+"题中,题干与答案的空格数量不一样");
|
|
|
+ }else {
|
|
|
+ importPaperCheck.setErrorInfo("[大题名称]:"+importPaperCheck.quesName+"第"+importPaperCheck.nestedHeadNumber+"个套题中,第"+subQuesNum+"题中,题干与答案的空格数量不一样");
|
|
|
+ }
|
|
|
+ throw new PaperException(importPaperCheck.errorInfo);
|
|
|
}
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
}
|
|
|
}
|
|
|
}
|