Browse Source

阅卷分配

ywx
雍文秀 3 weeks ago
parent
commit
1574715580

+ 17
- 2
smarking/src/main/java/com/xhkjedu/smarking/service/papercheck/MsBlockCheckService.java View File

@@ -177,15 +177,30 @@ public class MsBlockCheckService {
177 177
         } else {//双评
178 178
             //先从ypMap获取教师指定的mpsbid集合,不够的话从epMap获取教师指定的mpsbid集合;还不够的话从ypMap获取剩余的mpsbid集合,还不够的话从epMap获取剩余的mpsbid集合
179 179
             List<Integer> ids1 = ypMap.keySet().stream().filter(s -> teacherid.equals(ypMap.get(s))).collect(Collectors.toList());
180
-            List<Integer> ids2 = ypMap.keySet().stream().filter(s -> teacherid.equals(epMap.get(s))).collect(Collectors.toList());
180
+            List<Integer> ids2 = epMap.keySet().stream().filter(s -> teacherid.equals(epMap.get(s))).collect(Collectors.toList());
181 181
             int num1 = ids1.size();
182 182
             int num2 = ids2.size();
183 183
             if (taskNum > num1 + num2) {
184 184
                 //从ypMap获取taskNum-num1-num2个值为null的集合
185
-                List<Integer> ids3 = ypMap.keySet().stream().filter(s -> ypMap.get(s) == null).limit(taskNum - num1 - num2).collect(Collectors.toList());
185
+                int num3 = taskNum - num1 - num2;
186
+                //ypMap排除ids2的集合
187
+                LinkedHashMap<Integer, Integer> ypMap2 = new LinkedHashMap<>(ypMap);
188
+                ids2.forEach(ypMap2.keySet()::remove);
189
+                List<Integer> ids3 = ypMap2.keySet().stream().filter(s -> ypMap.get(s) == null).limit(num3).collect(Collectors.toList());
186 190
                 for (Integer mpsbid : ids3) {
187 191
                     ypMap.put(mpsbid, teacherid);
188 192
                 }
193
+                int num4 = num3 - ids3.size();
194
+                if (num4 > 0) {
195
+                    //epMap排除ids1、ids3的集合
196
+                    LinkedHashMap<Integer, Integer> epMap2 = new LinkedHashMap<>(epMap);
197
+                    ids1.forEach(epMap2.keySet()::remove);
198
+                    ids3.forEach(epMap2.keySet()::remove);
199
+                    List<Integer> ids4 = epMap2.keySet().stream().filter(s -> epMap.get(s) == null).limit(num4).collect(Collectors.toList());
200
+                    for (Integer mpsbid : ids4) {
201
+                        epMap.put(mpsbid, teacherid);
202
+                    }
203
+                }
189 204
             } else if (taskNum < num1) {
190 205
                 setYpAndEpMap(ypMap, epMap, taskNum, ids1, ids2);
191 206
             } else if (taskNum < num2) {

+ 2
- 2
smarking/src/main/resources/mapper/papercheck/MsPaperCheckMapper.xml View File

@@ -79,7 +79,7 @@
79 79
     <select id="listStudentByMBlockId" resultType="com.xhkjedu.smarking.vo.papercheck.MsPaperCheckVo">
80 80
         select psb.mpsbid,psb.mblockid,psb.checked,psb.firstcid,psb.firstcime,psb.secondcid,psb.secondctime
81 81
         from ms_paper_student_block psb
82
-        where psb.mblockid=#{mblockid} and psb.checked in(0,1)
82
+        where psb.mblockid=#{mblockid}
83 83
         <if test="numtype!=null and numtype==1">
84 84
             and psb.stuanswer is not null and psb.stuanswer!=''
85 85
         </if>
@@ -90,7 +90,7 @@
90 90
     <select id="listStudentByMpsqId" resultType="com.xhkjedu.smarking.vo.papercheck.MsPaperCheckVo">
91 91
         select psq.mpsqid as mpsbid,psq.mptqid as mblockid,psq.checked,psq.firstcid,psq.firstcime,psq.secondcid,psq.secondctime
92 92
         from ms_paper_student_question psq
93
-        where psq.mptqid=#{mblockid} and psq.checked in(0,1)
93
+        where psq.mptqid=#{mblockid}
94 94
         <if test="numtype!=null and numtype==1">
95 95
             and psq.stuanswer is not null and psq.stuanswer!=''
96 96
         </if>

Loading…
Cancel
Save