|
@@ -15,6 +15,8 @@ import cn.com.qmth.examcloud.exchange.outer.service.OutletPaperStructService;
|
|
|
import cn.com.qmth.examcloud.exchange.outer.service.bean.OuterCourseBean;
|
|
|
import cn.com.qmth.examcloud.exchange.outer.service.bean.OuterQuestionBean;
|
|
|
import cn.com.qmth.examcloud.question.commons.core.paper.DefaultQuestionGroup;
|
|
|
+import cn.com.qmth.examcloud.question.commons.core.paper.DefaultQuestionStructureWrapper;
|
|
|
+import cn.com.qmth.examcloud.question.commons.core.paper.DefaultQuestionUnitWrapper;
|
|
|
import cn.com.qmth.examcloud.support.cache.CacheHelper;
|
|
|
import cn.com.qmth.examcloud.support.cache.bean.ExtractConfigCacheBean;
|
|
|
import cn.com.qmth.examcloud.support.cache.bean.ExtractConfigDetailCacheBean;
|
|
@@ -61,20 +63,41 @@ public class OutletPaperStructServiceImpl implements OutletPaperStructService {
|
|
|
ExtractConfigPaperCacheBean extractConfigPaper = CacheHelper.getExtractConfigPaper(examId, courseCode, examPaper.getGroupCode(), examPaper.getPaperId());
|
|
|
List<DefaultQuestionGroup> questionGroupList = extractConfigPaper.getDefaultPaper().getQuestionGroupList();
|
|
|
|
|
|
- log.info("start setting questions...");
|
|
|
- List<OuterQuestionBean> questions = new ArrayList<>();
|
|
|
- for (DefaultQuestionGroup group : questionGroupList) {
|
|
|
- log.info(group.getGroupName());
|
|
|
- //todo
|
|
|
- }
|
|
|
-
|
|
|
- return questions;
|
|
|
+ return this.parseSubjectiveQuestions(questionGroupList);
|
|
|
} catch (Exception e) {
|
|
|
log.error(e.getMessage(), e);
|
|
|
return new ArrayList<>();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private List<OuterQuestionBean> parseSubjectiveQuestions(List<DefaultQuestionGroup> questionGroupList) {
|
|
|
+ log.info("parseSubjectiveQuestions start...");
|
|
|
+
|
|
|
+ List<OuterQuestionBean> subjectiveQuestions = new ArrayList<>();
|
|
|
+
|
|
|
+ int order = 0;
|
|
|
+ for (int i = 0; i < questionGroupList.size(); i++) {
|
|
|
+ DefaultQuestionGroup group = questionGroupList.get(i);
|
|
|
+ log.info(group.getGroupName() + " - " + group.getGroupScore() + " - " + group.getQuestionWrapperList().size());
|
|
|
+
|
|
|
+ for (DefaultQuestionStructureWrapper questionWrapper : group.getQuestionWrapperList()) {
|
|
|
+ for (DefaultQuestionUnitWrapper questionUnitWrapper : questionWrapper.getQuestionUnitWrapperList()) {
|
|
|
+ // questionUnitWrapper.getQuestionType(); todo
|
|
|
+
|
|
|
+ OuterQuestionBean subjectiveQuestion = new OuterQuestionBean();
|
|
|
+ subjectiveQuestion.setMainNumber(i + 1);
|
|
|
+ subjectiveQuestion.setMainTitle(group.getGroupName());
|
|
|
+ subjectiveQuestion.setSubNumber(++order);
|
|
|
+ subjectiveQuestion.setTotalScore(questionUnitWrapper.getQuestionScore());
|
|
|
+
|
|
|
+ subjectiveQuestions.add(subjectiveQuestion);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return subjectiveQuestions;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 获取考试相关联的课程列表
|
|
|
*
|