浏览代码

获取学生试题

ywx
王宁 2 周前
父节点
当前提交
ca028d710e

+ 2
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportother/MsrReportparamMapper.java 查看文件

@@ -18,4 +18,6 @@ public interface MsrReportparamMapper extends TkMapper<MsrReportparam> {
18 18
 
19 19
     //批量删除
20 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 查看文件

@@ -113,4 +113,6 @@ public class MsPaperStudentQuestion extends BaseBean {
113 113
     private Integer hasanswer;//试卷是否设置了正确
114 114
     @Transient
115 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 查看文件

@@ -89,6 +89,10 @@ public class MsrReportparamService {
89 89
      * @Return void
90 90
      **/
91 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 96
         List<MspReportparam> mspParams = mspReportparamMapper.listAllByGrade(schoolid,gradeid);
93 97
         List<MsrReportparam> saveParams = new ArrayList<>();
94 98
         Integer timestamp = N_Utils.getSecondTimestamp();

+ 5
- 0
smarking/src/main/resources/mapper/report/reportother/MsrReportparamMapper.xml 查看文件

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

+ 11
- 0
smarking/src/main/resources/mapper/stupaper/MsPaperStudentQuestionMapper.xml 查看文件

@@ -327,4 +327,15 @@
327 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 328
         </foreach>
329 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 341
 </mapper>

正在加载...
取消
保存