Browse Source

获取学生试题

ywx
王宁 2 weeks ago
parent
commit
ca028d710e

+ 2
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportother/MsrReportparamMapper.java View File

18
 
18
 
19
     //批量删除
19
     //批量删除
20
     int deleteBatchReportparam(@Param("list") List<Integer> list);
20
     int deleteBatchReportparam(@Param("list") List<Integer> list);
21
+
22
+    int getCountByExamid(@Param("examid") Integer examid);
21
 }
23
 }

+ 2
- 0
smarking/src/main/java/com/xhkjedu/smarking/model/stupaper/MsPaperStudentQuestion.java View File

113
     private Integer hasanswer;//试卷是否设置了正确
113
     private Integer hasanswer;//试卷是否设置了正确
114
     @Transient
114
     @Transient
115
     private String qanswer;//试题正确答案
115
     private String qanswer;//试题正确答案
116
+    @Transient
117
+    private Integer qtype;//类型1客观题2主观题
116
 }
118
 }

+ 4
- 0
smarking/src/main/java/com/xhkjedu/smarking/service/report/reportother/MsrReportparamService.java View File

89
      * @Return void
89
      * @Return void
90
      **/
90
      **/
91
     public void initReportparam(Integer schoolid,Integer gradeid,Integer examid,Integer handleid) {
91
     public void initReportparam(Integer schoolid,Integer gradeid,Integer examid,Integer handleid) {
92
+        //初始化时判断参数是否已经存在
93
+        int count = msrReportparamMapper.getCountByExamid(examid);
94
+        if(count > 0) return;//如果已有参数不再重新保存参数
95
+
92
         List<MspReportparam> mspParams = mspReportparamMapper.listAllByGrade(schoolid,gradeid);
96
         List<MspReportparam> mspParams = mspReportparamMapper.listAllByGrade(schoolid,gradeid);
93
         List<MsrReportparam> saveParams = new ArrayList<>();
97
         List<MsrReportparam> saveParams = new ArrayList<>();
94
         Integer timestamp = N_Utils.getSecondTimestamp();
98
         Integer timestamp = N_Utils.getSecondTimestamp();

+ 5
- 0
smarking/src/main/resources/mapper/report/reportother/MsrReportparamMapper.xml View File

12
         delete from msp_reportparam where rpid in
12
         delete from msp_reportparam where rpid in
13
         <foreach collection="list" item="rpid" open="(" separator="," close=")">#{rpid}</foreach>
13
         <foreach collection="list" item="rpid" open="(" separator="," close=")">#{rpid}</foreach>
14
     </delete>
14
     </delete>
15
+
16
+    <!--获取考试参数-->
17
+    <select id="getCountByExamid" resultType="java.lang.Integer">
18
+        select count(*) from msr_reportparam where examid = #{examid}
19
+    </select>
15
 </mapper>
20
 </mapper>

+ 11
- 0
smarking/src/main/resources/mapper/stupaper/MsPaperStudentQuestionMapper.xml View File

327
             (#{q.studentid},#{q.examid},#{q.subjectid},#{q.mpid},#{q.mpsid},#{q.mptqid},#{q.mblockid},#{q.ctype},#{q.questionid},#{q.qorder},#{q.qn},#{q.qscore})
327
             (#{q.studentid},#{q.examid},#{q.subjectid},#{q.mpid},#{q.mpsid},#{q.mptqid},#{q.mblockid},#{q.ctype},#{q.questionid},#{q.qorder},#{q.qn},#{q.qscore})
328
         </foreach>
328
         </foreach>
329
     </insert>
329
     </insert>
330
+
331
+    <!--获取考试对应的所有参考学生考试信息-->
332
+    <select id="listAllStuQues" resultType="com.xhkjedu.smarking.model.stupaper.MsPaperStudentQuestion">
333
+        select sq.mpsqid,sq.studentid,sq.subjectid,sq.mpid,sq.mpsid,sq.mptqid,sq.ctype,sq.questionid,
334
+               sq.qn,sq.qorder,sq.qscore,sq.answered,sq.answertype,sq.stuanswer,sq.converted,sq.answertime,
335
+               sq.costtime,sq.checked,sq.stuscore,sq.stumerge,sq.hasgood,sq.hasbad,q.qtype,q.qanswer
336
+        from ms_paper_student_question sq
337
+                 left join ms_paper_student ps on sq.mpsid=ps.mpsid
338
+                 left join ms_paper_qtype_question q on sq.mptqid=q.mptqid
339
+        where sq.examid=#{examid} and ps.sstate=2 order by sq.mpid,sq.studentid
340
+    </select>
330
 </mapper>
341
 </mapper>

Loading…
Cancel
Save