|
@@ -58,6 +58,8 @@ import java.util.*;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
import java.util.concurrent.TimeUnit;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
+import static com.zhongzheng.common.utils.ToolsUtils.getEncoding;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 题库题目Service业务层处理
|
|
* 题库题目Service业务层处理
|
|
|
*
|
|
*
|
|
@@ -850,7 +852,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
|
|
|
|
|
private boolean isLineStart(String content) {
|
|
private boolean isLineStart(String content) {
|
|
|
if (Validator.isNotEmpty(content)) {
|
|
if (Validator.isNotEmpty(content)) {
|
|
|
- if(isQuestionStart(content)||content.startsWith("A.")||content.startsWith("B.")||content.startsWith("C.")||content.startsWith("D.")||content.startsWith("E.")
|
|
|
|
|
|
|
+ if(isQuestionStart(content)||content.startsWith("А.")||content.startsWith("A.")||content.startsWith("B.")||content.startsWith("C.")||content.startsWith("D.")||content.startsWith("E.")
|
|
|
||content.startsWith("F.")||content.startsWith("正确答案")||content.startsWith("解题思路")||content.startsWith("考查考点")||content.startsWith("老师解答")
|
|
||content.startsWith("F.")||content.startsWith("正确答案")||content.startsWith("解题思路")||content.startsWith("考查考点")||content.startsWith("老师解答")
|
|
|
||content.startsWith("单选题模板")||content.startsWith("判读题模板")||content.startsWith("问答题模板")||content.startsWith("多选题题模板")){
|
|
||content.startsWith("单选题模板")||content.startsWith("判读题模板")||content.startsWith("问答题模板")||content.startsWith("多选题题模板")){
|
|
|
return true;
|
|
return true;
|
|
@@ -929,11 +931,6 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
boolean hasQuestion = false;
|
|
boolean hasQuestion = false;
|
|
|
for (XWPFParagraph paragraph : paragraphList) {
|
|
for (XWPFParagraph paragraph : paragraphList) {
|
|
|
content = paragraph.getText();
|
|
content = paragraph.getText();
|
|
|
- System.out.println(content);
|
|
|
|
|
- System.out.println("EEE");
|
|
|
|
|
- if(content.startsWith("2")){
|
|
|
|
|
- System.out.println("EEE");
|
|
|
|
|
- }
|
|
|
|
|
content = dealTxt(content);
|
|
content = dealTxt(content);
|
|
|
List<XWPFRun> runs = paragraph.getRuns();
|
|
List<XWPFRun> runs = paragraph.getRuns();
|
|
|
imgUrl = null;
|
|
imgUrl = null;
|
|
@@ -992,7 +989,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
QuestionAddBo addBo = new QuestionAddBo();
|
|
QuestionAddBo addBo = new QuestionAddBo();
|
|
|
qContent = removeNo(qContent);
|
|
qContent = removeNo(qContent);
|
|
|
if (Validator.isEmpty(qContent)) {
|
|
if (Validator.isEmpty(qContent)) {
|
|
|
- errorLog += "第" + index + "条题目内容空白\n";
|
|
|
|
|
|
|
+ errorLog += "第" + index + "条题目内容错误\n";
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
QuestionAddBo bo = new QuestionAddBo();
|
|
QuestionAddBo bo = new QuestionAddBo();
|
|
@@ -1053,10 +1050,10 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
//新题开头
|
|
//新题开头
|
|
|
qContent = qContent + content +"<br />";
|
|
qContent = qContent + content +"<br />";
|
|
|
}
|
|
}
|
|
|
- //第一个选项
|
|
|
|
|
- if(content.startsWith("A.")||(nowPart==1&&!isLineStart(content))) {
|
|
|
|
|
|
|
+ //第一个选项(包含西里尔字母А)
|
|
|
|
|
+ if(content.startsWith("А.")||content.startsWith("A.")||(nowPart==1&&!isLineStart(content))) {
|
|
|
if (Validator.isEmpty(qContent)) {
|
|
if (Validator.isEmpty(qContent)) {
|
|
|
- errorLog += "第" + index + "条题目内容空白\n";
|
|
|
|
|
|
|
+ errorLog += "第" + index + "条题目内容错误\n";
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
if(nowPart!=1){
|
|
if(nowPart!=1){
|
|
@@ -1069,17 +1066,21 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
if(optionsList.size()<1){
|
|
if(optionsList.size()<1){
|
|
|
bo1 = new QuestionChildAddBo();
|
|
bo1 = new QuestionChildAddBo();
|
|
|
bo1.setOptionsId(1L);
|
|
bo1.setOptionsId(1L);
|
|
|
- bo1.setContent(strContent.replace("A.", ""));
|
|
|
|
|
|
|
+ bo1.setContent(strContent.replace("A.", "").replace("А.", ""));
|
|
|
bo1.setImgUrl(imgUrl);
|
|
bo1.setImgUrl(imgUrl);
|
|
|
optionsList.add(bo1);
|
|
optionsList.add(bo1);
|
|
|
}else{
|
|
}else{
|
|
|
bo1 = optionsList.get(0);
|
|
bo1 = optionsList.get(0);
|
|
|
bo1.setImgUrl(imgUrl);
|
|
bo1.setImgUrl(imgUrl);
|
|
|
- bo1.setContent(strContent.replace("A.", ""));
|
|
|
|
|
|
|
+ bo1.setContent(strContent.replace("A.", "").replace("А.", ""));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
//第二个选项
|
|
//第二个选项
|
|
|
if (content.startsWith("B.")||(nowPart==2&&!isLineStart(content))) {
|
|
if (content.startsWith("B.")||(nowPart==2&&!isLineStart(content))) {
|
|
|
|
|
+ if (optionsList.size()<1) {
|
|
|
|
|
+ errorLog += "第" + index + "条题目选项A错误\n";
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
if(nowPart!=2){
|
|
if(nowPart!=2){
|
|
|
strContent = "";
|
|
strContent = "";
|
|
|
}
|
|
}
|
|
@@ -1181,7 +1182,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
//答案和题型
|
|
//答案和题型
|
|
|
if (content.startsWith("正确答案:")||(nowPart==7&&!isLineStart(content))) {
|
|
if (content.startsWith("正确答案:")||(nowPart==7&&!isLineStart(content))) {
|
|
|
if (Validator.isEmpty(qContent)) {
|
|
if (Validator.isEmpty(qContent)) {
|
|
|
- errorLog += "第" + index + "条题目内容空白\n";
|
|
|
|
|
|
|
+ errorLog += "第" + index + "条题目内容错误\n";
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
if(nowPart!=7){
|
|
if(nowPart!=7){
|
|
@@ -1363,7 +1364,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
QuestionAddBo addBo = new QuestionAddBo();
|
|
QuestionAddBo addBo = new QuestionAddBo();
|
|
|
qContent = removeNo(qContent);
|
|
qContent = removeNo(qContent);
|
|
|
if (Validator.isEmpty(qContent)) {
|
|
if (Validator.isEmpty(qContent)) {
|
|
|
- errorLog += "第" + index + "条题目内容空白\n";
|
|
|
|
|
|
|
+ errorLog += "第" + index + "条题目内容错误\n";
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
QuestionAddBo bo = new QuestionAddBo();
|
|
QuestionAddBo bo = new QuestionAddBo();
|
|
@@ -1426,9 +1427,9 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
qContent = qContent + content +"<br />";
|
|
qContent = qContent + content +"<br />";
|
|
|
}
|
|
}
|
|
|
//第一个选项
|
|
//第一个选项
|
|
|
- if(content.startsWith("A.")||(nowPart==1&&!isLineStart(content))) {
|
|
|
|
|
|
|
+ if(content.startsWith("А.")||content.startsWith("A.")||(nowPart==1&&!isLineStart(content))) {
|
|
|
if (Validator.isEmpty(qContent)) {
|
|
if (Validator.isEmpty(qContent)) {
|
|
|
- errorLog += "第" + index + "条题目内容空白\n";
|
|
|
|
|
|
|
+ errorLog += "第" + index + "条题目内容错误\n";
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
if(nowPart!=1){
|
|
if(nowPart!=1){
|
|
@@ -1442,16 +1443,20 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
bo1 = new QuestionChildAddBo();
|
|
bo1 = new QuestionChildAddBo();
|
|
|
bo1.setOptionsId(1L);
|
|
bo1.setOptionsId(1L);
|
|
|
bo1.setImgUrl(imgUrl);
|
|
bo1.setImgUrl(imgUrl);
|
|
|
- bo1.setContent(strContent.replace("A.", ""));
|
|
|
|
|
|
|
+ bo1.setContent(strContent.replace("A.", "").replace("А.", ""));
|
|
|
optionsList.add(bo1);
|
|
optionsList.add(bo1);
|
|
|
}else{
|
|
}else{
|
|
|
bo1 = optionsList.get(0);
|
|
bo1 = optionsList.get(0);
|
|
|
bo1.setImgUrl(imgUrl);
|
|
bo1.setImgUrl(imgUrl);
|
|
|
- bo1.setContent(strContent.replace("A.", ""));
|
|
|
|
|
|
|
+ bo1.setContent(strContent.replace("A.", "").replace("А.", ""));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
//第二个选项
|
|
//第二个选项
|
|
|
if (content.startsWith("B.")||(nowPart==2&&!isLineStart(content))) {
|
|
if (content.startsWith("B.")||(nowPart==2&&!isLineStart(content))) {
|
|
|
|
|
+ if (optionsList.size()<1) {
|
|
|
|
|
+ errorLog += "第" + index + "条题目选项A错误\n";
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
if(nowPart!=2){
|
|
if(nowPart!=2){
|
|
|
strContent = "";
|
|
strContent = "";
|
|
|
}
|
|
}
|
|
@@ -1553,7 +1558,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
//答案和题型
|
|
//答案和题型
|
|
|
if (content.startsWith("正确答案:")||(nowPart==7&&!isLineStart(content))) {
|
|
if (content.startsWith("正确答案:")||(nowPart==7&&!isLineStart(content))) {
|
|
|
if (Validator.isEmpty(qContent)) {
|
|
if (Validator.isEmpty(qContent)) {
|
|
|
- errorLog += "第" + index + "条题目内容空白\n";
|
|
|
|
|
|
|
+ errorLog += "第" + index + "条题目内容错误\n";
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
if(nowPart!=7){
|
|
if(nowPart!=7){
|