Browse Source

学生报告错题集分数显示控制

tags/正式版本
雍文秀 2 years ago
parent
commit
333cb1a325

+ 5
- 4
sexam/src/main/java/com/xhkjedu/sexam/mapper/reportstu/ERstudentMapper.java View File

@@ -45,12 +45,13 @@ public interface ERstudentMapper extends TkMapper<ERstudent> {
45 45
     List<Map> listStudentQuestionsFj(@Param("epid") Integer epid, @Param("studentid") Integer studentid
46 46
             ,@Param("showrank") Integer showrank);
47 47
     //学生报告-错题集-各科目错题
48
-    List<Map> listStudentSubjectErrorQues(@Param("examid") Integer examid, @Param("studentid") Integer studentid
49
-            ,@Param("showrank") Integer showrank);
48
+    List<Map> listStudentSubjectErrorQues(@Param("examid") Integer examid, @Param("studentid") Integer studentid);
50 49
     //学生报告-错题集-学生科目下错题
51
-    List<Map> listStudentErrorQuestionsForTk(@Param("examid")Integer examid,@Param("studentid")Integer studentid,@Param("subjectid")String subjectid);
50
+    List<Map> listStudentErrorQuestionsForTk(@Param("examid") Integer examid, @Param("studentid") Integer studentid
51
+            , @Param("subjectid") String subjectid,@Param("showrank") Integer showrank);
52 52
     //学生报告-错题集-学生科目下错题(附件)
53
-    List<Map> listStudentErrorQuestionsForFj(@Param("examid")Integer examid,@Param("studentid")Integer studentid,@Param("subjectid")String subjectid);
53
+    List<Map> listStudentErrorQuestionsForFj(@Param("examid") Integer examid, @Param("studentid") Integer studentid
54
+            , @Param("subjectid") String subjectid,@Param("showrank") Integer showrank);
54 55
     //学生报告-监控照片-考试科目下违规图片数量
55 56
     List<Map> listExamSubjectBadNums(@Param("examid")Integer examid,@Param("studentid")Integer studentid);
56 57
     //学生报告-监控照片-学生单科图片

+ 4
- 18
sexam/src/main/java/com/xhkjedu/sexam/service/report/EReportStudentService.java View File

@@ -431,15 +431,7 @@ public class EReportStudentService {
431 431
      * @Date 2022/8/29 11:39
432 432
      **/
433 433
     public List<Map> listStudentSubjectErrorQues(Integer examid, Integer studentid, Integer teacherid) {
434
-        Integer showrank;
435
-        EBase base = eBaseMapper.getShowRankById(examid);
436
-        if (!N_Utils.isEmptyInteger(teacherid)) {
437
-            showrank = base.getTeashowrank();
438
-        } else {
439
-            showrank = base.getStushowrank();
440
-        }
441
-        List<Map> list = eRstudentMapper.listStudentSubjectErrorQues(examid, studentid, showrank);
442
-        if (showrank == 0) return list;
434
+        List<Map> list = eRstudentMapper.listStudentSubjectErrorQues(examid, studentid);
443 435
         for (Map map : list) {
444 436
             List<Map> queslist = (List<Map>) map.get("questions");
445 437
             Integer ptype = Integer.parseInt(map.get("ptype").toString());
@@ -481,13 +473,7 @@ public class EReportStudentService {
481 473
         } else {
482 474
             showrank = base.getStushowrank();
483 475
         }
484
-        if (showrank == 0) {
485
-            Map map = new HashMap();
486
-            map.put("questions", new ArrayList<>());
487
-            map.put("points", new ArrayList<>());
488
-            return map;
489
-        }
490
-        List<Map> list = eRstudentMapper.listStudentErrorQuestionsForTk(examid, studentid, subjectid);
476
+        List<Map> list = eRstudentMapper.listStudentErrorQuestionsForTk(examid, studentid, subjectid, showrank);
491 477
         Map panalyze = ePaperAnalyzeMapper.getPaperAnalzyeBySubjectid(examid, subjectid);
492 478
         String pointjson = panalyze.get("pointjson").toString();
493 479
         List<Map> pointlist = JSON.parseArray(pointjson, Map.class);
@@ -536,8 +522,8 @@ public class EReportStudentService {
536 522
         } else {
537 523
             showrank = base.getStushowrank();
538 524
         }
539
-        if (showrank == 0) return new ArrayList<>();
540
-        List<Map> list = eRstudentMapper.listStudentErrorQuestionsForFj(examid, studentid, subjectid);
525
+        List<Map> list = eRstudentMapper.listStudentErrorQuestionsForFj(examid, studentid, subjectid, showrank);
526
+        if(showrank == 0) return list;
541 527
         for (Map map : list) {
542 528
             Double stuscore = Double.parseDouble(map.get("stuscore").toString());
543 529
             Double pscore = Double.parseDouble(map.get("qscore").toString());

+ 16
- 12
sexam/src/main/resources/mapper/report/ERstudentMapper.xml View File

@@ -306,7 +306,6 @@
306 306
         </collection>
307 307
     </resultMap>
308 308
     <select id="listStudentSubjectErrorQues" resultMap="listStudentSubjectErrorQues">
309
-        <if test="showrank!=0">
310 309
         select sq.subjectid,st.subjectname,p.ptype,sq.epsqid,sq.eptqid,q.questionid,q.qlevel,q.questionpid
311 310
         from e_paper_student_question sq
312 311
         left join t_question q on q.questionid=sq.questionid
@@ -314,20 +313,20 @@
314 313
         left join e_paper p on sq.epid=p.epid
315 314
         left join e_subject st on p.esid=st.esid
316 315
         where sq.examid=#{examid} and sq.studentid=#{studentid} and st.pstate=2 and sq.stuscore &lt; sq.qscore group by sq.epsqid order by st.esid
317
-        </if>
318
-        <if test="showrank==0">
319
-        select st.subjectid,st.subjectname,p.ptype,0 num
320
-        from e_subject st left join e_paper p on st.esid=p.esid
321
-        where st.examid=#{examid} and st.pstate=2
322
-        </if>
323 316
     </select>
324 317
     <!--学生报告-错题集-学生科目下错题(题库)-->
325 318
     <select id="listStudentErrorQuestionsForTk" resultMap="listStudentQues">
326
-        select sq.epsqid,sq.eptqid,sq.ctype,sq.questionid,sq.qn,sq.qorder,sq.qscore,sq.stuscore,sq.answered,
319
+        select sq.epsqid,sq.eptqid,sq.ctype,sq.questionid,sq.qn,sq.qorder,sq.qscore,sq.answered,
327 320
                sq.answertype,sq.stuanswer,sq.stuanswertxt,pq.answer,q.qstem,q.qoption,q.qanswer,q.qanalyze,q.hashear,q.hearfile,
328 321
                q.qlevel,q.sorder,q.complexity,q.questionpid,mq.questionid mquestionid,mq.qstem mqstem,mq.qoption mqoption,mq.qanswer mqanswer,
329 322
                mq.qanalyze mqanalyze,mq.hashear mhashear,mq.hearfile mhearfile,mq.qlevel mqlevel,mq.ctype mctype,mq.snum msnum,
330
-               mq.complexity mcomplexity,cq.classavgscore,cq.gradeavgscore
323
+               mq.complexity mcomplexity
324
+        <if test="showrank==0">
325
+            ,0 stuscore,0 classavgscore,0 gradeavgscore
326
+        </if>
327
+        <if test="showrank!=0">
328
+            ,sq.stuscore,cq.classavgscore,cq.gradeavgscore
329
+        </if>
331 330
         from e_paper_student_question sq left join t_question q on sq.questionid=q.questionid
332 331
         left join t_question mq on q.questionpid=mq.questionid
333 332
         left join e_rclass_question cq on sq.epid=cq.epid and sq.classid=cq.classid and (sq.questionid=cq.questionid or mq.questionid=cq.questionid)
@@ -338,9 +337,14 @@
338 337
 
339 338
     <!--学生报告-错题集-学生科目下错题(附件)-->
340 339
     <select id="listStudentErrorQuestionsForFj" resultType="java.util.Map">
341
-        select sq.epsqid,sq.eptqid,sq.ctype,sq.qn,sq.qorder,sq.qscore,sq.stuscore,sq.answered,
342
-               sq.answertype,sq.stuanswer,sq.stuanswertxt,q.qtypeid,q.qtypename,q.optionnum,q.answer,
343
-               cq.classavgscore,cq.gradeavgscore
340
+        select sq.epsqid,sq.eptqid,sq.ctype,sq.qn,sq.qorder,sq.qscore,sq.answered,
341
+               sq.answertype,sq.stuanswer,sq.stuanswertxt,q.qtypeid,q.qtypename,q.optionnum,q.answer
342
+        <if test="showrank==0">
343
+            ,0 stuscore,0 classavgscore,0 gradeavgscore
344
+        </if>
345
+        <if test="showrank!=0">
346
+            ,sq.stuscore,cq.classavgscore,cq.gradeavgscore
347
+        </if>
344 348
         from e_paper_student_question sq left join e_rclass_question cq on sq.eptqid=cq.eptqid and sq.classid=cq.classid
345 349
         left join e_paper_qtype_question q on sq.eptqid=q.eptqid
346 350
         where sq.examid=#{examid} and sq.subjectid=#{subjectid} and sq.studentid=#{studentid} and sq.stuscore &lt; sq.qscore

Loading…
Cancel
Save