|
|
@@ -330,8 +330,23 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
update.setUpdateTime(DateUtils.getNowTime());
|
|
|
update.setQuestionId(bo.getQuestionId());
|
|
|
update.setStatus(-1);
|
|
|
- return this.updateById(update);
|
|
|
+ this.updateById(update);
|
|
|
}
|
|
|
+ List<Long> questionIds = new ArrayList<>();
|
|
|
+ if (CollectionUtils.isNotEmpty(bo.getQuestionIds())) {
|
|
|
+ questionIds.addAll(bo.getQuestionIds());
|
|
|
+ }
|
|
|
+ if (ObjectUtils.isNotNull(bo.getQuestionId())){
|
|
|
+ questionIds.add(bo.getQuestionId());
|
|
|
+ }
|
|
|
+ //删除关联关系
|
|
|
+ if (CollectionUtils.isNotEmpty(questionIds)) {
|
|
|
+ List<ExamQuestion> list = iExamQuestionService.list(new LambdaUpdateWrapper<ExamQuestion>().in(ExamQuestion::getQuestionId, questionIds));
|
|
|
+ if (CollectionUtils.isNotEmpty(list)) {
|
|
|
+ iExamQuestionService.removeByIds(list.stream().map(ExamQuestion::getId).collect(Collectors.toList()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}else{
|
|
|
Question update = BeanUtil.toBean(bo, Question.class);
|
|
|
if (bo.getOptionsList() != null) {
|
|
|
@@ -5076,13 +5091,17 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
private String getAnswer(List<String> question){
|
|
|
//找正确答案
|
|
|
Integer index =0;
|
|
|
+ Integer m = 3;
|
|
|
for (int i = 0; i < question.size(); i++) {
|
|
|
String s = question.get(i);
|
|
|
if (s.equals("正确答案")){
|
|
|
index = i;
|
|
|
}
|
|
|
+ if (s.contains("判断题")){
|
|
|
+ m = 2;
|
|
|
+ }
|
|
|
}
|
|
|
- return question.get(index+3);
|
|
|
+ return question.get(index+m);
|
|
|
}
|
|
|
|
|
|
private List<String> filterContent(List<String> lines) {
|