|
@@ -15,8 +15,11 @@ import cn.com.qmth.examcloud.core.print.entity.SubjectiveQuestionStructure;
|
|
|
import cn.com.qmth.examcloud.core.print.repository.ObjectiveQuestionStructureRepository;
|
|
|
import cn.com.qmth.examcloud.core.print.repository.SubjectiveQuestionStructureRepository;
|
|
|
import cn.com.qmth.examcloud.core.print.service.ExamQuestionStructureService;
|
|
|
+import cn.com.qmth.examcloud.core.print.service.ExamStructureService;
|
|
|
import cn.com.qmth.examcloud.core.print.service.StatisticService;
|
|
|
import cn.com.qmth.examcloud.core.print.service.bean.examquestionstructure.ExamQuestionStructureInfo;
|
|
|
+import cn.com.qmth.examcloud.core.print.service.bean.examstructure.ExamStructureInfo;
|
|
|
+import com.google.common.collect.Lists;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
@@ -39,6 +42,8 @@ public class QuestionStructureServiceImpl implements ExamQuestionStructureServic
|
|
|
@Autowired
|
|
|
private SubjectiveQuestionStructureRepository subjectiveQuestionStructureRepository;
|
|
|
@Autowired
|
|
|
+ private ExamStructureService examStructureService;
|
|
|
+ @Autowired
|
|
|
private StatisticService statisticService;
|
|
|
|
|
|
@Override
|
|
@@ -79,7 +84,7 @@ public class QuestionStructureServiceImpl implements ExamQuestionStructureServic
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<ObjectiveQuestionStructure> getObjectiveQuestionStructureList(Long examId, String paperId) {
|
|
|
+ public List<ObjectiveQuestionStructure> getObjectiveQuestionStructureList(Long orgId, Long examId, String paperId, String paperType) {
|
|
|
Check.isNull(examId, "考试ID不能为空!");
|
|
|
Check.isEmpty(paperId, "试卷ID不能为空!");
|
|
|
|
|
@@ -89,12 +94,23 @@ public class QuestionStructureServiceImpl implements ExamQuestionStructureServic
|
|
|
|
|
|
Specification<ObjectiveQuestionStructure> spec = SpecUtils.buildSearchers(ObjectiveQuestionStructure.class, searches.build());
|
|
|
List<ObjectiveQuestionStructure> list = objectiveQuestionStructureRepository.findAll(spec);
|
|
|
+ if (list == null || list.isEmpty()) {
|
|
|
+ return Lists.newArrayList();
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取考试结构设置的客观题数量
|
|
|
+ ExamStructureInfo info = examStructureService.getExamStructure(orgId, examId);
|
|
|
+
|
|
|
+ for (ObjectiveQuestionStructure structure : list) {
|
|
|
+ structure.setPaperType(paperType);//补全信息
|
|
|
+ }
|
|
|
+
|
|
|
//todo
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<SubjectiveQuestionStructure> getSubjectiveQuestionStructureList(Long examId, String paperId) {
|
|
|
+ public List<SubjectiveQuestionStructure> getSubjectiveQuestionStructureList(Long examId, String paperId, String paperType) {
|
|
|
Check.isNull(examId, "考试ID不能为空!");
|
|
|
Check.isEmpty(paperId, "试卷ID不能为空!");
|
|
|
|
|
@@ -104,7 +120,13 @@ public class QuestionStructureServiceImpl implements ExamQuestionStructureServic
|
|
|
|
|
|
Specification<SubjectiveQuestionStructure> spec = SpecUtils.buildSearchers(SubjectiveQuestionStructure.class, searches.build());
|
|
|
List<SubjectiveQuestionStructure> list = subjectiveQuestionStructureRepository.findAll(spec);
|
|
|
- //todo
|
|
|
+ if (list == null || list.isEmpty()) {
|
|
|
+ return Lists.newArrayList();
|
|
|
+ }
|
|
|
+
|
|
|
+ for (SubjectiveQuestionStructure structure : list) {
|
|
|
+ structure.setPaperType(paperType);//补全信息
|
|
|
+ }
|
|
|
return list;
|
|
|
}
|
|
|
|