|
@@ -101,8 +101,7 @@ public class ImportPaperService {
|
|
|
public File getUploadFile(CommonsMultipartFile file) throws Exception {
|
|
|
String fileName = file.getOriginalFilename();
|
|
|
File tempFile = new File(DocxProcessUtil.TEMP_FILE_IMP + fileName);
|
|
|
- OutputStream os = null;
|
|
|
- os = new FileOutputStream(tempFile);
|
|
|
+ OutputStream os = new FileOutputStream(tempFile);
|
|
|
IOUtils.copyLarge(file.getInputStream(), os);
|
|
|
IOUtils.closeQuietly(os);
|
|
|
return tempFile;
|
|
@@ -137,7 +136,7 @@ public class ImportPaperService {
|
|
|
List<Question> questions,
|
|
|
ImportPaperCheck importPaperCheck) throws Exception {
|
|
|
Paper tempPaper = null;
|
|
|
- if (!StringUtils.isEmpty(importPaperCheck.errorInfo))
|
|
|
+ if (!StringUtils.isEmpty(importPaperCheck.getErrorInfo()))
|
|
|
return null;
|
|
|
if (paper != null) {
|
|
|
//总分校验
|
|
@@ -178,8 +177,8 @@ public class ImportPaperService {
|
|
|
* @return
|
|
|
*/
|
|
|
private List<PaperDetail> mergePaperDetails(List<PaperDetail> paperDetails, List<PaperDetailUnit> paperDetailUnits) {
|
|
|
- List<PaperDetail> mergePaperDetails = new ArrayList<PaperDetail>();
|
|
|
- Set<String> set = new HashSet<String>();
|
|
|
+ List<PaperDetail> mergePaperDetails = new ArrayList<>();
|
|
|
+ Set<String> set = new HashSet<>();
|
|
|
for (PaperDetail paperDetail : paperDetails) {
|
|
|
if (set.add(paperDetail.getName())) {
|
|
|
mergePaperDetails.add(paperDetail);
|
|
@@ -245,11 +244,11 @@ public class ImportPaperService {
|
|
|
// 创建空大题类
|
|
|
PaperDetail paperDetail = null;
|
|
|
// 创建大题集合
|
|
|
- List<PaperDetail> paperDetails = new ArrayList<PaperDetail>();
|
|
|
+ List<PaperDetail> paperDetails = new ArrayList<>();
|
|
|
// 创建小题集合
|
|
|
- List<PaperDetailUnit> paperDetailUnits = new ArrayList<PaperDetailUnit>();
|
|
|
+ List<PaperDetailUnit> paperDetailUnits = new ArrayList<>();
|
|
|
// 创建试题集合
|
|
|
- List<Question> questions = new ArrayList<Question>();
|
|
|
+ List<Question> questions = new ArrayList<>();
|
|
|
// 大题号
|
|
|
int mainQuesNum = 0;
|
|
|
// 小题号
|
|
@@ -264,22 +263,22 @@ public class ImportPaperService {
|
|
|
continue;
|
|
|
} else if (isMainQuesHeader(pText)) {
|
|
|
// 处理大题头信息
|
|
|
- processMainQuesHeader(pList, importPaperCheck.index, importPaperCheck, courseNo);
|
|
|
+ processMainQuesHeader(pList, importPaperCheck.getIndex(), importPaperCheck, courseNo);
|
|
|
// 校验大题头信息
|
|
|
if (!checkQuesHeader(importPaperCheck)) {
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
// 创建大题类
|
|
|
paperDetail = new PaperDetail();
|
|
|
// 设置大题类
|
|
|
initQuesHeader(paper, paperDetail, paperDetails, ++mainQuesNum, importPaperCheck);
|
|
|
// 设置当前索引,防止多余循环
|
|
|
- i = importPaperCheck.index - 1;
|
|
|
+ i = importPaperCheck.getIndex() - 1;
|
|
|
errorQuesNum = 0;
|
|
|
} else if (DocxProcessUtil.isNumPr(p)) {
|
|
|
// 检测到序列
|
|
|
- importPaperCheck.setErrorInfo(importPaperCheck.quesName + ImportPaperMsg.errMsg_10);
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ importPaperCheck.setErrorInfo(importPaperCheck.getQuesName() + ImportPaperMsg.errMsg_10);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
|
|
|
} else if ((pText.matches("^\\d{1,}\\.[\\s\\S]*") && !pText.startsWith(ImportPaperMsg.left_bracket))
|
|
|
|| (isNested(importPaperCheck) && pText.startsWith(ImportPaperMsg.nestedQuestion_start))) {
|
|
@@ -295,24 +294,24 @@ public class ImportPaperService {
|
|
|
// 初始化小题类和试题类
|
|
|
initPaperDetail(paper, paperDetail, paperDetailUnit, question, subQuesNum, importPaperCheck);
|
|
|
// 处理客观题
|
|
|
- if (importPaperCheck.quesType.equals(ImportPaperMsg.singleSelection) || importPaperCheck.quesType.equals(ImportPaperMsg.multipleSelection)) {
|
|
|
+ if (importPaperCheck.getQuesType().equals(ImportPaperMsg.singleSelection) || importPaperCheck.getQuesType().equals(ImportPaperMsg.multipleSelection)) {
|
|
|
// 处理题干
|
|
|
- processQuesBody(pList, importPaperCheck.index, subQuesNum, question, importPaperCheck, tmpWordMlPackage, errorQuesNum);
|
|
|
+ processQuesBody(pList, importPaperCheck.getIndex(), subQuesNum, question, importPaperCheck, tmpWordMlPackage, errorQuesNum);
|
|
|
// 处理选项
|
|
|
- processQuesOption(pList, importPaperCheck.index, subQuesNum, question, importPaperCheck,
|
|
|
+ processQuesOption(pList, importPaperCheck.getIndex(), subQuesNum, question, importPaperCheck,
|
|
|
tmpWordMlPackage, errorQuesNum);
|
|
|
// 处理尾信息
|
|
|
- processQuesTail(pList, importPaperCheck.index, subQuesNum, question, paperDetailUnit,
|
|
|
+ processQuesTail(pList, importPaperCheck.getIndex(), subQuesNum, question, paperDetailUnit,
|
|
|
importPaperCheck, tmpWordMlPackage, false, paper, errorQuesNum);
|
|
|
// 处理选择题的option--chenken 20170425
|
|
|
processSelectOption(question);
|
|
|
- } else if (importPaperCheck.quesType.equals(ImportPaperMsg.nestedQuestion_word)) {
|
|
|
+ } else if (importPaperCheck.getQuesType().equals(ImportPaperMsg.nestedQuestion_word)) {
|
|
|
// 处理套题
|
|
|
- processNestedQues(pList, importPaperCheck.index, question, paperDetailUnit, importPaperCheck, tmpWordMlPackage, paper);
|
|
|
+ processNestedQues(pList, importPaperCheck.getIndex(), question, paperDetailUnit, importPaperCheck, tmpWordMlPackage, paper);
|
|
|
} else {
|
|
|
// 处理其他题型
|
|
|
- processQuesBody(pList, importPaperCheck.index, subQuesNum, question, importPaperCheck, tmpWordMlPackage, errorQuesNum);
|
|
|
- processQuesTail(pList, importPaperCheck.index, subQuesNum, question, paperDetailUnit, importPaperCheck, tmpWordMlPackage, false, paper, errorQuesNum);
|
|
|
+ processQuesBody(pList, importPaperCheck.getIndex(), subQuesNum, question, importPaperCheck, tmpWordMlPackage, errorQuesNum);
|
|
|
+ processQuesTail(pList, importPaperCheck.getIndex(), subQuesNum, question, paperDetailUnit, importPaperCheck, tmpWordMlPackage, false, paper, errorQuesNum);
|
|
|
//填空题空格校验
|
|
|
if (question.getQuestionType().getName().equals(QuesStructType.FILL_BLANK_QUESTION.getName())) {
|
|
|
if (!StringUtils.isBlank(question.getQuesAnswer())) {
|
|
@@ -332,7 +331,7 @@ public class ImportPaperService {
|
|
|
questions.add(question);
|
|
|
paperDetailUnits.add(paperDetailUnit);
|
|
|
// 设置当前索引,防止多余循环
|
|
|
- i = importPaperCheck.index - 1;
|
|
|
+ i = importPaperCheck.getIndex() - 1;
|
|
|
} else if (paperDetail == null) {
|
|
|
throw new PaperException("导入文件格式有误,必须有大题头信息,且以[试题分类]开头!");
|
|
|
} else {
|
|
@@ -342,8 +341,8 @@ public class ImportPaperService {
|
|
|
}
|
|
|
throw new PaperException(importPaperCheck.getQuesName() + ":“" + errorMsg + "”" + ImportPaperMsg.errMsg_12);
|
|
|
}
|
|
|
- if (!StringUtils.isEmpty(importPaperCheck.errorInfo)) {
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ if (!StringUtils.isEmpty(importPaperCheck.getErrorInfo())) {
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
}
|
|
|
if (paperDetails.size() == 0 || paperDetailUnits.size() == 0) {
|
|
@@ -372,7 +371,7 @@ public class ImportPaperService {
|
|
|
}
|
|
|
|
|
|
public List<String> getWordXmlByQuestion(Question question) {
|
|
|
- List<String> wordXmls = new ArrayList<String>();
|
|
|
+ List<String> wordXmls = new ArrayList<>();
|
|
|
wordXmls.add(question.getQuesBodyWord());
|
|
|
List<QuesOption> options = question.getQuesOptions();
|
|
|
if (options != null && options.size() > 0) {
|
|
@@ -446,8 +445,8 @@ public class ImportPaperService {
|
|
|
|
|
|
paperDetail.setPaper(paper);
|
|
|
// 设置大题信息
|
|
|
- paperDetail.setName(importPaperCheck.quesName);
|
|
|
- paperDetail.setUnitCount(Integer.parseInt(importPaperCheck.quesCount));
|
|
|
+ paperDetail.setName(importPaperCheck.getQuesName());
|
|
|
+ paperDetail.setUnitCount(Integer.parseInt(importPaperCheck.getQuesCount()));
|
|
|
paperDetail.setNumber(mainQuesNum);
|
|
|
paperDetail.setCreator(paper.getCreator());
|
|
|
paperDetails.add(paperDetail);
|
|
@@ -467,14 +466,14 @@ public class ImportPaperService {
|
|
|
Question question, int subQuesNum, ImportPaperCheck importPaperCheck) {
|
|
|
|
|
|
//重置importPaperCheck
|
|
|
- importPaperCheck.nestedHeadNumber = 0;
|
|
|
- question.setQuestionType(getQuesStructType(importPaperCheck.quesType));
|
|
|
- question.setScore(Double.parseDouble(importPaperCheck.quesScore));
|
|
|
+ importPaperCheck.setNestedHeadNumber(0);
|
|
|
+ question.setQuestionType(getQuesStructType(importPaperCheck.getQuesType()));
|
|
|
+ question.setScore(Double.parseDouble(importPaperCheck.getQuesScore()));
|
|
|
paperDetailUnit.setNumber(subQuesNum);
|
|
|
paperDetailUnit.setQuestion(question);
|
|
|
paperDetailUnit.setPaperDetail(paperDetail);
|
|
|
- paperDetailUnit.setQuestionType(getQuesStructType(importPaperCheck.quesType));
|
|
|
- paperDetailUnit.setScore(Double.parseDouble(importPaperCheck.quesScore));
|
|
|
+ paperDetailUnit.setQuestionType(getQuesStructType(importPaperCheck.getQuesType()));
|
|
|
+ paperDetailUnit.setScore(Double.parseDouble(importPaperCheck.getQuesScore()));
|
|
|
paperDetailUnit.setCreator(paper.getCreator());
|
|
|
paperDetailUnit.setPaper(paper);
|
|
|
paperDetailUnit.setPaperType(PaperType.IMPORT);
|
|
@@ -489,26 +488,26 @@ public class ImportPaperService {
|
|
|
public boolean checkQuesHeader(ImportPaperCheck importPaperCheck) {
|
|
|
|
|
|
String tmpErrorInfo = "";
|
|
|
- if (StringUtils.isEmpty(importPaperCheck.quesGroup)) {
|
|
|
+ if (StringUtils.isEmpty(importPaperCheck.getQuesGroup())) {
|
|
|
tmpErrorInfo += ImportPaperMsg.errMsg_04;
|
|
|
|
|
|
}
|
|
|
- if (StringUtils.isEmpty(importPaperCheck.quesType)) {
|
|
|
+ if (StringUtils.isEmpty(importPaperCheck.getQuesType())) {
|
|
|
tmpErrorInfo += ImportPaperMsg.errMsg_05;
|
|
|
|
|
|
}
|
|
|
- if (StringUtils.isEmpty(importPaperCheck.quesName)) {
|
|
|
+ if (StringUtils.isEmpty(importPaperCheck.getQuesName())) {
|
|
|
tmpErrorInfo += ImportPaperMsg.errMsg_06;
|
|
|
|
|
|
}
|
|
|
- if (StringUtils.isEmpty(importPaperCheck.quesCount)) {
|
|
|
+ if (StringUtils.isEmpty(importPaperCheck.getQuesCount())) {
|
|
|
tmpErrorInfo += ImportPaperMsg.errMsg_07;
|
|
|
|
|
|
}
|
|
|
- if (StringUtils.isEmpty(importPaperCheck.quesScore)) {
|
|
|
+ if (StringUtils.isEmpty(importPaperCheck.getQuesScore())) {
|
|
|
tmpErrorInfo += ImportPaperMsg.errMsg_08;
|
|
|
}
|
|
|
- if (!StringUtils.isEmpty(importPaperCheck.quesType) && !CommonUtils.checkQuesType(importPaperCheck.quesType)) {
|
|
|
+ if (!StringUtils.isEmpty(importPaperCheck.getQuesType()) && !CommonUtils.checkQuesType(importPaperCheck.getQuesType())) {
|
|
|
tmpErrorInfo += ImportPaperMsg.errMsg_09;
|
|
|
}
|
|
|
if (StringUtils.isEmpty(tmpErrorInfo)) {
|
|
@@ -548,46 +547,46 @@ public class ImportPaperService {
|
|
|
if (tmpText.startsWith(ImportPaperMsg.questionClassify_word)) {
|
|
|
if (!nextTmpText.startsWith(ImportPaperMsg.questionType_word)) {
|
|
|
importPaperCheck.setErrorInfo("[试题分类]的下一题头应该是[题型],当前读到的信息为:“" + nextTmpText + "”,请检查word中格式问题");
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
List<String> paperList = Stream.of(tmpText.split("_")).collect(Collectors.toList());
|
|
|
//获取[试题分类]中的课程代码
|
|
|
if (paperList.size() != 2) {
|
|
|
importPaperCheck.setErrorInfo("[试题分类]的格式不正确或者是内容为空");
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
String impCourseCode = paperList.get(1);
|
|
|
if (!courseNo.equals(impCourseCode)) {
|
|
|
importPaperCheck.setErrorInfo("[试题分类]中的课程代码与指定的课程代码不一样,当前读到的信息为:“" + tmpText + "”,请检查word中格式问题");
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
importPaperCheck.setQuesGroup(getContent(tmpText, ImportPaperMsg.questionClassify_word));
|
|
|
} else if (tmpText.startsWith(ImportPaperMsg.questionType_word)) {
|
|
|
if (!nextTmpText.startsWith(ImportPaperMsg.questionName_word)) {
|
|
|
importPaperCheck.setErrorInfo("[题型]的下一题头应该是[大题名称],当前读到的信息为:“" + nextTmpText + "”,请检查word中格式问题");
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
importPaperCheck.setQuesType(getContent(tmpText, ImportPaperMsg.questionType_word));
|
|
|
} else if (tmpText.startsWith(ImportPaperMsg.questionName_word)) {
|
|
|
if (!nextTmpText.startsWith(ImportPaperMsg.questionNum_word)) {
|
|
|
importPaperCheck.setErrorInfo("[大题名称]的下一题头应该是[题目数量],当前读到的信息为:“" + nextTmpText + "”,请检查word中格式问题");
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
importPaperCheck.setQuesName(getContent(tmpText, ImportPaperMsg.questionName_word));
|
|
|
} else if (tmpText.startsWith(ImportPaperMsg.questionNum_word)) {
|
|
|
if (!CommonUtils.isInteger(getContent(tmpText, ImportPaperMsg.questionNum_word))) {
|
|
|
importPaperCheck.setErrorInfo("[题目数量]的格式不正确");
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
if (!nextTmpText.startsWith(ImportPaperMsg.score_word)) {
|
|
|
importPaperCheck.setErrorInfo("[题目数量]的下一题头应该是[分数],当前读到的信息为:“" + nextTmpText + "”,请检查word中格式问题");
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
importPaperCheck.setQuesCount(getContent(tmpText, ImportPaperMsg.questionNum_word));
|
|
|
} else if (tmpText.startsWith(ImportPaperMsg.score_word)) {
|
|
|
if (!CommonUtils.isInteger(getContent(tmpText, ImportPaperMsg.score_word))) {
|
|
|
importPaperCheck.setErrorInfo("[分数]的格式不正确");
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
importPaperCheck.setQuesScore(getContent(tmpText, ImportPaperMsg.score_word));
|
|
|
} else if (StringUtils.isEmpty(tmpText)) {
|
|
@@ -624,13 +623,13 @@ public class ImportPaperService {
|
|
|
//判断【套题】后面的值
|
|
|
if (StringUtils.isBlank(getContent(tmpText, ImportPaperMsg.nestedQuestion_start))) {
|
|
|
importPaperCheck.setErrorInfo(paperDetailUnit.getPaperDetail().getName() + "中“[套题]:”的后面没有值,当前读到的信息为:“" + tmpText + "”,请检查word中格式问题");
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
Pattern pattern = Pattern.compile("[0-9]*");
|
|
|
boolean isHeadNumber = pattern.matcher(getContent(tmpText, ImportPaperMsg.nestedQuestion_start)).matches();
|
|
|
if (!isHeadNumber) {
|
|
|
importPaperCheck.setErrorInfo("[套题]后面应该为整数,当前读到的信息为:“" + tmpText + "”,请检查word中格式问题");
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
//判断是否含有【套题数量】标签
|
|
|
if (!nextTmpText.startsWith(ImportPaperMsg.nestedQuestion_number)) {
|
|
@@ -639,21 +638,21 @@ public class ImportPaperService {
|
|
|
nextTmpText = nextTmpText.substring(0, 50) + "...";
|
|
|
}
|
|
|
importPaperCheck.setErrorInfo("[大题名称]:" + paperDetailUnit.getPaperDetail().getName() + "," + tmpText + "的下一题头应该是[套题数量],当前读到的信息为:“" + nextTmpText + "”,请检查word中格式问题");
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
//判断【套题数量】后面的值
|
|
|
if (StringUtils.isBlank(getContent(nextTmpText, ImportPaperMsg.nestedQuestion_number))) {
|
|
|
importPaperCheck.setErrorInfo("[套题数量]的后面没有值,当前读到的信息为:“" + nextTmpText + "”,请检查word中格式问题");
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
boolean isNumber = pattern.matcher(getContent(nextTmpText, ImportPaperMsg.nestedQuestion_number)).matches();
|
|
|
|
|
|
if (!isNumber) {
|
|
|
importPaperCheck.setErrorInfo("[套题数量]应该为整数,当前读到的信息为:“" + nextTmpText + "”,请检查word中格式问题");
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
- importPaperCheck.nestedHeadNumber = Integer.parseInt(getContent(tmpText, ImportPaperMsg.nestedQuestion_start));
|
|
|
- importPaperCheck.nestedQuesNumber = Integer.parseInt(getContent(nextTmpText, ImportPaperMsg.nestedQuestion_number));
|
|
|
+ importPaperCheck.setNestedHeadNumber(Integer.parseInt(getContent(tmpText, ImportPaperMsg.nestedQuestion_start)));
|
|
|
+ importPaperCheck.setNestedQuesNumber(Integer.parseInt(getContent(nextTmpText, ImportPaperMsg.nestedQuestion_number)));
|
|
|
} else {
|
|
|
importPaperCheck.setIndex(i + 1);
|
|
|
break;
|
|
@@ -685,8 +684,8 @@ public class ImportPaperService {
|
|
|
continue;
|
|
|
} else if (DocxProcessUtil.isNumPr(pBody)) {
|
|
|
// 检测到序列
|
|
|
- importPaperCheck.setErrorInfo(importPaperCheck.quesName + ImportPaperMsg.errMsg_10);
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ importPaperCheck.setErrorInfo(importPaperCheck.getQuesName() + ImportPaperMsg.errMsg_10);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
|
|
|
} else if (tmpText.matches("^\\d{1,}\\.[\\s\\S]*")) {
|
|
|
// 题干第一段
|
|
@@ -709,19 +708,19 @@ public class ImportPaperService {
|
|
|
}
|
|
|
if (StringUtils.isEmpty(quesBodyHtml) || StringUtils.isEmpty(quesBodyWordMl)) {
|
|
|
if (subQuesNum == 0) {
|
|
|
- if (importPaperCheck.nestedHeadNumber != 0) {
|
|
|
- importPaperCheck.setErrorInfo(importPaperCheck.quesName + "第" + importPaperCheck.nestedHeadNumber + "个题" + ImportPaperMsg.errMsg_01);
|
|
|
+ if (importPaperCheck.getNestedHeadNumber() != 0) {
|
|
|
+ importPaperCheck.setErrorInfo(importPaperCheck.getQuesName() + "第" + importPaperCheck.getNestedHeadNumber() + "个题" + ImportPaperMsg.errMsg_01);
|
|
|
} else {
|
|
|
- importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, errorQuesNum) + ImportPaperMsg.errMsg_01);
|
|
|
+ importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.getQuesName(), errorQuesNum) + ImportPaperMsg.errMsg_01);
|
|
|
}
|
|
|
} else {
|
|
|
- if (importPaperCheck.nestedHeadNumber != 0) {
|
|
|
- importPaperCheck.setErrorInfo(importPaperCheck.quesName + "第" + importPaperCheck.nestedHeadNumber + "个题" + errorQuesNum + ImportPaperMsg.errMsg_01);
|
|
|
+ if (importPaperCheck.getNestedHeadNumber() != 0) {
|
|
|
+ importPaperCheck.setErrorInfo(importPaperCheck.getQuesName() + "第" + importPaperCheck.getNestedHeadNumber() + "个题" + errorQuesNum + ImportPaperMsg.errMsg_01);
|
|
|
} else {
|
|
|
- importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, errorQuesNum) + ImportPaperMsg.errMsg_01);
|
|
|
+ importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.getQuesName(), errorQuesNum) + ImportPaperMsg.errMsg_01);
|
|
|
}
|
|
|
}
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
importPaperCheck.setIndex(i);
|
|
|
question.setQuesBody(quesBodyHtml.toString());
|
|
@@ -744,7 +743,7 @@ public class ImportPaperService {
|
|
|
ImportPaperCheck importPaperCheck, WordprocessingMLPackage wordMLPackage, int errorQuesNum) throws Exception {
|
|
|
|
|
|
// 定义选项集合
|
|
|
- List<QuesOption> quesOptions = new ArrayList<QuesOption>();
|
|
|
+ List<QuesOption> quesOptions = new ArrayList<>();
|
|
|
// 定义选项数量
|
|
|
int optionCount = 0;
|
|
|
// 当前所处的选项
|
|
@@ -759,12 +758,12 @@ public class ImportPaperService {
|
|
|
continue;
|
|
|
} else if (DocxProcessUtil.isNumPr(pOption)) {
|
|
|
// 检测到序列
|
|
|
- if (importPaperCheck.nestedHeadNumber != 0) {
|
|
|
- importPaperCheck.setErrorInfo(importPaperCheck.quesName + "第" + importPaperCheck.nestedHeadNumber + "个题" + errorQuesNum + ImportPaperMsg.errMsg_11);
|
|
|
+ if (importPaperCheck.getNestedHeadNumber() != 0) {
|
|
|
+ importPaperCheck.setErrorInfo(importPaperCheck.getQuesName() + "第" + importPaperCheck.getNestedHeadNumber() + "个题" + errorQuesNum + ImportPaperMsg.errMsg_11);
|
|
|
} else {
|
|
|
- importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, errorQuesNum) + ImportPaperMsg.errMsg_11);
|
|
|
+ importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.getQuesName(), errorQuesNum) + ImportPaperMsg.errMsg_11);
|
|
|
}
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
} else if (tmpText.matches("^[a-zA-Z]\\.[\\s\\S]*")) {
|
|
|
// 检测到选项开始段落
|
|
|
// 创建试题选项
|
|
@@ -773,12 +772,12 @@ public class ImportPaperService {
|
|
|
int optionNumber = DocxProcessUtil.getOptionNum(tmpText);
|
|
|
if (optionNumber != number || "abcdefghijklmnopqrstuvwxyz".indexOf(tmpText.substring(0, 1)) > -1) {
|
|
|
String errorMsg = tmpText.length() > 10 ? tmpText.substring(0, 10) : tmpText;
|
|
|
- if (importPaperCheck.nestedHeadNumber != 0) {
|
|
|
- importPaperCheck.setErrorInfo(importPaperCheck.quesName + "第" + importPaperCheck.nestedHeadNumber + "个题" + errorQuesNum + ":“" + errorMsg + "”" + ImportPaperMsg.errMsg_13);
|
|
|
+ if (importPaperCheck.getNestedHeadNumber() != 0) {
|
|
|
+ importPaperCheck.setErrorInfo(importPaperCheck.getQuesName() + "第" + importPaperCheck.getNestedHeadNumber() + "个题" + errorQuesNum + ":“" + errorMsg + "”" + ImportPaperMsg.errMsg_13);
|
|
|
} else {
|
|
|
- importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, errorQuesNum) + ":“" + errorMsg + "”" + ImportPaperMsg.errMsg_13);
|
|
|
+ importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.getQuesName(), errorQuesNum) + ":“" + errorMsg + "”" + ImportPaperMsg.errMsg_13);
|
|
|
}
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
current.setNumber(String.valueOf(optionNumber));
|
|
|
current.setOptionBody("");
|
|
@@ -804,16 +803,16 @@ public class ImportPaperService {
|
|
|
}
|
|
|
importPaperCheck.setIndex(i);
|
|
|
if (optionCount < 2) {
|
|
|
- if (importPaperCheck.nestedHeadNumber != 0) {
|
|
|
- importPaperCheck.setErrorInfo(importPaperCheck.quesName + "第" + importPaperCheck.nestedHeadNumber + "个题" + errorQuesNum + "中选项格式不正确或有缺失\n");
|
|
|
+ if (importPaperCheck.getNestedHeadNumber() != 0) {
|
|
|
+ importPaperCheck.setErrorInfo(importPaperCheck.getQuesName() + "第" + importPaperCheck.getNestedHeadNumber() + "个题" + errorQuesNum + "中选项格式不正确或有缺失\n");
|
|
|
} else {
|
|
|
- importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, errorQuesNum) + "中选项格式不正确或有缺失\n");
|
|
|
+ importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.getQuesName(), errorQuesNum) + "中选项格式不正确或有缺失\n");
|
|
|
}
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
} else {
|
|
|
question.setQuesOptions(quesOptions);
|
|
|
}
|
|
|
- return importPaperCheck.errorInfo;
|
|
|
+ return importPaperCheck.getErrorInfo();
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -842,8 +841,8 @@ public class ImportPaperService {
|
|
|
//定义公开度
|
|
|
Boolean publicity = null;
|
|
|
//定义试题属性集合
|
|
|
- List<QuesProperty> quesProperties = new ArrayList<QuesProperty>();
|
|
|
- // Map<String, String> quesParams = new HashMap<String, String>();
|
|
|
+ List<QuesProperty> quesProperties = new ArrayList<>();
|
|
|
+ // Map<String, String> quesParams = new HashMap<>();
|
|
|
int i = 0;
|
|
|
// 是否刚刚检测到答案内容
|
|
|
boolean answerStart = false;
|
|
@@ -883,12 +882,12 @@ public class ImportPaperService {
|
|
|
// 检测到分数开始段落
|
|
|
quesScore = getContent(tmpText, ImportPaperMsg.subQuesScore_word);
|
|
|
if (!CommonUtils.isInteger(quesScore)) {
|
|
|
- if (importPaperCheck.nestedHeadNumber == 0) {
|
|
|
- importPaperCheck.setErrorInfo("[大题名称]:" + importPaperCheck.quesName + "第" + errorQuesNum + "题中[小题分数]格式不对或没有值");
|
|
|
+ if (importPaperCheck.getNestedHeadNumber() == 0) {
|
|
|
+ importPaperCheck.setErrorInfo("[大题名称]:" + importPaperCheck.getQuesName() + "第" + errorQuesNum + "题中[小题分数]格式不对或没有值");
|
|
|
} else {
|
|
|
- importPaperCheck.setErrorInfo("[大题名称]:" + importPaperCheck.quesName + "第" + importPaperCheck.nestedHeadNumber + "个套题中,第" + errorQuesNum + "题中[小题分数]格式不对或没有值");
|
|
|
+ importPaperCheck.setErrorInfo("[大题名称]:" + importPaperCheck.getQuesName() + "第" + importPaperCheck.getNestedHeadNumber() + "个套题中,第" + errorQuesNum + "题中[小题分数]格式不对或没有值");
|
|
|
}
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
answerStart = false;
|
|
|
}
|
|
@@ -938,9 +937,9 @@ public class ImportPaperService {
|
|
|
if (paperDetailUnit.getQuestionType() == QuesStructType.NESTED_ANSWER_QUESTION) {
|
|
|
importPaperCheck.setErrorInfo(paperDetailUnit.getPaperDetail().getName() + "中,第" + paperDetailUnit.getNumber() + "个套题的" + errorQuesNum + "小题中,缺失“[答案]”");
|
|
|
} else {
|
|
|
- importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, errorQuesNum) + "中,缺失“[答案]”");
|
|
|
+ importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.getQuesName(), errorQuesNum) + "中,缺失“[答案]”");
|
|
|
}
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
// 设置答案
|
|
|
if (StringUtils.isNotEmpty(answerHTML)) {
|
|
@@ -988,12 +987,12 @@ public class ImportPaperService {
|
|
|
ImportPaperCheck importPaperCheck, int subQuesNum, Paper paper, List<QuesProperty> quesProperties) throws Exception {
|
|
|
//一级属性为空,二级属性有值
|
|
|
if (StringUtils.isBlank(firstProperty) && StringUtils.isNotBlank(secondProperty)) {
|
|
|
- if (importPaperCheck.nestedHeadNumber != 0) {
|
|
|
- importPaperCheck.setErrorInfo(importPaperCheck.quesName + "第" + importPaperCheck.nestedHeadNumber + "个题" + subQuesNum + "中,小题一级属性值为空,请检查");
|
|
|
+ if (importPaperCheck.getNestedHeadNumber() != 0) {
|
|
|
+ importPaperCheck.setErrorInfo(importPaperCheck.getQuesName() + "第" + importPaperCheck.getNestedHeadNumber() + "个题" + subQuesNum + "中,小题一级属性值为空,请检查");
|
|
|
} else {
|
|
|
- importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, subQuesNum) + "中,小题一级属性值为空,请检查");
|
|
|
+ importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.getQuesName(), subQuesNum) + "中,小题一级属性值为空,请检查");
|
|
|
}
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
//一级属性,二级属性都有值
|
|
|
else if (StringUtils.isNotBlank(firstProperty) && StringUtils.isNotBlank(secondProperty)) {
|
|
@@ -1002,12 +1001,12 @@ public class ImportPaperService {
|
|
|
//根据课程查询所有课程属性树
|
|
|
List<CourseProperty> courseProperties = coursePropertyRepo.findByCourseCodeAndEnable(paper.getCourse().getCode(), true);
|
|
|
if (courseProperties == null || courseProperties.size() < 1) {
|
|
|
- if (importPaperCheck.nestedHeadNumber != 0) {
|
|
|
- importPaperCheck.setErrorInfo(importPaperCheck.quesName + "第" + importPaperCheck.nestedHeadNumber + "个题" + subQuesNum + "中,没有设置课程属性结构,请先设置课程属性结构");
|
|
|
+ if (importPaperCheck.getNestedHeadNumber() != 0) {
|
|
|
+ importPaperCheck.setErrorInfo(importPaperCheck.getQuesName() + "第" + importPaperCheck.getNestedHeadNumber() + "个题" + subQuesNum + "中,没有设置课程属性结构,请先设置课程属性结构");
|
|
|
} else {
|
|
|
- importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, subQuesNum) + "中,没有设置课程属性结构,请先设置课程属性结构");
|
|
|
+ importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.getQuesName(), subQuesNum) + "中,没有设置课程属性结构,请先设置课程属性结构");
|
|
|
}
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
for (CourseProperty courseProperty : courseProperties) {
|
|
|
Property propertyParent = new Property(firstProperty, 0l, courseProperty.getId());
|
|
@@ -1035,20 +1034,20 @@ public class ImportPaperService {
|
|
|
}
|
|
|
}
|
|
|
if (isFirstEmpty) {
|
|
|
- if (importPaperCheck.nestedHeadNumber != 0) {
|
|
|
- importPaperCheck.setErrorInfo(importPaperCheck.quesName + "第" + importPaperCheck.nestedHeadNumber + "个题" + subQuesNum + "中,小题一级属性值与课程属性中一级属性不匹配,请检查");
|
|
|
+ if (importPaperCheck.getNestedHeadNumber() != 0) {
|
|
|
+ importPaperCheck.setErrorInfo(importPaperCheck.getQuesName() + "第" + importPaperCheck.getNestedHeadNumber() + "个题" + subQuesNum + "中,小题一级属性值与课程属性中一级属性不匹配,请检查");
|
|
|
} else {
|
|
|
- importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, subQuesNum) + "中,小题一级属性值与课程属性中一级属性不匹配,请检查");
|
|
|
+ importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.getQuesName(), subQuesNum) + "中,小题一级属性值与课程属性中一级属性不匹配,请检查");
|
|
|
}
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
if (isSecondEmpty) {
|
|
|
- if (importPaperCheck.nestedHeadNumber != 0) {
|
|
|
- importPaperCheck.setErrorInfo(importPaperCheck.quesName + "第" + importPaperCheck.nestedHeadNumber + "个题" + subQuesNum + "中,小题二级属性值与课程属性中二级属性不匹配,请检查");
|
|
|
+ if (importPaperCheck.getNestedHeadNumber() != 0) {
|
|
|
+ importPaperCheck.setErrorInfo(importPaperCheck.getQuesName() + "第" + importPaperCheck.getNestedHeadNumber() + "个题" + subQuesNum + "中,小题二级属性值与课程属性中二级属性不匹配,请检查");
|
|
|
} else {
|
|
|
- importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, subQuesNum) + "中,小题二级属性值与课程属性中二级属性不匹配,请检查");
|
|
|
+ importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.getQuesName(), subQuesNum) + "中,小题二级属性值与课程属性中二级属性不匹配,请检查");
|
|
|
}
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
}
|
|
|
//一级属性有值,二级属性为空
|
|
@@ -1058,12 +1057,12 @@ public class ImportPaperService {
|
|
|
//根据课程查询所有课程属性树
|
|
|
List<CourseProperty> courseProperties = coursePropertyRepo.findByCourseCodeAndEnable(paper.getCourse().getCode(), true);
|
|
|
if (courseProperties == null || courseProperties.size() < 1) {
|
|
|
- if (importPaperCheck.nestedHeadNumber != 0) {
|
|
|
- importPaperCheck.setErrorInfo(importPaperCheck.quesName + "第" + importPaperCheck.nestedHeadNumber + "个题" + subQuesNum + "中,没有设置课程属性结构,请先设置课程属性结构");
|
|
|
+ if (importPaperCheck.getNestedHeadNumber() != 0) {
|
|
|
+ importPaperCheck.setErrorInfo(importPaperCheck.getQuesName() + "第" + importPaperCheck.getNestedHeadNumber() + "个题" + subQuesNum + "中,没有设置课程属性结构,请先设置课程属性结构");
|
|
|
} else {
|
|
|
- importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, subQuesNum) + "中,没有设置课程属性结构,请先设置课程属性结构");
|
|
|
+ importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.getQuesName(), subQuesNum) + "中,没有设置课程属性结构,请先设置课程属性结构");
|
|
|
}
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
for (CourseProperty courseProperty : courseProperties) {
|
|
|
//查询一级属性
|
|
@@ -1090,20 +1089,20 @@ public class ImportPaperService {
|
|
|
}
|
|
|
}
|
|
|
if (isFirstEmpty) {
|
|
|
- if (importPaperCheck.nestedHeadNumber != 0) {
|
|
|
- importPaperCheck.setErrorInfo(importPaperCheck.quesName + "第" + importPaperCheck.nestedHeadNumber + "个题" + subQuesNum + "中,小题一级属性值与课程属性中一级属性不匹配,请检查");
|
|
|
+ if (importPaperCheck.getNestedHeadNumber() != 0) {
|
|
|
+ importPaperCheck.setErrorInfo(importPaperCheck.getQuesName() + "第" + importPaperCheck.getNestedHeadNumber() + "个题" + subQuesNum + "中,小题一级属性值与课程属性中一级属性不匹配,请检查");
|
|
|
} else {
|
|
|
- importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, subQuesNum) + "中,小题一级属性值与课程属性中一级属性不匹配,请检查");
|
|
|
+ importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.getQuesName(), subQuesNum) + "中,小题一级属性值与课程属性中一级属性不匹配,请检查");
|
|
|
}
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
if (isSecondEmpty) {
|
|
|
- if (importPaperCheck.nestedHeadNumber != 0) {
|
|
|
- importPaperCheck.setErrorInfo(importPaperCheck.quesName + "第" + importPaperCheck.nestedHeadNumber + "个题" + subQuesNum + "中,小题二级属性值与课程属性中二级属性不匹配,请检查");
|
|
|
+ if (importPaperCheck.getNestedHeadNumber() != 0) {
|
|
|
+ importPaperCheck.setErrorInfo(importPaperCheck.getQuesName() + "第" + importPaperCheck.getNestedHeadNumber() + "个题" + subQuesNum + "中,小题二级属性值与课程属性中二级属性不匹配,请检查");
|
|
|
} else {
|
|
|
- importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, subQuesNum) + "中,小题二级属性值与课程属性中二级属性不匹配,请检查");
|
|
|
+ importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.getQuesName(), subQuesNum) + "中,小题二级属性值与课程属性中二级属性不匹配,请检查");
|
|
|
}
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
}//一级,二级都为空
|
|
|
else {
|
|
@@ -1122,36 +1121,36 @@ public class ImportPaperService {
|
|
|
private void checkAttributeIsFull(String firstProperty, String secondProperty, Double difficulty,
|
|
|
Boolean publicity, ImportPaperCheck importPaperCheck, int subQuesNum) throws Exception {
|
|
|
if (firstProperty == null) {
|
|
|
- if (importPaperCheck.nestedHeadNumber != 0) {
|
|
|
- importPaperCheck.setErrorInfo(importPaperCheck.quesName + "第" + importPaperCheck.nestedHeadNumber + "个题" + subQuesNum + "中,小题一级属性缺失,请检查");
|
|
|
+ if (importPaperCheck.getNestedHeadNumber() != 0) {
|
|
|
+ importPaperCheck.setErrorInfo(importPaperCheck.getQuesName() + "第" + importPaperCheck.getNestedHeadNumber() + "个题" + subQuesNum + "中,小题一级属性缺失,请检查");
|
|
|
} else {
|
|
|
- importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, subQuesNum) + "中,小题一级属性缺失,请检查");
|
|
|
+ importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.getQuesName(), subQuesNum) + "中,小题一级属性缺失,请检查");
|
|
|
}
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
if (secondProperty == null) {
|
|
|
- if (importPaperCheck.nestedHeadNumber != 0) {
|
|
|
- importPaperCheck.setErrorInfo(importPaperCheck.quesName + "第" + importPaperCheck.nestedHeadNumber + "个题" + subQuesNum + "中,小题二级属性缺失,请检查");
|
|
|
+ if (importPaperCheck.getNestedHeadNumber() != 0) {
|
|
|
+ importPaperCheck.setErrorInfo(importPaperCheck.getQuesName() + "第" + importPaperCheck.getNestedHeadNumber() + "个题" + subQuesNum + "中,小题二级属性缺失,请检查");
|
|
|
} else {
|
|
|
- importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, subQuesNum) + "中,小题二级属性缺失,请检查");
|
|
|
+ importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.getQuesName(), subQuesNum) + "中,小题二级属性缺失,请检查");
|
|
|
}
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
if (difficulty == null) {
|
|
|
- if (importPaperCheck.nestedHeadNumber != 0) {
|
|
|
- importPaperCheck.setErrorInfo(importPaperCheck.quesName + "第" + importPaperCheck.nestedHeadNumber + "个题" + subQuesNum + "中,小题难度缺失,请检查");
|
|
|
+ if (importPaperCheck.getNestedHeadNumber() != 0) {
|
|
|
+ importPaperCheck.setErrorInfo(importPaperCheck.getQuesName() + "第" + importPaperCheck.getNestedHeadNumber() + "个题" + subQuesNum + "中,小题难度缺失,请检查");
|
|
|
} else {
|
|
|
- importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, subQuesNum) + "中,小题难度缺失,请检查");
|
|
|
+ importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.getQuesName(), subQuesNum) + "中,小题难度缺失,请检查");
|
|
|
}
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
if (publicity == null) {
|
|
|
- if (importPaperCheck.nestedHeadNumber != 0) {
|
|
|
- importPaperCheck.setErrorInfo(importPaperCheck.quesName + "第" + importPaperCheck.nestedHeadNumber + "个题" + subQuesNum + "中,小题公开性缺失,请检查");
|
|
|
+ if (importPaperCheck.getNestedHeadNumber() != 0) {
|
|
|
+ importPaperCheck.setErrorInfo(importPaperCheck.getQuesName() + "第" + importPaperCheck.getNestedHeadNumber() + "个题" + subQuesNum + "中,小题公开性缺失,请检查");
|
|
|
} else {
|
|
|
- importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, subQuesNum) + "中,小题公开性缺失,请检查");
|
|
|
+ importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.getQuesName(), subQuesNum) + "中,小题公开性缺失,请检查");
|
|
|
}
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1193,11 +1192,11 @@ public class ImportPaperService {
|
|
|
//处理套题的头信息
|
|
|
processNestedQuestionHead(pList, index, 0, question, importPaperCheck, paperDetailUnit);
|
|
|
// 设置套题题干
|
|
|
- processQuesBody(pList, importPaperCheck.index, 0, question, importPaperCheck, wordMLPackage, 0);
|
|
|
+ processQuesBody(pList, importPaperCheck.getIndex(), 0, question, importPaperCheck, wordMLPackage, 0);
|
|
|
// 创建小题集合
|
|
|
- List<Question> subQuesList = new ArrayList<Question>();
|
|
|
+ List<Question> subQuesList = new ArrayList<>();
|
|
|
Question subQues = null;
|
|
|
- int beginNum = importPaperCheck.index;
|
|
|
+ int beginNum = importPaperCheck.getIndex();
|
|
|
int quesTypeNum = 0;
|
|
|
int subQuesNum = 0;
|
|
|
boolean hasQuesType = false;
|
|
@@ -1209,22 +1208,22 @@ public class ImportPaperService {
|
|
|
}
|
|
|
if (tmpText.startsWith(ImportPaperMsg.subQuestionType_word)) {
|
|
|
nestedQuesType = getContent(tmpText, ImportPaperMsg.subQuestionType_word);
|
|
|
- importPaperCheck.index++;
|
|
|
+ importPaperCheck.setIndex(importPaperCheck.getIndex() + 1);
|
|
|
quesTypeNum++;
|
|
|
hasQuesType = true;
|
|
|
} else if (tmpText.matches("^\\d{1,}\\.[\\s\\S]*")) {
|
|
|
++subQuesNum;
|
|
|
if (!hasQuesType) {
|
|
|
- if (importPaperCheck.nestedHeadNumber == 0) {
|
|
|
- importPaperCheck.setErrorInfo("[大题名称]:" + importPaperCheck.quesName + "第" + subQuesNum + "题中,缺失[小题型],请检查套题");
|
|
|
+ if (importPaperCheck.getNestedHeadNumber() == 0) {
|
|
|
+ importPaperCheck.setErrorInfo("[大题名称]:" + importPaperCheck.getQuesName() + "第" + subQuesNum + "题中,缺失[小题型],请检查套题");
|
|
|
} else {
|
|
|
- importPaperCheck.setErrorInfo("[大题名称]:" + importPaperCheck.quesName + "第" + importPaperCheck.nestedHeadNumber + "个套题中,第" + subQuesNum + "题缺失[小题型],请检查套题");
|
|
|
+ importPaperCheck.setErrorInfo("[大题名称]:" + importPaperCheck.getQuesName() + "第" + importPaperCheck.getNestedHeadNumber() + "个套题中,第" + subQuesNum + "题缺失[小题型],请检查套题");
|
|
|
}
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
if (StringUtils.isBlank(nestedQuesType) || getQuesStructType(nestedQuesType) == null) {
|
|
|
- importPaperCheck.setErrorInfo(importPaperCheck.quesName + "第" + importPaperCheck.nestedHeadNumber + "个题" + subQuesNum + "中," + ImportPaperMsg.errMsg_02 + "(" + ImportPaperMsg.errMsg_09 + ")");
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ importPaperCheck.setErrorInfo(importPaperCheck.getQuesName() + "第" + importPaperCheck.getNestedHeadNumber() + "个题" + subQuesNum + "中," + ImportPaperMsg.errMsg_02 + "(" + ImportPaperMsg.errMsg_09 + ")");
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
subQues = new Question();
|
|
|
subQues.setId(UUID.randomUUID().toString());
|
|
@@ -1235,49 +1234,49 @@ public class ImportPaperService {
|
|
|
// 处理客观题
|
|
|
if (nestedQuesType.equals(ImportPaperMsg.singleSelection) || nestedQuesType.equals(ImportPaperMsg.multipleSelection)) {
|
|
|
// 处理题干
|
|
|
- processQuesBody(pList, importPaperCheck.index, subQuesNum, subQues, importPaperCheck, wordMLPackage, subQuesNum);
|
|
|
+ processQuesBody(pList, importPaperCheck.getIndex(), subQuesNum, subQues, importPaperCheck, wordMLPackage, subQuesNum);
|
|
|
// 处理选项
|
|
|
- processQuesOption(pList, importPaperCheck.index, subQuesNum, subQues, importPaperCheck, wordMLPackage, subQuesNum);
|
|
|
+ processQuesOption(pList, importPaperCheck.getIndex(), subQuesNum, subQues, importPaperCheck, wordMLPackage, subQuesNum);
|
|
|
// 处理尾信息
|
|
|
- processQuesTail(pList, importPaperCheck.index, subQuesNum, subQues, paperDetailUnit, importPaperCheck, wordMLPackage, true, paper, subQuesNum);
|
|
|
+ processQuesTail(pList, importPaperCheck.getIndex(), subQuesNum, subQues, paperDetailUnit, importPaperCheck, wordMLPackage, true, paper, subQuesNum);
|
|
|
// 处理选择题的option--chenken 20170426
|
|
|
processSelectOption(subQues);
|
|
|
} else {
|
|
|
// 处理其他题型
|
|
|
- processQuesBody(pList, importPaperCheck.index, subQuesNum, subQues, importPaperCheck, wordMLPackage, subQuesNum);
|
|
|
- processQuesTail(pList, importPaperCheck.index, subQuesNum, subQues, paperDetailUnit, importPaperCheck, wordMLPackage, true, paper, subQuesNum);
|
|
|
+ processQuesBody(pList, importPaperCheck.getIndex(), subQuesNum, subQues, importPaperCheck, wordMLPackage, subQuesNum);
|
|
|
+ processQuesTail(pList, importPaperCheck.getIndex(), subQuesNum, subQues, paperDetailUnit, importPaperCheck, wordMLPackage, true, paper, subQuesNum);
|
|
|
//填空题空格校验
|
|
|
if (QuesStructType.FILL_BLANK_QUESTION.getName().equals(subQues.getQuestionType().getName())) {
|
|
|
processFill(subQues, paperDetailUnit, importPaperCheck, subQuesNum, subQuesNum);
|
|
|
}
|
|
|
}
|
|
|
subQuesList.add(subQues);
|
|
|
- i = importPaperCheck.index - 1;
|
|
|
+ i = importPaperCheck.getIndex() - 1;
|
|
|
nestedQuesType = "";
|
|
|
hasQuesType = false;
|
|
|
} else if (subQuesNum != quesTypeNum) {
|
|
|
if (StringUtils.isEmpty(nestedQuesType)) {
|
|
|
- importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, quesTypeNum) + ImportPaperMsg.errMsg_02);
|
|
|
+ importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.getQuesName(), quesTypeNum) + ImportPaperMsg.errMsg_02);
|
|
|
} else {
|
|
|
- importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, quesTypeNum) + ImportPaperMsg.errMsg_03);
|
|
|
+ importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.getQuesName(), quesTypeNum) + ImportPaperMsg.errMsg_03);
|
|
|
}
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
} else if (isHeader(tmpText)) {
|
|
|
break;
|
|
|
}
|
|
|
- if (!StringUtils.isEmpty(importPaperCheck.errorInfo)) {
|
|
|
+ if (!StringUtils.isEmpty(importPaperCheck.getErrorInfo())) {
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
//判断标签是否丢失
|
|
|
- if (importPaperCheck.nestedQuesNumber == 0 || importPaperCheck.nestedHeadNumber == 0) {
|
|
|
- importPaperCheck.setErrorInfo(importPaperCheck.quesName + "中,套题可能缺失【套题】和【套题数量】标签,请检查套题");
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ if (importPaperCheck.getNestedQuesNumber() == 0 || importPaperCheck.getNestedHeadNumber() == 0) {
|
|
|
+ importPaperCheck.setErrorInfo(importPaperCheck.getQuesName() + "中,套题可能缺失【套题】和【套题数量】标签,请检查套题");
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
//判断子题数量是否一样
|
|
|
- if (importPaperCheck.nestedQuesNumber != subQuesList.size()) {
|
|
|
- importPaperCheck.setErrorInfo(importPaperCheck.quesName + "第" + importPaperCheck.nestedHeadNumber + "个套题" + "中,套题数量与子题数量不一样,请检查套题");
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ if (importPaperCheck.getNestedQuesNumber() != subQuesList.size()) {
|
|
|
+ importPaperCheck.setErrorInfo(importPaperCheck.getQuesName() + "第" + importPaperCheck.getNestedHeadNumber() + "个套题" + "中,套题数量与子题数量不一样,请检查套题");
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
question.setSubQuestions(subQuesList);
|
|
|
// 设置套题主题干的 难度,公开度,一级属性,二级属性
|
|
@@ -1304,7 +1303,7 @@ public class ImportPaperService {
|
|
|
Double totalDouble = 0d;
|
|
|
Double sum = 0.0;
|
|
|
Boolean publicity = false;
|
|
|
- List<QuesProperty> subQuesProperties = new ArrayList<QuesProperty>();
|
|
|
+ List<QuesProperty> subQuesProperties = new ArrayList<>();
|
|
|
for (Question subQuestion : subQuesList) {
|
|
|
//设置一级属性,二级属性
|
|
|
List<QuesProperty> quesProperties = subQuestion.getQuesProperties();
|
|
@@ -1399,7 +1398,7 @@ public class ImportPaperService {
|
|
|
* @return
|
|
|
*/
|
|
|
public static String getCourseNo(ImportPaperCheck importPaperCheck) {
|
|
|
- String[] courseInfo = importPaperCheck.quesGroup.split("_");
|
|
|
+ String[] courseInfo = importPaperCheck.getQuesGroup().split("_");
|
|
|
if (courseInfo.length == 2) {
|
|
|
return courseInfo[1];
|
|
|
} else {
|
|
@@ -1414,7 +1413,7 @@ public class ImportPaperService {
|
|
|
* @return
|
|
|
*/
|
|
|
public static String getCourseName(ImportPaperCheck importPaperCheck) {
|
|
|
- String[] courseInfo = importPaperCheck.quesGroup.split("_");
|
|
|
+ String[] courseInfo = importPaperCheck.getQuesGroup().split("_");
|
|
|
if (courseInfo.length == 2) {
|
|
|
return courseInfo[0];
|
|
|
} else {
|
|
@@ -1430,7 +1429,7 @@ public class ImportPaperService {
|
|
|
* @return
|
|
|
*/
|
|
|
public Map<String, Object> saveBlankPaper(String courseNo, String paperName, User user) {
|
|
|
- Map<String, Object> returnMap = new HashMap<String, Object>();
|
|
|
+ Map<String, Object> returnMap = new HashMap<>();
|
|
|
Paper paper = new Paper();
|
|
|
String msg = paperService.checkPaperName(paperName, user.getRootOrgId().toString());
|
|
|
if (msg != null) {
|
|
@@ -1469,7 +1468,7 @@ public class ImportPaperService {
|
|
|
}
|
|
|
if (paper.getTotalScore() != null && paper.getTotalScore() != totalScore) {
|
|
|
importPaperCheck.setErrorInfo("试卷总分(" + totalScore + ")与设置总分(" + paper.getTotalScore() + ")不符");
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1479,7 +1478,7 @@ public class ImportPaperService {
|
|
|
* @throws PaperException
|
|
|
*/
|
|
|
private void checkUnitNum(List<PaperDetailUnit> paperDetailUnits, ImportPaperCheck importPaperCheck) throws PaperException {
|
|
|
- Map<PaperDetail, Integer> unitNumMap = new HashMap<PaperDetail, Integer>();
|
|
|
+ Map<PaperDetail, Integer> unitNumMap = new HashMap<>();
|
|
|
Collections.sort(paperDetailUnits);
|
|
|
for (PaperDetailUnit paperDetailUnit : paperDetailUnits) {
|
|
|
PaperDetail key = paperDetailUnit.getPaperDetail();
|
|
@@ -1505,7 +1504,7 @@ public class ImportPaperService {
|
|
|
+ "标识小题数量(" + paperDetail.getUnitCount()
|
|
|
+ ")与实际小题数量(" + entry.getValue() + ")不符。"
|
|
|
+ "(注:若检查小题数量无问题,请检查word中题目的格式是否正确)");
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1524,7 +1523,7 @@ public class ImportPaperService {
|
|
|
if (!StringUtils.isBlank(answerWord)) {
|
|
|
String[] pAnswerArray = answerWord.split(",");
|
|
|
List<QuesOption> options = question.getQuesOptions();
|
|
|
- List<String> optionNumList = new ArrayList<String>();
|
|
|
+ List<String> optionNumList = new ArrayList<>();
|
|
|
for (QuesOption quesOption : options) {
|
|
|
Integer numInteger = Integer.parseInt(quesOption.getNumber());
|
|
|
char word = (char) (numInteger + 64);
|
|
@@ -1534,15 +1533,15 @@ public class ImportPaperService {
|
|
|
answer = answer.trim();
|
|
|
String pattern = "[A-Z]|[a-z]";
|
|
|
if (!Pattern.matches(pattern, answer)) {
|
|
|
- importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, subQuesNum) +
|
|
|
+ importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.getQuesName(), subQuesNum) +
|
|
|
"中,答案格式不正确,答案为:" + answerWord);
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
if (!optionNumList.contains(answer)) {
|
|
|
- importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, subQuesNum) +
|
|
|
+ importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.getQuesName(), subQuesNum) +
|
|
|
"中,选项为:" + optionNumList.toString() + ",答案为:" + answerWord +
|
|
|
"。(注:若检查选项无问题,请检查word中题目的格式是否正确)");
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1562,9 +1561,9 @@ public class ImportPaperService {
|
|
|
if (tmpText.equals("正确") || tmpText.equals("错误")) {
|
|
|
return;
|
|
|
} else {
|
|
|
- importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, subQuesNum) +
|
|
|
+ importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.getQuesName(), subQuesNum) +
|
|
|
"中,答案格式不正确,应为:正确或错误");
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1585,8 +1584,8 @@ public class ImportPaperService {
|
|
|
question.setDifficulty("中");
|
|
|
} else if (!isInteger(tmpText) || (Double.parseDouble(tmpText) < 1) || (Double.parseDouble(tmpText) > 10)) {
|
|
|
//如果不是整数,或者在1到10之间,就报错
|
|
|
- importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, subQuesNum) + "中,试题难度只能是1到10之间整数");
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.getQuesName(), subQuesNum) + "中,试题难度只能是1到10之间整数");
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
} else {
|
|
|
difficulty = Double.parseDouble(tmpText) / 10;
|
|
|
question.setDifficulty(setDiff(difficulty));
|
|
@@ -1619,8 +1618,8 @@ public class ImportPaperService {
|
|
|
publicity = true;
|
|
|
} else if (!tmpText.equals("公开") && !tmpText.equals("非公开")) {
|
|
|
//如果不是公开和非公开,就报错
|
|
|
- importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, subQuesNum) + "中,试题公开度只能是公开和非公开");
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.getQuesName(), subQuesNum) + "中,试题公开度只能是公开和非公开");
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
} else {
|
|
|
if (tmpText.equals("非公开")) {
|
|
|
publicity = false;
|
|
@@ -1638,7 +1637,7 @@ public class ImportPaperService {
|
|
|
* @throws PaperException
|
|
|
*/
|
|
|
private void checkAnswerISfull(List<PaperDetailUnit> paperDetailUnits, ImportPaperCheck importPaperCheck) throws PaperException {
|
|
|
- Map<Question, PaperDetailUnit> map = new HashMap<Question, PaperDetailUnit>();
|
|
|
+ Map<Question, PaperDetailUnit> map = new HashMap<>();
|
|
|
for (PaperDetailUnit paperDetailUnit : paperDetailUnits) {
|
|
|
Question question = paperDetailUnit.getQuestion();
|
|
|
if (question.getQuestionType() == QuesStructType.SINGLE_ANSWER_QUESTION
|
|
@@ -1689,10 +1688,10 @@ public class ImportPaperService {
|
|
|
}
|
|
|
}
|
|
|
importPaperCheck.setErrorInfo("第" + paperDetailUnit.getNumber() + "大题套题中" + number + "小题答案缺失,请检查");
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
importPaperCheck.setErrorInfo("第" + paperDetailUnit.getNumber() + "小题答案缺失,请检查");
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1718,7 +1717,7 @@ public class ImportPaperService {
|
|
|
* @return
|
|
|
*/
|
|
|
public Map<String, Object> clonePaper(String paperId, String paperName, String courseNo, User user) {
|
|
|
- Map<String, Object> map = new HashMap<String, Object>();
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
String msg = paperService.checkPaperName(paperName, user.getRootOrgId().toString());
|
|
|
if (msg != null) {
|
|
|
map.put("msg", msg);
|
|
@@ -1834,7 +1833,7 @@ public class ImportPaperService {
|
|
|
copyAudioDir.delete();
|
|
|
//查询新音频
|
|
|
List<QuestionAudio> newQuestionAudios = questionAudioService.findQuestionAudiosByQuestionId(newQuestion.getId());
|
|
|
- Map<String, String> newMap = new HashMap<String, String>();
|
|
|
+ Map<String, String> newMap = new HashMap<>();
|
|
|
for (QuestionAudio audio : newQuestionAudios) {
|
|
|
newMap.put(audio.getFileName(), audio.getId());
|
|
|
}
|
|
@@ -1842,7 +1841,7 @@ public class ImportPaperService {
|
|
|
String body = newQuestion.getQuesBody();
|
|
|
List<String> ids = CommonUtils.getTagANames(body);
|
|
|
List<String> names = CommonUtils.getTagANames2(body);
|
|
|
- Map<String, String> oldBodyMap = new HashMap<String, String>();
|
|
|
+ Map<String, String> oldBodyMap = new HashMap<>();
|
|
|
for (int i = 0; i < ids.size(); i++) {
|
|
|
oldBodyMap.put(names.get(i), ids.get(i));
|
|
|
}
|
|
@@ -1856,7 +1855,7 @@ public class ImportPaperService {
|
|
|
String newOptionBody = option.getOptionBody();
|
|
|
List<String> optionIds = CommonUtils.getTagANames(newOptionBody);
|
|
|
List<String> optionNames = CommonUtils.getTagANames2(newOptionBody);
|
|
|
- Map<String, String> oldOptionMap = new HashMap<String, String>();
|
|
|
+ Map<String, String> oldOptionMap = new HashMap<>();
|
|
|
for (int i = 0; i < optionIds.size(); i++) {
|
|
|
oldOptionMap.put(optionNames.get(i), optionIds.get(i));
|
|
|
}
|
|
@@ -1907,12 +1906,12 @@ public class ImportPaperService {
|
|
|
if (quesAnwser.length == 1 && !StringUtils.isBlank(str) || quesAnwser.length > 1) {
|
|
|
//判断题干空格和答案空格是否相等
|
|
|
if ((quesBody.length - 1) != quesAnwser.length) {
|
|
|
- if (importPaperCheck.nestedHeadNumber == 0) {
|
|
|
- importPaperCheck.setErrorInfo("[大题名称]:" + importPaperCheck.quesName + "第" + errorQuesNum + "题中,题干与答案的空格数量不一样");
|
|
|
+ if (importPaperCheck.getNestedHeadNumber() == 0) {
|
|
|
+ importPaperCheck.setErrorInfo("[大题名称]:" + importPaperCheck.getQuesName() + "第" + errorQuesNum + "题中,题干与答案的空格数量不一样");
|
|
|
} else {
|
|
|
- importPaperCheck.setErrorInfo("[大题名称]:" + importPaperCheck.quesName + "第" + importPaperCheck.nestedHeadNumber + "个套题中,第" + errorQuesNum + "题中,题干与答案的空格数量不一样");
|
|
|
+ importPaperCheck.setErrorInfo("[大题名称]:" + importPaperCheck.getQuesName() + "第" + importPaperCheck.getNestedHeadNumber() + "个套题中,第" + errorQuesNum + "题中,题干与答案的空格数量不一样");
|
|
|
}
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ throw new PaperException(importPaperCheck.getErrorInfo());
|
|
|
}
|
|
|
}
|
|
|
}
|