Просмотр исходного кода

试卷知识点分析试题知识点分平均

tags/正式版本
王宁 2 лет назад
Родитель
Сommit
f7ccd69c40

+ 177
- 82
sexam/src/main/java/com/xhkjedu/sexam/service/paper/EPaperQtypeService.java Просмотреть файл

@@ -162,12 +162,7 @@ public class EPaperQtypeService {
162 162
                 if(q.getOptionnum()==null){
163 163
                     q.setOptionnum(0);
164 164
                 }
165
-                /*Integer qorder = q.getQorder();
166
-                if (ptype == 1 && ctype != 11) {
167
-                    q.setQn(qorder.toString());
168
-                } else if (ptype == 1 && ctype == 11) {
169
-                    q.setQn(qorder + "." + (i + 1));
170
-                }*/
165
+
171 166
                 if(q.getCtype() == 14){
172 167
                     q.setGnum(900);//语文作文格数
173 168
                 }else if(q.getCtype() == 15){
@@ -195,42 +190,50 @@ public class EPaperQtypeService {
195 190
     }
196 191
 
197 192
     //保存试卷分析--题库
198
-    public void savePaperAnalyzeForQuestion(EPaper ePaper){
193
+    private void savePaperAnalyzeForQuestion(EPaper ePaper){
199 194
         //保存之前先清除之前的试卷分析
200 195
         ePaperAnalyzeMapper.deleteByEpid(ePaper.getEpid());
201 196
         //总体分析(主观题、客观题)
202 197
         List<EPaperQtypeVo> qtypelist = ePaperQtypeMapper.listPaperQtypeQuestions(ePaper.getEpid());//试卷题型试题信息
203
-        List<EPaperQtypeQuestionVo> queslist = new ArrayList<>();//试卷中所有试题(子题)
204
-        List<Map> quespoints = new ArrayList<>();//试卷中所有单题和子题以及对应知识点
205
-        List<EPaperQtypeQuestion> uplist = new ArrayList<>();//如果是客观题则获取客观题选项数量更改试卷中客观题选项数量
198
+        List<EPaperQtypeQuestion> uplist = new ArrayList<>();//改试卷中客观题选项数量
199
+        List<QuestionOrderVo> pointqlist = new ArrayList<>();//用于存放知识点,以及知识点下得分
200
+        List<EPaperQtypeQuestionVo> mquestions = new ArrayList<>();//存放单题和母题
206 201
 
207 202
         //处理题型1单选题2多选题3主观题4判断对错5判断√×6判断TF7完形填空8阅读理解10任务型阅读11综合题12听力
208 203
         List<Map> typelist = new ArrayList<>();//题型分析
209 204
         //处理出试卷中所有试题、知识点
210 205
         for(EPaperQtypeVo qt : qtypelist){
211 206
             List<Integer> qorderlist = new ArrayList<>();
212
-            for(EPaperQtypeQuestionVo q : qt.getQuestions()){
213
-                //处理试题关联知识点
214
-                List<Map> pointslist = q.getPoints();
215
-                if(pointslist != null && pointslist.size()>0){
216
-                    for(Map point : pointslist){
217
-                        Map p = new HashMap();
218
-                        p.put("pointid",point.get("pointid").toString());
219
-                        p.put("pointname",point.get("pointname").toString());
220
-                        p.put("eptqid",q.getEptqid());
221
-                        p.put("order",q.getQorder());
222
-                        p.put("score",q.getScore());
223
-                        quespoints.add(p);
224
-                    }
225
-                }
207
+            List<QuestionOrderVo> qtypeqlist = new ArrayList<>();
208
+            List<EPaperQtypeQuestionVo> tqlist = qt.getQuestions();
209
+            int hasmt = 0;
210
+            for(EPaperQtypeQuestionVo q : tqlist){
211
+                int ctype = q.getCtype();
212
+                //单题的pid设置为默认值,方便后续进行单题和母题处理
226 213
                 if(q.getQlevel()==1){
227 214
                     q.setQuestionpid("000");
215
+                    //判断试题是否是客观题
216
+                    if(N_Utils.isObjectiveQuestion(ctype)){
217
+                        //判断试题是否是客观题,暂时用mctype进行标识
218
+                        q.setMctype(111);
219
+                    }else{
220
+                        q.setMctype(112);
221
+                    }
222
+                    //设置知识点
223
+                    mquestions.add(q);
224
+                    //获取试题知识点
225
+                    List<Map> qpoints = q.getPoints();
226
+                    //处理试题知识点占分
227
+                    setPaperQuestionPointScore(pointqlist,qpoints,q,null,null);
228
+                    setPaperQuestionQtypeScore(qtypeqlist,q,null,null);//处理试题题型
229
+                }
230
+                if(q.getQlevel() == 3){
231
+                    hasmt ++;
228 232
                 }
229
-                queslist.add(q);
230 233
                 if(!qorderlist.contains(q.getQorder())){
231 234
                     qorderlist.add(q.getQorder());
232 235
                 }
233
-                int ctype = q.getCtype();
236
+                //为了处理客观题中选项数量
234 237
                 if(ctype == 1 || ctype ==2 || ctype==4 || ctype ==5 || ctype==6){
235 238
                     List<String> strlst = JSON.parseArray(q.getQoption(),String.class);
236 239
                     EPaperQtypeQuestion eqq = new EPaperQtypeQuestion();
@@ -240,54 +243,66 @@ public class EPaperQtypeService {
240 243
                 }
241 244
             }
242 245
 
246
+            if(hasmt > 0){
247
+                //说明该题型下有复合题,复合体进行知识点、题型下试题题号及id进行操作
248
+                Map<String,List<EPaperQtypeQuestionVo>> quesMap = tqlist.stream().collect(Collectors.groupingBy(EPaperQtypeQuestionVo:: getQuestionpid, Collectors.toList()));
249
+                for(Map.Entry<String, List<EPaperQtypeQuestionVo>> entry : quesMap.entrySet()){
250
+                    if(!entry.getKey().equals("000")){
251
+                        //说明该题为母题,
252
+                        EPaperQtypeQuestionVo mq = new EPaperQtypeQuestionVo();
253
+                        List<EPaperQtypeQuestionVo> sonques = entry.getValue();
254
+                        int k = 0;//如果k大于1说明有小题是主观题,则母题为主观题
255
+                        double score = 0;
256
+                        for(EPaperQtypeQuestionVo sq : sonques){
257
+                            if(!N_Utils.isObjectiveQuestion(sq.getCtype())){
258
+                                k++;
259
+                            }
260
+                            score = N_Utils.getDoubleSum(score,sq.getScore());
261
+                        }
262
+
263
+                        EPaperQtypeQuestionVo qobj = sonques.get(0);
264
+                        mq.setQuestionid(qobj.getQuestionpid());
265
+                        mq.setComplexity(qobj.getMcomplexity());
266
+                        mq.setQorder(qobj.getQorder());
267
+                        mq.setScore(score);
268
+                        if(k == 0){
269
+                            mq.setMctype(111);
270
+                        }else{
271
+                            mq.setMctype(112);
272
+                        }
273
+
274
+                        mquestions.add(mq);
275
+                        mq.setQlevel(qobj.getMqlevel());
276
+                        //获取所有子题的试题题号
277
+                        List<String> qns = sonques.stream().map(EPaperQtypeQuestionVo::getQn).collect(Collectors.toList());
278
+                        String[] qnstr = qns.stream().toArray(String[]::new);
279
+                        //所有子题的试题eptqid
280
+                        List<Integer> eptqids = sonques.stream().map(EPaperQtypeQuestionVo::getEptqid).collect(Collectors.toList());
281
+                        Integer[] eptqidstr = eptqids.stream().toArray(Integer[]::new);
282
+
283
+                        //获取知识点
284
+                        List<Map> qpoints = sonques.get(0).getPoints();
285
+                        mq.setPoints(qpoints);
286
+                        setPaperQuestionPointScore(pointqlist,qpoints,mq,qnstr,eptqidstr);
287
+                        setPaperQuestionQtypeScore(qtypeqlist,mq,qnstr,eptqidstr);//处理试题题型
288
+                    }
289
+                }
290
+            }
291
+
292
+            //试题题型分析数据
243 293
             double storerate = N_Utils.getDoubleDivideAndMulitiply(qt.getEptscore(), ePaper.getPscore());
244 294
             Map tmap = new HashMap();
245 295
             tmap.put("qtname",qt.getEptname());
246 296
             tmap.put("num",qt.getEptnum());
247 297
             tmap.put("score",qt.getEptscore());
248 298
             tmap.put("srate",storerate);
249
-            tmap.put("qns",qorderlist);
299
+            tmap.put("ques",qtypeqlist);
250 300
             typelist.add(tmap);
251 301
         }
252 302
 
253
-        //获取出所有单题和母题,进行判断区分
254
-        Map<String,List<EPaperQtypeQuestionVo>> quesMap = queslist.stream().collect(Collectors.groupingBy(EPaperQtypeQuestionVo:: getQuestionpid, Collectors.toList()));
255
-        List<EPaperQtypeQuestionVo> mquestions = new ArrayList<>();//仅存放单题和母题
256
-        for(Map.Entry<String, List<EPaperQtypeQuestionVo>> entry : quesMap.entrySet()){
257
-            if(entry.getKey().equals("000")){
258
-                for(EPaperQtypeQuestionVo dq : entry.getValue()){
259
-                    if(N_Utils.isObjectiveQuestion(dq.getCtype())){
260
-                        //判断试题是否是客观题,暂时用mctype进行标识
261
-                        dq.setMctype(111);
262
-                    }else{
263
-                        dq.setMctype(112);
264
-                    }
265
-                    mquestions.add(dq);
266
-                }
267
-            }else{
268
-                EPaperQtypeQuestionVo mq = new EPaperQtypeQuestionVo();
269
-                List<EPaperQtypeQuestionVo> sonques = entry.getValue();
270
-                int k = 0;//如果k大于1说明有小题是主观题,则母题为主观题
271
-                double score = 0;
272
-                for(EPaperQtypeQuestionVo sq : sonques){
273
-                    if(!N_Utils.isObjectiveQuestion(sq.getCtype())){
274
-                        k++;
275
-                    }
276
-                    score = N_Utils.getDoubleSum(score,sq.getScore());
277
-                }
278
-
279
-                EPaperQtypeQuestionVo qobj = sonques.get(0);
280
-                mq.setQuestionid(qobj.getQuestionpid());
281
-                mq.setComplexity(qobj.getMcomplexity());
282
-                mq.setScore(score);
283
-                if(k == 0){
284
-                    mq.setMctype(111);
285
-                }else{
286
-                    mq.setMctype(112);
287
-                }
288
-
289
-                mquestions.add(mq);
290
-            }
303
+        //进行客观题选项处理
304
+        if(N_Utils.isListNotEmpty(uplist)){
305
+            ePaperQtypeQuestionMapper.updateBatchQuestionOptionnum(uplist);
291 306
         }
292 307
 
293 308
         //试题总体分布进行分析
@@ -325,22 +340,24 @@ public class EPaperQtypeService {
325 340
             clist.add(cmap);
326 341
         }
327 342
 
328
-        //知识点
329
-        Map<String,List<Map>> pointmap =  quespoints.stream().collect(Collectors.groupingBy(item -> item.get("pointid").toString(), Collectors.toList()));
343
+        //知识点分析
330 344
         List<Map> pointlist = new ArrayList<>();
331
-        for(Map.Entry<String, List<Map>> entry : pointmap.entrySet()){
332
-            Map pm = new HashMap();
333
-            List<Map> pvo = entry.getValue();
334
-            double cscore = pvo.stream().collect(Collectors.summingDouble(item -> Double.valueOf(item.get("score").toString())));
335
-            double scorerate = N_Utils.getDoubleDivideAndMulitiply(cscore, ePaper.getPscore());
336
-            List<Integer> thlist = pvo.stream().map(item -> Integer.parseInt(item.get("order").toString())).collect(Collectors.toList());
337
-            thlist = thlist.stream().distinct().collect(Collectors.toList());
338
-            pm.put("pointid",pvo.get(0).get("pointid").toString());
339
-            pm.put("pointname",pvo.get(0).get("pointname").toString());
340
-            pm.put("score",cscore);
341
-            pm.put("srate",scorerate);
342
-            pm.put("order",thlist);
343
-            pointlist.add(pm);
345
+        if(N_Utils.isListNotEmpty(pointqlist)){
346
+            Map<String,List<QuestionOrderVo>> pointmap = pointqlist.stream().collect(Collectors.groupingBy(QuestionOrderVo::getId,Collectors.toList()));
347
+            //根据指示进行分组,
348
+            for(Map.Entry<String, List<QuestionOrderVo>> entry : pointmap.entrySet()){
349
+                List<QuestionOrderVo> pgblist = entry.getValue();
350
+                //获取知识点的总分
351
+                Double score = pgblist.stream().mapToDouble(s -> s.getScore()).sum();
352
+                Double srate = N_Utils.getDoubleDivideAndMulitiply(score,ePaper.getPscore());
353
+                Map prate = new HashMap();
354
+                prate.put("pointid",entry.getKey());
355
+                prate.put("pointname",pgblist.get(0).getName());
356
+                prate.put("score",score);
357
+                prate.put("srate",srate);
358
+                prate.put("ques",pgblist);
359
+                pointlist.add(prate);
360
+            }
344 361
         }
345 362
 
346 363
         EPaperAnalyze epa = new EPaperAnalyze();
@@ -350,11 +367,89 @@ public class EPaperQtypeService {
350 367
         epa.setComplexityjson(JSON.toJSONString(clist));//难易度分析
351 368
         epa.setPointjson(JSON.toJSONString(pointlist));//知识点分析
352 369
         ePaperAnalyzeMapper.insertUseGeneratedKeys(epa);
353
-        if(N_Utils.isListNotEmpty(uplist)){
354
-            ePaperQtypeQuestionMapper.updateBatchQuestionOptionnum(uplist);
370
+    }
371
+
372
+    //设置知识点
373
+    private void setPaperQuestionPointScore(List<QuestionOrderVo> pointqlist,List<Map> qpoints,EPaperQtypeQuestionVo dq,String[] qnstr,Integer[] eptqidstr){
374
+        if(N_Utils.isListNotEmpty(qpoints)){
375
+            if(qpoints.size() == 1){
376
+                //试题只有一个知识点
377
+                Map pointmap = qpoints.get(0);
378
+                QuestionOrderVo qpoint = new QuestionOrderVo();
379
+                qpoint.setId(pointmap.get("pointid").toString());
380
+                qpoint.setName(pointmap.get("pointname").toString());
381
+                qpoint.setOrder(dq.getQorder());
382
+                qpoint.setScore(dq.getScore());
383
+                qpoint.setQlevel(dq.getQlevel());
384
+                if(qnstr == null){
385
+                    qpoint.setQns(new String[]{dq.getQn()});
386
+                }else{
387
+                    qpoint.setQns(qnstr);
388
+                }
389
+                if(eptqidstr == null){
390
+                    qpoint.setEptqids(new Integer[]{dq.getEptqid()});
391
+                }else{
392
+                    qpoint.setEptqids(eptqidstr);
393
+                }
394
+
395
+                pointqlist.add(qpoint);
396
+            }else{
397
+                //试题有多个知识点
398
+                //计算每个知识点所占分值(平均分配)
399
+                Double[] avgps = ExamUtil.getPointAvgScore(qpoints.size(),dq.getScore());
400
+                for(int m = 0; m<qpoints.size();m++){
401
+                    Map pointmap = qpoints.get(m);
402
+                    QuestionOrderVo qpoint = new QuestionOrderVo();
403
+                    qpoint.setId(pointmap.get("pointid").toString());
404
+                    qpoint.setName(pointmap.get("pointname").toString());
405
+                    qpoint.setOrder(dq.getQorder());
406
+                    qpoint.setQlevel(dq.getQlevel());
407
+
408
+                    if(avgps.length == 2 && (m+1) == qpoints.size()){
409
+                        //不能整除分,并且是最后一个知识点
410
+                        qpoint.setScore(avgps[1]);
411
+                    }else{
412
+                        qpoint.setScore(avgps[0]);
413
+                    }
414
+
415
+                    //题号集合
416
+                    if(qnstr == null){
417
+                        qpoint.setQns(new String[]{dq.getQn()});
418
+                    }else{
419
+                        qpoint.setQns(qnstr);
420
+                    }
421
+                    //试卷中试题id集合
422
+                    if(eptqidstr == null){
423
+                        qpoint.setEptqids(new Integer[]{dq.getEptqid()});
424
+                    }else{
425
+                        qpoint.setEptqids(eptqidstr);
426
+                    }
427
+                    pointqlist.add(qpoint);
428
+                }
429
+            }
355 430
         }
356 431
     }
357 432
 
433
+    private void setPaperQuestionQtypeScore(List<QuestionOrderVo> qtypelist,EPaperQtypeQuestionVo dq,String[] qnstr,Integer[] eptqidstr){
434
+        QuestionOrderVo qtype = new QuestionOrderVo();
435
+        qtype.setId(dq.getQtypeid());
436
+        qtype.setName(dq.getQtypename());
437
+        qtype.setOrder(dq.getQorder());
438
+        qtype.setScore(dq.getScore());
439
+        qtype.setQlevel(dq.getQlevel());
440
+        if(qnstr == null){
441
+            qtype.setQns(new String[]{dq.getQn()});
442
+        }else{
443
+            qtype.setQns(qnstr);
444
+        }
445
+        if(eptqidstr == null){
446
+            qtype.setEptqids(new Integer[]{dq.getEptqid()});
447
+        }else{
448
+            qtype.setEptqids(eptqidstr);
449
+        }
450
+
451
+        qtypelist.add(qtype);
452
+    }
358 453
     //保存试卷分析--附件
359 454
     private void savePaperAnalyzeForFj(EPaper ePaper,List<EPaperQtype> fjtypelist,List<EPaperQtypeQuestion> queslist){
360 455
         //保存之前先清除之前的试卷分析

+ 0
- 1
sexam/src/main/java/com/xhkjedu/sexam/service/report/EReportGenerateService.java Просмотреть файл

@@ -27,7 +27,6 @@ import com.xhkjedu.sexam.model.reportstu.ERStudentQtype;
27 27
 import com.xhkjedu.sexam.model.reportstu.ERstudent;
28 28
 import com.xhkjedu.sexam.model.reportstu.ERstudentPoint;
29 29
 import com.xhkjedu.sexam.utils.ExamUtil;
30
-import com.xhkjedu.sexam.vo.paper.EPaperQPointVo;
31 30
 import com.xhkjedu.sexam.vo.paper.EPaperQtypeQuestionVo;
32 31
 import com.xhkjedu.sexam.vo.paper.EPaperQtypeVo;
33 32
 import com.xhkjedu.sexam.vo.report.ERClassScoreVo;

+ 25
- 0
sexam/src/main/java/com/xhkjedu/sexam/utils/ExamUtil.java Просмотреть файл

@@ -1,5 +1,6 @@
1 1
 package com.xhkjedu.sexam.utils;
2 2
 
3
+import com.alibaba.fastjson.JSON;
3 4
 import com.xhkjedu.utils.N_Utils;
4 5
 import lombok.extern.slf4j.Slf4j;
5 6
 
@@ -182,4 +183,28 @@ public class ExamUtil {
182 183
             return thiscount;
183 184
         }
184 185
     }
186
+
187
+    /**
188
+     * @Description 分值平均后得到的值,如果整除返回数组元素1,未整除返回元素数量2
189
+     * @Param [num, score] 数量,分值
190
+     * @Return java.lang.Double[] 第一个未平均分值,第二个值为最后一个数的分值
191
+     * @Author wn
192
+     * @Date 2022/8/18 11:07
193
+     **/
194
+    public static Double[] getPointAvgScore(int num,Double score){
195
+        BigDecimal bScore = new BigDecimal(Double.toString(score));
196
+        BigDecimal bNum = new BigDecimal(Integer.toString(num));
197
+
198
+        BigDecimal avg = bScore.divide(bNum, 1, BigDecimal.ROUND_DOWN);
199
+        BigDecimal avgAllScore = avg.multiply(bNum);//平均分乘以数量得到的分值
200
+        if(bScore.equals(avgAllScore)){
201
+            //说明整除
202
+            return new Double[]{avg.doubleValue()};
203
+        }else{
204
+            //未整除,计算最后剩余分值,subtract总分减去平均分和数量的积
205
+            // 平均分加上剩余得分得到最后一个分值
206
+            BigDecimal lastScore = avg.add(bScore.subtract(avgAllScore));
207
+            return new Double[]{avg.doubleValue(),lastScore.doubleValue()};
208
+        }
209
+    }
185 210
 }

+ 0
- 19
sexam/src/main/java/com/xhkjedu/sexam/vo/paper/EPaperQPointVo.java Просмотреть файл

@@ -1,19 +0,0 @@
1
-package com.xhkjedu.sexam.vo.paper;
2
-
3
-import lombok.Data;
4
-
5
-/**
6
- * @Description 知识点
7
- * @Author WN
8
- * Date 2022/7/19 10:03
9
- **/
10
-@Data
11
-public class EPaperQPointVo {
12
-    private String pointid;//知识点id
13
-    private String pointname;//知识点名称
14
-
15
-    private String questionid;//试题id
16
-    private Integer eptqid;//试题id
17
-    private double score;//分值
18
-    private Integer qorder;//试题排序
19
-}

+ 0
- 17
sexam/src/main/java/com/xhkjedu/sexam/vo/paper/QuestionOptionVo.java Просмотреть файл

@@ -1,17 +0,0 @@
1
-package com.xhkjedu.sexam.vo.paper;
2
-
3
-import lombok.Data;
4
-
5
-import java.util.List;
6
-
7
-/**
8
- * @Description 阅读理解和完形填空
9
- * @Author WN
10
- * Date 2022/7/26 15:36
11
- **/
12
-@Data
13
-public class QuestionOptionVo {
14
-    private String sqstem; //题干
15
-
16
-    private List<String> sqoptions;//选项
17
-}

+ 30
- 0
sexam/src/main/java/com/xhkjedu/sexam/vo/paper/QuestionOrderVo.java Просмотреть файл

@@ -0,0 +1,30 @@
1
+package com.xhkjedu.sexam.vo.paper;
2
+
3
+import lombok.Data;
4
+
5
+/**
6
+ * @Description 试题题号
7
+ * @Author WN
8
+ * Date 2022/8/18 14:01
9
+ **/
10
+@Data
11
+public class QuestionOrderVo {
12
+
13
+    private String id;
14
+
15
+    private String name;
16
+
17
+    //试题类型1单题2母题
18
+    private Integer qlevel;
19
+
20
+    private Double score;//试题分值
21
+
22
+    //试题题号(单题、母题) (子题不占题号)
23
+    private Integer order;
24
+
25
+    //试题题号对应子题在试卷中id(单题时数组长度为1)
26
+    private Integer[] eptqids;
27
+
28
+    //试题题号对应子题在试卷中显示的题号(单题时数组长度为1)
29
+    private String[] qns;
30
+}

+ 0
- 7
sexam/src/test/java/com/xhkjedu/sexam/SexamApplicationTests.java Просмотреть файл

@@ -14,17 +14,10 @@ import java.util.Map;
14 14
 
15 15
 @SpringBootTest
16 16
 class SexamApplicationTests {
17
-    @Resource
18
-    private EPaperQtypeService ePaperQtypeService;
19 17
 
20 18
     @Test
21 19
     void contextLoads() {
22
-        EPaper ePaper = new EPaper();
23
-        ePaper.setEpid(289);
24
-        ePaper.setPnum(7);
25
-        ePaper.setPscore(80.0);
26 20
 
27
-        ePaperQtypeService.savePaperAnalyzeForQuestion(ePaper);
28 21
     }
29 22
 
30 23
 }

+ 15
- 2
sstudy/src/main/java/com/xhkjedu/sstudy/service/question/UserBasketService.java Просмотреть файл

@@ -65,6 +65,7 @@ public class UserBasketService {
65 65
         //英语学科时处理听力题
66 66
         if(sujectname.contains("英语")){
67 67
             List<QuestionVo> hearqs  = new ArrayList<>();
68
+            List<UserBasketVo> rtnbaskets = new ArrayList<>();
68 69
             for (UserBasketVo b : baskets) {
69 70
                 List<QuestionVo> questions = b.getQuestions();
70 71
 
@@ -74,11 +75,23 @@ public class UserBasketService {
74 75
 
75 76
                     questions = questions.stream().filter( o -> o.getHashear() ==0).collect(Collectors.toList());
76 77
                 }
77
-                b.setPtnum(questions.size());
78
+                /*b.setPtnum(questions.size());
78 79
                 Double scoretotal = questions.stream().collect(Collectors.summingDouble(QuestionVo::getScore));
79 80
                 b.setPtscore(scoretotal);
80
-                b.setQuestions(questions);
81
+                b.setQuestions(questions);*/
82
+
83
+                if(questions.size() > 0){
84
+                    UserBasketVo bn = new UserBasketVo();
85
+                    bn.setQtypeid(b.getQtypeid());
86
+                    bn.setQtypename(b.getQtypename());
87
+                    bn.setPtnum(questions.size());
88
+                    Double ptscore = questions.stream().collect(Collectors.summingDouble(QuestionVo::getScore));
89
+                    bn.setPtscore(ptscore);
90
+                    bn.setQuestions(questions);
91
+                    rtnbaskets.add(bn);
92
+                }
81 93
             }
94
+            baskets = new ArrayList<>(rtnbaskets);
82 95
 
83 96
             if(N_Utils.isListNotEmpty(hearqs)){
84 97
                 UserBasketVo tlvo = new UserBasketVo();

Загрузка…
Отмена
Сохранить