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

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

@@ -25,7 +25,7 @@
25 25
     </select>
26 26
     <!--作业分析-->
27 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 29
         ,(select pc.showtype from t_paper_class pc where pc.paperid=ps.paperid and pc.classid=ps.classid)showtype
30 30
         from t_paper p left join t_paper_analyze pa on p.paperid = pa.paperid
31 31
         left join t_paper_student ps on p.paperid = ps.paperid
@@ -70,11 +70,14 @@
70 70
         select pq.qtypename,pq.ptid,pq.ptorder,psq.qorder,sum(psq.qscore) as qscore,tq.ctype,
71 71
         (if(tq.qlevel=1, pqq.qn, pqq.ptqorder)) as qn,
72 72
         pqq.questionpid as questionid,tq.qtypename qqtypename
73
-        <if test="showanswer==1">
73
+        <if test="showanswer==1 or hasreport==1">
74 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 76
             ,(if(tq.qlevel=1, psq.checkcomm, '')) as checkcomm
77 77
         </if>
78
+        <if test="showanswer==1">
79
+            ,tq.qanswer,tq.qanalyze
80
+        </if>
78 81
         ,psq.answered,psq.answertype,psq.useranswer,psq.converted,psq.useranswertxt
79 82
         ,tq.qstem,tq.qoption,tq.hashear,tq.hearfile,tq.qlevel
80 83
         from t_paper_qtype_question pqq left join t_paper_qtype pq on pqq.ptid=pq.ptid
@@ -89,9 +92,12 @@
89 92
     <select id="listFjSt" resultMap="typeResult">
90 93
         select pq.qtypename,pq.psqtypeid as ptid,pq.pstorder as ptorder,ps.qn,ps.psorder as qorder
91 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 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 101
         </if>
96 102
         ,pss.answered,pss.answertype,pss.useranswer,pss.converted,pss.useranswertxt
97 103
         from t_paper_scantron ps left join t_paper_student_scantron pss on ps.pscaid=pss.pscaid

Loading…
Cancel
Save