CrazyIter_Bin 1 éve
szülő
commit
c77ccb61a1

+ 16 - 1
TEAMModelOS.SDK/Models/Service/LessonService.cs

@@ -236,8 +236,13 @@ namespace TEAMModelOS.SDK.Models.Service
                 int interactCount = -1;
                 int interactCount = -1;
                 //抢权作答的学生
                 //抢权作答的学生
                 List<int > buzzClients= new List<int>();
                 List<int > buzzClients= new List<int>();
+
+
                 if (iRSDatas.IsNotEmpty()) {
                 if (iRSDatas.IsNotEmpty()) {
-                    interactCount= iRSDatas.Where(z => z.isBuzz==false).Select(v => v.clientAnswers).Select(z=>z.Keys).Count();
+                    var keys = iRSDatas.Where(z => z.isBuzz==false).Select(v => v.clientAnswers).SelectMany(z => z.Keys).ToList();
+                    var values = iRSDatas.Where(z => z.isBuzz==false).Select(v => v.clientAnswers).SelectMany(z => z.Values).ToList();
+
+                    interactCount= keys.Count();
                     var bclients = iRSDatas.Where(z => z.buzzClients.IsNotEmpty()).SelectMany(v => v.buzzClients);
                     var bclients = iRSDatas.Where(z => z.buzzClients.IsNotEmpty()).SelectMany(v => v.buzzClients);
                     if (bclients!=null && bclients.Count()>0) {
                     if (bclients!=null && bclients.Count()>0) {
                         foreach (var bc in bclients) {
                         foreach (var bc in bclients) {
@@ -316,8 +321,18 @@ namespace TEAMModelOS.SDK.Models.Service
                     var buzIds = buzzClients.FindAll(z => z==x.seatID);
                     var buzIds = buzzClients.FindAll(z => z==x.seatID);
                     if (buzIds.IsNotEmpty()) {
                     if (buzIds.IsNotEmpty()) {
                         stuInteractJoin=stuInteractJoin+buzIds.Count;
                         stuInteractJoin=stuInteractJoin+buzIds.Count;
+                        if (stuInteractCount>-1)
+                        {
+                            stuInteractCount = stuInteractCount + buzIds.Count;
+                        }
+                        else {
+                            stuInteractCount = buzIds.Count;
+                        }
 
 
                     }
                     }
+                    //普通作答的互动
+
+
                     if (record != null)
                     if (record != null)
                     {
                     {
                         if (clientSummaryList != null)
                         if (clientSummaryList != null)

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 998 - 0
TEAMModelOS.TEST/Program.cs


+ 19 - 16
TEAMModelOS/Controllers/Student/OverallEducationController.cs

@@ -570,13 +570,13 @@ namespace TEAMModelOS.Controllers
                 var examData =  await ExamService.getGradeScore(_coreAPIHttpService, _dingDing,_azureCosmos.GetCosmosClient(), grade_classes.Select(x=>x.id).ToList(), $"{_periodId}", school.id,   semesterData.date.ToUnixTimeMilliseconds(), semesterData.nextSemester.ToUnixTimeMilliseconds());
                 var examData =  await ExamService.getGradeScore(_coreAPIHttpService, _dingDing,_azureCosmos.GetCosmosClient(), grade_classes.Select(x=>x.id).ToList(), $"{_periodId}", school.id,   semesterData.date.ToUnixTimeMilliseconds(), semesterData.nextSemester.ToUnixTimeMilliseconds());
               
               
                 var groupExam= examData.GroupBy(x => x.name).Select(y => new { key = y.Key, list = y });
                 var groupExam= examData.GroupBy(x => x.name).Select(y => new { key = y.Key, list = y });
-                List<Exam3Score> exam3Scores = new List<Exam3Score>();
+                List<ExamScore> exam3Scores = new List<ExamScore>();
                 foreach (var item in examData) {
                 foreach (var item in examData) {
 
 
                     if (!string.IsNullOrWhiteSpace($"{_studentId}"))
                     if (!string.IsNullOrWhiteSpace($"{_studentId}"))
                     {
                     {
                         var student =  students.Find(x => x.id.Equals($"{_studentId}"));
                         var student =  students.Find(x => x.id.Equals($"{_studentId}"));
-                        Exam3Score exam3Score = new Exam3Score();
+                        ExamScore exam3Score = new ExamScore();
                         exam3Score.name = item.name;
                         exam3Score.name = item.name;
                         exam3Score.gradeScore=item.total;
                         exam3Score.gradeScore=item.total;
                         exam3Score.xdatas= new List<CodeDouble> 
                         exam3Score.xdatas= new List<CodeDouble> 
@@ -596,7 +596,7 @@ namespace TEAMModelOS.Controllers
                         if (isClass)
                         if (isClass)
                         {
                         {
                             Class clazz = classes.First();
                             Class clazz = classes.First();
-                            Exam3Score exam3Score = new Exam3Score();
+                            ExamScore exam3Score = new ExamScore();
                             exam3Score.name = item.name;
                             exam3Score.name = item.name;
                             exam3Score.gradeScore=item.total;
                             exam3Score.gradeScore=item.total;
                             exam3Score.classScore=item.classMore.Find(x => x.classId.Equals(clazz.id)).average;
                             exam3Score.classScore=item.classMore.Find(x => x.classId.Equals(clazz.id)).average;
@@ -605,7 +605,7 @@ namespace TEAMModelOS.Controllers
                         }
                         }
                         else
                         else
                         {
                         {
-                            Exam3Score exam3Score = new Exam3Score();
+                            ExamScore exam3Score = new ExamScore();
                             exam3Score.name = item.name;
                             exam3Score.name = item.name;
                             exam3Score.gradeScore=item.total;
                             exam3Score.gradeScore=item.total;
                             exam3Score.classScore=-1;
                             exam3Score.classScore=-1;
@@ -614,7 +614,7 @@ namespace TEAMModelOS.Controllers
                         }
                         }
                     }
                     }
                 }
                 }
-                var newExam3Scores = exam3Scores.Select(x => new { 
+                var examScores = exam3Scores.Select(x => new { 
                     x.name,
                     x.name,
                     x.gradeScore,
                     x.gradeScore,
                     x.classScore,
                     x.classScore,
@@ -624,14 +624,15 @@ namespace TEAMModelOS.Controllers
                         z.value
                         z.value
                     })
                     })
                 });
                 });
-                dynamic studentInClassAndGrade = new ExpandoObject();
+                //学生统计数据
+                dynamic studentStatistics = new ExpandoObject();
                 if (!string.IsNullOrWhiteSpace($"{_studentId}"))
                 if (!string.IsNullOrWhiteSpace($"{_studentId}"))
                 {
                 {
-                    List<ExamDimensionScore> examScores= new List<ExamDimensionScore>();
+                    List<ExamDimensionScore> stuExamScores= new List<ExamDimensionScore>();
                     exam3Scores.ForEach(z => {
                     exam3Scores.ForEach(z => {
-                        var stu =  z.xdatas.Find(z => z.code.Equals($"{_semesterId}"));
+                        var stu =  z.xdatas.Find(z => z.code.Equals($"{_studentId}"));
                         if (stu!=null) {
                         if (stu!=null) {
-                            examScores.Add(new ExamDimensionScore { examName=z.name, classScore=z.classScore,gradeScore=z.gradeScore,stuScore=stu.value });
+                            stuExamScores.Add(new ExamDimensionScore { examName=z.name, classScore=z.classScore,gradeScore=z.gradeScore,stuScore=stu.value });
                         }
                         }
                     });
                     });
                     var student = students.Find(z => z.id.Equals($"{_studentId}"));
                     var student = students.Find(z => z.id.Equals($"{_studentId}"));
@@ -640,7 +641,7 @@ namespace TEAMModelOS.Controllers
                     {
                     {
                         studentDimension=new StudentDimensionScore
                         studentDimension=new StudentDimensionScore
                         {
                         {
-                            examScores=examScores,
+                            stuExamScores=stuExamScores,
                             art=60,
                             art=60,
                             classId=student.classId,
                             classId=student.classId,
                             className=student.classId,
                             className=student.classId,
@@ -663,9 +664,11 @@ namespace TEAMModelOS.Controllers
                             virtue=60,
                             virtue=60,
                         };
                         };
                     }
                     }
-                    studentDimension.examScores= examScores;
+                    else {
+                        studentDimension.stuExamScores= stuExamScores;
+                    }
                     var classDimension = classDimensions.Find(z => z.classId.Equals(student.classId));
                     var classDimension = classDimensions.Find(z => z.classId.Equals(student.classId));
-                    studentInClassAndGrade= new { studentDimension, inClass = classDimension, inGrade = new { grade_gscore_avg, grade_pscore_avg, grade_tscore_avg } };
+                    studentStatistics= new { studentDimension, inClass = classDimension, inGrade = new { grade_gscore_avg, grade_pscore_avg, grade_tscore_avg } };
                     studentOverallEducation = overallEducations.FindAll(x => x.studentId.Equals($"{_studentId}")).FirstOrDefault();
                     studentOverallEducation = overallEducations.FindAll(x => x.studentId.Equals($"{_studentId}")).FirstOrDefault();
                     if (studentOverallEducation==null)
                     if (studentOverallEducation==null)
                     {
                     {
@@ -676,7 +679,7 @@ namespace TEAMModelOS.Controllers
                 #endregion
                 #endregion
                 return Ok(new
                 return Ok(new
                 {
                 {
-                    newExam3Scores,
+                    examScores,
                     sports_count60,
                     sports_count60,
                     sports_count90,
                     sports_count90,
                     labour_count60,
                     labour_count60,
@@ -716,7 +719,7 @@ namespace TEAMModelOS.Controllers
                     subject_painting_rate60,
                     subject_painting_rate60,
                     studentCount = students.Count(),
                     studentCount = students.Count(),
                     studentOverallEducation,
                     studentOverallEducation,
-                    studentInClassAndGrade
+                    studentStatistics
                 });
                 });
             }
             }
             catch (Exception ex)
             catch (Exception ex)
@@ -726,7 +729,7 @@ namespace TEAMModelOS.Controllers
             }
             }
             return Ok();
             return Ok();
         }
         }
-        public class Exam3Score { 
+        public class ExamScore { 
 
 
             public double gradeScore { get; set; }
             public double gradeScore { get; set; }
             public double classScore { get; set; }
             public double classScore { get; set; }
@@ -783,7 +786,7 @@ namespace TEAMModelOS.Controllers
         }
         }
         public class StudentDimensionScore
         public class StudentDimensionScore
         {
         {
-            public List<ExamDimensionScore> examScores { get; set; } = new List<ExamDimensionScore>();
+            public List<ExamDimensionScore> stuExamScores { get; set; } = new List<ExamDimensionScore>();
             public string className { get; set; }
             public string className { get; set; }
             public string classId { get; set; }
             public string classId { get; set; }
             public string studentId { get; set; }
             public string studentId { get; set; }