|
@@ -13,6 +13,7 @@ import cn.com.qmth.examcloud.core.questions.service.PaperService;
|
|
import cn.com.qmth.examcloud.core.questions.service.QuesService;
|
|
import cn.com.qmth.examcloud.core.questions.service.QuesService;
|
|
import cn.com.qmth.examcloud.core.questions.service.QuestionAudioService;
|
|
import cn.com.qmth.examcloud.core.questions.service.QuestionAudioService;
|
|
import cn.com.qmth.examcloud.core.questions.service.bean.QuestionAnswerBean;
|
|
import cn.com.qmth.examcloud.core.questions.service.bean.QuestionAnswerBean;
|
|
|
|
+import cn.com.qmth.examcloud.core.questions.service.bean.QuestionAnswerConvert;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.bson.types.ObjectId;
|
|
import org.bson.types.ObjectId;
|
|
import org.docx4j.XmlUtils;
|
|
import org.docx4j.XmlUtils;
|
|
@@ -738,16 +739,24 @@ public class QuesServiceImpl implements QuesService {
|
|
}
|
|
}
|
|
|
|
|
|
Question question = optional.get();
|
|
Question question = optional.get();
|
|
-
|
|
|
|
QuestionAnswerBean bean = new QuestionAnswerBean();
|
|
QuestionAnswerBean bean = new QuestionAnswerBean();
|
|
List<String> answers = new ArrayList<>();
|
|
List<String> answers = new ArrayList<>();
|
|
|
|
+
|
|
if (QuesStructType.NESTED_ANSWER_QUESTION == question.getQuestionType()) {
|
|
if (QuesStructType.NESTED_ANSWER_QUESTION == question.getQuestionType()) {
|
|
List<Question> subQuestions = question.getSubQuestions();
|
|
List<Question> subQuestions = question.getSubQuestions();
|
|
for (Question subQuestion : subQuestions) {
|
|
for (Question subQuestion : subQuestions) {
|
|
- answers.add(subQuestion.getQuesAnswer() != null ? subQuestion.getQuesAnswer() : "");
|
|
|
|
|
|
+ if (QuesStructType.SINGLE_ANSWER_QUESTION == subQuestion.getQuestionType() || QuesStructType.MULTIPLE_ANSWER_QUESTION == subQuestion.getQuestionType()) {
|
|
|
|
+ answers.add(StringUtils.join(QuestionAnswerConvert.parseQuestionOptionAnswerList(subQuestion.getQuesOptions()), ""));
|
|
|
|
+ } else {
|
|
|
|
+ answers.add(StringUtils.join(QuestionAnswerConvert.parseQuestionAnswerList(subQuestion), ""));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- answers.add(question.getQuesAnswer() != null ? question.getQuesAnswer() : "");
|
|
|
|
|
|
+ if (QuesStructType.SINGLE_ANSWER_QUESTION == question.getQuestionType() || QuesStructType.MULTIPLE_ANSWER_QUESTION == question.getQuestionType()) {
|
|
|
|
+ answers.add(StringUtils.join(QuestionAnswerConvert.parseQuestionOptionAnswerList(question.getQuesOptions()), ""));
|
|
|
|
+ } else {
|
|
|
|
+ answers.add(StringUtils.join(QuestionAnswerConvert.parseQuestionAnswerList(question), ""));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
bean.setRightAnswers(answers);
|
|
bean.setRightAnswers(answers);
|