Browse Source

Merge remote-tracking branch 'cloud-schoolapi/ywx'

tags/正式版本
王宁 2 years ago
parent
commit
b47d77e619

+ 10
- 1
sstudy/src/main/java/com/xhkjedu/sstudy/service/question/QuestionClassService.java View File

@@ -87,13 +87,21 @@ public class QuestionClassService {
87 87
         Integer qctype = question.getQctype();
88 88
         Integer checked = paperGroupMapper.getPaperClassChecked(paperid, classid);//获取班级作业是否结束批阅
89 89
         if (checked == 1) return;//已结束批阅不处理
90
-        String subjectid = paperMapper.getSubjectIdByPid(paperid);
90
+        TPaper paper = paperMapper.selectByPrimaryKey(paperid);
91
+        String subjectid = paper.getSubjectid();
92
+        Integer hashear;
93
+        if (N_Utils.isEmpty(paper.getHearfile())) {
94
+            hashear = 0;
95
+        } else {
96
+            hashear = 1;
97
+        }
91 98
         //已批阅未得满分的试题
92 99
         List<TQuestionStudent> questions = questionStudentService.listQuestions(paperid, classid, qctype);
93 100
         for (TQuestionStudent q : questions) {
94 101
             q.setQctype(qctype);
95 102
             q.setSubjectid(subjectid);
96 103
             q.setPaperid(paperid);
104
+            if (qctype == 2) q.setHashear(hashear);
97 105
             questionStudentService.updateQuestionStudent(q);
98 106
         }
99 107
 
@@ -118,6 +126,7 @@ public class QuestionClassService {
118 126
             Double errorrate = N_Utils.getDoubleDivideAndMulitiply((totalscore-stuscore),totalscore);
119 127
             q.setErrorrate(errorrate);
120 128
             q.setCreatetime(N_Utils.getSecondTimestamp());
129
+            if (qctype == 2) q.setHashear(hashear);
121 130
             if (errorrate > serrorrate){
122 131
                 list.add(q);
123 132
             }

+ 2
- 2
sstudy/src/main/resources/mapper/question/QuestionStudentMapper.xml View File

@@ -117,7 +117,7 @@
117 117
         <if test="qctype==1 or qctype==3">
118 118
             select q.studentid,ptq.mscore qscore,sum(q.stuscore)stuscore,ptq.questionpid questionid
119 119
             ,ptq.mqtypeid qtypeid,ptq.ptqorder qorder,max(q.checked)checked
120
-            ,concat('[',group_concat(json_object('questionid',q.questionid,'qn',q.qn,'answertype',q.answertype
120
+            ,concat('[',group_concat(json_object('questionid',q.questionid,'qn',q.qn,'qorder',q.qorder,'answertype',q.answertype
121 121
             ,'useranswer',q.useranswer,'useranswertxt',q.useranswertxt,'converted',q.converted
122 122
             ,'qscore',q.qscore,'stuscore',q.stuscore,'ctype',ptq.ctype)),']')stujson
123 123
             ,(select tq.hashear from t_question tq where tq.questionid=ptq.questionpid)hashear
@@ -127,7 +127,7 @@
127 127
         </if>
128 128
         <if test="qctype==2">
129 129
             select q.studentid,q.qscore,q.stuscore,q.pscaid questionid,ps.qtypeid,ps.psorder qorder
130
-            ,concat('[',group_concat(json_object('questionid',q.pscaid,'qn',q.qorder,'answertype',q.answertype
130
+            ,concat('[',group_concat(json_object('questionid',q.pscaid,'qn',q.qn,'qorder',q.qorder,'answertype',q.answertype
131 131
             ,'useranswer',q.useranswer,'useranswertxt',q.useranswertxt,'converted',q.converted
132 132
             ,'qscore',q.qscore,'stuscore',q.stuscore,'ctype',ps.ctype)),']')stujson
133 133
             from t_paper_student_scantron q left join t_paper_scantron ps on q.pscaid=ps.pscaid

Loading…
Cancel
Save