|
@@ -51,6 +51,7 @@ import com.github.pagehelper.Page;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
+import java.io.IOException;
|
|
|
import java.io.InputStream;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
@@ -380,6 +381,9 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
System.out.println(content);
|
|
|
// content = trimFirstAndLastChar(content, "\t");
|
|
|
if(Validator.isNotEmpty(content)){
|
|
|
+ if(content.startsWith("注意事项")){
|
|
|
+ break;
|
|
|
+ }
|
|
|
//第一个选项
|
|
|
if(content.startsWith("A.")){
|
|
|
isOption = true;
|
|
@@ -516,7 +520,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
type = 5; //简答题
|
|
|
int j = i;
|
|
|
String q_content = ""; //简答题
|
|
|
- QuestionChildAddBo bo1 = new QuestionChildAddBo();
|
|
|
+
|
|
|
while (j<paragraphList.size())
|
|
|
{
|
|
|
String tempTxt = paragraphList.get(j).getText();
|
|
@@ -527,9 +531,14 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
j++;
|
|
|
}
|
|
|
q_content = q_content.replace("解题思路:", "");
|
|
|
+ QuestionChildAddBo bo1 = null;
|
|
|
+ if(optionsList.size()==0){
|
|
|
+ bo1 = new QuestionChildAddBo();
|
|
|
+ optionsList.add(bo1);
|
|
|
+ }
|
|
|
+ bo1 = optionsList.get(0);
|
|
|
bo1.setOptionsId(1L);
|
|
|
bo1.setAnalysisContent(q_content);
|
|
|
- optionsList.add(bo1);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -596,7 +605,13 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
j++;
|
|
|
}
|
|
|
q_content = q_content.replace("【问题】", "");
|
|
|
- QuestionChildAddBo bo1 = optionsList.get(0);
|
|
|
+ QuestionChildAddBo bo1 = null;
|
|
|
+ if(optionsList.size()==0){
|
|
|
+ bo1 = new QuestionChildAddBo();
|
|
|
+ optionsList.add(bo1);
|
|
|
+ }
|
|
|
+ bo1 = optionsList.get(0);
|
|
|
+ bo1.setOptionsId(1L);
|
|
|
bo1.setContent(q_content);
|
|
|
i = j;
|
|
|
}
|
|
@@ -632,7 +647,6 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
answerQuestion = null;
|
|
|
analysisContent = "";
|
|
|
optionsList.clear();
|
|
|
-
|
|
|
}
|
|
|
i++;
|
|
|
}
|
|
@@ -642,8 +656,8 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
} else {
|
|
|
throw new CustomException("请导入word文件!");
|
|
|
}
|
|
|
- }catch (Exception e){
|
|
|
- System.out.println("此文件不是word文件!A"+e.getMessage());
|
|
|
+ }catch (IOException e){
|
|
|
+ System.out.println("此文件不是word文件!A"+e.getMessage()+e.toString()+e.getLocalizedMessage());
|
|
|
}
|
|
|
}
|
|
|
|