mingfu пре 1 месец
родитељ
комит
94bbad2441

+ 14 - 9
ie-admin/src/main/java/com/ruoyi/web/controller/front/FrontExamController.java

@@ -18,6 +18,7 @@ import com.ruoyi.learn.service.ILearnExamineeService;
 import com.ruoyi.learn.service.ILearnPaperService;
 import com.ruoyi.system.service.ISysUserService;
 import com.ruoyi.web.service.ExamService;
+import com.ruoyi.web.service.PaperService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
@@ -36,11 +37,13 @@ public class FrontExamController {
     private final IDzControlService controlService;
     private final ISysUserService sysUserService;
     private final ExamService examService;
+    private final PaperService paperService;
 
-    public FrontExamController(IDzControlService controlService, ISysUserService sysUserService, ExamService examService) {
+    public FrontExamController(IDzControlService controlService, ISysUserService sysUserService, ExamService examService, PaperService paperService) {
         this.controlService = controlService;
         this.sysUserService = sysUserService;
         this.examService = examService;
+        this.paperService = paperService;
     }
 
     // 试卷: 真题卷,批次测试卷,自组卷, 生成考试记录
@@ -53,20 +56,22 @@ public class FrontExamController {
         return AjaxResult.success(examService.openExaminee(paperType, relateId));
     }
 
-    @ApiOperation("04 取答")
-    @GetMapping(value = "answerExaminee")
+    @ApiOperation("04 取答")
+    @GetMapping(value = "loadExaminee")
     public AjaxResult loadAnswers(@ApiParam("答卷ID") Long examineeId) {
         // 检查状态,以决定是否返回答案
-        return AjaxResult.success();
+        return AjaxResult.success(examService.loadExaminee(examineeId));
     }
 
     @ApiOperation("02 交卷")
     @PostMapping(value = "commitExamineePaper")
-    public AjaxResult commitExamineePaper(@RequestBody PaperVO paperDto) {
-//        if (MxjbContants.ExamineeTypeIeValue.equals(paperDto.getExamineeType())) {
-//            return mxjbPaperExamService.saveExamPaper(paperDto);
-//        }
-//        return syTestMajorService.saveTestPaper(paperDto);
+    public AjaxResult commitExamineePaper(@RequestBody AnswerSheet answerSheet) {
+        boolean savePaper = answerSheet.getQuestions().stream().filter(t -> null != t.getIsNotKnow() && t.getIsNotKnow() || t.getAnswers().isEmpty()).count() > 0; // 判断是保存还是提交
+        if(savePaper) {
+            examService.updateAnswerSheet(answerSheet);
+        } else {
+            examService.commitAnswerSheet(answerSheet);
+        }
         return AjaxResult.success();
     }
 

+ 97 - 10
ie-admin/src/main/java/com/ruoyi/web/service/ExamService.java

@@ -10,6 +10,7 @@ import com.ruoyi.enums.PaperType;
 import com.ruoyi.ie.domain.AMarjorPlan;
 import com.ruoyi.ie.service.IAMarjorPlanService;
 import com.ruoyi.learn.domain.*;
+import com.ruoyi.learn.mapper.LearnAnswerMapper;
 import com.ruoyi.learn.mapper.LearnExamineeMapper;
 import com.ruoyi.learn.mapper.LearnKnowledgeTreeMapper;
 import com.ruoyi.learn.mapper.LearnPaperMapper;
@@ -20,16 +21,16 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.validation.ValidationException;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.List;
-import java.util.Set;
+import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * 考试服务
  */
 @Service
 public class ExamService {
+    private final LearnAnswerMapper learnAnswerMapper;
+    private final LearnExamineeMapper learnExamineeMapper;
     private Set<PaperType> paperTypeSet = Sets.newHashSet(PaperType.Real, PaperType.Custom, PaperType.Test);
     private final LearnPaperMapper paperMapper;
     private final LearnKnowledgeTreeMapper knowledgeTreeMapper;
@@ -38,13 +39,15 @@ public class ExamService {
     private final PaperService paperService;
     private final IAMarjorPlanService marjorPlanService;
 
-    public ExamService(LearnPaperMapper paperMapper, LearnKnowledgeTreeMapper knowledgeTreeMapper, LearnExamineeMapper examineeMapper, ILearnPaperService learnPaperService, PaperService paperService, IAMarjorPlanService marjorPlanService) {
+    public ExamService(LearnPaperMapper paperMapper, LearnKnowledgeTreeMapper knowledgeTreeMapper, LearnExamineeMapper examineeMapper, ILearnPaperService learnPaperService, PaperService paperService, IAMarjorPlanService marjorPlanService, LearnAnswerMapper learnAnswerMapper, LearnExamineeMapper learnExamineeMapper) {
         this.paperMapper = paperMapper;
         this.knowledgeTreeMapper = knowledgeTreeMapper;
         this.examineeMapper = examineeMapper;
         this.learnPaperService = learnPaperService;
         this.paperService = paperService;
         this.marjorPlanService = marjorPlanService;
+        this.learnAnswerMapper = learnAnswerMapper;
+        this.learnExamineeMapper = learnExamineeMapper;
     }
 
     /**
@@ -64,6 +67,23 @@ public class ExamService {
         throw new RuntimeException("错误类型: " + paperType);
     }
 
+    public AnswerSheet loadExaminee(Long examineeId) {
+        LearnExaminee examinee = examineeMapper.selectLearnExamineeByExamineeId(examineeId);
+        if(ExamineeStatus.Exam.getVal().equals(examinee.getState())) {
+            throw new RuntimeException("考试中,不能提取答案");
+        }
+        LearnAnswer aCond = new LearnAnswer();
+        aCond.setExamineeId(examineeId);
+        Map<Long, LearnAnswer> answerMap = learnAnswerMapper.selectLearnAnswerList(aCond).stream().collect(Collectors.toMap(LearnAnswer::getQuestionId, t -> t));
+        LearnPaper learnPaper = learnPaperService.selectLearnPaperById(examinee.getPaperId());
+        List<PaperVO.QuestionSeq> questionList = paperService.loadPaperQuestions(examinee.getPaperId(), answerMap, true);
+        AnswerSheet answerSheet = buildAnswerSheet(learnPaper, examinee);
+        answerSheet.setTotalCount(questionList.size());
+        answerSheet.setWrongCount(examinee.getWrongCount());
+        answerSheet.setQuestions(questionList);
+        return answerSheet;
+    }
+
     /**
      * 临时保存
      */
@@ -73,10 +93,61 @@ public class ExamService {
 
     /**
      * 交卷
-     * @param answer
+     * @param answerSheet
      */
-    public void commitAnswerSheet(AnswerSheet answer) {
+    @Transactional(rollbackFor = Exception.class)
+    public void commitAnswerSheet(AnswerSheet answerSheet) {
+        LearnAnswer aCond = new LearnAnswer();
+        aCond.setExamineeId(answerSheet.getExamineeId());
+        Map<Long, LearnAnswer> answerMap = learnAnswerMapper.selectLearnAnswerList(aCond).stream().collect(Collectors.toMap(LearnAnswer::getQuestionId, t -> t));
+        Map<Long, PaperVO.QuestionSeq> questionMap = paperService.loadPaperQuestions(answerSheet.getPaperId(), answerMap, true).stream().collect(Collectors.toMap(PaperVO.QuestionSeq::getId, t -> t));
+
+        List<LearnAnswer> addList = Lists.newArrayList();
+        List<LearnAnswer> updateList = Lists.newArrayList();
+        Integer wrongCount = 0;
+        for(PaperVO.QuestionSeq question : answerSheet.getQuestions()) {
+            LearnAnswer answer = new LearnAnswer();
+            PaperVO.QuestionSeq exist = questionMap.remove(question.getId());
+            if(null == exist) {
+                answer.setExamineeId(answerSheet.getExamineeId());
+                answer.setStudentId(SecurityUtils.getUserId());
+                answer.setQuestionId(question.getId());
+                answer.setSeq(question.getSeq());
+                answer.setKnowledgeId(answerSheet.getKnowledgeId());
+                addList.add(answer);
+            } else {
+                answer.setAnswerId(answerMap.get(question.getId()).getAnswerId());
+                updateList.add(answer);
+            }
+            answer.setAnswer(StringUtils.join(question.getAnswers(), ","));
+            answer.setState(question.getState());
+            if(!answer.getState().equals(1L)) {
+                wrongCount++;
+            }
+        }
+        if(addList.size() > 0) {
+            addList.stream().forEach(t -> {
+                learnAnswerMapper.insertLearnAnswer(t);
+            });
+        }
+        if(updateList.size() > 0) {
+            updateList.stream().forEach(t -> {
+                learnAnswerMapper.updateLearnAnswer(t);
+            });
+        }
+        LearnExaminee upExaminee = new LearnExaminee();
+        upExaminee.setExamineeId(answerSheet.getExamineeId());
+        upExaminee.setDuration(answerSheet.getDuration());
+        upExaminee.setEndTime(new Date());
+        upExaminee.setState(ExamineeStatus.Commit.getVal());
+        upExaminee.setWrongCount(wrongCount);
+        learnExamineeMapper.updateLearnExaminee(upExaminee);
 
+        // 关闭试卷
+        LearnPaper up = new LearnPaper();
+        up.setId(answerSheet.getPaperId());
+        up.setStatus(PaperStatus.Valid.getVal());
+        paperMapper.updateLearnPaper(up);
     }
 
     private AnswerSheet openExaminee(PaperType paperType, Long paperId, Long studentId) {
@@ -93,6 +164,7 @@ public class ExamService {
         } else {
             learnExaminee.setState(ExamineeStatus.Exam.getVal());
             learnExaminee.setBeginTime(new Date());
+            learnExaminee.setDuration(0L);
             examineeMapper.insertLearnExaminee(learnExaminee);
         }
         return buildAnswerSheet(paper, learnExaminee);
@@ -118,9 +190,10 @@ public class ExamService {
             throw new ValidationException("专业id无效");
         }
         LearnPaper paper = getBestPaper(plan, existPaperIdSet);
-        examinee.setPaperKey(PaperType.Simulated.name() + "_" + paper.getId());
+        examinee.setPaperKey(paper.getId().toString());
         examinee.setState(ExamineeStatus.Exam.getVal());
         examinee.setBeginTime(new Date());
+        examinee.setDuration(0L);
         examineeMapper.insertLearnExaminee(examinee);
         return buildAnswerSheet(paper, examinee);
     }
@@ -144,10 +217,18 @@ public class ExamService {
             learnExaminee.setStudentId(studentId);
             learnExaminee.setPaperId(existPaper.getId());
             learnExaminee.setPaperType(PaperType.Practice.getVal());
+            learnExaminee.setState(ExamineeStatus.Exam.getVal());
             List<LearnExaminee> examineeList = examineeMapper.selectLearnExamineeList(learnExaminee);
             if (CollectionUtils.isNotEmpty(examineeList)) {
                 LearnExaminee examinee = examineeList.get(0);
-                return buildAnswerSheet(existPaper, examinee);
+                LearnAnswer aCond = new LearnAnswer();
+                aCond.setExamineeId(examinee.getExamineeId());
+                Map<Long, LearnAnswer> answerMap = learnAnswerMapper.selectLearnAnswerList(aCond).stream().collect(Collectors.toMap(LearnAnswer::getQuestionId, t -> t));
+                List<PaperVO.QuestionSeq> questionList = paperService.loadPaperQuestions(examinee.getPaperId(), answerMap, false);
+                AnswerSheet answerSheet = buildAnswerSheet(existPaper, examinee);
+                answerSheet.setQuestions(questionList);
+                answerSheet.setKnowledgeId(existPaper.getRelateId());
+                return answerSheet;
             }
             // 关闭试卷
             LearnPaper up = new LearnPaper();
@@ -168,16 +249,22 @@ public class ExamService {
         paper.setPaperSource(0);
         paper.setSubjectId(knowledgeTree.getSubjectId());
         paper.setPaperName(studentId + "-" + knowledgeTree.getName() + "-" + DateUtils.format(new Date(), "yyyyMMddHHmmss"));
+        paper.setRelateId(knowledgeId);
         paperService.savePaper(paper, pqList);
 
         LearnExaminee learnExaminee = new LearnExaminee();
         learnExaminee.setStudentId(studentId);
         learnExaminee.setPaperType(PaperType.Practice.getVal());
         learnExaminee.setPaperId(paper.getId());
+        learnExaminee.setPaperKey(String.valueOf(knowledgeId));
         learnExaminee.setState(ExamineeStatus.Exam.getVal());
         learnExaminee.setBeginTime(new Date());
+        learnExaminee.setDuration(0L);
         examineeMapper.insertLearnExaminee(learnExaminee);
-        return buildAnswerSheet(paper, learnExaminee);
+
+        AnswerSheet answerSheet = buildAnswerSheet(paper, learnExaminee);
+        answerSheet.setKnowledgeId(paper.getRelateId());
+        return answerSheet;
     }
 
     private LearnPaper getBestPaper(AMarjorPlan plan, Set<Long> existPaperIdSet) {

+ 21 - 7
ie-admin/src/main/java/com/ruoyi/web/service/PaperService.java

@@ -50,25 +50,40 @@ public class PaperService {
 //        getQuestions(1L, 100L, paperDef);
     }
 
+    public PaperVO loadPaper(Long paperId) {
+        LearnPaper learnPaper = paperMapper.selectLearnPaperById(paperId);
+        PaperVO result = new PaperVO();
+        BeanUtils.copyProperties(learnPaper, result);
+        result.setQuestions(loadPaperQuestions(paperId, null, false));
+        return result;
+    }
+
     /**
      * 加载试卷
      * @param paperId
      * @return
      */
-    public PaperVO loadPaper(Long paperId) {
-        PaperVO result = new PaperVO();
-        LearnPaper learnPaper = paperMapper.selectLearnPaperById(paperId);
-        BeanUtils.copyProperties(learnPaper, result);
+    public List<PaperVO.QuestionSeq> loadPaperQuestions(Long paperId, Map<Long, LearnAnswer> answerMap, boolean withParse) {
         List<LearnQuestions> questions = questionsMapper.selectQuestionByPaperId(paperId);
         Map<String, PaperVO.QuestionSeq> gropuMap = Maps.newHashMap();
         List<PaperVO.QuestionSeq> paperQuestionList = Lists.newArrayList();
+        LearnAnswer answer;
         for(LearnQuestions lqs : questions) {
             PaperVO.QuestionSeq qs = new PaperVO.QuestionSeq();
-            BeanUtils.copyProperties(lqs, qs, "options", "parse", "answer1", "answer2");
+            if(!withParse) {
+                BeanUtils.copyProperties(lqs, qs, "options");
+            } else {
+                BeanUtils.copyProperties(lqs, qs, "options", "parse", "answer1", "answer2");
+            }
             QuestionType qt = QuestionType.of(lqs.getQtpye());
             qs.setTypeId(qt.getVal());
             qs.setType(qt.getTitle());
             qs.setOptions(getOptions(lqs.getOptionA(), lqs.getOptionB(), lqs.getOptionC(), lqs.getOptionD(), lqs.getOptionE(), lqs.getOptionF(), lqs.getOptionG()));
+            if(null != answerMap && null != (answer = answerMap.get(lqs.getId()))) {
+                qs.setAnswers(Arrays.asList(answer.getAnswer().split(",")));
+                qs.setState(answer.getState());
+                qs.setIsNotKnow(answer.getState().equals(3L));
+            }
             if(StringUtils.isNotBlank(lqs.getTitle0())) { // 大题
                 PaperVO.QuestionSeq qg = gropuMap.get(lqs.getTitle0());
                 if(qg == null) {
@@ -82,8 +97,7 @@ public class PaperService {
                 paperQuestionList.add(qs);
             }
         }
-        result.setQuestions(paperQuestionList);
-        return result;
+        return paperQuestionList;
     }
 
     public List<String> getOptions(String... options) {

+ 12 - 0
ie-system/src/main/java/com/ruoyi/learn/domain/AnswerSheet.java

@@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.util.Date;
+import java.util.List;
 
 @ApiModel("答题卷")
 @Data
@@ -15,6 +16,8 @@ public class AnswerSheet {
     Long examineeId;
     @Excel(name = "试卷id")
     private Long paperId;
+    @Excel(name = "试卷id")
+    private Long knowledgeId;
     @ApiModelProperty("测试名称")
     String name;
     @ApiModelProperty("考试开始时间")
@@ -37,4 +40,13 @@ public class AnswerSheet {
     Boolean allowAnswer;
     @ApiModelProperty("是否可阅卷")
     Boolean allowScore;
+
+    @ApiModelProperty("做题时长")
+    private Long duration;
+    @ApiModelProperty("总题数")
+    private Integer totalCount;
+    @ApiModelProperty("错误题数")
+    private Integer wrongCount;
+
+    List<PaperVO.QuestionSeq> questions;
 }

+ 4 - 4
ie-system/src/main/java/com/ruoyi/learn/domain/LearnAnswer.java

@@ -32,7 +32,7 @@ public class LearnAnswer extends BaseEntity
 
     /** 题号 */
     @Excel(name = "题号")
-    private Long seq;
+    private Integer seq;
 
     /** 知识点 */
     @Excel(name = "知识点")
@@ -55,7 +55,7 @@ public class LearnAnswer extends BaseEntity
     private Long count;
 
     /** 状态 1 正确 */
-    @Excel(name = "状态 1 正确")
+    @Excel(name = "0 默认 1正确 2错误 3不会")
     private Long state;
 
     /** 评级 */
@@ -110,12 +110,12 @@ public class LearnAnswer extends BaseEntity
         return questionId;
     }
 
-    public void setSeq(Long seq) 
+    public void setSeq(Integer seq)
     {
         this.seq = seq;
     }
 
-    public Long getSeq() 
+    public Integer getSeq()
     {
         return seq;
     }

+ 23 - 1
ie-system/src/main/java/com/ruoyi/learn/domain/LearnExaminee.java

@@ -35,6 +35,9 @@ public class LearnExaminee extends BaseEntity
     @Excel(name = "试卷标识")
     private String paperKey;
 
+    @Excel(name = "做题时长")
+    private Long duration;
+    
     /** 开始时间 */
     @JsonFormat(pattern = "yyyy-MM-dd")
     @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
@@ -69,6 +72,9 @@ public class LearnExaminee extends BaseEntity
     @Excel(name = "年排名次")
     private Long gradeRanking;
 
+    @Excel(name = "错题总数")
+    private Integer wrongCount;
+
     /** 选择题正确数 */
     @Excel(name = "选择题正确数")
     private Long chooseCount;
@@ -133,6 +139,14 @@ public class LearnExaminee extends BaseEntity
         this.paperKey = paperKey;
     }
 
+    public Long getDuration() {
+        return duration;
+    }
+
+    public void setDuration(Long duration) {
+        this.duration = duration;
+    }
+
     public void setBeginTime(Date beginTime)
     {
         this.beginTime = beginTime;
@@ -163,7 +177,15 @@ public class LearnExaminee extends BaseEntity
         return state;
     }
 
-    public void setScoreLevel(String scoreLevel) 
+    public Integer getWrongCount() {
+        return wrongCount;
+    }
+
+    public void setWrongCount(Integer wrongCount) {
+        this.wrongCount = wrongCount;
+    }
+
+    public void setScoreLevel(String scoreLevel)
     {
         this.scoreLevel = scoreLevel;
     }

+ 32 - 1
ie-system/src/main/java/com/ruoyi/learn/domain/PaperVO.java

@@ -1,10 +1,12 @@
 package com.ruoyi.learn.domain;
 
-import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.enums.QuestionType;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+import org.apache.commons.collections4.CollectionUtils;
 
+import java.util.Arrays;
 import java.util.List;
 
 @Data
@@ -40,9 +42,38 @@ public class PaperVO {
         @ApiModelProperty("选项数组")
         List<String> options;
 
+        @ApiModelProperty("本卷中标记")
+        Boolean isMark;
+        @ApiModelProperty("是否收藏")
+        Boolean isFavorite;
+        @ApiModelProperty("不会做,转State")
+        Boolean isNotKnow;
         @ApiModelProperty("学生回答")
         List<String> answers;
 
+        @ApiModelProperty("答题正确状态 0 默认 1正确 2错误 3不会")
+        Long state;
+
         List<QuestionSeq> subQuestions;
+
+        public Long getState() {
+            if(null != isNotKnow && isNotKnow) {
+                return 3L;
+            }
+            QuestionType qt = QuestionType.of(this.typeId);
+            if(QuestionType.Single.equals(qt) || QuestionType.Judgment.equals(qt)) {
+                if(CollectionUtils.isEmpty(answers)) {
+                    return 0L;
+                }
+                return answers.get(0).equals(answer1) ? 1L : 2L;
+            } else if(QuestionType.Multiple.equals(qt)) {
+                if(CollectionUtils.isEmpty(answers)) {
+                    return 0L;
+                }
+                List<String> stdAnswers = Arrays.asList(answer1.split(","));
+                return stdAnswers.size() == answers.size() && CollectionUtils.intersection(stdAnswers, answers).size() == answers.size() ? 1L : 2L;
+            }
+            return 0L;
+        }
     }
 }

+ 11 - 1
ie-system/src/main/resources/mapper/learn/LearnExamineeMapper.xml

@@ -11,12 +11,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="paperId"    column="paper_id"    />
         <result property="beginTime"    column="begin_time"    />
         <result property="endTime"    column="end_time"    />
+        <result property="duration"    column="duration"    />
         <result property="state"    column="state"    />
         <result property="scoreLevel"    column="score_level"    />
         <result property="score"    column="score"    />
         <result property="scoreRate"    column="score_rate"    />
         <result property="ranking"    column="ranking"    />
         <result property="gradeRanking"    column="grade_ranking"    />
+        <result property="wrongCount"    column="wrong_count"    />
         <result property="chooseCount"    column="choose_count"    />
         <result property="chooseTotal"    column="choose_total"    />
         <result property="subjectiveCount"    column="subjective_count"    />
@@ -26,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectLearnExamineeVo">
-        select examinee_id, student_id, paper_type, paper_id, begin_time, end_time, state, score_level, score, score_rate, ranking, grade_ranking, choose_count, choose_total, subjective_count, subjective_total, create_time, update_time from learn_examinee
+        select examinee_id, student_id, paper_type, paper_id, begin_time, end_time, duration, state, score_level, score, score_rate, ranking, grade_ranking, wrong_count, choose_count, choose_total, subjective_count, subjective_total, create_time, update_time from learn_examinee
     </sql>
 
     <select id="selectLearnExamineeList" parameterType="LearnExaminee" resultMap="LearnExamineeResult">
@@ -37,12 +39,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="paperId != null "> and paper_id = #{paperId}</if>
             <if test="beginTime != null "> and begin_time = #{beginTime}</if>
             <if test="endTime != null "> and end_time = #{endTime}</if>
+            <if test="duration != null "> and duration = #{duration}</if>
             <if test="state != null "> and state = #{state}</if>
             <if test="scoreLevel != null  and scoreLevel != ''"> and score_level = #{scoreLevel}</if>
             <if test="score != null "> and score = #{score}</if>
             <if test="scoreRate != null "> and score_rate = #{scoreRate}</if>
             <if test="ranking != null "> and ranking = #{ranking}</if>
             <if test="gradeRanking != null "> and grade_ranking = #{gradeRanking}</if>
+            <if test="wrongCount != null "> and wrong_count = #{wrongCount}</if>
             <if test="chooseCount != null "> and choose_count = #{chooseCount}</if>
             <if test="chooseTotal != null "> and choose_total = #{chooseTotal}</if>
             <if test="subjectiveCount != null "> and subjective_count = #{subjectiveCount}</if>
@@ -63,12 +67,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="paperId != null">paper_id,</if>
             <if test="beginTime != null">begin_time,</if>
             <if test="endTime != null">end_time,</if>
+            <if test="duration != null">duration,</if>
             <if test="state != null">state,</if>
             <if test="scoreLevel != null">score_level,</if>
             <if test="score != null">score,</if>
             <if test="scoreRate != null">score_rate,</if>
             <if test="ranking != null">ranking,</if>
             <if test="gradeRanking != null">grade_ranking,</if>
+            <if test="wrongCount != null">wrong_count,</if>
             <if test="chooseCount != null">choose_count,</if>
             <if test="chooseTotal != null">choose_total,</if>
             <if test="subjectiveCount != null">subjective_count,</if>
@@ -82,12 +88,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="paperId != null">#{paperId},</if>
             <if test="beginTime != null">#{beginTime},</if>
             <if test="endTime != null">#{endTime},</if>
+            <if test="duration != null">#{duration},</if>
             <if test="state != null">#{state},</if>
             <if test="scoreLevel != null">#{scoreLevel},</if>
             <if test="score != null">#{score},</if>
             <if test="scoreRate != null">#{scoreRate},</if>
             <if test="ranking != null">#{ranking},</if>
             <if test="gradeRanking != null">#{gradeRanking},</if>
+            <if test="wrongCount != null">#{wrongCount},</if>
             <if test="chooseCount != null">#{chooseCount},</if>
             <if test="chooseTotal != null">#{chooseTotal},</if>
             <if test="subjectiveCount != null">#{subjectiveCount},</if>
@@ -105,12 +113,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="paperId != null">paper_id = #{paperId},</if>
             <if test="beginTime != null">begin_time = #{beginTime},</if>
             <if test="endTime != null">end_time = #{endTime},</if>
+            <if test="duration != null">duration = #{duration},</if>
             <if test="state != null">state = #{state},</if>
             <if test="scoreLevel != null">score_level = #{scoreLevel},</if>
             <if test="score != null">score = #{score},</if>
             <if test="scoreRate != null">score_rate = #{scoreRate},</if>
             <if test="ranking != null">ranking = #{ranking},</if>
             <if test="gradeRanking != null">grade_ranking = #{gradeRanking},</if>
+            <if test="wrongCount != null">wrong_count = #{wrongCount},</if>
             <if test="chooseCount != null">choose_count = #{chooseCount},</if>
             <if test="chooseTotal != null">choose_total = #{chooseTotal},</if>
             <if test="subjectiveCount != null">subjective_count = #{subjectiveCount},</if>