CrazyIter_Bin 9 meses atrás
pai
commit
48f24b89f8

+ 61 - 32
TEAMModelOS.Extension/HTEX.Test/Controllers/LessonRecordController.cs

@@ -259,7 +259,7 @@ namespace HTEX.Test.Controllers
                         var studentLessonData = studentLessonDatas.Find(x => x.seatID!.Equals($"{mbr}"));
                         if (studentLessonData!=null)
                         {
-                            studentLessonData.interactRecords.Add(new InteractRecord() 
+                            studentLessonData.interactRecord.interactRecords.Add(new ItemRecord() 
                             {
                                 resultWeight = InteractWeight.TT,
                                 resultType="TT",
@@ -358,14 +358,14 @@ namespace HTEX.Test.Controllers
                         for (int index = 0; index< clientAnswers[0].Count; index++)
                         {
                             //index  代表学生下标
-                            List<InteractRecord> interactRecords = new List<InteractRecord>();
+                            List<ItemRecord> interactRecords = new List<ItemRecord>();
                             if (clientAnswers.Count==1)
                             {
                                 //即问即答
                                 interactType = "PopQuesLoad";
                                 var ans0 = clientAnswers[0][index];
                                 var IS0 = GetInteractResultHasAnswer(answers, ans0, objective,type);
-                                interactRecords.Add(new InteractRecord()
+                                interactRecords.Add(new ItemRecord()
                                 {
                                     resultWeight = IS0.weight,
                                     resultType=IS0.reultType,
@@ -378,7 +378,7 @@ namespace HTEX.Test.Controllers
                                 interactType="ReAtmpAnsStrt";
                                 var ans1 = clientAnswers[1][index];
                                 var IS1 = GetInteractResultHasAnswer(answers, ans1, objective,type);
-                                interactRecords.Add(new InteractRecord()
+                                interactRecords.Add(new ItemRecord()
                                 {
                                     resultWeight = IS1.weight,
                                     resultType=IS1.reultType,
@@ -391,14 +391,14 @@ namespace HTEX.Test.Controllers
                                 interactType="TeAtmpAnsStrt";
                                 var ans2 = clientAnswers[2][index];
                                 var IS2 = GetInteractResultHasAnswer(answers, ans2, objective,type);
-                                interactRecords.Add(new InteractRecord()
+                                interactRecords.Add(new ItemRecord()
                                 {
                                     resultWeight = IS2.weight,
                                     resultType=IS2.reultType,
                                     interactType= interactType
                                 });
                             }
-                            studentLessonDatas[index].interactRecords.AddRange(interactRecords);
+                            studentLessonDatas[index].interactRecord.interactRecords.AddRange(interactRecords);
                         }
 
                     }
@@ -408,31 +408,31 @@ namespace HTEX.Test.Controllers
                 {
                     interactType = "BuzrAns";
                     //处理参与抢权的
-                    Dictionary<string, InteractRecord> buzzParticipants = new Dictionary<string, InteractRecord>();
+                    Dictionary<string, ItemRecord> buzzParticipants = new Dictionary<string, ItemRecord>();
                     foreach (var buzzParticipant in irsDataPage.buzzParticipants)
                     {
                         var studentData = studentLessonDatas.Find(x => x.seatID!.Equals(buzzParticipant));
                         if (studentData != null)
                         {
-                            buzzParticipants[buzzParticipant]=new InteractRecord() { resultWeight = InteractWeight.T1, interactType= interactType };
+                            buzzParticipants[buzzParticipant]=new ItemRecord() { resultWeight = InteractWeight.T1, interactType= interactType };
                         }
                     }
                     //处理抢权成功的
                     foreach (var buzzClient in irsDataPage.buzzClients)
                     {
-                        buzzParticipants[buzzClient]=new InteractRecord() { resultWeight = InteractWeight.TT, interactType= interactType };
+                        buzzParticipants[buzzClient]=new ItemRecord() { resultWeight = InteractWeight.TT, interactType= interactType };
                     }
                     foreach (var studentLessonData in studentLessonDatas)
                     {
                         if (buzzParticipants.ContainsKey(studentLessonData.seatID!))
                         {
                             //处理已经有抢权结果的数据
-                            studentLessonData.interactRecords.Add(buzzParticipants[studentLessonData.seatID!]);
+                            studentLessonData.interactRecord.interactRecords.Add(buzzParticipants[studentLessonData.seatID!]);
                         }
                         else
                         {
                             //处理未参与抢权的
-                            studentLessonData.interactRecords.Add(new InteractRecord() { resultWeight = InteractWeight.T0, interactType = interactType });
+                            studentLessonData.interactRecord.interactRecords.Add(new ItemRecord() { resultWeight = InteractWeight.T0, interactType = interactType });
                         }
                     }
                 }
@@ -707,7 +707,7 @@ namespace HTEX.Test.Controllers
                                 {
                                     StudentExamRecord studentExam = new StudentExamRecord();
                                     var studentScore = item.studentScores[index];
-                                    List<InteractRecord> answerRecords = new List<InteractRecord>();
+                                    List<ItemRecord> answerRecords = new List<ItemRecord>();
                                     //题目下标
                                     int itemIndex = 0;
                                     stu.ForEach(ans =>
@@ -715,12 +715,12 @@ namespace HTEX.Test.Controllers
                                         bool objective = objectiveTypes.Contains(examData.exam.papers[0].type[itemIndex]);
                                         var score =  examData.exam.papers[0].point[itemIndex];
                                         string type = examData.exam.papers[0].type[itemIndex]; 
-                                        var res= GetInteractResultHasAnswer(answers[itemIndex], ans, objective, type);
-                                        InteractRecord interactRecord = new InteractRecord()
+                                       // var res= GetInteractResultHasAnswer(answers[itemIndex], ans, objective, type);
+                                        ItemRecord interactRecord = new ItemRecord()
                                         {
                                             interactType="SPQStrt",//类型
-                                            resultType=res.reultType,//作答结果类型
-                                            resultWeight=res.weight,//得分权重
+                                           // resultType=res.reultType,//作答结果类型
+                                            //resultWeight=res.weight,//得分权重
                                             criterion= score,//标准分
                                             interactScore= studentScore[itemIndex]//得分
                                         };
@@ -749,9 +749,13 @@ namespace HTEX.Test.Controllers
         /// <param name="coworkDatas"></param>
         /// <param name="studentLessonDatas"></param>
         /// <returns></returns>
-        private async Task<dynamic> GetCoworkData(LessonRecord lessonRecord, LessonBase lessonBase, TimeLineData timeLineData, List<CoworkData> coworkDatas, List<StudentLessonData> studentLessonDatas)
+        private   List<StudentLessonData> GetCoworkData(LessonRecord lessonRecord, LessonBase lessonBase, TimeLineData timeLineData, List<CoworkData> coworkDatas, List<StudentLessonData> studentLessonDatas)
         {
-            return Ok(lessonRecord);
+            foreach (var coworkData in coworkDatas) 
+            {
+                
+            }
+            return studentLessonDatas;
         }
 
         /// <summary>
@@ -783,14 +787,7 @@ namespace HTEX.Test.Controllers
         }
     }
 
-    public class LessonRecordData
-    {
-        /// <summary>
-        /// 互动次数
-        /// </summary>
-        public int interactCount;
-        public List<StudentLessonData> data { get; set; } = new List<StudentLessonData>();
-    }
+    
 
 
     /// <summary>
@@ -830,10 +827,28 @@ namespace HTEX.Test.Controllers
         /// 小组下标 ,暂不使用
         /// </summary>
         //public int groupIndex { get; set; } = -1;
+       
         /// <summary>
+        /// 学生评测记录相关
+        /// </summary>
+        public List<StudentExamRecord> examRecords { get; set; } = new List<StudentExamRecord>();
+        public StudentCoworkRecord  coworkRecord { get; set; } = new StudentCoworkRecord();
+        /// <summary>
+        /// 互动记录
+        /// </summary>
+        public   StudentInteractRecord interactRecord { get; set; } = new StudentInteractRecord();
+
+    }
+
+    /// <summary>
+    /// 学生协作记录
+    /// </summary>
+    public class StudentInteractRecord
+    {
+     /// <summary>
         /// 学生专属的互动次数,单独设置此字段,因为存在挑人的情况,需要单独设置
         /// </summary>
-        public int interactCount { get; set; }
+        public int interactRate { get; set; }
         /// <summary>
         /// 互动积分
         /// </summary>
@@ -843,11 +858,25 @@ namespace HTEX.Test.Controllers
         /// -1表示本次互动未统计分数,0表示本次互动答错为0,大于0 的分数表示本次互动打对为相应的分数。  该分数用于统计成果。
         /// 互动积分记录[-1,0,10]
         /// </summary>
-        public List<InteractRecord> interactRecords { get; set; } = new List<InteractRecord>();
+        public List<ItemRecord> interactRecords { get; set; } = new List<ItemRecord>();
+    }
+    /// <summary>
+    /// 学生协作记录
+    /// </summary>
+    public class StudentCoworkRecord 
+    {
+        /// <summary>
+        /// 协作参与率
+        /// </summary>
+        public double coworkRate { get; set; }
         /// <summary>
-        /// 学生评测记录相关
+        /// 协作得分
         /// </summary>
-        public List<StudentExamRecord> examRecords { get; set; } = new List<StudentExamRecord>();
+        public double coworkScore { get; set; }
+        /// <summary>
+        /// 协作参与记录
+        /// </summary>
+        public List<ItemRecord> itemRecords /*{ get; set; }*/ = new List<ItemRecord>();
     }
     /// <summary>
     /// 学生课中评测记录
@@ -878,10 +907,10 @@ namespace HTEX.Test.Controllers
         /// 暂不计算,取消{ get; set; }
         /// 每个题的得分情况
         /// </summary>
-        public List<InteractRecord> itemRecords /*{ get; set; }*/ = new List<InteractRecord>();
+        public List<ItemRecord> itemRecords /*{ get; set; }*/ = new List<ItemRecord>();
     }
 
-    public class InteractRecord
+    public class ItemRecord
     {
 
         /// <summary>

+ 1 - 1
TEAMModelOS.SDK/Models/Cosmos/Common/ExamClassResult.cs

@@ -62,7 +62,7 @@ namespace TEAMModelOS.SDK.Models
     //ExamClassResult 學生作答紀錄
     public class ExamClassResultStudentAnswerArray : ExamClassResult
     {
-        public List<List<List<string>>> studentAnswersArray { get; set; }= new List<List<List<string>>>();
+        public List<List<string>>  studentAnswersArray { get; set; }= new List<List<string>>();
     }
     /*    public class PaperSimple {
             public string id { get; set; }