|
@@ -1044,7 +1044,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
}
|
|
|
if(!hasError){
|
|
|
if (Validator.isEmpty(answerQuestion)) {
|
|
|
- throw new CustomException("正确答案错误");
|
|
|
+ errorLog += "第" + index + "条正确答案错误\n";
|
|
|
}
|
|
|
if(type==5){
|
|
|
answerQuestion = null;
|
|
@@ -1316,7 +1316,8 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public List<QuestionAddBo> importWordQuestionList(MultipartFile file, Long eduId, Long projectId, Long businessId, Long subjectId) {
|
|
|
+ public Map<String,Object> importWordQuestionList(MultipartFile file, Long eduId, Long projectId, Long businessId, Long subjectId) {
|
|
|
+ Map<String,Object> result = new HashMap<>();
|
|
|
List<QuestionAddBo> list = new ArrayList<>();
|
|
|
String errorLog = ""; //错误提示
|
|
|
String buffer = "";
|
|
@@ -1428,7 +1429,8 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
}
|
|
|
if(!hasError){
|
|
|
if (Validator.isEmpty(answerQuestion)) {
|
|
|
- throw new CustomException("正确答案错误");
|
|
|
+ errorLog += "第" + index + "正确答案错误\n";
|
|
|
+
|
|
|
}
|
|
|
if(type==5){
|
|
|
answerQuestion = null;
|
|
@@ -1698,7 +1700,9 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
System.out.println("此文件不是word文件!" + e.getMessage() + e.toString() + e.getLocalizedMessage());
|
|
|
}
|
|
|
Collections.reverse(list);
|
|
|
- return list;
|
|
|
+ result.put("list",list);
|
|
|
+ result.put("errorLog",errorLog);
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
|