试卷生成代码调整

This commit is contained in:
tiger_zhou 2022-10-28 13:34:18 +08:00
parent d16e4275c0
commit 93c32f9d32

View File

@ -91,17 +91,13 @@ public class PaperQuestionVO implements Cloneable {
question.setQuestion(this.topic);
question.setOrgId(this.orgId);
this.setOptionId(question);
String dd = JsonUtils.writeValueAsString(this.optionList);
List<Map> listMap = JsonUtils.readCollection(dd,List.class,Map.class);
listMap.forEach(d->d.remove("correct"));
question.setQuestionOption(JsonUtils.writeValueAsString(listMap));
if(StringUtils.hasText(this.tags)){
List<String> tmpTagList =Splitter.on(",").omitEmptyStrings().trimResults().splitToList(this.tags)
.stream().filter(d->Objects.equals(d,"")).collect(Collectors.toList());
question.setTags(Joiner.on(",").join(tmpTagList));
}else{
question.setTags(null);