|
|
@@ -1139,6 +1139,9 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
if (content.indexOf("案例分析题")>-1) {
|
|
|
return true;
|
|
|
}
|
|
|
+ if (content.indexOf("章标题:")>-1) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
if (content.startsWith("参考答案")) {
|
|
|
return true;
|
|
|
}
|
|
|
@@ -2476,7 +2479,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
throw new CustomException("不支持doc格式");
|
|
|
} else if (path.endsWith("docx")) {
|
|
|
CourseBusinessQueryBo queryBo = new CourseBusinessQueryBo();
|
|
|
- queryBo.setEducationName("继续教育");
|
|
|
+ queryBo.setEducationName("考前培训");
|
|
|
queryBo.setProjectName("建造师");
|
|
|
queryBo.setBusinessName("二级");
|
|
|
CourseBusinessVo businessVo = iCourseBusinessService.queryFullId(queryBo);
|
|
|
@@ -2484,6 +2487,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
CourseSubject subject = iCourseSubjectService.getOne(new LambdaQueryWrapper<CourseSubject>()
|
|
|
.eq(CourseSubject::getSubjectName,subjectName).eq(CourseSubject::getStatus,1).last("limit 1"));
|
|
|
String importCode = ServletUtils.getImportEncoded("TM");
|
|
|
+ String importExamCode = ServletUtils.getEncoded("SJ");
|
|
|
InputStream is = file.getInputStream();
|
|
|
XWPFDocument doc = new XWPFDocument(is);
|
|
|
List<XWPFParagraph> paragraphList = doc.getParagraphs();
|
|
|
@@ -2529,6 +2533,13 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
alKeyList.add("案例(八)");
|
|
|
alKeyList.add("案例(九)");
|
|
|
alKeyList.add("案例(十)");
|
|
|
+ alKeyList.add("案例(十一)");
|
|
|
+ alKeyList.add("案例(十二)");
|
|
|
+ alKeyList.add("案例(十三)");
|
|
|
+ alKeyList.add("案例(十四)");
|
|
|
+ alKeyList.add("案例(十五)");
|
|
|
+ alKeyList.add("案例(十六)");
|
|
|
+ alKeyList.add("案例(十七)");
|
|
|
int anLiNum = 0;
|
|
|
String indexKey = null;
|
|
|
for (XWPFParagraph paragraph : paragraphList) {
|
|
|
@@ -2578,7 +2589,12 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
imgUrl = ossPath + "?x-oss-process=image/resize,w_" + wPx + ",h_" + HPx;
|
|
|
if(type==5||nowPart==9){
|
|
|
//正文图片
|
|
|
- qContent = qContent+"<br />" +"<p><img src=\"" + ossHost + "/" + imgUrl + "\"></p>";
|
|
|
+ if(!answerStatus){
|
|
|
+ qContent = qContent+"<br />" +"<p><img src=\"" + ossHost + "/" + imgUrl + "\"></p>";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(answerStatus){
|
|
|
+ analysisContent=analysisContent+"<br />" +"<p><img src=\"" + ossHost + "/" + imgUrl + "\"></p>";
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -2587,6 +2603,10 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
if(content.equals("")){
|
|
|
continue;
|
|
|
}
|
|
|
+ if(content.indexOf("关于《建设工程工程量清单计价规范》")>-1){
|
|
|
+ System.out.println(content);
|
|
|
+ }
|
|
|
+ System.out.println(content);
|
|
|
if (content.startsWith("###")||isXueJianQuestionStart(content,type,alKeyList)) {
|
|
|
|
|
|
if(hasQuestion&&!answerStatus){
|
|
|
@@ -2604,7 +2624,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
if (type == -1) {
|
|
|
hasError = true;
|
|
|
errorLog += "第" + index + "条题目选项错误\n";
|
|
|
- continue;
|
|
|
+ throw new CustomException("第" + index + "条题目选项错误\n");
|
|
|
|
|
|
}
|
|
|
if(!hasError){
|
|
|
@@ -2615,7 +2635,12 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
}*/
|
|
|
if(type==5){
|
|
|
answerQuestion = null;
|
|
|
+ }else{
|
|
|
+ if(optionsList.size()<4){
|
|
|
+ throw new CustomException("选项数量错误");
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
bo.setType(type);
|
|
|
bo.setStatus(1);
|
|
|
bo.setContent(qContent);
|
|
|
@@ -2751,6 +2776,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
}
|
|
|
ExamAddBo examAddBo = new ExamAddBo();
|
|
|
examAddBo.setExamName(preExamName);
|
|
|
+ examAddBo.setCode(importExamCode);
|
|
|
examAddBo.setBusinessList(businessItemList);
|
|
|
examAddBo.setQuestionList(questionList);
|
|
|
examAddBo.setStatus(1);
|
|
|
@@ -2760,7 +2786,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
list2.clear();
|
|
|
list3.clear();
|
|
|
list4.clear();
|
|
|
- type = -1;
|
|
|
+ type = -100;
|
|
|
|
|
|
continue;
|
|
|
}
|
|
|
@@ -2786,7 +2812,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
}
|
|
|
isOption = true; //是选择题
|
|
|
nowPart = 1;
|
|
|
- if(content.indexOf("B.")>0){
|
|
|
+ if(content.indexOf("B.")>-1){
|
|
|
//带B
|
|
|
int len = content.indexOf("B.");
|
|
|
strContent = content.substring(0,len) ;
|
|
|
@@ -2813,7 +2839,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
if (content.indexOf("B.")>0||content.startsWith("B.")||(nowPart==2&&!isXueJianLineStart(content,type,alKeyList))) {
|
|
|
if (optionsList.size()<1) {
|
|
|
errorLog += "第" + index + "条题目选项A错误\n";
|
|
|
- continue;
|
|
|
+ throw new CustomException("第" + index + "条题目选项A错误\n");
|
|
|
}
|
|
|
if(nowPart!=2){
|
|
|
strContent = "";
|
|
|
@@ -2870,7 +2896,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
|
|
|
}
|
|
|
//第四个选项
|
|
|
- if (content.indexOf("D.")>0||content.startsWith("D.")||(nowPart==4&&!isXueJianLineStart(content,type,alKeyList))) {
|
|
|
+ if (content.indexOf("D.")>-1||content.startsWith("D.")||(nowPart==4&&!isXueJianLineStart(content,type,alKeyList))) {
|
|
|
if(nowPart!=4){
|
|
|
strContent = "";
|
|
|
}
|