|
|
@ -72,10 +72,13 @@ public class QuestionUtil {
|
|
|
|
if (StrUtil.isBlank(optionText)) {
|
|
|
|
if (StrUtil.isBlank(optionText)) {
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// 属性名称
|
|
|
|
String optionName = optionField.getName();
|
|
|
|
String optionName = optionField.getName();
|
|
|
|
|
|
|
|
// 从属性名称中取A,BCD
|
|
|
|
|
|
|
|
String beforeLetter = optionName.substring(optionName.length() - 1);
|
|
|
|
QuestionInfo questionInfo = QuestionInfo.builder().questionStem(questionStem)
|
|
|
|
QuestionInfo questionInfo = QuestionInfo.builder().questionStem(questionStem)
|
|
|
|
.questionType(EnumUtil.likeValueOf(ResourcesQuestionTypeEnum.class, Integer.valueOf(questionType)))
|
|
|
|
.questionType(EnumUtil.likeValueOf(ResourcesQuestionTypeEnum.class, Integer.valueOf(questionType)))
|
|
|
|
.optionText(optionText).isTrue(trueAnswer.contains(optionName))
|
|
|
|
.optionText(optionText).isTrue(trueAnswer.contains(beforeLetter))
|
|
|
|
.build();
|
|
|
|
.build();
|
|
|
|
Kv.put(optionName, questionInfo);
|
|
|
|
Kv.put(optionName, questionInfo);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -121,6 +124,7 @@ public class QuestionUtil {
|
|
|
|
ReflectUtil.setFieldValue(t, trueAnswerFieldName, answer);
|
|
|
|
ReflectUtil.setFieldValue(t, trueAnswerFieldName, answer);
|
|
|
|
for (int j = 0; j < optionNames.length; j++) {
|
|
|
|
for (int j = 0; j < optionNames.length; j++) {
|
|
|
|
ReflectUtil.setFieldValue(t, optionNames[j], questionInfos[i].getOptionText());
|
|
|
|
ReflectUtil.setFieldValue(t, optionNames[j], questionInfos[i].getOptionText());
|
|
|
|
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}catch (Exception e) {
|
|
|
|
}catch (Exception e) {
|
|
|
|