|
@@ -160,11 +160,17 @@ public class ExtractConfigProviderServiceImpl implements ExtractConfigProviderSe
|
|
while (it.hasNext()) {
|
|
while (it.hasNext()) {
|
|
String key = it.next();
|
|
String key = it.next();
|
|
Paper paper = this.getPaperByProbability(examPaperMap.get(key));
|
|
Paper paper = this.getPaperByProbability(examPaperMap.get(key));
|
|
|
|
+
|
|
|
|
+ if (paper == null) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+
|
|
//不能用原来的paper对象,否则examPaperList中的paper对象会被覆盖
|
|
//不能用原来的paper对象,否则examPaperList中的paper对象会被覆盖
|
|
Paper newPaper = Model.of(paperRepo.findById(paper.getId()));
|
|
Paper newPaper = Model.of(paperRepo.findById(paper.getId()));
|
|
paperByTypeMap.put(key, newPaper);
|
|
paperByTypeMap.put(key, newPaper);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
return paperByTypeMap;
|
|
return paperByTypeMap;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -445,21 +451,22 @@ public class ExtractConfigProviderServiceImpl implements ExtractConfigProviderSe
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
private String[] getSelectQuestionAnswer(List<QuesOption> quesOptions) {
|
|
private String[] getSelectQuestionAnswer(List<QuesOption> quesOptions) {
|
|
- String[] rightAnswer = null;
|
|
|
|
List<String> list = new ArrayList<>();
|
|
List<String> list = new ArrayList<>();
|
|
|
|
|
|
- if (quesOptions != null && quesOptions.size() > 0) {
|
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(quesOptions)) {
|
|
for (int i = 0; i < quesOptions.size(); i++) {
|
|
for (int i = 0; i < quesOptions.size(); i++) {
|
|
QuesOption quesOption = quesOptions.get(i);
|
|
QuesOption quesOption = quesOptions.get(i);
|
|
if (quesOption.getIsCorrect() == 1) {
|
|
if (quesOption.getIsCorrect() == 1) {
|
|
list.add(String.valueOf(i));
|
|
list.add(String.valueOf(i));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- rightAnswer = list.toArray(new String[list.size()]);
|
|
|
|
- return rightAnswer;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- return rightAnswer;
|
|
|
|
|
|
+ if (list.size() > 0) {
|
|
|
|
+ return list.toArray(new String[list.size()]);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return new String[0];
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -660,6 +667,7 @@ public class ExtractConfigProviderServiceImpl implements ExtractConfigProviderSe
|
|
public List<String> getAnswer(String questionId) {
|
|
public List<String> getAnswer(String questionId) {
|
|
List<String> list = new ArrayList<>();
|
|
List<String> list = new ArrayList<>();
|
|
Question question = Model.of(quesRepo.findById(questionId));
|
|
Question question = Model.of(quesRepo.findById(questionId));
|
|
|
|
+
|
|
if (question.getQuestionType() == QuesStructType.NESTED_ANSWER_QUESTION) {
|
|
if (question.getQuestionType() == QuesStructType.NESTED_ANSWER_QUESTION) {
|
|
List<Question> subList = question.getSubQuestions();
|
|
List<Question> subList = question.getSubQuestions();
|
|
if (subList != null && subList.size() > 0) {
|
|
if (subList != null && subList.size() > 0) {
|
|
@@ -706,6 +714,7 @@ public class ExtractConfigProviderServiceImpl implements ExtractConfigProviderSe
|
|
}
|
|
}
|
|
list.add(answer);
|
|
list.add(answer);
|
|
}
|
|
}
|
|
|
|
+
|
|
return list;
|
|
return list;
|
|
}
|
|
}
|
|
|
|
|