lideyin %!s(int64=5) %!d(string=hai) anos
pai
achega
dbdb546ee2

+ 20 - 12
examcloud-core-oe-admin-api-provider/src/main/java/cn/com/qmth/examcloud/core/oe/admin/api/provider/ExamRecordCloudServiceProvider.java

@@ -10,6 +10,7 @@ import cn.com.qmth.examcloud.core.oe.admin.api.response.*;
 import cn.com.qmth.examcloud.question.commons.core.question.DefaultQuestionStructure;
 import cn.com.qmth.examcloud.question.commons.core.question.DefaultQuestionUnit;
 import cn.com.qmth.examcloud.support.cache.bean.QuestionCacheBean;
+import io.netty.util.internal.StringUtil;
 import org.jsoup.Jsoup;
 import org.jsoup.nodes.Document;
 import org.jsoup.nodes.Element;
@@ -344,25 +345,32 @@ public class ExamRecordCloudServiceProvider extends ControllerSupport implements
                 //如果主题干不为空,则认为是套题(套题需要将大题题干和小题题干拼在一起)
                 String mainBody = questionStructure.getBody();//主题干
                 if (!StringUtils.isNullOrEmpty(mainBody)) {
-                    //第1小题的子题干
-                    String subBody0 = questionUnits.get(0).getBody();
 
-                    //首先将本条数据添加(本条数据是完整的)
-                    subjectiveAnswerBean.setBody(mainBody + subBody0);//构建题干
-                    subjectiveAnswerBeanList.add(subjectiveAnswerBean);
 
-                    //其次,拼装套题的其它几个小题的题干(只初始化题干和唯一标识),并提前添加到结果集中
-                    for (int j = 1; j < questionUnits.size(); j++) {
+                    for (int j = 0; j < questionUnits.size(); j++) {
+
                         //判断当前套题中的小题是否为主观题,只有主观题才需要添加进来
                         if (!isSubjectiveQuestion(questionUnits.get(j).getQuestionType())) {
                             continue;
                         }
 
-                        ToBeMarkSubjectiveAnswerBean nextSubjectiveAnswerBean = new ToBeMarkSubjectiveAnswerBean();
-                        nextSubjectiveAnswerBean.setQuestionId(questionId);
-                        nextSubjectiveAnswerBean.setOrder(order + j);
-                        nextSubjectiveAnswerBean.setBody(mainBody + questionUnits.get(j).getBody());//构建题干
-                        subjectiveAnswerBeanList.add(nextSubjectiveAnswerBean);
+                        //拼装第一条套题下的小题,(本条数据是完整的),相当于全部添国,无需更新
+                        if (StringUtils.isNullOrEmpty(subjectiveAnswerBean.getBody())) {
+                            //第1个子主观题的题干(不一定是套题的第一题)
+                            String subBody0 = questionUnits.get(j).getBody();
+
+                            subjectiveAnswerBean.setBody(mainBody + subBody0);//构建题干
+                            subjectiveAnswerBeanList.add(subjectiveAnswerBean);
+                        }
+                        //拼装套题的其它几个小题的题干(只初始化题干和唯一标识),并提前添加到结果集中
+                        else {
+                            ToBeMarkSubjectiveAnswerBean nextSubjectiveAnswerBean = new ToBeMarkSubjectiveAnswerBean();
+                            nextSubjectiveAnswerBean.setQuestionId(questionId);
+                            nextSubjectiveAnswerBean.setOrder(order + j);
+                            nextSubjectiveAnswerBean.setBody(mainBody + questionUnits.get(j).getBody());//构建题干
+                            subjectiveAnswerBeanList.add(nextSubjectiveAnswerBean);
+                        }
+
                     }
                 }
                 //不是套题,则默认取第一条记录的题干