Ver código fonte

Merge remote-tracking branch 'origin/master' into ywx

tags/正式版本
雍文秀 2 anos atrás
pai
commit
71ef651e3b

+ 13
- 7
sexam/src/main/java/com/xhkjedu/sexam/service/paperstudent/EPaperStudentService.java Ver arquivo

@@ -527,11 +527,12 @@ public class EPaperStudentService {
527 527
     private void setQuestionsForPaper(List<Map> qtypes){
528 528
         for(Map mt : qtypes){
529 529
             Integer ctype = Integer.parseInt(mt.get("ctype").toString());
530
+            List<Map> mqlist = new ArrayList<>();
530 531
             if(ctype == 11 || ctype == 16 || ctype == 17){
531 532
                 //符合题、完形填空、任务型阅读
532 533
                 List<Map> questions = (List<Map>) mt.get("questions");
533 534
                 Map<String,List<Map>> quemap = questions.stream().collect(Collectors.groupingBy(o -> o.get("questionpid").toString()));
534
-                List<Map> mqlist = new ArrayList<>();
535
+
535 536
                 for(Map.Entry<String,List<Map>> entry : quemap.entrySet()){
536 537
                     List<Map> sonqlst = entry.getValue();
537 538
                     Double sontotalsocre = sonqlst.stream().mapToDouble(o -> Double.parseDouble(o.get("score").toString())).sum();
@@ -547,7 +548,9 @@ public class EPaperStudentService {
547 548
                     mque.put("qorder",sque.get("qorder").toString());
548 549
                     mque.put("qn",sque.get("qn").toString());
549 550
                     mque.put("snum",Integer.parseInt(sque.get("snum").toString()));
550
-                    if(ctype == 12 && sque.get("mhearfile")!=null){
551
+                    Integer hashear = Integer.parseInt(sque.get("mhashear").toString());
552
+                    mque.put("hashear",hashear);
553
+                    if(ctype == 12 && hashear==1){
551 554
                         mque.put("hearfile",sque.get("mhearfile").toString());
552 555
                     }else{
553 556
                         mque.put("hearfile","");
@@ -557,13 +560,9 @@ public class EPaperStudentService {
557 560
                     mque.put("stuscore",stuscore);
558 561
                     mqlist.add(mque);
559 562
                 }
560
-
561
-                mt.put("questions",mqlist);
562
-
563 563
             }else if(ctype == 12){
564 564
                 //听力题,包含单题和复合题
565 565
                 List<Map> questions = (List<Map>) mt.get("questions");
566
-                List<Map> mqlist = new ArrayList<>();
567 566
                 List<String> questionpids = new ArrayList<>();
568 567
                 for(Map q : questions){
569 568
                     Integer qlevel = Integer.parseInt(q.get("qlevel").toString());
@@ -587,7 +586,9 @@ public class EPaperStudentService {
587 586
                             mque.put("qorder",q.get("qorder").toString());
588 587
                             mque.put("qn",q.get("qn").toString());
589 588
                             mque.put("snum",Integer.parseInt(q.get("snum").toString()));
590
-                            if(ctype == 12 && q.get("mhearfile")!=null){
589
+                            Integer hashear = Integer.parseInt(q.get("mhashear").toString());
590
+                            mque.put("hashear",hashear);
591
+                            if(ctype == 12 && hashear == 1){
591 592
                                 mque.put("hearfile",q.get("mhearfile").toString());
592 593
                             }else{
593 594
                                 mque.put("hearfile","");
@@ -595,11 +596,16 @@ public class EPaperStudentService {
595 596
                             mque.put("score",sontotalsocre);
596 597
                             mque.put("stuscore",stuscore);
597 598
                             mque.put("sonques",sonques);
599
+                            mqlist.add(mque);
598 600
                         }
599 601
                     }
600 602
                 }
601 603
 
604
+            }else{
605
+                List<Map> questions = (List<Map>) mt.get("questions");
606
+                mqlist.addAll(questions);
602 607
             }
608
+            mt.put("questions",mqlist);
603 609
         }
604 610
     }
605 611
 

+ 6
- 3
sexam/src/main/resources/mapper/paperstudent/EPaperStudentQuestionMapper.xml Ver arquivo

@@ -161,7 +161,9 @@
161 161
             <result column="qtypeid" property="qtypeid"></result>
162 162
             <result column="qtypename" property="qtypename"></result>
163 163
             <result column="qctype" property="ctype"></result>
164
-            <result column="qstem" property="qstem"></result>
164
+            <result column="hashear" property="hashear"></result>
165
+            <result column="qctype" property="ctype"></result>
166
+            <result column="hearfile" property="hearfile"></result>
165 167
             <result column="qoption" property="qoption"></result>
166 168
             <result column="qlevel" property="qlevel"></result>
167 169
             <result column="sorder" property="sorder"></result>
@@ -172,15 +174,16 @@
172 174
             <result column="mqtypeid" property="mqtypeid"></result>
173 175
             <result column="mqtypename" property="mqtypename"></result>
174 176
             <result column="mctype" property="mctype"></result>
177
+            <result column="mhashear" property="mhashear"></result>
175 178
             <result column="mhearfile" property="mhearfile"></result>
176 179
         </collection>
177 180
     </resultMap>
178 181
     <select id="listQStuQuestionScore" resultMap="qtypesQuestion">
179 182
         select pt.ctype,pt.eptname,pt.eptnum,pt.eptorder,pt.eptscore,
180 183
                psq.epsqid,psq.questionid,psq.qorder,psq.qn,ptq.score,ptq.answer,psq.answered,psq.answertype,psq.stuanswer,
181
-               psq.stuanswertxt,psq.eptqid,psq.stuscore,q.qstem,q.qoption,q.ctype qctype,q.qtypeid,
184
+               psq.stuanswertxt,psq.eptqid,psq.stuscore,q.qstem,q.qoption,q.ctype qctype,q.qtypeid,q.hashear,q.hearfile,
182 185
                q.qtypename,q.qlevel,q.snum,q.sorder,q.questionpid,mq.questionid mquestionid,mq.qstem mqstem,
183
-               mq.qoption mqoption,mq.ctype mctype,mq.qtypeid mqtypeid,mq.qtypename mqtypename,mq.hearfile mhearfile
186
+               mq.qoption mqoption,mq.ctype mctype,mq.qtypeid mqtypeid,mq.qtypename mqtypename,mq.hashear mhashear,mq.hearfile mhearfile
184 187
         from e_paper_student_question psq left join e_paper_qtype_question ptq on psq.eptqid=ptq.eptqid
185 188
         left join e_paper_qtype pt on pt.eptid=ptq.eptid
186 189
         left join t_question q on psq.questionid=q.questionid

Carregando…
Cancelar
Salvar