|
@@ -9,8 +9,6 @@ import java.util.regex.Pattern;
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.bson.types.ObjectId;
|
|
|
-import org.docx4j.openpackaging.exceptions.InvalidFormatException;
|
|
|
-import org.docx4j.openpackaging.packages.WordprocessingMLPackage;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -35,7 +33,6 @@ import cn.com.qmth.examcloud.core.questions.base.question.enums.QuesStructType;
|
|
|
import cn.com.qmth.examcloud.core.questions.base.word.DocxProcessUtil;
|
|
|
import cn.com.qmth.examcloud.core.questions.dao.PaperDetailUnitRepo;
|
|
|
import cn.com.qmth.examcloud.core.questions.dao.PaperRepo;
|
|
|
-import cn.com.qmth.examcloud.core.questions.dao.QuesPkgPathRepo;
|
|
|
import cn.com.qmth.examcloud.core.questions.dao.QuesRepo;
|
|
|
import cn.com.qmth.examcloud.core.questions.dao.QuestionAudioRepo;
|
|
|
import cn.com.qmth.examcloud.core.questions.dao.entity.Paper;
|
|
@@ -73,8 +70,8 @@ public class QuesServiceImpl implements QuesService {
|
|
|
@Autowired
|
|
|
private QuestionAudioRepo questionAudioRepo;
|
|
|
|
|
|
- @Autowired
|
|
|
- private QuesPkgPathRepo quesPkgPathRepo;
|
|
|
+// @Autowired
|
|
|
+// private QuesPkgPathRepo quesPkgPathRepo;
|
|
|
|
|
|
@Autowired
|
|
|
private PaperDetailUnitRepo unitRepo;
|
|
@@ -85,15 +82,15 @@ public class QuesServiceImpl implements QuesService {
|
|
|
@Autowired
|
|
|
private PaperService paperService;
|
|
|
|
|
|
- private static WordprocessingMLPackage wordMLPackage = null;
|
|
|
+// private static WordprocessingMLPackage wordMLPackage = null;
|
|
|
|
|
|
- static {
|
|
|
- try {
|
|
|
- wordMLPackage = WordprocessingMLPackage.createPackage();
|
|
|
- } catch (InvalidFormatException e) {
|
|
|
- log.error(e.getMessage(), e);
|
|
|
- }
|
|
|
- }
|
|
|
+// static {
|
|
|
+// try {
|
|
|
+// wordMLPackage = WordprocessingMLPackage.createPackage();
|
|
|
+// } catch (InvalidFormatException e) {
|
|
|
+// log.error(e.getMessage(), e);
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
/**
|
|
|
* 套题子题按序号自动生成ID
|
|
@@ -502,12 +499,12 @@ public class QuesServiceImpl implements QuesService {
|
|
|
// return bodyString;
|
|
|
// }
|
|
|
|
|
|
- private String makeQuesAnswerWord(String quesAnswer) {
|
|
|
- String template = "<w:p xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" w:rsidR=\"00F65544\" w:rsidP=\"00F65544\" w:rsidRDefault=\"001738E2\">"
|
|
|
- + "<w:r w:rsidR=\"00F65544\">" + "<w:rPr>" + "<w:rFonts w:hint=\"eastAsia\"/>"
|
|
|
- + "<w:szCs w:val=\"21\"/>" + "</w:rPr>" + "<w:t>quesAnswer</w:t>" + "</w:r>" + "</w:p>";
|
|
|
- return template.replace("quesAnswer", quesAnswer);
|
|
|
- }
|
|
|
+// private String makeQuesAnswerWord(String quesAnswer) {
|
|
|
+// String template = "<w:p xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" w:rsidR=\"00F65544\" w:rsidP=\"00F65544\" w:rsidRDefault=\"001738E2\">"
|
|
|
+// + "<w:r w:rsidR=\"00F65544\">" + "<w:rPr>" + "<w:rFonts w:hint=\"eastAsia\"/>"
|
|
|
+// + "<w:szCs w:val=\"21\"/>" + "</w:rPr>" + "<w:t>quesAnswer</w:t>" + "</w:r>" + "</w:p>";
|
|
|
+// return template.replace("quesAnswer", quesAnswer);
|
|
|
+// }
|
|
|
|
|
|
/**
|
|
|
* 获取试题有效文本
|