liqk vor 3 Jahren
Ursprung
Commit
e1f9c148fc

+ 1 - 9
TEAMModelOS.SDK/Models/Cosmos/Common/Scoring.cs

@@ -71,15 +71,7 @@ namespace TEAMModelOS.SDK.Models.Cosmos.Common
 
 
             }
             }
         }
         }
-        public int isArb { get {
-                if (flag)
-                {
-                    return 0;
-                }
-                else {
-                    return 1;
-                }
-            } }
+        public int isArb { get; set; } = 0;
 
 
     }
     }
     public class Info { 
     public class Info { 

+ 25 - 6
TEAMModelOS/Controllers/Common/ExamController.cs

@@ -2721,6 +2721,7 @@ namespace TEAMModelOS.Controllers
             if (null != scoring)
             if (null != scoring)
             {
             {
                 scoring.scores[sin] = score.GetDouble() ;
                 scoring.scores[sin] = score.GetDouble() ;
+                scoring.items[sin].isArb = 1;
                 await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryIterator<ExamClassResult>(
                 await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryIterator<ExamClassResult>(
                     queryText: $"select value(c) from c where c.examId = '{scoring.examId}' and c.subjectId = '{scoring.subjectId}'",
                     queryText: $"select value(c) from c where c.examId = '{scoring.examId}' and c.subjectId = '{scoring.subjectId}'",
                     requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"ExamClassResult-{code}") }))
                     requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"ExamClassResult-{code}") }))
@@ -2793,18 +2794,36 @@ namespace TEAMModelOS.Controllers
                     List<(string subjectId, int count)> arbs = new List<(string subjectId, int count)>();
                     List<(string subjectId, int count)> arbs = new List<(string subjectId, int count)>();
                     List<(string subjectId, int count)> tarbs = new List<(string subjectId, int count)>();
                     List<(string subjectId, int count)> tarbs = new List<(string subjectId, int count)>();
                     List<(string subjectId, int count)> cs = new List<(string subjectId, int count)>();
                     List<(string subjectId, int count)> cs = new List<(string subjectId, int count)>();
+                    int qsCount = 0;
+                    int tqsCount = 0;
+                    int arbCount = 0;
+                    int tarbCount = 0;
                     foreach (SDK.Models.Cosmos.Common.Scoring ss in attr)
                     foreach (SDK.Models.Cosmos.Common.Scoring ss in attr)
                     {
                     {
                         List<Qs> qs = ss.qs.Where(s => !string.IsNullOrEmpty(s.err)).ToList();
                         List<Qs> qs = ss.qs.Where(s => !string.IsNullOrEmpty(s.err)).ToList();
+                        if (qs.Count > 0)
+                        {
+                            qsCount++;
+                        }
                         List<Qs> tqs = ss.qs.Where(s => !string.IsNullOrEmpty(s.improve)).ToList();
                         List<Qs> tqs = ss.qs.Where(s => !string.IsNullOrEmpty(s.improve)).ToList();
-                        List<Item> arb = ss.items.Where(s => s.isArb == 1).ToList();
-                        List<Item> tarb = ss.items.Where(s => s.isArb == 1 && s.flag == true).ToList();
+                        if (tqs.Count > 0)
+                        {
+                            tqsCount++;
+                        }
+                        List<Item> arb = ss.items.Where(s => s.flag == false).ToList();
+                        if (arb.Count > 0) {
+                            arbCount++;
+                        }
+                        List<Item> tarb = ss.items.Where(s => s.isArb == 1 && s.flag == false).ToList();
+                        if (tarb.Count > 0) {
+                            tarbCount++;
+                        }
                         bool flag = ss.scores.Exists(s => s == -1);
                         bool flag = ss.scores.Exists(s => s == -1);
                         if (!flag) cs.Add((ss.subjectId, 1));
                         if (!flag) cs.Add((ss.subjectId, 1));
-                        ps.Add((ss.subjectId, qs.Count));
-                        tps.Add((ss.subjectId, tqs.Count));
-                        arbs.Add((ss.subjectId, arb.Count));
-                        tarbs.Add((ss.subjectId, tarb.Count));
+                        ps.Add((ss.subjectId, qsCount));
+                        tps.Add((ss.subjectId, tqsCount));
+                        arbs.Add((ss.subjectId, arbCount));
+                        tarbs.Add((ss.subjectId, tarbCount));
                     }
                     }