|
@@ -9,6 +9,7 @@ import cn.com.qmth.examcloud.core.questions.base.question.enums.QuesStructType;
|
|
import cn.com.qmth.examcloud.core.questions.dao.*;
|
|
import cn.com.qmth.examcloud.core.questions.dao.*;
|
|
import cn.com.qmth.examcloud.core.questions.dao.entity.*;
|
|
import cn.com.qmth.examcloud.core.questions.dao.entity.*;
|
|
import cn.com.qmth.examcloud.core.questions.service.*;
|
|
import cn.com.qmth.examcloud.core.questions.service.*;
|
|
|
|
+import cn.com.qmth.examcloud.core.questions.service.bean.QuestionAnswerConvert;
|
|
import cn.com.qmth.examcloud.core.questions.service.bean.extract.ExtractConfigPaper;
|
|
import cn.com.qmth.examcloud.core.questions.service.bean.extract.ExtractConfigPaper;
|
|
import cn.com.qmth.examcloud.core.questions.service.config.SysProperty;
|
|
import cn.com.qmth.examcloud.core.questions.service.config.SysProperty;
|
|
import cn.com.qmth.examcloud.question.commons.core.paper.DefaultPaper;
|
|
import cn.com.qmth.examcloud.question.commons.core.paper.DefaultPaper;
|
|
@@ -434,70 +435,14 @@ public class ExtractConfigProviderServiceImpl implements ExtractConfigProviderSe
|
|
}
|
|
}
|
|
}
|
|
}
|
|
defaultQuestionUnit.setQuestionOptionList(defaultQuestionOptions);
|
|
defaultQuestionUnit.setQuestionOptionList(defaultQuestionOptions);
|
|
- defaultQuestionUnit.setRightAnswer(getSelectQuestionAnswer(quesOptions));
|
|
|
|
|
|
+ defaultQuestionUnit.setRightAnswer(QuestionAnswerConvert.parseQuestionOptionAnswers(quesOptions));
|
|
} else {
|
|
} else {
|
|
- defaultQuestionUnit.setRightAnswer(getAnswer(question));
|
|
|
|
|
|
+ defaultQuestionUnit.setRightAnswer(QuestionAnswerConvert.parseQuestionAnswers(question));
|
|
}
|
|
}
|
|
|
|
|
|
return defaultQuestionUnit;
|
|
return defaultQuestionUnit;
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 设置单选题和多选题 答案
|
|
|
|
- *
|
|
|
|
- * @param quesOptions
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- private String[] getSelectQuestionAnswer(List<QuesOption> quesOptions) {
|
|
|
|
- List<String> list = new ArrayList<>();
|
|
|
|
-
|
|
|
|
- if (CollectionUtils.isNotEmpty(quesOptions)) {
|
|
|
|
- for (int i = 0; i < quesOptions.size(); i++) {
|
|
|
|
- QuesOption quesOption = quesOptions.get(i);
|
|
|
|
- if (quesOption.getIsCorrect() == 1) {
|
|
|
|
- list.add(String.valueOf(i));
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (list.size() > 0) {
|
|
|
|
- return list.toArray(new String[list.size()]);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return new String[0];
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 设置试题答案
|
|
|
|
- *
|
|
|
|
- * @param question
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- private String[] getAnswer(Question question) {
|
|
|
|
- String[] rightAnswer = null;
|
|
|
|
- //判断题答案
|
|
|
|
- if (question.getQuestionType() == QuesStructType.BOOL_ANSWER_QUESTION) {
|
|
|
|
- if (question.getQuesAnswer().equals("正确")) {
|
|
|
|
- rightAnswer = new String[1];
|
|
|
|
- rightAnswer[0] = "true";
|
|
|
|
- return rightAnswer;
|
|
|
|
- }
|
|
|
|
- if (question.getQuesAnswer().equals("错误")) {
|
|
|
|
- rightAnswer = new String[1];
|
|
|
|
- rightAnswer[0] = "false";
|
|
|
|
- return rightAnswer;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- //填空题答案
|
|
|
|
- /*if(question.getQuestionType() == QuesStructType.BOOL_ANSWER_QUESTION){
|
|
|
|
- rightAnswer = question.getQuesAnswer().split("##");
|
|
|
|
- return rightAnswer;
|
|
|
|
- }*/
|
|
|
|
- rightAnswer = new String[1];
|
|
|
|
- rightAnswer[0] = question.getQuesAnswer();
|
|
|
|
- return rightAnswer;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* html中添加音频标签
|
|
* html中添加音频标签
|
|
*
|
|
*
|
|
@@ -672,7 +617,7 @@ public class ExtractConfigProviderServiceImpl implements ExtractConfigProviderSe
|
|
String answer = "";
|
|
String answer = "";
|
|
for (Question subQuestion : subList) {
|
|
for (Question subQuestion : subList) {
|
|
if (subQuestion.getQuestionType() == QuesStructType.SINGLE_ANSWER_QUESTION || subQuestion.getQuestionType() == QuesStructType.MULTIPLE_ANSWER_QUESTION) {
|
|
if (subQuestion.getQuestionType() == QuesStructType.SINGLE_ANSWER_QUESTION || subQuestion.getQuestionType() == QuesStructType.MULTIPLE_ANSWER_QUESTION) {
|
|
- String[] answers = getSelectQuestionAnswer(subQuestion.getQuesOptions());
|
|
|
|
|
|
+ String[] answers = QuestionAnswerConvert.parseQuestionOptionAnswers(subQuestion.getQuesOptions());
|
|
for (int i = 0; i < answers.length; i++) {
|
|
for (int i = 0; i < answers.length; i++) {
|
|
if (i == 0) {
|
|
if (i == 0) {
|
|
answer = answers[i];
|
|
answer = answers[i];
|
|
@@ -694,7 +639,7 @@ public class ExtractConfigProviderServiceImpl implements ExtractConfigProviderSe
|
|
} else {
|
|
} else {
|
|
String answer = "";
|
|
String answer = "";
|
|
if (question.getQuestionType() == QuesStructType.SINGLE_ANSWER_QUESTION || question.getQuestionType() == QuesStructType.MULTIPLE_ANSWER_QUESTION) {
|
|
if (question.getQuestionType() == QuesStructType.SINGLE_ANSWER_QUESTION || question.getQuestionType() == QuesStructType.MULTIPLE_ANSWER_QUESTION) {
|
|
- String[] answers = getSelectQuestionAnswer(question.getQuesOptions());
|
|
|
|
|
|
+ String[] answers = QuestionAnswerConvert.parseQuestionOptionAnswers(question.getQuesOptions());
|
|
for (int i = 0; i < answers.length; i++) {
|
|
for (int i = 0; i < answers.length; i++) {
|
|
if (i == 0) {
|
|
if (i == 0) {
|
|
answer = answers[i];
|
|
answer = answers[i];
|