he2802 3 năm trước cách đây
mục cha
commit
9bd8e0e0ed

+ 16 - 10
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionServiceImpl.java

@@ -1043,6 +1043,9 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                                 errorLog += "第" + index + "条题目选项错误\n";
                             }
                             if(!hasError){
+                                if(type==5){
+                                    answerQuestion = null;
+                                }
                                 bo.setType(type);
                                 bo.setStatus(1);
                                 bo.setContent(qContent);
@@ -1235,7 +1238,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                         }
                         nowPart = 7;
                         if(Validator.isNotEmpty(answerQuestion)){
-                            analysisContent = analysisContent +  "<br />" + content ;
+                            answerQuestion = answerQuestion +  "<br />" + content ;
                         }else{
                             answerQuestion = content.replace("正确答案:", "");
                         }
@@ -1255,7 +1258,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                                 answerQuestion = "0";
                                 type = 3;
                             } else {
-                                answerQuestion = null;
+                                analysisContent = answerQuestion; //简答题把正确答案填充到解析文本
                                 type = 5; //简答题
                             }
                         }
@@ -1263,15 +1266,15 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                     }
                     else if (content.startsWith("解题思路")||(nowPart==8&&!isLineStart(content))) {
                         nowPart = 8;
-                        analysisContent = analysisContent + "<br />"+  content +"<br />";
+                        analysisContent = analysisContent +   content +"<br />";
                     }
                     else if (content.startsWith("考查考点")||(nowPart==9&&!isLineStart(content))) {
                         nowPart = 9;
-                        analysisContent = analysisContent + "<br />"+  content +"<br />";
+                        analysisContent = analysisContent +   content +"<br />";
                     }
                     else if (content.startsWith("老师解答")||(nowPart==10&&!isLineStart(content))) {
                         nowPart = 10;
-                        analysisContent = analysisContent +  "<br />"+  content +"<br />";
+                        analysisContent = analysisContent +    content +"<br />";
                     }
                 }
                 //遍历正文
@@ -1425,6 +1428,9 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
 
                             }
                             if(!hasError){
+                                if(type==5){
+                                    answerQuestion = null;
+                                }
                                 bo.setType(type);
                                 bo.setStatus(1);
                                 bo.setContent(qContent);
@@ -1618,7 +1624,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                         nowPart = 7;
 
                         if(Validator.isNotEmpty(answerQuestion)){
-                            analysisContent = analysisContent +  "<br />" + content ;
+                            answerQuestion = answerQuestion +  "<br />" + content ;
                         }else{
                             answerQuestion = content.replace("正确答案:", "");
                         }
@@ -1638,7 +1644,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                                 answerQuestion = "0";
                                 type = 3;
                             } else {
-                                answerQuestion = null;
+                                analysisContent = answerQuestion; //简答题把正确答案填充到解析文本
                                 type = 5; //简答题
                             }
                         }
@@ -1646,15 +1652,15 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                     }
                     else if (content.startsWith("解题思路")||(nowPart==8&&!isLineStart(content))) {
                         nowPart = 8;
-                        analysisContent = analysisContent + "<br />"+  content +"<br />";
+                        analysisContent = analysisContent +   content +"<br />";
                     }
                     else if (content.startsWith("考查考点")||(nowPart==9&&!isLineStart(content))) {
                         nowPart = 9;
-                        analysisContent = analysisContent + "<br />"+  content +"<br />";
+                        analysisContent = analysisContent +   content +"<br />";
                     }
                     else if (content.startsWith("老师解答")||(nowPart==10&&!isLineStart(content))) {
                         nowPart = 10;
-                        analysisContent = analysisContent + "<br />"+  content +"<br />";
+                        analysisContent = analysisContent +   content +"<br />";
                     }
                 }
                 //遍历正文