Browse Source

学生作业报告-作答详情(未到显示答案时间,已生成报告除了答案、解析、知识点都可以查看)

tags/正式3.13.3
雍文秀 1 year ago
parent
commit
31bdf21105

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

24
 
24
 
25
     //题库作业试题
25
     //题库作业试题
26
     List<Map> listTkSt(@Param("paperid") Integer paperid, @Param("classid") Integer classid
26
     List<Map> listTkSt(@Param("paperid") Integer paperid, @Param("classid") Integer classid
27
-            , @Param("studentid") Integer studentid,@Param("showanswer") Integer showanswer);
27
+            , @Param("studentid") Integer studentid, @Param("showanswer") Integer showanswer
28
+            , @Param("hasreport") Integer hasreport);
28
 
29
 
29
     //附件作业试题
30
     //附件作业试题
30
     List<Map> listFjSt(@Param("paperid") Integer paperid, @Param("classid") Integer classid
31
     List<Map> listFjSt(@Param("paperid") Integer paperid, @Param("classid") Integer classid
31
-            ,@Param("studentid") Integer studentid,@Param("showanswer") Integer showanswer);
32
+            , @Param("studentid") Integer studentid, @Param("showanswer") Integer showanswer
33
+            , @Param("hasreport") Integer hasreport);
32
 
34
 
33
     //题库作业子题
35
     //题库作业子题
34
     List<Map> listZtQuestion(@Param("questionids") List<String> questionids,@Param("psid") Integer psid
36
     List<Map> listZtQuestion(@Param("questionids") List<String> questionids,@Param("psid") Integer psid

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

50
         Map paper = paperStudentReportMapper.getPaperAnalyze(paperid, classid, studentid);
50
         Map paper = paperStudentReportMapper.getPaperAnalyze(paperid, classid, studentid);
51
         Integer papertype = (Integer) paper.get("papertype");
51
         Integer papertype = (Integer) paper.get("papertype");
52
         Integer showanswer = N_Utils.str2Int(paper.get("showanswer").toString());
52
         Integer showanswer = N_Utils.str2Int(paper.get("showanswer").toString());
53
+        Integer hasreport = N_Utils.str2Int(paper.get("hasreport").toString());
53
         List<Map> list;
54
         List<Map> list;
54
         if (papertype == 1 || papertype == 3) {// 题库、靶向作业
55
         if (papertype == 1 || papertype == 3) {// 题库、靶向作业
55
-            list = paperStudentReportMapper.listTkSt(paperid, classid, studentid, showanswer);
56
+            list = paperStudentReportMapper.listTkSt(paperid, classid, studentid, showanswer, hasreport);
56
             List<Map> questions = new ArrayList<>();// 题库作业子题
57
             List<Map> questions = new ArrayList<>();// 题库作业子题
57
             List<String> questionids = new ArrayList<>();
58
             List<String> questionids = new ArrayList<>();
58
             list.forEach(t -> {
59
             list.forEach(t -> {
70
                     if (q.get("qlevel").equals(2)) {
71
                     if (q.get("qlevel").equals(2)) {
71
                         List<Map> sonques = questions.stream().filter(tq -> questionid.equals(tq.get("questionpid"))).collect(Collectors.toList());
72
                         List<Map> sonques = questions.stream().filter(tq -> questionid.equals(tq.get("questionpid"))).collect(Collectors.toList());
72
                         q.put("sonques", sonques);
73
                         q.put("sonques", sonques);
73
-                        if (showanswer == 1) {
74
+                        if (showanswer == 1 || hasreport == 1) {
74
                             Integer good = 0;
75
                             Integer good = 0;
75
                             long count = sonques.stream().filter(s -> s.get("good").equals(1)).count();
76
                             long count = sonques.stream().filter(s -> s.get("good").equals(1)).count();
76
                             if (count != 0) {
77
                             if (count != 0) {
79
                             q.put("good", good);
80
                             q.put("good", good);
80
                         }
81
                         }
81
                     }
82
                     }
82
-                    if (showanswer == 1) {
83
+                    if (showanswer == 1 || hasreport == 1) {
83
                         if(N_Utils.isEmpty(q.get("classavgscore"))){
84
                         if(N_Utils.isEmpty(q.get("classavgscore"))){
84
                             q.put("classavgscore",0);
85
                             q.put("classavgscore",0);
85
                         }
86
                         }
86
                         if(N_Utils.isEmpty(q.get("classscorerate"))){
87
                         if(N_Utils.isEmpty(q.get("classscorerate"))){
87
                             q.put("classscorerate",0);
88
                             q.put("classscorerate",0);
88
                         }
89
                         }
89
-                        q.put("pointnames", getQuestionPoint(points, questionid));// 试题知识点
90
                         q.put("ratetype", StudyUtil.getScoreRateType(StudyUtil.objToDouble(q.get("scorerate"))));
90
                         q.put("ratetype", StudyUtil.getScoreRateType(StudyUtil.objToDouble(q.get("scorerate"))));
91
                     }
91
                     }
92
+                    if (showanswer == 1) {
93
+                        q.put("pointnames", getQuestionPoint(points, questionid));// 试题知识点
94
+                    }
92
                 }
95
                 }
93
             }
96
             }
94
         } else {// 附件作业
97
         } else {// 附件作业
95
             String papername = paper.get("papername").toString();
98
             String papername = paper.get("papername").toString();
96
-            list = paperStudentReportMapper.listFjSt(paperid, classid, studentid, showanswer);
99
+            list = paperStudentReportMapper.listFjSt(paperid, classid, studentid, showanswer, hasreport);
97
             for (Map t : list) {
100
             for (Map t : list) {
98
                 for (Map q : (List<Map>) t.get("questions")) {
101
                 for (Map q : (List<Map>) t.get("questions")) {
99
                     q.put("qstem", papername + "-第" + q.get("qn") + "题");
102
                     q.put("qstem", papername + "-第" + q.get("qn") + "题");
100
-                    if (showanswer == 1) {
103
+                    if (showanswer == 1 || hasreport == 1) {
101
                         if (N_Utils.isEmpty(q.get("classavgscore"))) {
104
                         if (N_Utils.isEmpty(q.get("classavgscore"))) {
102
                             q.put("classavgscore", 0);
105
                             q.put("classavgscore", 0);
103
                         }
106
                         }

+ 11
- 5
sstudy/src/main/resources/mapper/paperreport/PaperStudentReportMapper.xml View File

25
     </select>
25
     </select>
26
     <!--作业分析-->
26
     <!--作业分析-->
27
     <select id="getPaperAnalyze" resultType="java.util.Map">
27
     <select id="getPaperAnalyze" resultType="java.util.Map">
28
-        select p.paperid,p.papertype,p.papername,pa.pointjson,ifnull(ps.showanswer,0) as showanswer,ps.psid
28
+        select p.paperid,p.papertype,p.papername,p.hasreport,pa.pointjson,ifnull(ps.showanswer,0) as showanswer,ps.psid
29
         ,(select pc.showtype from t_paper_class pc where pc.paperid=ps.paperid and pc.classid=ps.classid)showtype
29
         ,(select pc.showtype from t_paper_class pc where pc.paperid=ps.paperid and pc.classid=ps.classid)showtype
30
         from t_paper p left join t_paper_analyze pa on p.paperid = pa.paperid
30
         from t_paper p left join t_paper_analyze pa on p.paperid = pa.paperid
31
         left join t_paper_student ps on p.paperid = ps.paperid
31
         left join t_paper_student ps on p.paperid = ps.paperid
70
         select pq.qtypename,pq.ptid,pq.ptorder,psq.qorder,sum(psq.qscore) as qscore,tq.ctype,
70
         select pq.qtypename,pq.ptid,pq.ptorder,psq.qorder,sum(psq.qscore) as qscore,tq.ctype,
71
         (if(tq.qlevel=1, pqq.qn, pqq.ptqorder)) as qn,
71
         (if(tq.qlevel=1, pqq.qn, pqq.ptqorder)) as qn,
72
         pqq.questionpid as questionid,tq.qtypename qqtypename
72
         pqq.questionpid as questionid,tq.qtypename qqtypename
73
-        <if test="showanswer==1">
73
+        <if test="showanswer==1 or hasreport==1">
74
             ,q.classavgscore,q.classscorerate,truncate(sum(psq.stuscore)*100/sum(psq.qscore),2) as scorerate
74
             ,q.classavgscore,q.classscorerate,truncate(sum(psq.stuscore)*100/sum(psq.qscore),2) as scorerate
75
-            ,sum(psq.stuscore) as stuscore,psq.good,tq.qanswer,tq.qanalyze
75
+            ,sum(psq.stuscore) as stuscore,psq.good
76
             ,(if(tq.qlevel=1, psq.checkcomm, '')) as checkcomm
76
             ,(if(tq.qlevel=1, psq.checkcomm, '')) as checkcomm
77
         </if>
77
         </if>
78
+        <if test="showanswer==1">
79
+            ,tq.qanswer,tq.qanalyze
80
+        </if>
78
         ,psq.answered,psq.answertype,psq.useranswer,psq.converted,psq.useranswertxt
81
         ,psq.answered,psq.answertype,psq.useranswer,psq.converted,psq.useranswertxt
79
         ,tq.qstem,tq.qoption,tq.hashear,tq.hearfile,tq.qlevel
82
         ,tq.qstem,tq.qoption,tq.hashear,tq.hearfile,tq.qlevel
80
         from t_paper_qtype_question pqq left join t_paper_qtype pq on pqq.ptid=pq.ptid
83
         from t_paper_qtype_question pqq left join t_paper_qtype pq on pqq.ptid=pq.ptid
89
     <select id="listFjSt" resultMap="typeResult">
92
     <select id="listFjSt" resultMap="typeResult">
90
         select pq.qtypename,pq.psqtypeid as ptid,pq.pstorder as ptorder,ps.qn,ps.psorder as qorder
93
         select pq.qtypename,pq.psqtypeid as ptid,pq.pstorder as ptorder,ps.qn,ps.psorder as qorder
91
         ,ps.psscore as qscore,ps.ctype,ps.optionnum,ps.pscaid as ptqid,ps.qtypename as qqtypename
94
         ,ps.psscore as qscore,ps.ctype,ps.optionnum,ps.pscaid as ptqid,ps.qtypename as qqtypename
92
-        <if test="showanswer==1">
95
+        <if test="showanswer==1 or hasreport==1">
93
             ,q.classavgscore,q.classscorerate,truncate(pss.stuscore*100/pss.qscore,2)scorerate
96
             ,q.classavgscore,q.classscorerate,truncate(pss.stuscore*100/pss.qscore,2)scorerate
94
-            ,pss.stuscore,pss.good,pss.checkcomm,ps.psanswer qanswer
97
+            ,pss.stuscore,pss.good,pss.checkcomm
98
+        </if>
99
+        <if test="showanswer==1">
100
+            ,ps.psanswer qanswer
95
         </if>
101
         </if>
96
         ,pss.answered,pss.answertype,pss.useranswer,pss.converted,pss.useranswertxt
102
         ,pss.answered,pss.answertype,pss.useranswer,pss.converted,pss.useranswertxt
97
         from t_paper_scantron ps left join t_paper_student_scantron pss on ps.pscaid=pss.pscaid
103
         from t_paper_scantron ps left join t_paper_student_scantron pss on ps.pscaid=pss.pscaid

Loading…
Cancel
Save