Răsfoiți Sursa

添加更新小题分数小工具

lideyin 5 ani în urmă
părinte
comite
3be19a33eb
14 a modificat fișierele cu 1140 adăugiri și 26 ștergeri
  1. 6 3
      src/main/java/cn/com/qmth/dp/examcloud/oe/Task.java
  2. 3 5
      src/main/java/cn/com/qmth/dp/examcloud/oe/Tianji2App.java
  3. 15 14
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/get_student_answer_detail/GetStduentAnswerDetailService.java
  4. 2 2
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_correct_answer/FixCorrectAnswerAndResetScoreService.java
  5. 39 0
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_correct_answer/entity/ExamRecordDataEntity.java
  6. 658 0
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_question_score/UpdateQuestionScoreService.java
  7. 56 0
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_question_score/entity/DefaultPaperBean.java
  8. 56 0
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_question_score/entity/DefaultQuestionGroupBean.java
  9. 107 0
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_question_score/entity/DefaultQuestionStructureWrapperBean.java
  10. 67 0
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_question_score/entity/DefaultQuestionUnitWrapperBean.java
  11. 43 0
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_question_score/entity/ExamRecordPaperStructBean.java
  12. 59 0
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_question_score/entity/OuterGetPaperStructReq.java
  13. 27 0
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_question_score/entity/OuterGetPaperStructResp.java
  14. 2 2
      src/main/resources/application.properties

+ 6 - 3
src/main/java/cn/com/qmth/dp/examcloud/oe/Task.java

@@ -10,6 +10,7 @@ import cn.com.qmth.dp.examcloud.oe.modules.export_exam_student_score.ExportExamS
 import cn.com.qmth.dp.examcloud.oe.modules.get_student_answer_detail.GetStduentAnswerDetailService;
 import cn.com.qmth.dp.examcloud.oe.modules.get_student_answer_detail.GetStduentAnswerDetailService;
 import cn.com.qmth.dp.examcloud.oe.modules.update_correct_answer.FixCorrectAnswerAndResetScoreService;
 import cn.com.qmth.dp.examcloud.oe.modules.update_correct_answer.FixCorrectAnswerAndResetScoreService;
 import cn.com.qmth.dp.examcloud.oe.modules.update_correct_answer.ResetScoreService;
 import cn.com.qmth.dp.examcloud.oe.modules.update_correct_answer.ResetScoreService;
+import cn.com.qmth.dp.examcloud.oe.modules.update_question_score.UpdateQuestionScoreService;
 import cn.com.qmth.examcloud.commons.util.FileUtil;
 import cn.com.qmth.examcloud.commons.util.FileUtil;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang3.ClassPathUtils;
 import org.apache.commons.lang3.ClassPathUtils;
@@ -53,16 +54,18 @@ public class Task {
     public void start() {
     public void start() {
         try {
         try {
 
 
-            ResetScoreService bean1 = SpringContextHolder.getBean(ResetScoreService.class);
-            bean1.start();
+//            ResetScoreService bean1 = SpringContextHolder.getBean(ResetScoreService.class);
+//            bean1.start();
 
 
 
 
 //            FixCorrectAnswerAndResetScoreService bean = SpringContextHolder.getBean(FixCorrectAnswerAndResetScoreService.class);
 //            FixCorrectAnswerAndResetScoreService bean = SpringContextHolder.getBean(FixCorrectAnswerAndResetScoreService.class);
 //            bean.start();
 //            bean.start();
 
 
 //            GetStduentAnswerDetailService bean = SpringContextHolder.getBean(GetStduentAnswerDetailService.class);
 //            GetStduentAnswerDetailService bean = SpringContextHolder.getBean(GetStduentAnswerDetailService.class);
-//            bean.start(1360L, "303", "305");
+//            bean.start(1627L, "000004");
 
 
+            UpdateQuestionScoreService  bean = SpringContextHolder.getBean(UpdateQuestionScoreService.class);
+            bean.start();
         } catch (Exception e) {
         } catch (Exception e) {
             log.error("unexpected", e);
             log.error("unexpected", e);
             throw new RuntimeException(e);
             throw new RuntimeException(e);

+ 3 - 5
src/main/java/cn/com/qmth/dp/examcloud/oe/Tianji2App.java

@@ -1,5 +1,8 @@
 package cn.com.qmth.dp.examcloud.oe;
 package cn.com.qmth.dp.examcloud.oe;
 
 
+import cn.com.qmth.examcloud.commons.util.PropertiesUtil;
+import cn.com.qmth.examcloud.web.bootstrap.PropertyHolder;
+import cn.com.qmth.examcloud.web.support.SpringContextHolder;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -8,11 +11,6 @@ import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.scheduling.annotation.EnableAsync;
 import org.springframework.scheduling.annotation.EnableAsync;
 
 
-import cn.com.qmth.examcloud.commons.util.PropertiesUtil;
-import cn.com.qmth.examcloud.web.bootstrap.PropertyHolder;
-import cn.com.qmth.examcloud.web.support.SpringContextHolder;
-import cn.com.qmth.examcloud.web.upyun.UpyunSiteManager;
-
 /**
 /**
  * 启动类
  * 启动类
  *
  *

+ 15 - 14
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/get_student_answer_detail/GetStduentAnswerDetailService.java

@@ -193,20 +193,21 @@ public class GetStduentAnswerDetailService {
 					studentAnswer = Jsoup.clean(studentAnswer, Whitelist.simpleText());
 					studentAnswer = Jsoup.clean(studentAnswer, Whitelist.simpleText());
 				}
 				}
 
 
-				if (null != studentAnswer) {
-					if (questionType.equals("SINGLE_CHOICE")
-							|| questionType.equals("MULTIPLE_CHOICE")) {
-						studentAnswer = studentAnswer.replaceAll("0", "A");
-						studentAnswer = studentAnswer.replaceAll("1", "B");
-						studentAnswer = studentAnswer.replaceAll("2", "C");
-						studentAnswer = studentAnswer.replaceAll("3", "D");
-						studentAnswer = studentAnswer.replaceAll("4", "E");
-						studentAnswer = studentAnswer.replaceAll("5", "F");
-						studentAnswer = studentAnswer.replaceAll("6", "G");
-						studentAnswer = studentAnswer.replaceAll("7", "H");
-						studentAnswer = studentAnswer.replaceAll("8", "I");
-					}
-				}
+				//TEMP TODO 用完即删除
+//				if (null != studentAnswer) {
+//					if (questionType.equals("SINGLE_CHOICE")
+//							|| questionType.equals("MULTIPLE_CHOICE")) {
+//						studentAnswer = studentAnswer.replaceAll("0", "A");
+//						studentAnswer = studentAnswer.replaceAll("1", "B");
+//						studentAnswer = studentAnswer.replaceAll("2", "C");
+//						studentAnswer = studentAnswer.replaceAll("3", "D");
+//						studentAnswer = studentAnswer.replaceAll("4", "E");
+//						studentAnswer = studentAnswer.replaceAll("5", "F");
+//						studentAnswer = studentAnswer.replaceAll("6", "G");
+//						studentAnswer = studentAnswer.replaceAll("7", "H");
+//						studentAnswer = studentAnswer.replaceAll("8", "I");
+//					}
+//				}
 
 
 				Object[] row = new Object[]{identityNumber, courseCode, String.valueOf(order),
 				Object[] row = new Object[]{identityNumber, courseCode, String.valueOf(order),
 						questionId, studentAnswer, String.valueOf(studentScore)};
 						questionId, studentAnswer, String.valueOf(studentScore)};

+ 2 - 2
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_correct_answer/FixCorrectAnswerAndResetScoreService.java

@@ -215,7 +215,7 @@ public class FixCorrectAnswerAndResetScoreService {
 
 
                 List<ExamQuestionEntity> examQuestionList = erq.getExamQuestionEntities();
                 List<ExamQuestionEntity> examQuestionList = erq.getExamQuestionEntities();
 
 
-                //所有观题的试题id集合
+                //所有观题的试题id集合
                 List<String> questionIdList = examQuestionList.stream()
                 List<String> questionIdList = examQuestionList.stream()
                         .filter(p -> isObjectiveQues(p.getQuestionType()))
                         .filter(p -> isObjectiveQues(p.getQuestionType()))
                         .map(ExamQuestionEntity::getQuestionId)
                         .map(ExamQuestionEntity::getQuestionId)
@@ -320,7 +320,7 @@ public class FixCorrectAnswerAndResetScoreService {
     }
     }
 
 
     /**
     /**
-     * 是否为观题
+     * 是否为观题
      *
      *
      * @param questionType
      * @param questionType
      * @return
      * @return

+ 39 - 0
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_correct_answer/entity/ExamRecordDataEntity.java

@@ -44,6 +44,21 @@ public class ExamRecordDataEntity implements Serializable {
      */
      */
     private Boolean isIllegality;
     private Boolean isIllegality;
 
 
+    /**
+     * 试卷结构id
+     */
+    private String paperStructId;
+
+    /**
+     * 试卷类型
+     */
+    private String paperType;
+
+    /**
+     * 试卷id
+     */
+    private String basePaperId;
+
     public Boolean getWarn() {
     public Boolean getWarn() {
         return isWarn;
         return isWarn;
     }
     }
@@ -99,4 +114,28 @@ public class ExamRecordDataEntity implements Serializable {
     public void setExamStudentId(Long examStudentId) {
     public void setExamStudentId(Long examStudentId) {
         this.examStudentId = examStudentId;
         this.examStudentId = examStudentId;
     }
     }
+
+    public String getPaperStructId() {
+        return paperStructId;
+    }
+
+    public void setPaperStructId(String paperStructId) {
+        this.paperStructId = paperStructId;
+    }
+
+    public String getPaperType() {
+        return paperType;
+    }
+
+    public void setPaperType(String paperType) {
+        this.paperType = paperType;
+    }
+
+    public String getBasePaperId() {
+        return basePaperId;
+    }
+
+    public void setBasePaperId(String basePaperId) {
+        this.basePaperId = basePaperId;
+    }
 }
 }

+ 658 - 0
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_question_score/UpdateQuestionScoreService.java

@@ -0,0 +1,658 @@
+package cn.com.qmth.dp.examcloud.oe.modules.update_question_score;
+
+import cn.com.qmth.dp.examcloud.oe.modules.update_correct_answer.entity.*;
+import cn.com.qmth.dp.examcloud.oe.modules.update_correct_answer.util.OKHttpUtil;
+import cn.com.qmth.dp.examcloud.oe.modules.update_correct_answer.util.QmthUtil;
+import cn.com.qmth.dp.examcloud.oe.modules.update_question_score.entity.*;
+import cn.com.qmth.examcloud.commons.exception.StatusException;
+import cn.com.qmth.examcloud.commons.util.HttpMethod;
+import cn.com.qmth.examcloud.commons.util.JsonUtil;
+import cn.com.qmth.examcloud.commons.util.PropertiesUtil;
+import com.mongodb.client.result.UpdateResult;
+import com.mysql.cj.util.StringUtils;
+import okhttp3.Response;
+import org.apache.commons.io.IOUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.mongodb.core.MongoTemplate;
+import org.springframework.data.mongodb.core.query.Criteria;
+import org.springframework.data.mongodb.core.query.Query;
+import org.springframework.data.mongodb.core.query.Update;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.stereotype.Service;
+
+import java.io.*;
+import java.text.DecimalFormat;
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * @Description 更新小题分数(涉及到分数重新计算,待阅卷表的数据重新更新)
+ * @Author lideyin
+ * @Date 2020/5/25 14:51
+ * @Version 1.0
+ */
+@Service
+public class UpdateQuestionScoreService {
+
+    @Autowired
+    JdbcTemplate jdbcTemplate;
+
+    @Autowired
+    MongoTemplate mongoTemplate;
+
+    //试卷结构本地缓存
+    private final Map<String, DefaultPaperBean> paperCacheMap = new HashMap<>();
+
+    //小题标准答案本地缓存
+    private final Map<String, List<String>> rightAnswerCacheMap = new HashMap<>();
+
+    //部分平面化的试卷结构缓存
+    private final Map<String, Map<String, Object>> partialFacetPaperCacheMap = new HashMap<>();
+
+    //没有标答的小题id
+    private Set<String> noAnswerQuestionIdSet = new HashSet<>();
+
+    @Async
+    public void start() {
+
+        String absolutePath = PropertiesUtil.getString("fixAnswer.data.path");
+//        ClassPathResource classPathResource = new ClassPathResource("temp1.txt");
+        FileInputStream fis = null;
+        InputStreamReader isr = null;
+        BufferedReader br = null;
+
+        try {
+            fis = new FileInputStream(new File(absolutePath));
+            isr = new InputStreamReader(fis);
+            br = new BufferedReader(isr);
+            String strExamIdAndCourseCode = "";
+            while ((strExamIdAndCourseCode = br.readLine()) != null) {
+                Long examId = Long.valueOf(strExamIdAndCourseCode.split(",")[0]);
+                String courseCode = strExamIdAndCourseCode.split(",")[1];
+                System.out.println(String.format("examId:%s,courseCode:%s", examId, courseCode));
+                run(examId, courseCode);
+                Thread.sleep(10);
+                //19,"03013750"
+            }
+
+        } catch (IOException e) {
+            e.printStackTrace();
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        } finally {
+            if (br != null) {
+                try {
+                    br.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+
+            if (isr != null) {
+                try {
+                    isr.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+
+            if (fis != null) {
+                try {
+                    fis.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+
+
+    }
+
+    public void run(long examId, String courseCode) {
+        List<ExamRecordDataEntity> examRecordDataList = queryExamRecordDataList(examId, courseCode);
+
+        if (examRecordDataList.isEmpty()) {
+            throw new StatusException("100001", "找不到对应的考试记录");
+        }
+
+        //首先更新mongo中的作答记录
+        modifyMongoQuestionScore(examRecordDataList, examId, courseCode);
+
+        //重新计算分数并保存
+        modifyDbScore(examRecordDataList);
+
+        //如果存在,则打印错误数据
+        printErrorDataIfExist();
+
+        System.out.println("999.all is over.....");
+    }
+
+    private void printErrorDataIfExist() {
+        if (noAnswerQuestionIdSet.size() > 0) {
+            for (String quesId : noAnswerQuestionIdSet)
+                System.out.println(String.format("找不到quesId=%s的标答数据", quesId));
+        }
+    }
+
+    private void modifyDbScore(List<ExamRecordDataEntity> examRecordDataList) {
+        Set<Long> examStudentIdSet = new HashSet<>();
+        int effectiveNum = 0;//有效数量
+        //按考试记录更新分数表
+        for (ExamRecordDataEntity record : examRecordDataList) {
+            Query query = new Query();
+            query.addCriteria(Criteria.where("_id").is(record.getExamRecordQuestionsId()));
+            ExamRecordQuestionsEntity erq = mongoTemplate.findOne(query, ExamRecordQuestionsEntity.class, "examRecordQuestions");
+            if (erq == null) continue;
+
+            List<ExamQuestionEntity> objectiveQuesList = erq.getExamQuestionEntities().stream()
+                    .filter(p -> isObjectiveQues(p.getQuestionType())).collect(Collectors.toList());
+
+            double objectiveScore = calcTotalObjectiveScore(objectiveQuesList);
+            double objectiveAccuracy = calcTotalObjectiveAccuracy(objectiveQuesList);
+
+            updateExamScore(objectiveScore, objectiveAccuracy, record.getId());
+            updateExamRecord4Marking(objectiveScore, record.getId());
+            System.out.println(String.format("2.更新第%d条分数成功---examRecordDataId=%s", ++effectiveNum, record.getId()));
+            examStudentIdSet.add(record.getExamStudentId());
+        }
+
+//        int esNum = 0;
+//        //按考生id,删除考生最终分数表(此表如果不存在数据,获取时,系统会重新计算)
+//        for (Long estId : examStudentIdSet) {
+//            deleteFinalScore(estId);
+//            System.out.println(String.format("3.删除第%d条最终分数成功---examStudentId=%s", ++esNum, estId));
+//        }
+
+    }
+
+    private void deleteFinalScore(Long estId) {
+        String strSql = String.format("delete from ec_oe_exam_student_final_score where exam_student_id=%d ", estId);
+
+        jdbcTemplate.execute(strSql);
+    }
+
+    /**
+     * 计算客观题总分
+     *
+     * @param objectiveQuesList
+     * @return
+     */
+    private double calcTotalObjectiveScore(List<ExamQuestionEntity> objectiveQuesList) {
+        double totalObjectiveScore = 0d;//客观题总分
+
+        for (ExamQuestionEntity eq : objectiveQuesList) {
+            if (!StringUtils.isNullOrEmpty(eq.getStudentAnswer())
+                    && !StringUtils.isNullOrEmpty(eq.getCorrectAnswer())
+                    && eq.getStudentAnswer().equals(eq.getCorrectAnswer())) {
+                totalObjectiveScore += eq.getQuestionScore();
+            }
+        }
+
+        return totalObjectiveScore;
+    }
+
+    /**
+     * 计算客观题正确率
+     *
+     * @param objectiveQuesList
+     * @return
+     */
+    private double calcTotalObjectiveAccuracy(List<ExamQuestionEntity> objectiveQuesList) {
+        double correctNum = 0d;
+        double totalNum = 0d;
+        for (ExamQuestionEntity eq : objectiveQuesList) {
+            if (!StringUtils.isNullOrEmpty(eq.getStudentAnswer())
+                    && !StringUtils.isNullOrEmpty(eq.getCorrectAnswer())
+                    && eq.getStudentAnswer().equals(eq.getCorrectAnswer())) {
+                correctNum += 1;
+            }
+            totalNum += 1;
+        }
+
+        if (totalNum == 0) {
+            return 0;
+        }
+
+        return Double.valueOf(new DecimalFormat("#.00").format(correctNum * 100D / totalNum));
+    }
+
+    /**
+     * 更新作答记录中的小题分数
+     *
+     * @param examRecordDataList
+     */
+    private void modifyMongoQuestionScore(List<ExamRecordDataEntity> examRecordDataList, long examId, String courseCode) {
+        int rubbishNum = 0;
+        int effectiveNum = 0;//有效数量
+        int rubbishNum2 = 0;
+        int effectiveNum2 = 0;//有效数量
+        for (ExamRecordDataEntity record : examRecordDataList) {
+            //更新作答记录中的小题分数
+            try {
+                String examRecordQuestionsId = record.getExamRecordQuestionsId();
+                Query query = new Query();
+                query.addCriteria(Criteria.where("_id").is(examRecordQuestionsId));
+                //作答记录
+                ExamRecordQuestionsEntity erq = mongoTemplate.findOne(query, ExamRecordQuestionsEntity.class, "examRecordQuestions");
+
+                if (erq == null) {
+                    System.out.println(String.format("1.作答记录发现%d条垃圾数据:examRecordDataId=%s", ++rubbishNum, record.getId()));
+                    continue;//垃圾数据
+                }
+
+                List<ExamQuestionEntity> examQuestionList = erq.getExamQuestionEntities();
+
+                for (ExamQuestionEntity ques : examQuestionList) {
+                    String quesId = ques.getQuestionId();
+
+                    //最小维度的小题单元集合
+                    List<ExamQuestionEntity> questionUnitList = examQuestionList.stream()
+                            .filter(p -> p.getQuestionId().equals(quesId))
+                            .sorted((o1, o2) -> o1.getOrder().intValue() - o2.getOrder().intValue())
+                            .collect(Collectors.toList());
+                    //根据题目id获取标答集合
+                    List<String> rightAnswerList = getRightAnswerList(quesId);
+                    if (rightAnswerList == null) {
+                        noAnswerQuestionIdSet.add(quesId);
+                    }
+
+                    //根据题目id获取小题分集合
+                    List<Double> questionScoreList =
+                            getQuestionScoreList(quesId, examId, courseCode, record.getPaperType(), record.getBasePaperId());
+
+                    //循环保存所有小题单元
+                    for (int i = 0; i < questionUnitList.size(); i++) {
+                        Double questionScore = questionScoreList.get(i);
+                        //更新小题分数
+                        updateQuestionScore(examRecordQuestionsId, ques.getOrder(), questionScore);
+
+                        //如果为客观题重新算分并保存
+                        if (isObjectiveQues(ques.getQuestionType())) {
+                            String rightAnswer = rightAnswerList.get(i);
+                            if (!StringUtils.isNullOrEmpty(rightAnswer)) {
+                                ExamQuestionEntity curQues = questionUnitList.get(i);
+
+                                String curCorrectAnswer = curQues.getCorrectAnswer();
+
+                                if (StringUtils.isNullOrEmpty(curCorrectAnswer)
+                                        || (!StringUtils.isNullOrEmpty(curCorrectAnswer) && !curCorrectAnswer.equals(rightAnswer))) {
+                                    updatePartialQuestionAnswer(examRecordQuestionsId, curQues.getOrder(),
+                                            rightAnswer, calcStudentUnitScore(rightAnswer, curQues.getStudentAnswer(), questionScore));
+                                }
+                            }
+                        }
+                    }
+                }
+                System.out.println(String.format("1.更新第%d条作答记录成功---examRecordDataId=%s", ++effectiveNum, record.getId()));
+            } catch (Exception e) {
+                System.out.println(String.format("1.更新第%d条作答记录失败---examRecordDataId=%s", ++effectiveNum, record.getId()));
+                throw new StatusException("100002", e.getMessage(), e);
+            }
+
+            //更新试卷结构中的小题分数
+            try {
+                String paperStructId = record.getPaperStructId();
+                Query query = new Query();
+                query.addCriteria(Criteria.where("_id").is(paperStructId));
+                //试卷结构
+                ExamRecordPaperStructBean paperStructBean = mongoTemplate.findOne(query, ExamRecordPaperStructBean.class, "examRecordPaperStruct");
+
+                if (paperStructBean == null) {
+                    System.out.println(String.format("1.2.试卷结构发现%d条垃圾数据:examRecordDataId=%s", ++rubbishNum2, record.getId()));
+                    continue;//垃圾数据
+                }
+
+                //题库中的原始试卷结构
+                DefaultPaperBean originalPaper = getPaper(examId, courseCode, record.getPaperType(), record.getBasePaperId());
+
+                DefaultPaperBean defaultPaper = paperStructBean.getDefaultPaper();
+
+                //题组
+                List<DefaultQuestionGroupBean> questionGroupList = defaultPaper.getQuestionGroupList();
+                for (DefaultQuestionGroupBean group : questionGroupList) {
+                    //题包装器
+                    List<DefaultQuestionStructureWrapperBean> questionWrapperList = group.getQuestionWrapperList();
+                    for (DefaultQuestionStructureWrapperBean qw : questionWrapperList) {
+                        Map<String, Object> partialFacetPaper =
+                                getPartialFacetPaper(qw.getQuestionId(), examId, courseCode, record.getPaperType(), record.getBasePaperId());
+                        if (null != partialFacetPaper) {
+                            if (null != partialFacetPaper.get("groupScore")) {
+                                group.setGroupScore(Double.valueOf(partialFacetPaper.get("groupScore").toString()));
+                            }
+
+                            if (null != partialFacetPaper.get("questionWrapperScore")) {
+                                qw.setQuestionScore(Double.valueOf(partialFacetPaper.get("questionWrapperScore").toString()));
+                            }
+
+                            if (null != partialFacetPaper.get("questionUnitList")) {
+                                List<DefaultQuestionUnitWrapperBean> questionUnitList =
+                                        (List<DefaultQuestionUnitWrapperBean>) partialFacetPaper.get("questionUnitList");
+
+                                List<DefaultQuestionUnitWrapperBean> questionUnitWrapperList = qw.getQuestionUnitWrapperList();
+                                for (int i = 0; i < questionUnitWrapperList.size(); i++) {
+                                    questionUnitWrapperList.get(i).setQuestionScore(questionUnitList.get(i).getQuestionScore());
+                                }
+                            }
+
+                        }
+                    }
+
+                }
+
+                //更新修改后的试卷结构
+                mongoTemplate.save(paperStructBean, "examRecordPaperStruct");
+                System.out.println(String.format("1.2.更新第%d条试卷结构数据成功---examRecordDataId=%s,paperStructId=%s",
+                        ++effectiveNum, record.getId(), record.getPaperStructId()));
+
+            } catch (Exception e) {
+                System.out.println(String.format("1.2.更新第%d条试卷结构数据失败---examRecordDataId=%s,paperStructId=%s",
+                        ++effectiveNum, record.getId(), record.getPaperStructId()));
+                throw new StatusException("100003", e.getMessage(), e);
+            }
+
+        }
+    }
+
+    /**
+     * 获取当前考试id下的所有小题分集合
+     *
+     * @param questionId
+     * @param examId
+     * @param courseCode
+     * @param paperType
+     * @param basePaperId
+     * @return
+     */
+    private List<Double> getQuestionScoreList(String questionId, Long examId, String courseCode,
+                                              String paperType, String basePaperId) {
+
+        Map<String, Object> partialFacetPaper = getPartialFacetPaper(questionId, examId, courseCode, paperType, basePaperId);
+        if (null == partialFacetPaper) {
+            return null;
+        }
+
+        List<DefaultQuestionUnitWrapperBean> questionUnitList = (List<DefaultQuestionUnitWrapperBean>) partialFacetPaper.get("questionUnitList");
+
+        return questionUnitList.stream()
+                .map(DefaultQuestionUnitWrapperBean::getQuestionScore).collect(Collectors.toList());
+    }
+
+    /**
+     * 获取部分平面化的试卷信息
+     *
+     * @param questionId
+     * @param examId
+     * @param courseCode
+     * @param paperType
+     * @param basePaperId
+     * @return
+     */
+    private Map<String, Object> getPartialFacetPaper(String questionId, Long examId, String courseCode,
+                                                     String paperType, String basePaperId) {
+        String cacheKey = String.format("questionScore_%s", questionId);
+        if (partialFacetPaperCacheMap.containsKey(cacheKey)) {
+            return partialFacetPaperCacheMap.get(cacheKey);
+        }
+
+        DefaultPaperBean defaultPaper = getPaper(examId, courseCode, paperType, basePaperId);
+        if (null == defaultPaper) {
+            return null;
+        }
+
+        Map<String, Object> resultMap = new HashMap<>();
+        List<DefaultQuestionGroupBean> questionGroupList = defaultPaper.getQuestionGroupList();
+        for (DefaultQuestionGroupBean group : questionGroupList) {
+            List<DefaultQuestionStructureWrapperBean> questionWrapperList = group.getQuestionWrapperList();
+            for (DefaultQuestionStructureWrapperBean qw : questionWrapperList) {
+                if (qw.getQuestionId().equals(questionId)) {
+                    Map<String, Object> curQuestionMap = new HashMap<>();
+                    //当前试题id对应的题组分数
+                    curQuestionMap.put("groupScore", group.getGroupScore());
+                    //当前试题id对应的题包装器分数
+                    curQuestionMap.put("questionWrapperScore", qw.getQuestionScore());
+                    //当前试题id对应的题单元集合
+                    curQuestionMap.put("questionUnitList", qw.getQuestionUnitWrapperList());
+
+                    partialFacetPaperCacheMap.put(cacheKey, curQuestionMap);
+                    return curQuestionMap;
+                }
+            }
+        }
+
+        return null;
+    }
+
+    private DefaultPaperBean getPaper(Long examId, String courseCode,
+                                      String paperType, String basePaperId) {
+        String cacheKey = String.format("paper_%s_%s_%s_%s", examId, courseCode, paperType, basePaperId);
+        if (paperCacheMap.containsKey(cacheKey)) {
+            return paperCacheMap.get(cacheKey);
+        }
+
+        OuterGetPaperStructReq reqBody = new OuterGetPaperStructReq();
+        reqBody.setBasePaperId(basePaperId);
+        reqBody.setCourseCode(courseCode);
+        reqBody.setExamId(examId);
+        reqBody.setPaperType(paperType);
+
+        String url = QmthUtil.buildUrl("/api/exchange/outer/question/getPaperStruct");
+        Response resp = null;
+        try {
+            resp = OKHttpUtil.call(HttpMethod.POST, url, QmthUtil.getSecurityHeaders(),
+                    JsonUtil.toJson(reqBody));
+            if (resp.code() == 200) {
+                String resultJson = resp.body().string();
+                OuterGetPaperStructResp outerGetQuestionAnswerResp = JsonUtil.fromJson(resultJson, OuterGetPaperStructResp.class);
+
+                DefaultPaperBean defaultPaper = outerGetQuestionAnswerResp.getDefaultPaper();
+                paperCacheMap.putIfAbsent(cacheKey, defaultPaper);
+
+                return defaultPaper;
+            }
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new StatusException("102002", e.getMessage(), e);
+        } finally {
+            IOUtils.closeQuietly(resp);
+        }
+        return null;
+    }
+
+    /**
+     * 计算学生的小题得分
+     *
+     * @param rightAnswer
+     * @param studentAnswer
+     * @param questionScore
+     * @return
+     */
+    private Double calcStudentUnitScore(String rightAnswer, String studentAnswer, Double questionScore) {
+        Double studentUnitScore = 0D;
+        if (!StringUtils.isNullOrEmpty(rightAnswer)
+                && !(StringUtils.isNullOrEmpty(studentAnswer))
+                && rightAnswer.equals(studentAnswer)) {
+            studentUnitScore = questionScore;
+        }
+        return studentUnitScore;
+    }
+
+    /**
+     * 获取题目正确答案
+     *
+     * @param quesId
+     * @return
+     */
+    private List<String> getRightAnswerList(String quesId) {
+//        if (1 == 1) {
+//            List<String> list = new ArrayList<>();
+//            list.add("2");
+//            list.add("2");
+//            list.add("2");
+//            list.add("2");
+//            list.add("2");
+//            list.add("2");
+//            return list;
+//        }
+
+        if (rightAnswerCacheMap.containsKey(quesId)) {
+            return rightAnswerCacheMap.get(quesId);
+        }
+
+        OuterGetQuestionAnswerReq reqBody = new OuterGetQuestionAnswerReq();
+        reqBody.setQuestionId(quesId);
+
+        String url = QmthUtil.buildUrl("/api/exchange/outer/question/getQuestionAnswer");
+        Response resp = null;
+        try {
+            resp = OKHttpUtil.call(HttpMethod.POST, url, QmthUtil.getSecurityHeaders(),
+                    JsonUtil.toJson(reqBody));
+            if (resp.code() == 200) {
+                String resultJson = resp.body().string();
+                OuterGetQuestionAnswerResp outerGetQuestionAnswerResp = JsonUtil.fromJson(resultJson, OuterGetQuestionAnswerResp.class);
+
+                rightAnswerCacheMap.putIfAbsent(quesId, outerGetQuestionAnswerResp.getAnswerList());
+                return outerGetQuestionAnswerResp.getAnswerList();
+
+            }
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new StatusException("102002", e.getMessage(), e);
+        } finally {
+            IOUtils.closeQuietly(resp);
+        }
+        return null;
+    }
+
+    /**
+     * 是否为客观题
+     *
+     * @param questionType
+     * @return
+     */
+    private boolean isObjectiveQues(String questionType) {
+        return "SINGLE_CHOICE".equals(questionType)
+                || "MULTIPLE_CHOICE".equals(questionType)
+                || "TRUE_OR_FALSE".equals(questionType);
+    }
+
+    private List<ExamRecordDataEntity> queryExamRecordDataList(Long examId, String courseCode) {
+        String strSql = String.format("SELECT " +
+                "t1.`id`, " +
+                "t1.`exam_student_id`, " +
+                "t1.`paper_struct_id`, " +
+                "t1.`paper_type`, " +
+                "t1.`base_paper_id`, " +
+                "t1.exam_record_questions_id " +
+                "FROM " +
+                "ec_oe_exam_record_data t1 " +
+                "INNER JOIN ec_b_course t2 ON t1.course_id = t2.id " +
+                "WHERE " +
+                "t1.exam_id = %d " +
+                "AND t2.`code` ='%s' ", examId, courseCode);
+
+        List<Map<String, Object>> mapList = jdbcTemplate.queryForList(strSql);
+        List<ExamRecordDataEntity> resultList = new ArrayList<>();
+        for (Map<String, Object> map : mapList) {
+            ExamRecordDataEntity entity = new ExamRecordDataEntity();
+            if (map.get("id") != null) {
+                entity.setId(Long.valueOf(map.get("id").toString()));
+            }
+
+            if (map.get("exam_student_id") != null) {
+                entity.setExamStudentId(Long.valueOf(map.get("exam_student_id").toString()));
+            }
+
+            if (map.get("exam_record_questions_id") != null) {
+                entity.setExamRecordQuestionsId(map.get("exam_record_questions_id").toString());
+            }
+
+            if (map.get("paper_struct_id") != null) {
+                entity.setPaperStructId(map.get("paper_struct_id").toString());
+            }
+
+            if (map.get("paper_type") != null) {
+                entity.setPaperType(map.get("paper_type").toString());
+            }
+
+            if (map.get("base_paper_id") != null) {
+                entity.setBasePaperId(map.get("base_paper_id").toString());
+            }
+            resultList.add(entity);
+        }
+        return resultList;
+    }
+
+    private void updateExamScore(double objectiveScore, double objectiveAccuracy,
+                                 Long examRecordDataId) {
+        String strSql = String.format("UPDATE ec_oe_exam_score " +
+                "SET objective_score = %s, " +
+                "objective_accuracy = %s, " +
+                "total_score = objective_score+ IFNULL(subjective_score,0) " +
+                "WHERE " +
+                "exam_record_data_id = %d  ", objectiveScore, objectiveAccuracy, examRecordDataId);
+
+        jdbcTemplate.execute(strSql);
+    }
+
+    private void updateExamRecord4Marking(double objectiveScore, Long examRecordDataId) {
+        String strSql = String.format("UPDATE ec_oe_exam_record_4_marking " +
+                "SET objective_score = %s " +
+                "WHERE " +
+                " exam_record_data_id = %s ", objectiveScore, examRecordDataId);
+
+        jdbcTemplate.execute(strSql);
+    }
+
+    /**
+     * 更新小题分数
+     *
+     * @param examRecordQuestionsId
+     * @param order
+     * @param newQuestionScore
+     * @return
+     */
+    public long updateQuestionScore(String examRecordQuestionsId, Integer order, Double newQuestionScore) {
+        // 查询相应的题目
+        Query query = Query.query(Criteria.where("_id").is(examRecordQuestionsId)
+                .and("examQuestionEntities.order").is(order));
+        Update update = new Update();
+        update.set("examQuestionEntities.$.questionScore", newQuestionScore);
+
+        UpdateResult upResult = mongoTemplate.updateFirst(query, update, "examRecordQuestions");
+        long res =upResult.getMatchedCount();
+
+        System.out.println(String.format("更新作答记录中小题分数成功effectNum=%s,id=%s,order=%s,newQuestionScore=%s",
+                res,examRecordQuestionsId, order, newQuestionScore));
+        return res;
+    }
+
+    /**
+     * 更新学生作答的部分数据
+     *
+     * @param examRecordQuestionsId
+     * @param order
+     * @param newAnswer
+     * @param studentScore
+     * @return
+     */
+    public long updatePartialQuestionAnswer(String examRecordQuestionsId, Integer order, String newAnswer, Double studentScore) {
+        // 查询相应的题目
+        Query query = Query.query(Criteria.where("_id").is(examRecordQuestionsId)
+                .and("examQuestionEntities.order").is(order));
+        Update update = new Update();
+        update.set("examQuestionEntities.$.correctAnswer", newAnswer);
+        update.set("examQuestionEntities.$.studentScore", studentScore);
+
+        UpdateResult upResult = mongoTemplate.updateFirst(query, update, "examRecordQuestions");
+        long res =upResult.getMatchedCount();
+
+        System.out.println(String.format("更新作答记录中学生分数成功effectNum=%s,id=%s,order=%s,studentScore=%s,correctAnswer=%s",
+                res,examRecordQuestionsId, order, studentScore,newAnswer));
+        return res;
+    }
+
+
+}

+ 56 - 0
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_question_score/entity/DefaultPaperBean.java

@@ -0,0 +1,56 @@
+package cn.com.qmth.dp.examcloud.oe.modules.update_question_score.entity;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 试卷结构
+ *
+ * @author WANGWEI
+ * @date 2018年8月15日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class DefaultPaperBean implements Serializable {
+
+	private static final long serialVersionUID = -5979287118960427883L;
+
+	/**
+	 * 试卷名称
+	 */
+	private String name;
+
+	/**
+	 * 是否全是客观题
+	 */
+	private Boolean fullyObjective;
+
+	/**
+	 * 分组集合
+	 */
+	private List<DefaultQuestionGroupBean> questionGroupList;
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public Boolean getFullyObjective() {
+		return fullyObjective;
+	}
+
+	public void setFullyObjective(Boolean fullyObjective) {
+		this.fullyObjective = fullyObjective;
+	}
+
+	public List<DefaultQuestionGroupBean> getQuestionGroupList() {
+		return questionGroupList;
+	}
+
+	public void setQuestionGroupList(List<DefaultQuestionGroupBean> questionGroupList) {
+		this.questionGroupList = questionGroupList;
+	}
+
+}

+ 56 - 0
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_question_score/entity/DefaultQuestionGroupBean.java

@@ -0,0 +1,56 @@
+package cn.com.qmth.dp.examcloud.oe.modules.update_question_score.entity;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 题分组集合
+ *
+ * @author WANGWEI
+ * @date 2018年8月15日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class DefaultQuestionGroupBean implements Serializable {
+
+	private static final long serialVersionUID = 2149814711274942645L;
+
+	/**
+	 * 题组名称
+	 */
+	private String groupName;
+
+	/**
+	 * 题包装器集合<br>
+	 */
+	private List<DefaultQuestionStructureWrapperBean> questionWrapperList;
+
+	/**
+	 * 题组总分
+	 */
+	private Double groupScore;
+
+	public String getGroupName() {
+		return groupName;
+	}
+
+	public void setGroupName(String groupName) {
+		this.groupName = groupName;
+	}
+
+	public List<DefaultQuestionStructureWrapperBean> getQuestionWrapperList() {
+		return questionWrapperList;
+	}
+
+	public void setQuestionWrapperList(List<DefaultQuestionStructureWrapperBean> questionWrapperList) {
+		this.questionWrapperList = questionWrapperList;
+	}
+
+	public Double getGroupScore() {
+		return groupScore;
+	}
+
+	public void setGroupScore(Double groupScore) {
+		this.groupScore = groupScore;
+	}
+
+}

+ 107 - 0
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_question_score/entity/DefaultQuestionStructureWrapperBean.java

@@ -0,0 +1,107 @@
+package cn.com.qmth.dp.examcloud.oe.modules.update_question_score.entity;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 题结构包装器
+ *
+ * @author WANGWEI
+ * @date 2018年8月15日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class DefaultQuestionStructureWrapperBean implements Serializable {
+
+	private static final long serialVersionUID = 8423916951155451548L;
+
+	/**
+	 * 题ID
+	 */
+	private String questionId;
+
+	/**
+	 * 版本号
+	 */
+	private String version;
+
+	/**
+	 * 题分数
+	 */
+	private Double questionScore;
+
+	/**
+	 * 限制播放次数
+	 */
+	private Integer limitedPlayTimes;
+
+	/**
+	 * 已播放次数
+	 */
+	private Integer playedTimes;
+
+	/**
+	 * 作答限时
+	 */
+	private Long timeLimit;
+
+	/**
+	 * 题单元包装器
+	 */
+	private List<DefaultQuestionUnitWrapperBean> questionUnitWrapperList;
+
+	public String getQuestionId() {
+		return questionId;
+	}
+
+	public void setQuestionId(String questionId) {
+		this.questionId = questionId;
+	}
+
+	public String getVersion() {
+		return version;
+	}
+
+	public void setVersion(String version) {
+		this.version = version;
+	}
+
+	public Double getQuestionScore() {
+		return questionScore;
+	}
+
+	public void setQuestionScore(Double questionScore) {
+		this.questionScore = questionScore;
+	}
+
+	public Integer getLimitedPlayTimes() {
+		return limitedPlayTimes;
+	}
+
+	public void setLimitedPlayTimes(Integer limitedPlayTimes) {
+		this.limitedPlayTimes = limitedPlayTimes;
+	}
+
+	public Integer getPlayedTimes() {
+		return playedTimes;
+	}
+
+	public void setPlayedTimes(Integer playedTimes) {
+		this.playedTimes = playedTimes;
+	}
+
+	public Long getTimeLimit() {
+		return timeLimit;
+	}
+
+	public void setTimeLimit(Long timeLimit) {
+		this.timeLimit = timeLimit;
+	}
+
+	public List<DefaultQuestionUnitWrapperBean> getQuestionUnitWrapperList() {
+		return questionUnitWrapperList;
+	}
+
+	public void setQuestionUnitWrapperList(List<DefaultQuestionUnitWrapperBean> questionUnitWrapperList) {
+		this.questionUnitWrapperList = questionUnitWrapperList;
+	}
+}

+ 67 - 0
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_question_score/entity/DefaultQuestionUnitWrapperBean.java

@@ -0,0 +1,67 @@
+package cn.com.qmth.dp.examcloud.oe.modules.update_question_score.entity;
+
+import java.io.Serializable;
+
+/**
+ * 题单元包装器
+ *
+ * @author WANGWEI
+ * @date 2018年8月16日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class DefaultQuestionUnitWrapperBean implements Serializable {
+
+	private static final long serialVersionUID = 7584275153456817959L;
+
+	/**
+	 * 选项排序值
+	 */
+	private Integer[] optionPermutation;
+
+	/**
+	 * 题分数
+	 */
+	private Double questionScore;
+
+	/**
+	 * 题型
+	 */
+	private String questionType;
+
+	/**
+	 * 作答类型
+	 */
+	private String answerType;
+
+	public Integer[] getOptionPermutation() {
+		return optionPermutation;
+	}
+
+	public void setOptionPermutation(Integer[] optionPermutation) {
+		this.optionPermutation = optionPermutation;
+	}
+
+	public Double getQuestionScore() {
+		return questionScore;
+	}
+
+	public void setQuestionScore(Double questionScore) {
+		this.questionScore = questionScore;
+	}
+
+	public String getQuestionType() {
+		return questionType;
+	}
+
+	public void setQuestionType(String questionType) {
+		this.questionType = questionType;
+	}
+
+	public String getAnswerType() {
+		return answerType;
+	}
+
+	public void setAnswerType(String answerType) {
+		this.answerType = answerType;
+	}
+}

+ 43 - 0
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_question_score/entity/ExamRecordPaperStructBean.java

@@ -0,0 +1,43 @@
+package cn.com.qmth.dp.examcloud.oe.modules.update_question_score.entity;
+
+import org.springframework.data.mongodb.core.mapping.Document;
+
+import javax.persistence.Id;
+import java.io.Serializable;
+
+/**
+ *
+ * @author  	chenken
+ * @date    	2018年8月27日 下午3:26:27
+ * @company 	QMTH
+ * @description ExamRecordPaper.java
+ */
+@Document(collection="examRecordPaperStruct")
+public class ExamRecordPaperStructBean implements Serializable{
+
+	/**
+	 *
+	 */
+	private static final long serialVersionUID = -4672132535133881321L;
+
+	@Id
+	private String id;
+
+	private DefaultPaperBean defaultPaper;
+
+	public String getId() {
+		return id;
+	}
+
+	public void setId(String id) {
+		this.id = id;
+	}
+
+	public DefaultPaperBean getDefaultPaper() {
+		return defaultPaper;
+	}
+
+	public void setDefaultPaper(DefaultPaperBean defaultPaper) {
+		this.defaultPaper = defaultPaper;
+	}
+}

+ 59 - 0
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_question_score/entity/OuterGetPaperStructReq.java

@@ -0,0 +1,59 @@
+package cn.com.qmth.dp.examcloud.oe.modules.update_question_score.entity;
+
+import cn.com.qmth.examcloud.api.commons.exchange.EnterpriseRequest;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @Description 获取试卷结构
+ * @Author lideyin
+ * @Date 2020/5/25 15:56
+ * @Version 1.0
+ */
+public class OuterGetPaperStructReq extends EnterpriseRequest {
+
+    private static final long serialVersionUID = -8374755306658040184L;
+
+    @ApiModelProperty(value = "考试id", example = "123", required = true)
+    private Long examId;
+
+    @ApiModelProperty(value = "课程code", example = "123", required = true)
+    private String courseCode;
+
+    @ApiModelProperty(value = "卷型", example = "123", required = true)
+    private String paperType;
+
+    @ApiModelProperty(value = "原始试卷id", example = "123", required = true)
+    private String basePaperId;
+
+    public Long getExamId() {
+        return examId;
+    }
+
+    public void setExamId(Long examId) {
+        this.examId = examId;
+    }
+
+    public String getCourseCode() {
+        return courseCode;
+    }
+
+    public void setCourseCode(String courseCode) {
+        this.courseCode = courseCode;
+    }
+
+    public String getPaperType() {
+        return paperType;
+    }
+
+    public void setPaperType(String paperType) {
+        this.paperType = paperType;
+    }
+
+    public String getBasePaperId() {
+        return basePaperId;
+    }
+
+    public void setBasePaperId(String basePaperId) {
+        this.basePaperId = basePaperId;
+    }
+}

+ 27 - 0
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_question_score/entity/OuterGetPaperStructResp.java

@@ -0,0 +1,27 @@
+package cn.com.qmth.dp.examcloud.oe.modules.update_question_score.entity;
+
+import cn.com.qmth.examcloud.api.commons.exchange.EnterpriseResponse;
+
+/**
+ * @Description 获取试卷结构
+ * @Author lideyin
+ * @Date 2020/5/25 15:40
+ * @Version 1.0
+ */
+public class OuterGetPaperStructResp extends EnterpriseResponse {
+
+    private static final long serialVersionUID = 8290190579593586203L;
+
+    /**
+     * 试卷结构
+     */
+    private DefaultPaperBean defaultPaper;
+
+    public DefaultPaperBean getDefaultPaper() {
+        return defaultPaper;
+    }
+
+    public void setDefaultPaper(DefaultPaperBean defaultPaper) {
+        this.defaultPaper = defaultPaper;
+    }
+}

+ 2 - 2
src/main/resources/application.properties

@@ -31,8 +31,8 @@ spring.datasource.druid.test-on-return=false
 spring.datasource.druid.test-while-idle=true
 spring.datasource.druid.test-while-idle=true
 
 
 #mongodb
 #mongodb
-mguri.username=root
-mguri.password=qmth87863577%21%40%23
+mguri.username=exam-cloud-dev
+mguri.password=Examcloud123
 mguri.hostAndPortGroup=dds-wz972dde5d2d78e433270.mongodb.rds.aliyuncs.com:3717
 mguri.hostAndPortGroup=dds-wz972dde5d2d78e433270.mongodb.rds.aliyuncs.com:3717
 mguri.database=admin
 mguri.database=admin
 spring.data.mongodb.uri=mongodb://${mguri.username}:${mguri.password}@${mguri.hostAndPortGroup}/${mguri.database}
 spring.data.mongodb.uri=mongodb://${mguri.username}:${mguri.password}@${mguri.hostAndPortGroup}/${mguri.database}