|
@@ -236,18 +236,14 @@ public class ExamQuestionOuterServiceProvider extends ControllerSupport implemen
|
|
|
osb.setSubjectName(course.getName());
|
|
|
|
|
|
List<OuterSubjectivePaperQuestionBean> subPaperQuesList = new ArrayList<>();
|
|
|
- //所有试题信息
|
|
|
- List<OuterQuestionBean> allQuestions = outletPaperStructService.getPaperStructQuestions(
|
|
|
- req.getExamId(), course.getCode(), QuestionCategory.SUBJECTIVE);
|
|
|
-
|
|
|
-
|
|
|
for (OuterQuestionBean subQues : subjectiveQuestions) {
|
|
|
OuterSubjectivePaperQuestionBean subPaperQues = new OuterSubjectivePaperQuestionBean();
|
|
|
+
|
|
|
//获取指定小题的题干相关信息
|
|
|
QuestionCacheBean cachedQues = CacheHelper.getQuestion(examId, subjectCode, subQues.getPaperType(), subQues.getQuestionId());
|
|
|
- String strAnswer = getCorrectAnswer(subQues.getSubNumber(), subQues.getQuestionId(), cachedQues, allQuestions);
|
|
|
+ String strAnswer = getCorrectAnswer(subQues.getSubNumber(), subQues.getQuestionId(), cachedQues, subjectiveQuestions);
|
|
|
String strParentBody = getParentBody(cachedQues);
|
|
|
- String strBody = getBody(subQues.getSubNumber(), subQues.getQuestionId(), cachedQues, allQuestions);
|
|
|
+ String strBody = getBody(subQues.getSubNumber(), subQues.getQuestionId(), cachedQues, subjectiveQuestions);
|
|
|
|
|
|
//注意:ComplexTextHandler类中有公共字段,需要多例,不能搞成单例,否则会出问题
|
|
|
RichTextHandler answerComplexRichTextHandler = RichTextHandlerFactory.getHandler("complex");
|
|
@@ -261,10 +257,11 @@ public class ExamQuestionOuterServiceProvider extends ControllerSupport implemen
|
|
|
subPaperQues.setMainNumber(subQues.getMainNumber());
|
|
|
subPaperQues.setSubNumber(subQues.getSubNumber());
|
|
|
subPaperQues.setQuestionId(subQues.getQuestionId());
|
|
|
+
|
|
|
subPaperQuesList.add(subPaperQues);
|
|
|
}
|
|
|
- osb.setQuestions(subPaperQuesList);
|
|
|
|
|
|
+ osb.setQuestions(subPaperQuesList);
|
|
|
resp.setSubjectivePaper(osb);
|
|
|
|
|
|
return resp;
|
|
@@ -617,7 +614,7 @@ public class ExamQuestionOuterServiceProvider extends ControllerSupport implemen
|
|
|
*
|
|
|
* @param curSubNumber 当前小题号
|
|
|
* @param questionId 原小题id
|
|
|
- * @param cachedQues 带题干的试卷结构
|
|
|
+ * @param cachedQues 带题干的试题结构
|
|
|
* @param allEqList 所有作答集合
|
|
|
* @return
|
|
|
*/
|
|
@@ -639,7 +636,7 @@ public class ExamQuestionOuterServiceProvider extends ControllerSupport implemen
|
|
|
filter(p -> p.getQuestionId().equals(questionId)).collect(Collectors.toList());
|
|
|
|
|
|
for (int i = 0; i < noBodySubjectiveQuesList.size(); i++) {
|
|
|
- //如果小题号相同,则根据相同索引从带题干的集合中取出对应的小题题干
|
|
|
+ //如果小题号相同,则根据相同索引从带题干的集合中取出对应的小题答案
|
|
|
if (noBodySubjectiveQuesList.get(i).getSubNumber().intValue() == curSubNumber.intValue()) {
|
|
|
return rightAnswerList.get(i);
|
|
|
}
|