Browse Source

学生作业报告、作业详情完善

tags/正式3.10.0
雍文秀 1 year ago
parent
commit
1c959f893b

+ 4
- 3
sstudy/src/main/java/com/xhkjedu/sstudy/controller/paperstudent/PaperStudentReportController.java View File

85
      * @return com.xhkjedu.vo.ResultVo
85
      * @return com.xhkjedu.vo.ResultVo
86
      **/
86
      **/
87
     @PostMapping("p")
87
     @PostMapping("p")
88
-    public ResultVo getPaper(@RequestBody TPaperClass paper) {
88
+    public ResultVo getPaper(@RequestBody PaperRstudent paper) {
89
         Integer paperid = paper.getPaperid();
89
         Integer paperid = paper.getPaperid();
90
         Integer classid = paper.getClassid();
90
         Integer classid = paper.getClassid();
91
-        N_Utils.validation(new Object[]{paperid, "作业id", 1, classid, "班级id", 1});
92
-        Map map = paperStudentReportService.getPaper(paperid, classid);
91
+        Integer studentid = paper.getStudentid();
92
+        N_Utils.validation(new Object[]{paperid, "作业id", 1, classid, "班级id", 1, studentid, "学生id", 1});
93
+        Map map = paperStudentReportService.getPaper(paperid, classid, studentid);
93
         return new ResultVo(0, "获取作业基本信息成功", map);
94
         return new ResultVo(0, "获取作业基本信息成功", map);
94
     }
95
     }
95
 }
96
 }

+ 1
- 1
sstudy/src/main/java/com/xhkjedu/sstudy/mapper/paperreport/PaperStudentReportMapper.java View File

39
             ,@Param("papertype") Integer papertype);
39
             ,@Param("papertype") Integer papertype);
40
 
40
 
41
     //作业基本信息
41
     //作业基本信息
42
-    Map getPaper(@Param("paperid") Integer paperid, @Param("classid") Integer classid);
42
+    Map getPaper(@Param("paperid") Integer paperid, @Param("classid") Integer classid,@Param("studentid") Integer studentid);
43
 }
43
 }

+ 2
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/service/paper/PaperService.java View File

967
                     q.setScore(score);
967
                     q.setScore(score);
968
                     q.setPtqorder(tq.getPtqorder());
968
                     q.setPtqorder(tq.getPtqorder());
969
                     q.setSonqlist(JSON.parseArray(JSON.toJSONString(list), Map.class));
969
                     q.setSonqlist(JSON.parseArray(JSON.toJSONString(list), Map.class));
970
+                    q.setQtypename(type.getQtypename());
971
+                    q.setComplexity(tq.getComplexity());
970
                 } else {
972
                 } else {
971
                     q = tq;
973
                     q = tq;
972
                 }
974
                 }

+ 3
- 3
sstudy/src/main/java/com/xhkjedu/sstudy/service/paperreport/PaperStudentReportService.java View File

139
 
139
 
140
     /**
140
     /**
141
      * @Description 作业基本信息
141
      * @Description 作业基本信息
142
-     * @Param [paperid, classid]
142
+     * @Param [paperid, classid, studentid]
143
      * @Author ywx
143
      * @Author ywx
144
      * @Date 2023/6/9 16:25
144
      * @Date 2023/6/9 16:25
145
      * @return java.util.Map
145
      * @return java.util.Map
146
      **/
146
      **/
147
-    public Map getPaper(Integer paperid, Integer classid) {
148
-        return paperStudentReportMapper.getPaper(paperid, classid);
147
+    public Map getPaper(Integer paperid, Integer classid, Integer studentid) {
148
+        return paperStudentReportMapper.getPaper(paperid, classid, studentid);
149
     }
149
     }
150
 }
150
 }

+ 3
- 1
sstudy/src/main/resources/mapper/paper/PaperMapper.xml View File

22
             <result property="hashear" column="hashear"></result>
22
             <result property="hashear" column="hashear"></result>
23
             <result property="hearfile" column="hearfile"></result>
23
             <result property="hearfile" column="hearfile"></result>
24
             <result property="qn" column="qn"></result>
24
             <result property="qn" column="qn"></result>
25
+            <result property="complexity" column="complexity"></result>
26
+            <result property="qtypename" column="typename"></result>
25
         </collection>
27
         </collection>
26
     </resultMap>
28
     </resultMap>
27
     <!--获取作业题型列表-->
29
     <!--获取作业题型列表-->
28
     <select id="listPaperType" resultMap="typeResult">
30
     <select id="listPaperType" resultMap="typeResult">
29
         select pt.qtypeid,pt.qtypename,pt.ptorder,pt.ptscore,pt.ptnum,ptq.questionid,ptq.ptqscore score,ptq.ptqorder,ptq.qn
31
         select pt.qtypeid,pt.qtypename,pt.ptorder,pt.ptscore,pt.ptnum,ptq.questionid,ptq.ptqscore score,ptq.ptqorder,ptq.qn
30
         ,q.questionid,ifnull(q.questionpid,q.questionid)questionpid,q.qlevel,q.ctype,q.qstem,q.qoption,q.qanswer,q.qanalyze
32
         ,q.questionid,ifnull(q.questionpid,q.questionid)questionpid,q.qlevel,q.ctype,q.qstem,q.qoption,q.qanswer,q.qanalyze
31
-        ,q.hashear,q.hearfile,pt.ctype pctype
33
+        ,q.hashear,q.hearfile,q.complexity,q.qtypename typename,pt.ctype pctype
32
         from t_paper_qtype pt left join t_paper_qtype_question ptq on pt.ptid = ptq.ptid
34
         from t_paper_qtype pt left join t_paper_qtype_question ptq on pt.ptid = ptq.ptid
33
         left join t_question q on ptq.questionid = q.questionid
35
         left join t_question q on ptq.questionid = q.questionid
34
         where pt.paperid=#{paperid} order by pt.ptorder,ptq.ptqid
36
         where pt.paperid=#{paperid} order by pt.ptorder,ptq.ptqid

+ 4
- 2
sstudy/src/main/resources/mapper/paperreport/PaperStudentReportMapper.xml View File

153
     <!--作业基本信息-->
153
     <!--作业基本信息-->
154
     <select id="getPaper" resultType="java.util.Map">
154
     <select id="getPaper" resultType="java.util.Map">
155
         select p.papername,p.papertype,p.paperclass,p.createtime,p.hasfile,p.committype,p.timetype
155
         select p.papername,p.papertype,p.paperclass,p.createtime,p.hasfile,p.committype,p.timetype
156
-        ,pg.starttime,pg.stoptime,pg.showtype,p.papernum,p.paperscore
156
+        ,pg.starttime,pg.stoptime,pg.showtype,ps.papernum,ps.paperscore,ps.showanswer
157
+        ,(case when ps.showanswer=1 then ps.userscore else 0 end)userscore
157
         from t_paper p left join t_paper_class pg on p.paperid = pg.paperid
158
         from t_paper p left join t_paper_class pg on p.paperid = pg.paperid
158
-        where p.paperid=#{paperid} and pg.classid=#{classid}
159
+        left join t_paper_student ps on ps.paperid=pg.paperid and ps.classid=pg.classid
160
+        where p.paperid=#{paperid} and pg.classid=#{classid} and ps.studentid=#{studentid}
159
     </select>
161
     </select>
160
 </mapper>
162
 </mapper>

+ 1
- 1
sstudy/src/main/resources/mapper/paperstudent/PaperStudentMapper.xml View File

342
     <!--获取学生作业状态-->
342
     <!--获取学生作业状态-->
343
     <select id="getPaperState" resultType="java.util.Map">
343
     <select id="getPaperState" resultType="java.util.Map">
344
         select s.psid,s.paperid,s.classid,s.studentid,s.psstate,s.pschecked
344
         select s.psid,s.paperid,s.classid,s.studentid,s.psstate,s.pschecked
345
-        ,p.hasreport,p.papertype
345
+        ,p.hasreport,p.papertype,p.hasfile,p.hearfile
346
         ,(case when s.psstate=3 then (select psb.comm from t_paper_student_back psb
346
         ,(case when s.psstate=3 then (select psb.comm from t_paper_student_back psb
347
         where psb.psid=s.psid order by psbid desc limit 1) else null end)comm
347
         where psb.psid=s.psid order by psbid desc limit 1) else null end)comm
348
         from t_paper_student s left join t_paper p on s.paperid=p.paperid
348
         from t_paper_student s left join t_paper p on s.paperid=p.paperid

Loading…
Cancel
Save