|
@@ -1342,7 +1342,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
String qContent = ""; //题目正文
|
|
|
String answerQuestion = null; //答案
|
|
|
String analysisContent = ""; //解析文本
|
|
|
- int index = 0; //题目序列号
|
|
|
+ int index = 1; //题目序列号
|
|
|
List<QuestionBusinessAddBo> businessList = new ArrayList<>();
|
|
|
QuestionBusinessAddBo questionBusinessAddBo = new QuestionBusinessAddBo();
|
|
|
questionBusinessAddBo.setEducationTypeId(eduId);
|
|
@@ -1360,6 +1360,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
String strContent = "";
|
|
|
String imgUrl = "";
|
|
|
boolean hasQuestion = false;
|
|
|
+ boolean hasRightTag = false;
|
|
|
boolean hasError = false;
|
|
|
for (XWPFParagraph paragraph : paragraphList) {
|
|
|
content = paragraph.getText();
|
|
@@ -1419,17 +1420,20 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
if (Validator.isEmpty(qContent)) {
|
|
|
hasError = true;
|
|
|
errorLog += "第" + index + "条题目内容错误\n";
|
|
|
+ continue;
|
|
|
|
|
|
}
|
|
|
QuestionAddBo bo = new QuestionAddBo();
|
|
|
if (type == -1) {
|
|
|
hasError = true;
|
|
|
errorLog += "第" + index + "条题目选项错误\n";
|
|
|
+ continue;
|
|
|
|
|
|
}
|
|
|
if(!hasError){
|
|
|
if (Validator.isEmpty(answerQuestion)) {
|
|
|
errorLog += "第" + index + "正确答案错误\n";
|
|
|
+ continue;
|
|
|
|
|
|
}
|
|
|
if(type==5){
|
|
@@ -1470,16 +1474,25 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
analysisContent = "";
|
|
|
optionsList.clear();
|
|
|
nowPart = -1;
|
|
|
+ hasRightTag= false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ System.out.println(index);
|
|
|
+ if (content.startsWith("正确答案:")){
|
|
|
+ if(!hasRightTag){
|
|
|
+ hasRightTag = true;
|
|
|
+ }else{
|
|
|
+ errorLog += "第" + index + "题目序号可能错误\n";
|
|
|
+ hasRightTag =false;
|
|
|
+ continue;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
if (content.startsWith("#")) { //导入结束
|
|
|
break;
|
|
|
}
|
|
|
if(Validator.isEmpty(content)||content.equals("")){
|
|
|
continue;
|
|
|
}
|
|
|
-
|
|
|
if (isQuestionStart(content)||(nowPart==0&&!isLineStart(content))) {
|
|
|
hasQuestion = true;
|
|
|
if(nowPart!=0){
|
|
@@ -1617,7 +1630,6 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
}
|
|
|
//答案和题型
|
|
|
if (content.startsWith("正确答案:")||(nowPart==7&&!isLineStart(content))) {
|
|
|
- hasQuestion = true;
|
|
|
if(nowPart!=7){
|
|
|
strContent = "";
|
|
|
}
|