浏览代码

Merge branch 'develop' of http://52.130.252.100:10000/TEAMMODEL/TEAMModelOS into develop

zhouj1203@hotmail.com 1 年之前
父节点
当前提交
3d266b27bb

+ 57 - 16
TEAMModelOS.SDK/Models/Cosmos/Common/Activity.cs

@@ -300,7 +300,7 @@ namespace TEAMModelOS.SDK.Models
         /// <summary>
         /// <summary>
         /// 一个作品需要被评审多少次,作品被分配给多少个专家评审
         /// 一个作品需要被评审多少次,作品被分配给多少个专家评审
         /// </summary>
         /// </summary>
-        public int taskInt { get; set; }
+        public int taskCount { get; set; }
         /// <summary>
         /// <summary>
         /// 统分规则 
         /// 统分规则 
         /// only        分配一次的情况直接获取分数=1
         /// only        分配一次的情况直接获取分数=1
@@ -660,9 +660,9 @@ namespace TEAMModelOS.SDK.Models
         public string cipher { get; set; }
         public string cipher { get; set; }
 
 
         /// <summary>
         /// <summary>
-        /// 是否是团队队长0,队员,1 队长
+        ///-1个人组的默认值, 是否是团队队长0,队员,1 队长
         /// </summary>
         /// </summary>
-        public int leader { get; set; }
+        public int leader { get; set; } = -1;
         public string teamName { get; set; }
         public string teamName { get; set; }
         /// <summary>
         /// <summary>
         /// 表单填报信息
         /// 表单填报信息
@@ -691,7 +691,10 @@ namespace TEAMModelOS.SDK.Models
         [Required(ErrorMessage = "Required")]
         [Required(ErrorMessage = "Required")]
         public int type { get; set; }
         public int type { get; set; }
         public string cipher { get; set; }
         public string cipher { get; set; }
-        public int leader { get; set; }
+        /// <summary>
+        /// -1个人组的默认值, 是否是团队队长0,队员,1 队长
+        /// </summary>
+        public int leader { get; set; } = -1;
         public string teamName { get; set; }
         public string teamName { get; set; }
         /// <summary>
         /// <summary>
         /// 表单填报信息
         /// 表单填报信息
@@ -735,31 +738,69 @@ namespace TEAMModelOS.SDK.Models
     /// <summary>
     /// <summary>
     /// 专家分配的任务
     /// 专家分配的任务
     /// </summary>
     /// </summary>
-    public class ActivityExpertTask:CosmosEntity
+    public class ActivityExpertTask : CosmosEntity
     {
     {
-        //id  教师id,
+        //id  专家id ,
         //code  ActivityExpertTask-活动id
         //code  ActivityExpertTask-活动id
-
-      
+        /// <summary>
+        /// 专家在优课评选中的评审任务
+        /// </summary>
+        public List<ExpertContestTask>  contestTasks{ get; set; }
     }
     }
     /// <summary>
     /// <summary>
     /// 专家在优课评选模块的任务分配
     /// 专家在优课评选模块的任务分配
     /// </summary>
     /// </summary>
-    public class ExpertContestTask { 
-        public List<ContestExpert> experts { get; set; }
+    public class ExpertContestTask {
+        /// <summary>
+        /// 作品id
+        /// </summary>
+        public string uploadId { get; set; }
+        /// <summary>
+        /// 组队口令
+        /// </summary>
+        public string cipher { get; set; }
+        /// <summary>
+        /// 参赛类型 0个人,1 团队
+        /// </summary>
+        public string type { get; set; }
 
 
-    
-    }
-    public class ContestExpert {
+        /// <summary>
+        /// -1 个人组的默认值, 0 队员,1队长
+        /// </summary>
+        public int leader { get; set; } = -1;
+        /// <summary>
+        /// 队员醍摩豆id ,包含队长,id,name(填报信息的name,真实姓名),code ,nickname 醍摩豆名称
+        /// </summary>
+        public List<IdNameCode> members { get; set; }
+        /// <summary>
+        /// 如果是个人组,则是个人的tmdid, 如果是团队组,则是队长的tmdid
+        /// </summary>
         public string tmdid { get; set; }
         public string tmdid { get; set; }
-        public string name { get; set; }
-        public string picture { get; set; }
+        //public string name { get; set; }
+        //public string picture { get; set; }
+        //public string nickname { get; set; }
+        /// <summary>
+        /// 评分状态
+        /// </summary>
         public int status { get; set; } = -1;
         public int status { get; set; } = -1;
         public double score { get; set; } = -1;
         public double score { get; set; } = -1;
-    }
 
 
+    }
+    
     public class ExpertDto : Expert
     public class ExpertDto : Expert
     {
     {
+        /// <summary>
+        /// 任务数量
+        /// </summary>
+        public int taskCount {  get; set; }
+        /// <summary>
+        /// 完成数量
+        /// </summary>
+        public int completeCount {  get; set; }
+        /// <summary>
+        /// 
+        /// </summary>
+        public int teacherCount { get; set; }
 
 
     }
     }
 
 

+ 17 - 17
TEAMModelOS/ClientApp/public/lang/en-US.js

@@ -3726,14 +3726,14 @@ const LANG_EN_US = {
         dashboard: {
         dashboard: {
             dashCenter: 'Data Center',
             dashCenter: 'Data Center',
             schoolDash: 'School Dashboard',
             schoolDash: 'School Dashboard',
-            teacherDash: 'Teaching Dashboard',
+            teacherDash: 'IES Dashboard',
             studentDash: 'Student Dashboard',
             studentDash: 'Student Dashboard',
             iotDash: 'IoT Dashboard',
             iotDash: 'IoT Dashboard',
             dashTitle: 'Select the data dashboard to view',
             dashTitle: 'Select the data dashboard to view',
             schoolSummary: 'Showcases school information, teaching resources, and course dynamics, providing an overview of the school for school leaders',
             schoolSummary: 'Showcases school information, teaching resources, and course dynamics, providing an overview of the school for school leaders',
-            teacherSummary: "Displays smart lesson data, focusing on teaching and learning outcomes to support student comprehensive development",
+            teacherSummary: "Statistics of the current semester's activity data, sources include lesson records using IES cloud lists and online assessment & homework data.",
             studentSummary: 'Displays students holistic development in virtues, intelligence, physique, social skills, and aesthetics, promoting a positive school culture and nurturing well-rounded personalities',
             studentSummary: 'Displays students holistic development in virtues, intelligence, physique, social skills, and aesthetics, promoting a positive school culture and nurturing well-rounded personalities',
-            iotSummary: 'Statistics of whole school smart classroom usage are automatically summarized by the IoT, and are not limited to IES cloud courses',
+            iotSummary: "Statistics of the current semester's activity data, sources include lesson records using IES cloud lists and online assessment & homework data.",
             cols: 'Display Columns',
             cols: 'Display Columns',
             title: 'Smart Campus Big Data',
             title: 'Smart Campus Big Data',
             title3: 'All-round Quality Big Data',
             title3: 'All-round Quality Big Data',
@@ -4421,14 +4421,14 @@ const LANG_EN_US = {
         stuYear1: 'Skipping',
         stuYear1: 'Skipping',
         stuYear2: 'Retained',
         stuYear2: 'Retained',
 
 
-        educloudtw: 'EDU Cloud',
+        educloudtw: 'Taiwan Education Cloud',
         binded: 'Bound',
         binded: 'Bound',
-        unBound: 'Unbound',
-        unBindEDUTitle: 'Unbind',
-        unBindEDUCont1: 'Sure to unbind ',
-        unBindEDUCont2: 'from EDU Cloud TW',
+        unBound: 'Not bound',
+        unBindEDUTitle: 'Unbound',
+        unBindEDUCont1: 'Are you sure to unbind ',
+        unBindEDUCont2: 'from Taiwan Education Cloud',
         unbdOk: 'Unbind successfully',
         unbdOk: 'Unbind successfully',
-        unbdFail: 'Unbind failed',
+        unbdFail: 'Failed to unbind',
 
 
         // AddStudent.vue
         // AddStudent.vue
         accountInfo: 'Account Information',
         accountInfo: 'Account Information',
@@ -4612,7 +4612,7 @@ const LANG_EN_US = {
             courseNo: 'Invitation Code',
             courseNo: 'Invitation Code',
             listName: 'List Name',
             listName: 'List Name',
             joinTime: 'Application Time',
             joinTime: 'Application Time',
-            todayWrong: "Today's Smart wrong question practice",
+            todayWrong: "Today's SMART Incorrectly Answered Question Practice",
         },
         },
         public: {
         public: {
             noData: 'No data yet',
             noData: 'No data yet',
@@ -5060,7 +5060,7 @@ const LANG_EN_US = {
             table3: "File Type",
             table3: "File Type",
             table4: "Operate",
             table4: "Operate",
             tips3: "The course that initiated this activity were not found",
             tips3: "The course that initiated this activity were not found",
-            tips4: "No courses on this subject were found",
+            tips4: "No courses found for this subject",
         },
         },
         classmatesComment: {
         classmatesComment: {
             title: "Classmates' homework observation and mutual evaluation",
             title: "Classmates' homework observation and mutual evaluation",
@@ -5370,8 +5370,8 @@ const LANG_EN_US = {
                 button7: "Full of energy, continue",
                 button7: "Full of energy, continue",
                 button8: "Practice another day, leave first",
                 button8: "Practice another day, leave first",
                 title1: "All current questions have been practiced",
                 title1: "All current questions have been practiced",
-                showParent1: 'Expand main stem content',
-                showParent2: 'Shrink the main stem content',
+                showParent1: 'Expand main question stem content',
+                showParent2: 'Close the main question stem content',
             },
             },
             today: 'Today',
             today: 'Today',
             message1: 'Currently, there are no incorrectly answered questions to practice.',
             message1: 'Currently, there are no incorrectly answered questions to practice.',
@@ -5393,9 +5393,9 @@ const LANG_EN_US = {
             statistics1: 'Correctly Answered',
             statistics1: 'Correctly Answered',
             statistics2: 'Incorrectly Answered',
             statistics2: 'Incorrectly Answered',
             showOptionType: "Show Objective Question's Options",
             showOptionType: "Show Objective Question's Options",
-            tooltips1: 'Indicates the number of questions recommended by smart practicing system',
-            tooltips2: 'Indicates the total number of missed questions so far',
-            noInfo1: 'This smart question exercise gets',
+            tooltips1: 'Indicates the number of questions recommended for practice by the system',
+            tooltips2: 'Indicates the total number of questions done incorrectly so far',
+            noInfo1: 'This smart question practice gets',
             noInfo2: 'questions',
             noInfo2: 'questions',
             noInfo3: 'questions can be practiced',
             noInfo3: 'questions can be practiced',
             noInfo4: 'questions are temporarily unavailable because the original test records have been removed',
             noInfo4: 'questions are temporarily unavailable because the original test records have been removed',
@@ -7666,7 +7666,7 @@ const LANG_EN_US = {
             title: 'Device Statistics',
             title: 'Device Statistics',
             deviceTotal: 'Total Devices',
             deviceTotal: 'Total Devices',
             deviceOnline: 'Used Devices',
             deviceOnline: 'Used Devices',
-            numAndproportion: 'Quantity and Proportion',
+            numAndproportion: 'Quantity & Proportion',
         },
         },
         lessons: {
         lessons: {
             title: 'Lesson and Application History Chart',
             title: 'Lesson and Application History Chart',

+ 1 - 1
TEAMModelOS/ClientApp/public/lang/zh-TW.js

@@ -3733,7 +3733,7 @@ const LANG_ZH_TW = {
             iotDash: '智慧教室IoT儀表',
             iotDash: '智慧教室IoT儀表',
             dashTitle: '選擇需要查看的數據儀表',
             dashTitle: '選擇需要查看的數據儀表',
             schoolSummary: '展現學校資訊、教學資源和課程動態,學校整體風貌,方便學校行政掌握學校情況',
             schoolSummary: '展現學校資訊、教學資源和課程動態,學校整體風貌,方便學校行政掌握學校情況',
-            teacherSummary: '統計本學期的活動數據, 來源包含使用IES雲端名單的智慧課堂記錄以及線上',
+            teacherSummary: '統計本學期的活動數據, 來源包含使用IES雲端名單的智慧課堂記錄以及線上測驗作業數據',
             studentSummary: '展示學生五育(德、智、體、群、美)全面發展,呈現優良校風,培育健全人格',
             studentSummary: '展示學生五育(德、智、體、群、美)全面發展,呈現優良校風,培育健全人格',
             iotSummary: '統計由智慧教室物聯網自動化歸納本校的課堂運用數據,不侷限於使用IES雲端名單',
             iotSummary: '統計由智慧教室物聯網自動化歸納本校的課堂運用數據,不侷限於使用IES雲端名單',
             cols: '顯示列',
             cols: '顯示列',

+ 19 - 4
TEAMModelOS/Controllers/Common/ActivityController.cs

@@ -1652,7 +1652,7 @@ namespace TEAMModelOS.Controllers
             Azure.Response response = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Common).ReadItemStreamAsync(_activityId.GetString(), new PartitionKey("Activity"));
             Azure.Response response = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Common).ReadItemStreamAsync(_activityId.GetString(), new PartitionKey("Activity"));
             if (response.Status==200)
             if (response.Status==200)
             {
             {
-                Activity activity = JsonDocument.Parse(response.Content).RootElement.ToObject<Activity>();
+                ActivityDto activity = JsonDocument.Parse(response.Content).RootElement.ToObject<ActivityDto>();
                 if (activity.publish!=1  && activity.publish!=2)
                 if (activity.publish!=1  && activity.publish!=2)
                 {
                 {
                     return Ok(new { code = 1, msg = "活动未发布!" });
                     return Ok(new { code = 1, msg = "活动未发布!" });
@@ -1684,6 +1684,8 @@ namespace TEAMModelOS.Controllers
                 }
                 }
                 Training training = null;
                 Training training = null;
                 TEAMModelOS.SDK.Models.Research research = null;
                 TEAMModelOS.SDK.Models.Research research = null;
+                var (blob_uri, blob_sas) = _azureStorage.GetBlobContainerSAS(activity.owner, BlobContainerSasPermissions.Read | BlobContainerSasPermissions.List);
+                activity.sas=blob_sas;
                 return Ok(new {code =200, activity,contest,reviewRule, training,  research});
                 return Ok(new {code =200, activity,contest,reviewRule, training,  research});
             }
             }
             else
             else
@@ -1930,7 +1932,14 @@ namespace TEAMModelOS.Controllers
                                         enroll= JsonDocument.Parse(responseActivityEnroll.Content).RootElement.ToObject<ActivityEnroll>();
                                         enroll= JsonDocument.Parse(responseActivityEnroll.Content).RootElement.ToObject<ActivityEnroll>();
                                         if (enroll.contest!=null  && enroll.contest.leader==1)
                                         if (enroll.contest!=null  && enroll.contest.leader==1)
                                         {
                                         {
-                                            return Ok(new { code = 3, msg = "请移交队长后再退出参赛!" });
+                                            // 如果没有其他队员,则可以直接退出
+                                            //检查是否还有其他成员
+                                            string cipherSQL = $"select value  c.id  from c where c.contest!=null  and c.activityId='{_activityId.GetString()}' and c.contest.type=1 and  c.contest.cipher='{enroll.contest.cipher}' and c.id<>'{tmdid}' ";
+                                            var cipherResult = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Teacher).GetList<string>(cipherSQL, $"ActivityEnroll-{_activityId}");
+                                            if (cipherResult.list.Count>0)
+                                            {
+                                                return Ok(new { code = 3, msg = "队伍中还有其他参赛队员,请移交队长后或移除队员后再退出参赛!" });
+                                            }
                                         }
                                         }
                                         Azure.Response responseActivityEnrollDel = await client.GetContainer(Constant.TEAMModelOS, Constant.Teacher).DeleteItemStreamAsync(enroll.id, new PartitionKey($"ActivityEnroll-{_activityId.GetString()}"));
                                         Azure.Response responseActivityEnrollDel = await client.GetContainer(Constant.TEAMModelOS, Constant.Teacher).DeleteItemStreamAsync(enroll.id, new PartitionKey($"ActivityEnroll-{_activityId.GetString()}"));
                                         if (responseActivityEnrollDel.Status==201)
                                         if (responseActivityEnrollDel.Status==201)
@@ -2166,7 +2175,7 @@ namespace TEAMModelOS.Controllers
                                                                 //队长
                                                                 //队长
                                                                 if (cipherResult.list.IsNotEmpty())
                                                                 if (cipherResult.list.IsNotEmpty())
                                                                 {
                                                                 {
-                                                                    //组队口令已被其他团队使用
+                                                                    //组队口令已被其他团队使用,此处已顺便处理成员篡位的逻辑
                                                                     var otherTeam = cipherResult.list.FindAll(z => !z.id.Equals(tmdid));
                                                                     var otherTeam = cipherResult.list.FindAll(z => !z.id.Equals(tmdid));
                                                                     if (otherTeam.IsNotEmpty())
                                                                     if (otherTeam.IsNotEmpty())
                                                                     {
                                                                     {
@@ -2196,6 +2205,11 @@ namespace TEAMModelOS.Controllers
                                                             }
                                                             }
                                                             else
                                                             else
                                                             {
                                                             {
+                                                                //队长跑路
+                                                                if (enroll!=null  && enroll.contest!=null && enroll.contest.leader==1 && enrollData.leader==0) {
+                                                                    return Ok(new { code = 17, msg = "你是队长,不能变更身份!" });
+                                                                }
+
                                                                 //队员
                                                                 //队员
                                                                 if (cipherResult.list.IsNotEmpty())
                                                                 if (cipherResult.list.IsNotEmpty())
                                                                 {
                                                                 {
@@ -2494,7 +2508,8 @@ namespace TEAMModelOS.Controllers
                                                             foreach (var z in cipherResult.list)
                                                             foreach (var z in cipherResult.list)
                                                             {
                                                             {
                                                                 z.upload=enroll.upload;
                                                                 z.upload=enroll.upload;
-                                                                z.upload.uploadId=Guid.NewGuid().ToString();
+                                                                //队长统一上传的作品不需要单独生成作品id.
+                                                                // z.upload.uploadId=Guid.NewGuid().ToString();
                                                                 await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Teacher).UpsertItemAsync(z, new PartitionKey(z.code));
                                                                 await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Teacher).UpsertItemAsync(z, new PartitionKey(z.code));
                                                             }
                                                             }
                                                         }
                                                         }

+ 14 - 4
TEAMModelOS/Controllers/Student/OverallEducationController.cs

@@ -277,17 +277,27 @@ namespace TEAMModelOS.Controllers
                         //}
                         //}
                         //else { 
                         //else { 
                         //}
                         //}
+                        List<EducationScore> intelligenceScore = new List<EducationScore>();
+                        if (schoolSetting.overallEducationSetting.examTypes.IsNotEmpty())
+                        {
+                            var datas = item.intelligence.FindAll(z => !string.IsNullOrWhiteSpace(z.examType)  &&  schoolSetting.overallEducationSetting.examTypes.Contains(z.examType));
+                            if (datas.IsNotEmpty()) {
+                                intelligenceScore.AddRange(datas);
+                            }
+                        }
+                        else {
+                            intelligenceScore.AddRange(item.intelligence);
+                        }
 
 
-
-                        double sumScore = item.intelligence.Average(x => x.sumScore);
-                        double totalScore = item.intelligence.Average(x => x.totalScore);
+                        double sumScore = intelligenceScore.Average(x => x.sumScore);
+                        double totalScore = intelligenceScore.Average(x => x.totalScore);
                         if (totalScore > 0)
                         if (totalScore > 0)
                         {
                         {
                             intelligence = Math.Round(sumScore * 1.0 / totalScore * 100, 2);
                             intelligence = Math.Round(sumScore * 1.0 / totalScore * 100, 2);
                         }
                         }
                         else
                         else
                         {
                         {
-                            intelligence = Math.Round(sumScore * 1.0 / item.intelligence.Count, 2);
+                            intelligence = Math.Round(sumScore * 1.0 / intelligenceScore.Count, 2);
                         }
                         }
                         dimensionScoreDefault.intelligence=1;
                         dimensionScoreDefault.intelligence=1;
                         dimensionScoreDefault.exam=1;
                         dimensionScoreDefault.exam=1;