zengh
2021-07-17 99b5e4a501d12dd3cb00582985eb2b943ac843c3
选项屏蔽正确答案
5 files modified
45 ■■■■■ changed files
src/main/java/org/springblade/modules/exam/mapper/ExamPaperMapper.java 2 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/mapper/ExamPaperMapper.xml 27 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/service/ExamPaperService.java 7 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/service/impl/ExamPaperServiceImpl.java 7 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/service/impl/ExamScoreServiceImpl.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/mapper/ExamPaperMapper.java
@@ -35,4 +35,6 @@
public interface ExamPaperMapper extends BaseMapper<ExamPaper> {
    ExamPaperSubjectVO queryPagerSubject(@Param("paper") ExamPaper paper);
    ExamPaperSubjectVO PagerSubject(@Param("paper") ExamPaper paper);
}
src/main/java/org/springblade/modules/exam/mapper/ExamPaperMapper.xml
@@ -12,6 +12,17 @@
        </collection>
    </resultMap>
    <resultMap id="PagerSubjectAnswer" type="org.springblade.modules.exam.vo.ExamPaperSubjectVO"
               autoMapping="true">
        <id property="id" column="id"/>
        <collection property="examExaminationSubjects" javaType="java.util.List" ofType="org.springblade.modules.exam.entity.ExamExaminationSubject" autoMapping="true">
            <id property="id" column="tid"/>
            <association property="examSubjectChoices" javaType="org.springblade.modules.exam.entity.ExamSubjectChoices" autoMapping="true">
                <id property="id" column="sid"/>
            </association>
        </collection>
    </resultMap>
    <resultMap id="brakesResult" type="org.springblade.modules.exam.vo.ExamSubjectChoicesVO">
        <id property="id" column="sid"/>
        <id property="categoryId" column="category_id"/>
@@ -45,4 +56,20 @@
        </if>
    </select>
    <select id="PagerSubject" resultMap="PagerSubjectAnswer">
        SELECT
        sj.*,
        tm.id tid,
        tmxq.id as sid,tmxq.*
        FROM
        ksxt_exam sj
        LEFT JOIN exam_examination_subject tm ON sj.id = tm.examination_id
        LEFT JOIN exam_subject_choices tmxq ON tm.subject_id = tmxq.id
        WHERE
        1 = 1
        <if test="paper.id !=null">
        and sj.id = #{paper.id}
        </if>
    </select>
</mapper>
src/main/java/org/springblade/modules/exam/service/ExamPaperService.java
@@ -30,4 +30,11 @@
    ExamPaperSubjectVO queryPagerSubject(ExamPaper paper);
    /**
     * 计算成绩返回答案接口
     * @param paper
     * @return
     */
    ExamPaperSubjectVO PagerSubject(ExamPaper paper);
}
src/main/java/org/springblade/modules/exam/service/impl/ExamPaperServiceImpl.java
@@ -36,7 +36,12 @@
    @Override
    public ExamPaperSubjectVO queryPagerSubject(ExamPaper paper) {
        //查询试卷分类信息
        return baseMapper.queryPagerSubject(paper);
    }
    @Override
    public ExamPaperSubjectVO PagerSubject(ExamPaper paper) {
        //查询试卷分类信息
        return baseMapper.PagerSubject(paper);
    }
}
src/main/java/org/springblade/modules/exam/service/impl/ExamScoreServiceImpl.java
@@ -65,7 +65,7 @@
            ExamPaper examPaper = new ExamPaper();
            examPaper.setId(examScore.getPapersId());
            List<ExamExaminationSubject> examExaminationSubjects
                = examPaperService.queryPagerSubject(examPaper).getExamExaminationSubjects();
                = examPaperService.PagerSubject(examPaper).getExamExaminationSubjects();
            //比对考试结果
            //声明理论得分
            int theoryGrade = 0;