CrazyIter_Bin 7 months ago
parent
commit
158fa4627f

+ 3 - 3
TEAMModelBI/TEAMModelBI.csproj

@@ -65,9 +65,9 @@
 		<SpaRoot>ClientApp\</SpaRoot>
 		<DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes>
 		<UserSecretsId>078b5d89-7d90-4f6a-88fc-7d96025990a8</UserSecretsId>
-		<Version>5.2410.9</Version>
-		<AssemblyVersion>5.2410.9.1</AssemblyVersion>
-		<FileVersion>5.2410.9.1</FileVersion>
+		<Version>5.2410.16</Version>
+		<AssemblyVersion>5.2410.16.1</AssemblyVersion>
+		<FileVersion>5.2410.16.1</FileVersion>
 		<Description>TEAMModelBI(BI)</Description>
 		<PackageReleaseNotes>BI版本说明版本切换标记2022000908</PackageReleaseNotes>
 		<PackageId>TEAMModelBI</PackageId>

+ 315 - 43
TEAMModelOS.Extension/HTEX.Test/Controllers/MockDataController.cs

@@ -3,6 +3,7 @@ using System.Text.Json;
 using static HTEX.Test.Controllers.LessonRecordController;
 using TEAMModelOS.SDK.Extension;
 using TEAMModelOS.SDK.Models;
+using System;
 
 namespace HTEX.Test.Controllers
 {
@@ -10,6 +11,12 @@ namespace HTEX.Test.Controllers
     [Route("mock-data")]
     public class MockDataController : ControllerBase
     {
+        private readonly  ILogger<MockDataController> _logger;
+        public MockDataController(ILogger<MockDataController> logger)
+        {
+            _logger = logger;   
+        }
+
         [HttpPost("student-lesson")]
         public async Task<IActionResult> StudentLesson(JsonElement json) 
         {
@@ -23,11 +30,11 @@ namespace HTEX.Test.Controllers
             //互动次数
             int icount = Random.Shared.Next(3, 20);
             //任务次数
-            int tcount = Random.Shared.Next(1, 3);
+            int tcount = Random.Shared.Next(1, 4);
             //评价次数
-            int pcount = Random.Shared.Next(1, 3);
+            int pcount = Random.Shared.Next(2, 4);
             //协作次数
-            int xcount = Random.Shared.Next(1, 3);
+            int xcount = Random.Shared.Next(3, 4);
             List<StudentLessonData> students = new List<StudentLessonData>();
             //个人计分,小组计分
             List<WeightedItem> gpitems = new List<WeightedItem>
@@ -97,16 +104,16 @@ namespace HTEX.Test.Controllers
                 //rateCount.Add(counts);
 
 
-                var t = Random.Shared.Next(0, 3);
+                var t = Random.Shared.Next(0, 1);
                 switch (true)
                 {
-                    case bool when t==0:
+                    case bool when i==0:
                         types.Add("Voting");
                         break;
-                    case bool when t==1:
-                        types.Add("GrandRating");
+                    case bool when i==1:
+                        types.Add("GrandRating"); 
                         break;
-                    case bool when t==2:
+                    case bool when i==2:
                         types.Add("PeerAssessment");
                         break;
                 }
@@ -284,7 +291,7 @@ namespace HTEX.Test.Controllers
                     double allocation = 0;
                     for (var q = 0; q<qcount; q++)
                     {
-                        var criterion = Random.Shared.Next(2, 10);
+                        var criterion = Random.Shared.Next(5, 10);
                         allocation+=criterion;
                         var item = new ItemRecord { criterion =criterion };
                         var w = Random.Shared.Next(0, 4);
@@ -385,7 +392,7 @@ namespace HTEX.Test.Controllers
 
         
 
-        private static void ProcessStudentData(List<StudentLessonData> studentLessonDatas, LessonDataAnalysis lessonDataAnalysis, int scount, int ecount, int qcount, int icount, int tcount, int pcount, int xcount)
+        private  void ProcessStudentData(List<StudentLessonData> studentLessonDatas, LessonDataAnalysis lessonDataAnalysis, int scount, int ecount, int qcount, int icount, int tcount, int pcount, int xcount)
         {
             //历史记录的个人计分集合,通过“2倍标准差规则”移除异常值后得到的集合
             var max_q = lessonDataAnalysis.pscore.Max();
@@ -394,43 +401,189 @@ namespace HTEX.Test.Controllers
             //历史记录的小组计分集合,通过“2倍标准差规则”移除异常值后得到的集合
             var max_h = lessonDataAnalysis.gscore.Max();
             var j = InteractWeight.T1;
+            double t = InteractWeight.TT;
+            List<StudentLessonItem> lessonItems= new List<StudentLessonItem>();
             foreach (var studentLessonData in studentLessonDatas)
             {
-                //互动成效指数
-                var a = 0.0;
-                //互动参与指数
-                var b = 0.0;
+                StudentLessonItem lessonItem = new StudentLessonItem() { studentId= studentLessonData.id! };
+                double u =  0.0;
+                if (studentLessonData.attend==1) 
+                {
+                    u=100.0;
+                }
                 //c个人计分指数,d互动计分指数,e小组计分指数
                 double c = 0, d = 0, e = 0;
-                //课例互动次数
-                double n = studentLessonData.interactRecord.interactRecords.Count()*1.0;
-                //是IES大陆正式站历史课例数据,自2024-03-01至2024-10-08日,互动指数或学法指数黄灯或绿灯,不包含醍摩豆学校及测试学校,课例时长超过5分钟的有效课例(10,680笔数据) 的IRS互动+抢权+挑人的次数集合,
-                //通过“2倍标准差规则” 移除异常值后得到的集合,再通过K-Means聚类算法得到高低位阶互动频次两个集合,并根据当前课例互动次数位阶的集合的质心值,该值定为m值
-                var m = n<=lessonDataAnalysis.clustersInteract.First().Value.Max() ? lessonDataAnalysis.clustersInteract.First().Key*1.0 : lessonDataAnalysis.clustersInteract.Last().Key *1.0;
-                //学生作答次数
-                var w = studentLessonData.interactRecord.interactRecords.Where(x => x.resultWeight>=InteractWeight.T1).Count()*1.0;
-                //作答正确数(包括部分正确)
-                var r = studentLessonData.interactRecord.interactRecords.Where(x => x.resultWeight>InteractWeight.T1).Count()*1.0;
-                //有参与的权重集合60≤k(x)≤100
-                var kw = studentLessonData.interactRecord.interactRecords.Where(x => x.resultWeight>=InteractWeight.T1).Sum(x => x.resultWeight*1.0);
-                //有得分的权重集合60<e(x)≤100
-                var er = studentLessonData.interactRecord.interactRecords.Where(x => x.resultWeight>InteractWeight.T1).Sum(x => x.resultWeight*1.0);
-                //本节课的所有互动计分
-                var i = studentLessonData.interactRecord.interactRecords.Sum(x => x.itemScore*1.0);
-                //本节课教师手动给学生的个人计分
-                var s = studentLessonData.pscore;
-                //个人计分指数
-                c = s*1.0/max_q;
-                //互动计分指数
-                d = i*1.0/max_t;
-                //互动成效指数
-                a = (d+w*kw/(j*m)+r*er/(j*m))*1.0/n;
-                //互动参与指数
-                b = ((w*w)/m+(r*r)/m)*1.0/n;
-                //c+a= 个人计分指数+ 个人互动成效指数
-                var f = Math.Round(190*1.0/(1+Math.Exp(-(c+a)))-95, 4);
-                studentLessonData.achieve=f;
-                Console.WriteLine($"{studentLessonData.id}=>成效:{f}\t互动次数:{n}\t参与次数:{w}\t正确次数:{r}\t个人计分:{s}\t{Math.Round(c,2)}\t互动计分:{i}\t{Math.Round(d,2)},\t学习成效:{Math.Round(a,2)}");// kw:{Math.Round(kw,2)}\t er:{Math.Round(er,2)}
+             
+                ////互动
+                //double hd_cx = 0;//互动成效指数
+                //double hd_cy = 0;//互动参与指数
+                //double hd_fqc = 0;//互动发起次数
+                //double hd_cyc = 0;//互动参与次数
+                //double hd_zqc = 0;//互动正确次数
+                //double gr_jf = 0;//个人计分
+                ////评测
+                //double pc_df = 0;//评测得分率
+                //double pc_zd = 0;//评测作答率
+                ////任务
+                //double rw_fqc = 0;//任务发起次数
+                //double rw_cyc = 0;//任务参与次数
+                //double rw_cx = 0;//任务成效指数
+                //double rw_cy = 0;//任务参与指数
+                ////评价
+                //double pj_nl = 0;//评价能力
+                //double pj_cs = 0;//评价发起次数
+                //double pj_vc = 0;//评价-投票发起次数
+                //double pj_vg = 0;//投票得票数
+                //double pj_vo = 0;//投票次数
+                //double pj_gc = 0;//评价-星光发起次数
+                //double pj_gg = 0;//星光得分数
+                //double pj_go = 0;//星光评分次数
+                //double pj_pc = 0;//评价-互评发起次数
+                //double pj_pg = 0;//互评的分数
+                //double pj_po = 0;//互评评分次数
+                ////协作
+                //double xz_fqc = 0;//协作发起次数
+                //double xz_cyc = 0;//协作参与次数
+                //double xz_cgf = 0;//协作成果分数
+                //double xz_cx = 0;//协作能力指数
+                //double xz_cy = 0;//协作参与指数
+
+                {
+                    //互动相关的计分
+                    //课例互动次数
+                    double n = studentLessonData.interactRecord.interactRecords.Count()*1.0;
+                    //是IES大陆正式站历史课例数据,自2024-03-01至2024-10-08日,互动指数或学法指数黄灯或绿灯,不包含醍摩豆学校及测试学校,课例时长超过5分钟的有效课例(10,680笔数据) 的IRS互动+抢权+挑人的次数集合,
+                    //通过“2倍标准差规则” 移除异常值后得到的集合,再通过K-Means聚类算法得到高低位阶互动频次两个集合,并根据当前课例互动次数位阶的集合的质心值,该值定为m值
+                    var m = n<=lessonDataAnalysis.clustersInteract.First().Value.Max() ? lessonDataAnalysis.clustersInteract.First().Key*1.0 : lessonDataAnalysis.clustersInteract.Last().Key *1.0;
+                    //学生作答次数
+                    var w = studentLessonData.interactRecord.interactRecords.Where(x => x.resultWeight>=InteractWeight.T1).Count()*1.0;
+                    //作答正确数(包括部分正确)
+                    var r = studentLessonData.interactRecord.interactRecords.Where(x => x.resultWeight>InteractWeight.T1).Count()*1.0;
+                    //有参与的权重集合60≤k(x)≤100
+                    var kw = studentLessonData.interactRecord.interactRecords.Where(x => x.resultWeight>=InteractWeight.T1).Sum(x => x.resultWeight*1.0);
+                    //有得分的权重集合60<e(x)≤100
+                    var er = studentLessonData.interactRecord.interactRecords.Where(x => x.resultWeight>InteractWeight.T1).Sum(x => x.resultWeight*1.0);
+                    //本节课的所有互动计分
+                    var i = studentLessonData.interactRecord.interactRecords.Sum(x => x.itemScore*1.0);
+                    //本节课教师手动给学生的个人计分
+                    var s = studentLessonData.pscore;
+                    //个人计分指数
+                    c = s*1.0/max_q;
+                    //互动计分指数
+                    d = i*1.0/max_t;
+                    //互动成效指数
+                    var a = (d+w*kw/(j*m)+r*er/(j*m))*1.0/n;
+                    //互动参与指数
+                    var b = ((w*w)/m+(r*r)/m)*1.0/n;
+                    //c+a= 个人计分指数+ 个人互动成效指数
+                    //学习成效
+                    var f1 = Math.Round(190*1.0/(1+Math.Exp(-(c+a)))-95, 4);
+                    lessonItem.hd_cx=f1;
+                    var f2 = Math.Round(200*1.0/(1+Math.Exp(-(b+u/100)))-100, 4);
+                    lessonItem.hd_cy=f2;
+                    lessonItem.hd_cyc=w;
+                    lessonItem.hd_fqc=n;
+                    lessonItem.hd_zqc=r;
+                    lessonItem.gr_jf=s;
+                    //studentLessonData.achieve=f1;
+                    //studentLessonData.attitude=f2;
+                    // _logger.LogInformation($"{studentLessonData.id}=>学习成效:{f1}\t学习态度:{f2}\t互动次数:{n}\t参与次数:{w}\t正确次数:{r}\t个人计分:{s}\t{Math.Round(c, 2)}\t互动计分:{i}\t{Math.Round(d, 2)}"); 
+                }
+                {
+                    //评测相关指数
+                    double n = studentLessonData.examRecords.Count()*1.0;
+                    //题目数量
+                    double nq = studentLessonData.examRecords.Sum(x => x.qcount)*1.0;
+                    double max_e = lessonDataAnalysis.exam.Max();
+                    //得分率
+                    double sum_s = studentLessonData.examRecords.Sum(x => x.scoreRate);
+                    //作答率
+                    double sum_a = studentLessonData.examRecords.Sum(x => x.answerRate);
+                    double f8 = Math.Round(sum_s/n*100,4);
+                    double f9 = Math.Round(sum_a/n*100, 4);
+                    lessonItem.pc_df=f8;
+                    lessonItem.pc_zd=f9;
+                 //   _logger.LogInformation($"{studentLessonData.id}=>评测指数:{f8}\t得分率:{Math.Round(sum_s/n,4)}\t参与指数:{f9}\t作答率:{Math.Round(sum_a/n,4)}");
+                }
+                { 
+                    //小组相关指数
+                }
+                { 
+                    //任务相关指数
+                    double n = studentLessonData.taskRecord.itemRecords.Count()*1.0;
+                    double max_m = lessonDataAnalysis.task.Max();
+                    double w= studentLessonData.taskRecord.itemRecords.Where(x => x.resultWeight>0).Count()*1.0;
+                    double y =  (10 *w/n+(j/t) *w)/max_m;
+                    double l = max_m*(w*w/n+(j/t) * w )/n;
+                    double f4 = Math.Round(190*1.0/(1+Math.Exp(-(y)))-95, 4);
+                    double f5 = Math.Round(200*1.0/(1+Math.Exp(-(l)))-100, 4);
+                    lessonItem.rw_fqc =n;
+                    lessonItem.rw_cyc =w;
+                    lessonItem.rw_cx =f4;
+                    lessonItem.rw_cy =f5;
+                   // _logger.LogInformation($"{studentLessonData.id}=>任务指数:{f4}\t参与指数:{f5}\t任务次数:{n}\t参与次数:{w}\t");
+
+                }
+                {
+                    //评价相关指数
+                    
+                    double n = studentLessonData.rateingRecord.itemRecords.Count()*1.0;
+                    var  v = studentLessonData.rateingRecord.itemRecords.Where(x => x.itemType.Equals("Voting"));
+                    double vc= v.Count()*1.0;
+                    var g = studentLessonData.rateingRecord.itemRecords.Where(x => x.itemType.Equals("GrandRating"));
+                    double gc = g.Count()*1.0;
+                    var p = studentLessonData.rateingRecord.itemRecords.Where(x => x.itemType.Equals("PeerAssessment"));
+                    double pc = p.Count()*1.0;
+
+                    var vg = v.Sum(x => x.itemScore);
+                    var vo = v.Sum(x => x.optCount);
+                    double vs = vc/n* (vg+ vo);
+
+                    var gg = g.Sum(x => x.itemScore);
+                    var go = g.Sum(x => x.optCount);
+                    double gs = gc/n* (gg+ go);
+
+                    var pg = p.Sum(x => x.itemScore);
+                    var po = p.Sum(x => x.optCount);
+                    double ps = pc/n* (pg+ po);
+                    double h = vs+ps+gs;
+                    double f3= Math.Round(190*1.0/(1+Math.Exp(-(h)))-95, 4);
+                    studentLessonData.appraise=f3;
+                    _logger.LogInformation($"{studentLessonData.id}=>评价能力:{f3}\t评价次数:{n}\t投票次数:{vc}-{vg}-{vo}\t星光次数:{gc}-{gg}-{go}\t互评次数:{pc}-{pg}-{po}");
+
+                    lessonItem.pj_nl =f3;
+                    lessonItem.pj_cs =n;
+                    lessonItem.pj_vc =vc;
+                    lessonItem.pj_vg =vg;
+                    lessonItem.pj_vo =vo;
+                    lessonItem.pj_gc =gc;
+                    lessonItem.pj_gg =gg;
+                    lessonItem.pj_go =go;
+                    lessonItem.pj_pc =pc;
+                    lessonItem.pj_pg =pg;
+                    lessonItem.pj_po =po;
+                }
+                {
+                    //协作相关指数
+                    var n= studentLessonData.coworkRecord.itemRecords.Count()*1.0;
+                    double max_m = lessonDataAnalysis.cowork.Max();
+                    double max_s = 35;
+                    var  w = studentLessonData.coworkRecord.itemRecords.Where(x => x.resultWeight>0);
+                    double ss = w.Sum(x => x.itemScore)*1.0;
+                    double sw =w.Sum(x=>x.resultWeight)*1.0;
+                    double wc = w.Count()*1.0;
+                  
+                    double k = ((wc*wc/n+(j/t) * wc))/n+ ss/(10 *n);
+                    double f6 = Math.Round(190*1.0/(1+Math.Exp(-(k)))-95, 4);
+                    double f7 = Math.Round(200*1.0/(1+Math.Exp(-(k)))-100, 4);
+                    lessonItem.xz_fqc =n;
+                    lessonItem.xz_cyc =wc;
+                    lessonItem.xz_cgf =ss;
+                    lessonItem.xz_cx =f6;
+                    lessonItem.xz_cy =f7;
+                    //_logger.LogInformation($"{studentLessonData.id}=>协作指数:{f6}\t参与指数:{f7}\t协作次数:{n}\t参与次数:{wc}\t协作成果分数:{ss}\t{k}");
+                }
+                lessonItems.Add(lessonItem);
             }
         }
 
@@ -465,4 +618,123 @@ namespace HTEX.Test.Controllers
         public int Value { get; set; }
         public double Weight { get; set; }
     }
+    class StudentLessonItem
+    {
+        /// <summary>
+        /// 学生id
+        /// </summary>
+        public string studentId { get; set; }
+        /// <summary>
+        /// 互动成效指数
+        /// </summary>
+        public double hd_cx { get; set; } = 0;
+        /// <summary>
+        /// 互动参与指数
+        /// </summary>
+        public double hd_cy { get; set; } = 0;
+        /// <summary>
+        /// 互动发起次数
+        /// </summary>
+        public double hd_fqc { get; set; } = 0;
+        /// <summary>
+        /// 互动参与次数
+        /// </summary>
+        public double hd_cyc { get; set; } = 0;
+        /// <summary>
+        /// 互动正确次数
+        /// </summary>
+        public double hd_zqc { get; set; } = 0;
+        /// <summary>
+        /// 个人计分
+        /// </summary>
+        public double gr_jf { get; set; } = 0;
+        /// <summary>
+        /// 评测得分率
+        /// </summary>
+        public double pc_df { get; set; } = 0;
+        /// <summary>
+        /// 评测作答率
+        /// </summary>
+        public double pc_zd { get; set; } = 0;
+        /// <summary>
+        /// 任务发起次数
+        /// </summary>
+        public double rw_fqc { get; set; } = 0;
+        /// <summary>
+        /// 任务参与次数
+        /// </summary>
+        public double rw_cyc { get; set; } = 0;
+        /// <summary>
+        /// 任务成效指数
+        /// </summary>
+        public double rw_cx { get; set; } = 0;
+        /// <summary>
+        /// 任务参与指数
+        /// </summary>
+        public double rw_cy { get; set; } = 0; 
+        /// <summary>
+        /// 评价能力
+        /// </summary>
+        public double pj_nl { get; set; } = 0;
+        /// <summary>
+        /// 评价发起次数
+        /// </summary>
+        public double pj_cs { get; set; } = 0;
+        /// <summary>
+        /// 投票发起次数
+        /// </summary>
+        public double pj_vc { get; set; } = 0;
+        /// <summary>
+        /// 投票得票数
+        /// </summary>
+        public double pj_vg { get; set; } = 0;
+        /// <summary>
+        /// 投票次数
+        /// </summary>
+        public double pj_vo { get; set; } = 0;
+        /// <summary>
+        /// 星光发起次数
+        /// </summary>
+        public double pj_gc { get; set; } = 0;
+        /// <summary>
+        /// 星光得分数
+        /// </summary>
+        public double pj_gg { get; set; } = 0;
+        /// <summary>
+        /// 星光评分次数
+        /// </summary>
+        public double pj_go { get; set; } = 0;
+        /// <summary>
+        /// 互评发起次数
+        /// </summary>
+        public double pj_pc { get; set; } = 0;
+        /// <summary>
+        /// 互评得分数
+        /// </summary>
+        public double pj_pg { get; set; } = 0;
+        /// <summary>
+        /// 互评评分次数
+        /// </summary>
+        public double pj_po { get; set; } = 0;
+        /// <summary>
+        /// 协作发起次数
+        /// </summary>
+        public double xz_fqc { get; set; } = 0;
+        /// <summary>
+        /// 协作参与次数
+        /// </summary>
+        public double xz_cyc { get; set; } = 0;
+        /// <summary>
+        /// 协作成果分数
+        /// </summary>
+        public double xz_cgf { get; set; } = 0;
+        /// <summary>
+        /// 协作能力指数
+        /// </summary>
+        public double xz_cx { get; set; } = 0;
+        /// <summary>
+        /// 协作参与指数
+        /// </summary>
+        public double xz_cy { get; set; } = 0;
+    }
 }

+ 1 - 0
TEAMModelOS.Extension/HTEX.Test/HTEX.Test.csproj

@@ -8,6 +8,7 @@
 
   <ItemGroup>
     <PackageReference Include="Bogus" Version="35.6.1" />
+    <PackageReference Include="EPPlus" Version="7.4.1" />
     <PackageReference Include="Microsoft.ML" Version="3.0.1" />
   </ItemGroup>
 

+ 3 - 3
TEAMModelOS.Function/TEAMModelOS.Function.csproj

@@ -5,9 +5,9 @@
     <OutputType>Exe</OutputType>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
-	<Version>5.2410.9</Version>
-	<AssemblyVersion>5.2410.9.1</AssemblyVersion>
-	<FileVersion>5.2410.9.1</FileVersion>
+	<Version>5.2410.16</Version>
+	<AssemblyVersion>5.2410.16.1</AssemblyVersion>
+	<FileVersion>5.2410.16.1</FileVersion>
 	<PackageId>TEAMModelOS.FunctionV4</PackageId>
 	<Authors>teammodel</Authors>
 	<Company>醍摩豆(成都)信息技术有限公司</Company>

+ 1 - 0
TEAMModelOS.SDK/Models/Cosmos/Student/StudentArtResult.cs

@@ -38,6 +38,7 @@ namespace TEAMModelOS.SDK.Models
     public class ArtSubjectScore {
         public string subjectId { get; set; }
         public double score { get; set; } = 0;
+        public string level {  get; set; }
         public string comment { get; set; }
     }
     public class ArtQuotaResult

+ 25 - 0
TEAMModelOS.SDK/Models/Service/ArtService.cs

@@ -283,6 +283,31 @@ namespace TEAMModelOS.SDK.Models.Service
                     //allScore = allSubjectArtQuotaPdfs.Sum(a => a.score) / allSubjectArtQuotaPdfs.Count;
                    // allScore = allSubjectArtQuotaPdfs.Sum(a => a.score) / allSubjectArtQuotaPdfs.Count;
                    allScore=Math.Round(x.subjectScores.Sum(a => a.score)*1.0/ x.subjectScores.Count,2) ;
+                    foreach (var xs in x.subjectScores) 
+                    {
+                        var slevel = string.Empty;
+                        if (xs.score >= 100)
+                        {
+
+                            slevel = "优秀(A+)";
+                        }
+                        if (xs.score <= 0)
+                        {
+
+                            slevel = "待及格(D)";
+                        }
+                        if (xs.score < 100)
+                        {
+                            artSetting.reviewLevel.ForEach(r =>
+                            {
+                                if (r.value[0] <= xs.score && r.value[1] > xs.score)
+                                {
+                                    slevel = r.code;
+                                }
+                            });
+                        }
+                        xs.level = slevel;
+                    }
                 }
 
                 if (allScore >= 100)

+ 3 - 3
TEAMModelOS.SDK/TEAMModelOS.SDK.csproj

@@ -1,9 +1,9 @@
 <Project Sdk="Microsoft.NET.Sdk">
 	<PropertyGroup>
 		<TargetFramework>net8.0</TargetFramework>
-		<Version>5.2410.9</Version>
-		<AssemblyVersion>5.2410.9.1</AssemblyVersion>
-		<FileVersion>5.2410.9.1</FileVersion>
+		<Version>5.2410.16</Version>
+		<AssemblyVersion>5.2410.16.1</AssemblyVersion>
+		<FileVersion>5.2410.16.1</FileVersion>
 		<PackageReleaseNotes>发版</PackageReleaseNotes>
 	</PropertyGroup>
 

+ 87 - 2
TEAMModelOS/Controllers/Both/ItemController.cs

@@ -803,7 +803,7 @@ namespace TEAMModelOS.Controllers
             var client = _azureCosmos.GetCosmosClient();
             StringBuilder sql = new StringBuilder();
             sql.Append("select distinct c.id,c.code,c.repairResource, c.periodId,c.question,c.useCount,c.level,c.field,c.knowledge,c.type,c.option,c.createTime," +
-                "c.answer,c.explain,c.children,c.score,c.gradeIds,c.subjectId,c.blob,c.scope from c where 1=1 and c.pid=null ");
+                "c.answer,c.explain,c.children,c.score,c.gradeIds,c.subjectId,c.blob,c.scope,c.tags from c where 1=1 and c.pid=null ");
             if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
             if (!request.TryGetProperty("scope", out JsonElement scope)) return BadRequest();
             if (!request.TryGetProperty("researchKey", out JsonElement researchKey)) return BadRequest();
@@ -1079,6 +1079,87 @@ namespace TEAMModelOS.Controllers
 
         }
 
+        /// <summary>
+        /// 手动挑题
+        /// </summary>
+        /// <param name="request"></param>
+        /// <returns></returns>
+        [ProducesDefaultResponseType]
+        //[AuthToken(Roles = "teacher")]
+        [HttpPost("get-tags")]
+        [Authorize(Roles = "IES")]
+        public async Task<IActionResult> GetTags(JsonElement request) 
+        {
+
+            if (!request.TryGetProperty("scope", out JsonElement scope)) return BadRequest();
+            if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+            string tbname = Constant.School;
+            Dictionary<string, object> dict = new Dictionary<string, object>();
+            StringBuilder sql = new StringBuilder("SELECT distinct value(c.tags ) FROM c ");
+            if (scope.ToString().Equals("private")) 
+            {
+                tbname=Constant.Teacher;
+            }
+            if (request.TryGetProperty("periodId", out JsonElement periodId))
+            {
+                dict.Add("periodId", periodId);
+            }
+            if (request.TryGetProperty("subjectId", out JsonElement subjectId))
+            {
+                dict.Add("subjectId", subjectId);
+            }
+            if (request.TryGetProperty("level", out JsonElement level))
+            {
+                dict.Add("level", level);
+            }
+            if (request.TryGetProperty("type", out JsonElement type))
+            {
+                dict.Add("type", type);
+            }
+            if (request.TryGetProperty("field", out JsonElement field))
+            {
+                dict.Add("field", field);
+            }
+            if (request.TryGetProperty("gradeIds[*]", out JsonElement gradeIds))
+            {
+                dict.Add("gradeIds[*]", gradeIds);
+            }
+            if (request.TryGetProperty("tags[*]", out JsonElement tags))
+            {
+                dict.Add("tags[*]", tags);
+            }
+            if (request.TryGetProperty("knowledge[*]", out JsonElement knowledge))
+            {
+                dict.Add("knowledge[*]", knowledge);
+            }
+            if (request.TryGetProperty("pid", out JsonElement pd))
+            {
+                if (pd.ValueKind != JsonValueKind.Null)
+                {
+                    dict.Add("pid", pd.ToString());
+                }
+                else
+                {
+                    dict.Add("pid", null);
+                }
+            }
+            AzureCosmosQuery cosmosDbQuery = SQLHelper.GetSQL(dict, sql);
+
+            cosmosDbQuery.QueryText.Replace("where", " where  ARRAY_LENGTH(c.tags)>0 and  ");
+            HashSet<string> tagData = new HashSet<string>();
+            var result=  await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, tbname).GetList<List<string>>(sql.ToString(), $"Item-{code}");
+            if (result.list.IsNotEmpty()) 
+            {
+                foreach (var item in result.list) 
+                {
+                    foreach (var item2 in item) 
+                    {
+                        tagData.Add(item2);
+                    }
+                }
+            }
+            return Ok(new { tags = tagData });
+        }
         /// <summary>
         /// 手动挑题
         /// </summary>
@@ -1094,7 +1175,7 @@ namespace TEAMModelOS.Controllers
             {
                 var client = _azureCosmos.GetCosmosClient();
                 StringBuilder sql = new StringBuilder();
-                sql.Append("select c.id,c.code,c.repairResource, c.periodId,c.question,c.useCount,c.level,c.field,c.knowledge,c.type,c.option,c.createTime,c.answer,c.explain,c.children,c.score,c.gradeIds,c.subjectId,c.blob,c.scope from c ");
+                sql.Append("select c.id,c.code,c.repairResource, c.periodId,c.question,c.useCount,c.level,c.field,c.knowledge,c.type,c.option,c.createTime,c.answer,c.explain,c.children,c.score,c.gradeIds,c.subjectId,c.blob,c.scope,c.tags from c ");
                 if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 /*            if (!request.TryGetProperty("@CURRPAGE", out JsonElement page)) return BadRequest();
                             if (!request.TryGetProperty("@PAGESIZE", out JsonElement size)) return BadRequest();*/
@@ -1145,6 +1226,10 @@ namespace TEAMModelOS.Controllers
                 {
                     dict.Add("gradeIds[*]", gradeIds);
                 }
+                if (request.TryGetProperty("tags[*]", out JsonElement tags))
+                {
+                    dict.Add("tags[*]", tags);
+                }
                 if (request.TryGetProperty("knowledge[*]", out JsonElement knowledge))
                 {
                     dict.Add("knowledge[*]", knowledge);

+ 2 - 2
TEAMModelOS/Controllers/School/ImportExamController.cs

@@ -101,8 +101,8 @@ namespace TEAMModelOS.Controllers
             return Ok(new { data.quotaImports, data.error, data.warn });
         }
 
-        private async Task<(List<QuotaImport> quotaImports, List<KeyValuePair<string, List<string>>> error, List<KeyValuePair<string, List<string>>> warn)> 
-            DoQuotaImport(IFormFile[] file , string periodId,string school, string subjectName, string type, string dimension) {
+        private async Task<(List<QuotaImport> quotaImports, List<KeyValuePair<string, List<string>>> error, List<KeyValuePair<string, List<string>>> warn)>   DoQuotaImport(IFormFile[] file , string periodId,string school, string subjectName, string type, string dimension)
+        {
             List<KeyValuePair<string, List<string>>> error = new List<KeyValuePair<string, List<string>>>();
             List<KeyValuePair<string, List<string>>> warn = new List<KeyValuePair<string, List<string>>>();
             List<QuotaImport> quotaImports = new List<QuotaImport> { };

+ 4 - 4
TEAMModelOS/TEAMModelOS.csproj

@@ -80,11 +80,11 @@
 		<SpaRoot>ClientApp\</SpaRoot>
 		<DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes>
 		<UserSecretsId>078b5d89-7d90-4f6a-88fc-7d96025990a8</UserSecretsId>
-		<Version>5.2410.9</Version>
-		<AssemblyVersion>5.2410.9.1</AssemblyVersion>
-		<FileVersion>5.2410.9.1</FileVersion>
+		<Version>5.2410.16</Version>
+		<AssemblyVersion>5.2410.16.1</AssemblyVersion>
+		<FileVersion>5.2410.16.1</FileVersion>
 		<Description>TEAMModelOS(IES5)</Description>
-		<PackageReleaseNotes>IES版本说明版本切换标记5.2410.9.1</PackageReleaseNotes>
+		<PackageReleaseNotes>IES版本说明版本切换标记5.2410.16.1</PackageReleaseNotes>
 		<PackageId>TEAMModelOS</PackageId>
 		<Authors>teammodel</Authors>
 		<Company>醍摩豆(成都)信息技术有限公司</Company>

+ 1 - 1
TEAMModelOS/appsettings.Development.json

@@ -18,7 +18,7 @@
     "IdTokenSalt": "8263692E2213497BB55E74792B7900B4",
     "HttpTrigger": "https://teammodelosfunction-test.chinacloudsites.cn/api/",
     //"HttpTrigger": "http://localhost:7071/api/"
-    "Version": "5.2410.9.1"
+    "Version": "5.2410.16.1"
   },
   "Azure": {
     // 测试站数据库

+ 1 - 1
TEAMModelOS/appsettings.json

@@ -18,7 +18,7 @@
     "Exp": 86400,
     "IdTokenSalt": "8263692E2213497BB55E74792B7900B4",
     "HttpTrigger": "https://teammodelosfunction.chinacloudsites.cn/api/",
-    "Version": "5.2410.9.1"
+    "Version": "5.2410.16.1"
   },
   "Azure": {
     "Storage": {