瀏覽代碼

update 错题调整

zhouj1203@hotmail.com 1 年之前
父節點
當前提交
a7e351ea52
共有 1 個文件被更改,包括 15 次插入5 次删除
  1. 15 5
      TEAMModelOS.FunctionV4/CosmosDB/TriggerExam.cs

+ 15 - 5
TEAMModelOS.FunctionV4/CosmosDB/TriggerExam.cs

@@ -1610,11 +1610,11 @@ namespace TEAMModelOS.FunctionV4
                         }
                     }*/
 
-                    double[] point = StringHelper.ListTodouble(result.paper.point);
+                   /* double[] point = StringHelper.ListTodouble(result.paper.point);
                     double[,] res = StringHelper.ListToDouble(result.studentScores);
-                    var cdm = new ClouDASMatrix(res, point);
+                    var cdm = new ClouDASMatrix(res, point);*/
                     //需要努力的题目
-                    var ss = cdm.StriveTopic;
+                    //var ss = cdm.StriveTopic;
                     int n = 0;
                     List<Task<ItemResponse<ErrorItems>>> task_error = new();
                     List<ErrorItems> errors = new();
@@ -1631,9 +1631,19 @@ namespace TEAMModelOS.FunctionV4
                             subjectId = result.subjectId,
                             time = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
                         };
+                        int index_stu = result.studentIds.IndexOf(sIds);
                         //顺序学生错题的索引
-                        int[] item_index = ss[n];
-                        foreach (var item in item_index)
+                        var itemScore = result.studentScores[index_stu];
+                        List<int> index = new();
+                        int index_item = 0;
+                        foreach (var sc in itemScore) {
+                            if (sc == 0) {
+                                index.Add(index_item+1);
+                            }
+                            index_item++;
+                        }
+                        //int[] item_index = ss[n];
+                        foreach (var item in index)
                         {
                             Items items = new()
                             {