|
|
|
@ -2,6 +2,7 @@ package com.ibeetl.jlw.entity;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
|
import cn.hutool.core.util.EnumUtil;
|
|
|
|
|
import cn.hutool.core.util.NumberUtil;
|
|
|
|
|
import cn.hutool.core.util.ReUtil;
|
|
|
|
|
import cn.hutool.core.util.ReflectUtil;
|
|
|
|
|
import cn.jlw.validate.ValidateConfig;
|
|
|
|
@ -22,6 +23,9 @@ import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.concurrent.CopyOnWriteArrayList;
|
|
|
|
|
|
|
|
|
|
import static cn.hutool.core.util.ArrayUtil.join;
|
|
|
|
|
import static cn.hutool.core.util.ObjectUtil.defaultIfNull;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* 资源管理 - 题库管理
|
|
|
|
|
* gen by Spring Boot2 Admin 2021-06-25
|
|
|
|
@ -384,16 +388,26 @@ public class ResourcesQuestion extends BaseEntity{
|
|
|
|
|
});
|
|
|
|
|
} break;
|
|
|
|
|
case FILL_QUESTION: {
|
|
|
|
|
// 填空题 questionOptionA 存放的是[---] 空的长度
|
|
|
|
|
final String optionName = "questionOptionA";
|
|
|
|
|
// 填空题 questionOptionA 存放的是空格的数量
|
|
|
|
|
questionOptionList.forEach(item -> {
|
|
|
|
|
Integer count = NumberUtil.toInt(defaultIfNull(getQuestionOptionA(), "0").getBytes());
|
|
|
|
|
setQuestionOptionA((++count).toString());
|
|
|
|
|
});
|
|
|
|
|
} break;
|
|
|
|
|
case ANALYSIS_QUESTION: {
|
|
|
|
|
// 分析题 questionOptionA 存放的是[---] 空的长度
|
|
|
|
|
// 分析题 questionOptionB 存放的是带填空的题干
|
|
|
|
|
final String optionName = "questionOptionA";
|
|
|
|
|
final String questionSubStem = "questionOptionB";
|
|
|
|
|
questionOptionList.forEach(item -> {
|
|
|
|
|
Integer count = NumberUtil.toInt(defaultIfNull(getQuestionOptionA(), "0").getBytes());
|
|
|
|
|
setQuestionOptionA((++count).toString());
|
|
|
|
|
|
|
|
|
|
String questionOptionB = defaultIfNull(getQuestionOptionB(), "");
|
|
|
|
|
|
|
|
|
|
String[] splitArr = item.split("_{8,}");
|
|
|
|
|
if (splitArr != null) {
|
|
|
|
|
setQuestionOptionB(questionOptionB + join(splitArr, "[---]"));
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} break;
|
|
|
|
|
default:
|
|
|
|
|
log.error("ResourcesQuestion.putQuestionOptionList 方法,未知的题目类型!");
|
|
|
|
|