Переглянути джерело

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

tags/正式3.10.0
雍文秀 1 рік тому
джерело
коміт
1c959f893b

+ 4
- 3
sstudy/src/main/java/com/xhkjedu/sstudy/controller/paperstudent/PaperStudentReportController.java Переглянути файл

@@ -85,11 +85,12 @@ public class PaperStudentReportController {
85 85
      * @return com.xhkjedu.vo.ResultVo
86 86
      **/
87 87
     @PostMapping("p")
88
-    public ResultVo getPaper(@RequestBody TPaperClass paper) {
88
+    public ResultVo getPaper(@RequestBody PaperRstudent paper) {
89 89
         Integer paperid = paper.getPaperid();
90 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 94
         return new ResultVo(0, "获取作业基本信息成功", map);
94 95
     }
95 96
 }

+ 1
- 1
sstudy/src/main/java/com/xhkjedu/sstudy/mapper/paperreport/PaperStudentReportMapper.java Переглянути файл

@@ -39,5 +39,5 @@ public interface PaperStudentReportMapper {
39 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 Переглянути файл

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

+ 3
- 3
sstudy/src/main/java/com/xhkjedu/sstudy/service/paperreport/PaperStudentReportService.java Переглянути файл

@@ -139,12 +139,12 @@ public class PaperStudentReportService {
139 139
 
140 140
     /**
141 141
      * @Description 作业基本信息
142
-     * @Param [paperid, classid]
142
+     * @Param [paperid, classid, studentid]
143 143
      * @Author ywx
144 144
      * @Date 2023/6/9 16:25
145 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 Переглянути файл

@@ -22,13 +22,15 @@
22 22
             <result property="hashear" column="hashear"></result>
23 23
             <result property="hearfile" column="hearfile"></result>
24 24
             <result property="qn" column="qn"></result>
25
+            <result property="complexity" column="complexity"></result>
26
+            <result property="qtypename" column="typename"></result>
25 27
         </collection>
26 28
     </resultMap>
27 29
     <!--获取作业题型列表-->
28 30
     <select id="listPaperType" resultMap="typeResult">
29 31
         select pt.qtypeid,pt.qtypename,pt.ptorder,pt.ptscore,pt.ptnum,ptq.questionid,ptq.ptqscore score,ptq.ptqorder,ptq.qn
30 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 34
         from t_paper_qtype pt left join t_paper_qtype_question ptq on pt.ptid = ptq.ptid
33 35
         left join t_question q on ptq.questionid = q.questionid
34 36
         where pt.paperid=#{paperid} order by pt.ptorder,ptq.ptqid

+ 4
- 2
sstudy/src/main/resources/mapper/paperreport/PaperStudentReportMapper.xml Переглянути файл

@@ -153,8 +153,10 @@
153 153
     <!--作业基本信息-->
154 154
     <select id="getPaper" resultType="java.util.Map">
155 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 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 161
     </select>
160 162
 </mapper>

+ 1
- 1
sstudy/src/main/resources/mapper/paperstudent/PaperStudentMapper.xml Переглянути файл

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

Завантаження…
Відмінити
Зберегти