deason 5 лет назад
Родитель
Сommit
0b9f2120fa

+ 13 - 9
examcloud-exchange-outer-service/src/main/java/cn/com/qmth/examcloud/exchange/outer/service/impl/OutletPaperStructServiceImpl.java

@@ -17,6 +17,7 @@ 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.question.commons.core.question.QuestionType;
 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;
@@ -82,15 +83,18 @@ public class OutletPaperStructServiceImpl implements OutletPaperStructService {
 
             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);
+                    int mainNumber = i + 1, subNumber = ++order;
+
+                    // if (QuestionType.FILL_UP == questionUnitWrapper.getQuestionType() || QuestionType.ESSAY == questionUnitWrapper.getQuestionType()) {
+                        // 只封装主观题信息
+                        OuterQuestionBean subjectiveQuestion = new OuterQuestionBean();
+                        subjectiveQuestion.setMainNumber(mainNumber);
+                        subjectiveQuestion.setMainTitle(String.format("第%s大题", mainNumber));
+                        subjectiveQuestion.setSubNumber(subNumber);
+                        subjectiveQuestion.setTotalScore(questionUnitWrapper.getQuestionScore());
+
+                        subjectiveQuestions.add(subjectiveQuestion);
+                    // }
                 }
             }
         }