deason 5 năm trước cách đây
mục cha
commit
03e484393e

+ 9 - 4
examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/impl/QuesServiceImpl.java

@@ -741,21 +741,26 @@ public class QuesServiceImpl implements QuesService {
         Question question = optional.get();
         QuestionAnswerBean bean = new QuestionAnswerBean();
         List<String> answers = new ArrayList<>();
+        final String separator = "";//默认分隔符
 
         if (QuesStructType.NESTED_ANSWER_QUESTION == question.getQuestionType()) {
             List<Question> subQuestions = question.getSubQuestions();
             for (Question subQuestion : subQuestions) {
                 if (QuesStructType.SINGLE_ANSWER_QUESTION == subQuestion.getQuestionType() || QuesStructType.MULTIPLE_ANSWER_QUESTION == subQuestion.getQuestionType()) {
-                    answers.add(StringUtils.join(QuestionAnswerConvert.parseQuestionOptionAnswerList(subQuestion.getQuesOptions()), ""));
+                    List<String> values = QuestionAnswerConvert.parseQuestionOptionAnswerList(subQuestion.getQuesOptions());
+                    answers.add(StringUtils.join(values, separator));
                 } else {
-                    answers.add(StringUtils.join(QuestionAnswerConvert.parseQuestionAnswerList(subQuestion), ""));
+                    List<String> values = QuestionAnswerConvert.parseQuestionAnswerList(subQuestion);
+                    answers.add(StringUtils.join(values, separator));
                 }
             }
         } else {
             if (QuesStructType.SINGLE_ANSWER_QUESTION == question.getQuestionType() || QuesStructType.MULTIPLE_ANSWER_QUESTION == question.getQuestionType()) {
-                answers.add(StringUtils.join(QuestionAnswerConvert.parseQuestionOptionAnswerList(question.getQuesOptions()), ""));
+                List<String> values = QuestionAnswerConvert.parseQuestionOptionAnswerList(question.getQuesOptions());
+                answers.add(StringUtils.join(values, separator));
             } else {
-                answers.add(StringUtils.join(QuestionAnswerConvert.parseQuestionAnswerList(question), ""));
+                List<String> values = QuestionAnswerConvert.parseQuestionAnswerList(question);
+                answers.add(StringUtils.join(values, separator));
             }
         }