|
@@ -110,6 +110,9 @@ public class QuestionStructureServiceImpl implements ExamQuestionStructureServic
|
|
|
throw new StatusException(PRT_CODE_500, "当前的考试结构设置不存在!");
|
|
|
}
|
|
|
|
|
|
+ //默认属性信息
|
|
|
+ Map<String, String> properties = new HashMap<>();
|
|
|
+
|
|
|
//按试题类型封装试题集合
|
|
|
Map<String, List<ObjectiveQuestionStructure>> structureMaps = new HashMap<>();
|
|
|
ExamQuestionStructure questionStructure = info.getQuestionStructure();
|
|
@@ -121,19 +124,27 @@ public class QuestionStructureServiceImpl implements ExamQuestionStructureServic
|
|
|
structureMaps.put(objective.getQuestionType(), list);
|
|
|
}
|
|
|
list.add(objective);
|
|
|
+
|
|
|
+ if (properties.size() > 0) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ properties.put("courseCode", objective.getCourseCode());
|
|
|
+ properties.put("courseName", objective.getCourseName());
|
|
|
+ properties.put("paperName", objective.getPaperName());
|
|
|
+ properties.put("paperType", paperType);
|
|
|
}
|
|
|
|
|
|
//补全阅卷时缺失的单选题
|
|
|
int startNum = 1;
|
|
|
- this.fillQuestionStructure(structureMaps, QuesStructType.SINGLE_ANSWER_QUESTION, questionStructure.getSingleChoiceTotal(), startNum);
|
|
|
+ this.fillQuestionStructure(structureMaps, properties, QuesStructType.SINGLE_ANSWER_QUESTION, questionStructure.getSingleChoiceTotal(), startNum);
|
|
|
|
|
|
//补全阅卷时缺失的多选题
|
|
|
startNum += questionStructure.getSingleChoiceTotal();
|
|
|
- this.fillQuestionStructure(structureMaps, QuesStructType.MULTIPLE_ANSWER_QUESTION, questionStructure.getMultipleChoiceTotal(), startNum);
|
|
|
+ this.fillQuestionStructure(structureMaps, properties, QuesStructType.MULTIPLE_ANSWER_QUESTION, questionStructure.getMultipleChoiceTotal(), startNum);
|
|
|
|
|
|
//补全阅卷时缺失的判断题
|
|
|
startNum += questionStructure.getMultipleChoiceTotal();
|
|
|
- this.fillQuestionStructure(structureMaps, QuesStructType.BOOL_ANSWER_QUESTION, questionStructure.getBoolQuestionTotal(), startNum);
|
|
|
+ this.fillQuestionStructure(structureMaps, properties, QuesStructType.BOOL_ANSWER_QUESTION, questionStructure.getBoolQuestionTotal(), startNum);
|
|
|
|
|
|
//返回所有客观题集合
|
|
|
List<ObjectiveQuestionStructure> allObjectives = new ArrayList<>();
|
|
@@ -159,7 +170,7 @@ public class QuestionStructureServiceImpl implements ExamQuestionStructureServic
|
|
|
*
|
|
|
* @See ExportPaperAbstractService --> fillObjectiveQuestions(...)
|
|
|
*/
|
|
|
- private void fillQuestionStructure(Map<String, List<ObjectiveQuestionStructure>> structureMaps, QuesStructType quesStructType, int limitSize, int startNum) {
|
|
|
+ private void fillQuestionStructure(Map<String, List<ObjectiveQuestionStructure>> structureMaps, Map<String, String> properties, QuesStructType quesStructType, int limitSize, int startNum) {
|
|
|
List<ObjectiveQuestionStructure> objectives = structureMaps.get(quesStructType.getTitle());
|
|
|
if (objectives == null) {
|
|
|
objectives = new ArrayList<>();
|
|
@@ -176,7 +187,9 @@ public class QuestionStructureServiceImpl implements ExamQuestionStructureServic
|
|
|
if (currentSize == 0) {
|
|
|
//若当前试卷该题型的数量为0,则设置默认小题集合
|
|
|
for (int i = 0; i < limitSize; i++) {
|
|
|
- objectives.add(new ObjectiveQuestionStructure(quesStructType, startNum + i));
|
|
|
+ ObjectiveQuestionStructure objective = new ObjectiveQuestionStructure(quesStructType, properties);
|
|
|
+ objective.setUnitNum(startNum + i);
|
|
|
+ objectives.add(objective);
|
|
|
}
|
|
|
return;
|
|
|
}
|
|
@@ -188,7 +201,9 @@ public class QuestionStructureServiceImpl implements ExamQuestionStructureServic
|
|
|
ObjectiveQuestionStructure objective = objectives.get(i);
|
|
|
objective.setUnitNum(startNum + i);
|
|
|
} else {
|
|
|
- objectives.add(new ObjectiveQuestionStructure(quesStructType, startNum + i));
|
|
|
+ ObjectiveQuestionStructure objective = new ObjectiveQuestionStructure(quesStructType, properties);
|
|
|
+ objective.setUnitNum(startNum + i);
|
|
|
+ objectives.add(objective);
|
|
|
}
|
|
|
}
|
|
|
return;
|