|
@@ -89,12 +89,13 @@ public class ImportPaperService {
|
|
|
|
|
|
/**
|
|
|
* 导入试卷
|
|
|
- *
|
|
|
- * @param paperName
|
|
|
- * @param courseNo
|
|
|
+ * @param paper
|
|
|
+ * @param user
|
|
|
* @param file
|
|
|
* @return
|
|
|
+ * @throws Exception
|
|
|
*/
|
|
|
+
|
|
|
public Paper importPaper(Paper paper, AccessUser user,File file) throws Exception {
|
|
|
paperService.checkPaperNameNew(paper.getName(), user.getRootOrgId().toString());
|
|
|
return processImportPaper(paper,user,file);
|
|
@@ -161,14 +162,13 @@ public class ImportPaperService {
|
|
|
|
|
|
/**
|
|
|
* 处理导入试卷
|
|
|
- *
|
|
|
- * @param paperName
|
|
|
- * @param courseNo
|
|
|
- * @param courseName
|
|
|
+ * @param paper
|
|
|
* @param user
|
|
|
* @param file
|
|
|
* @return
|
|
|
+ * @throws Exception
|
|
|
*/
|
|
|
+
|
|
|
public Paper processImportPaper(Paper paper,AccessUser user,File file) throws Exception {
|
|
|
WordprocessingMLPackage wordMLPackage;
|
|
|
WordprocessingMLPackage tmpWordMlPackage;
|
|
@@ -219,6 +219,11 @@ public class ImportPaperService {
|
|
|
initQuesHeader(paper, paperDetail, paperDetails, ++mainQuesNum, importPaperCheck);
|
|
|
// 设置当前索引,防止多余循环
|
|
|
i = importPaperCheck.index - 1;
|
|
|
+ } else if (DocxProcessUtil.isNumPr(p)) {
|
|
|
+ // 检测到序列
|
|
|
+ importPaperCheck.setErrorInfo(importPaperCheck.quesName+ImportPaperMsg.errMsg_10);
|
|
|
+ throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+
|
|
|
} else if (pText.matches("^\\d{1,}\\.[\\s\\S]*")
|
|
|
|| (isNested(importPaperCheck) && !pText.startsWith(ImportPaperMsg.left_bracket))) {
|
|
|
if(paperDetail == null){
|
|
@@ -459,6 +464,11 @@ public class ImportPaperService {
|
|
|
if (StringUtils.isEmpty(tmpText) && DocxProcessUtil.isText(pBody)) {
|
|
|
// 跳过空白段落
|
|
|
continue;
|
|
|
+ } else if (DocxProcessUtil.isNumPr(pBody)) {
|
|
|
+ // 检测到序列
|
|
|
+ importPaperCheck.setErrorInfo(importPaperCheck.quesName+ImportPaperMsg.errMsg_10);
|
|
|
+ throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+
|
|
|
} else if (tmpText.matches("^\\d{1,}\\.[\\s\\S]*")) {
|
|
|
// 题干第一段
|
|
|
// 过滤题干标题
|