zhouj1203@hotmail.com 1 年之前
父节点
当前提交
a32822533a
共有 2 个文件被更改,包括 6 次插入2 次删除
  1. 5 1
      TEAMModelOS.FunctionV4/CosmosDB/TriggerExam.cs
  2. 1 1
      TEAMModelOS/Controllers/Common/ArtController.cs

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

@@ -451,9 +451,13 @@ namespace TEAMModelOS.FunctionV4
                                         periodId = info.period.id,
                                         periodId = info.period.id,
                                         subjectId = "subject_exam"
                                         subjectId = "subject_exam"
                                     };
                                     };
+                                    //作答合格率
+                                    var sta = examClassResults.SelectMany(x => x.status).ToList();
+                                    var ansCount = sta.Where(x => x == 0).ToList();
+                                    var persent = ansCount.Count * 1.0 / sta.Count * 100;
                                     var period = sc.period.Where(x => x.id.Equals(info.period.id)).FirstOrDefault();
                                     var period = sc.period.Where(x => x.id.Equals(info.period.id)).FirstOrDefault();
                                     //获取学期信息
                                     //获取学期信息
-                                    if (null != period) {
+                                    if (null != period && persent >= 60) {
                                         var (currSemester, studyYear, date, nextSemester) = SchoolService.GetSemester(period, info.startTime);
                                         var (currSemester, studyYear, date, nextSemester) = SchoolService.GetSemester(period, info.startTime);
                                         //获取学生信息
                                         //获取学生信息
                                         (List<RMember> rmembers, List<RGroupList> groups) = await GroupListService.GetMemberByListids(_coreAPIHttpService, client, _dingDing, info.classes, info.school);
                                         (List<RMember> rmembers, List<RGroupList> groups) = await GroupListService.GetMemberByListids(_coreAPIHttpService, client, _dingDing, info.classes, info.school);

+ 1 - 1
TEAMModelOS/Controllers/Common/ArtController.cs

@@ -595,7 +595,7 @@ namespace TEAMModelOS.Controllers.Common
                         }
                         }
                         else
                         else
                         {
                         {
-                            string queryScore = $" select c.id from c where c.artId  = {art.id})";
+                            string queryScore = $" select c.id from c where c.artId  = '{art.id})'";
                             List<string> ids = new();
                             List<string> ids = new();
                             await foreach (var item in client.GetContainer(Constant.TEAMModelOS, Constant.Student).GetItemQueryStreamIterator
                             await foreach (var item in client.GetContainer(Constant.TEAMModelOS, Constant.Student).GetItemQueryStreamIterator
                                 (queryText: queryScore, requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey("ArtRecord") }))
                                 (queryText: queryScore, requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey("ArtRecord") }))