|
@@ -1387,7 +1387,239 @@ namespace HTEX.Lib.ETL.Lesson
|
|
|
//排名 = (积分 - 最低积分) / (最高积分 - 最低积分) * (最大排名 - 最小排名) + 最小排名
|
|
|
return x==0 ? 0 : max-min!=0 ? (x - min)*1.0 / (max - min) * (maxRank - minRank) + minRank : (x)*1.0 / (max) * (maxRank - minRank) + minRank;
|
|
|
}
|
|
|
+ public static List<StudentLessonItem> ProcessStudentDataV2(List<StudentLessonData> studentLessonDatas, LessonDataAnalysisCluster lessonDataAnalysis)
|
|
|
+
|
|
|
+ {
|
|
|
+
|
|
|
+ //历史记录的个人计分集合,通过“2倍标准差规则”移除异常值后得到的集合
|
|
|
+ var max_q = lessonDataAnalysis.pscore.Max();
|
|
|
+ //历史记录的互动计分集合,通过“2倍标准差规则”移除异常值后得到的集合
|
|
|
+ var max_t = lessonDataAnalysis.tscore.Max();
|
|
|
+ //历史记录的小组计分集合,通过“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)
|
|
|
+ {
|
|
|
+ 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;
|
|
|
+ if (n>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().Value.Max()*1.0 : lessonDataAnalysis.clustersInteract.Last().Value.Max() *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 = GetPersent(lessonDataAnalysis.pscore, s).persent/100;// s*1.0/max_q;
|
|
|
+ //互动计分指数
|
|
|
+ d = GetPersent(lessonDataAnalysis.tscore, i).persent/100; //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;
|
|
|
+ if (n>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;
|
|
|
+ if (n>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;
|
|
|
+ if (n>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;
|
|
|
+
|
|
|
+ if (n>0)
|
|
|
+ {
|
|
|
+
|
|
|
+ //总的协作成果数
|
|
|
+
|
|
|
+ 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 x = 0.0;
|
|
|
+ if (wc>0)
|
|
|
+ {
|
|
|
+ x=sw/(j *wc);
|
|
|
+ }
|
|
|
+ double max_xzcg = 40;
|
|
|
+ double k = (wc*wc/n+x)/n+ wc*(ss/max_xzcg)* (wc/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}");
|
|
|
+ }
|
|
|
+
|
|
|
+ double xx_cx = 0, xx_cy = 0;
|
|
|
+ int avg_cx = 0, avg_cy = 0;
|
|
|
+ if (lessonItem.xz_cx>0)
|
|
|
+ {
|
|
|
+ avg_cx+=1;
|
|
|
+ }
|
|
|
+ if (lessonItem.pj_nl>0)
|
|
|
+ {
|
|
|
+ avg_cx+=1;
|
|
|
+ }
|
|
|
+ if (lessonItem.rw_cx>0)
|
|
|
+ {
|
|
|
+ avg_cx+=1;
|
|
|
+ }
|
|
|
+ if (lessonItem.pc_df>0)
|
|
|
+ {
|
|
|
+ avg_cx+=1;
|
|
|
+
|
|
|
+ }
|
|
|
+ if (lessonItem.hd_cx>0)
|
|
|
+ {
|
|
|
+ avg_cx+=1;
|
|
|
+ }
|
|
|
+ xx_cx+=lessonItem.hd_cx * 1.0/avg_cx+ lessonItem.pc_df* 1.0/avg_cx+ lessonItem.rw_cx* 1.0/avg_cx+ lessonItem.pj_nl* 1.0/avg_cx+ lessonItem.xz_cx* 1.0/avg_cx;
|
|
|
+
|
|
|
+ if (lessonItem.xz_cy>0)
|
|
|
+ {
|
|
|
+ avg_cy+=1;
|
|
|
+ }
|
|
|
+ if (lessonItem.pj_nl>0)
|
|
|
+ {
|
|
|
+ avg_cy+=1;
|
|
|
+ }
|
|
|
+ if (lessonItem.rw_cy>0)
|
|
|
+ {
|
|
|
+ avg_cy+=1;
|
|
|
+ }
|
|
|
+ if (lessonItem.pc_zd>0)
|
|
|
+ {
|
|
|
+ avg_cy+=1;
|
|
|
+ }
|
|
|
+ if (lessonItem.hd_cy>0)
|
|
|
+ {
|
|
|
+ avg_cy+=1;
|
|
|
+ }
|
|
|
+ xx_cy+=lessonItem.hd_cy * 1.0/avg_cy+ lessonItem.pc_zd* 1.0/avg_cy+ lessonItem.rw_cy* 1.0/avg_cy+ lessonItem.pj_nl* 1.0/avg_cy+ lessonItem.xz_cy* 1.0/avg_cy;
|
|
|
+ lessonItem.xx_cx=xx_cx;
|
|
|
+ lessonItem.xx_cy=xx_cy;
|
|
|
+ lessonItems.Add(lessonItem);
|
|
|
+ }
|
|
|
+ return lessonItems;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
@@ -1396,7 +1628,7 @@ namespace HTEX.Lib.ETL.Lesson
|
|
|
/// <param name="studentLessonDatas"></param>
|
|
|
/// <param name="lessonDataAnalysis"></param>
|
|
|
/// <returns></returns>
|
|
|
- public static List<StudentLessonItem> ProcessStudentData(List<StudentLessonData> studentLessonDatas, LessonDataAnalysisCluster lessonDataAnalysis)
|
|
|
+ public static List<StudentLessonItem> ProcessStudentDataV1(List<StudentLessonData> studentLessonDatas, LessonDataAnalysisCluster lessonDataAnalysis)
|
|
|
{
|
|
|
//历史记录的个人计分集合,通过“2倍标准差规则”移除异常值后得到的集合
|
|
|
var max_q = lessonDataAnalysis.pscore.Max();
|
|
@@ -1439,9 +1671,9 @@ namespace HTEX.Lib.ETL.Lesson
|
|
|
//本节课教师手动给学生的个人计分
|
|
|
var s = studentLessonData.pscore;
|
|
|
//个人计分指数
|
|
|
- c = GetPersent(lessonDataAnalysis.pscore, s)/100;// s*1.0/max_q;
|
|
|
+ c = GetPersent(lessonDataAnalysis.pscore, s).persent/100;// s*1.0/max_q;
|
|
|
//互动计分指数
|
|
|
- d = GetPersent(lessonDataAnalysis.tscore, i)/100; //i*1.0/max_t;
|
|
|
+ d = GetPersent(lessonDataAnalysis.tscore, i).persent/100; //i*1.0/max_t;
|
|
|
//互动成效指数
|
|
|
var a = (d+w*kw/(j*m)+r*er/(j*m))*1.0/n;
|
|
|
//互动参与指数
|
|
@@ -1715,7 +1947,7 @@ namespace HTEX.Lib.ETL.Lesson
|
|
|
/// <param name="nums"></param>
|
|
|
/// <param name="curr"></param>
|
|
|
/// <returns></returns>
|
|
|
- public static double GetPersent(IEnumerable<double> nums, double curr)
|
|
|
+ public static (double persent,int count ) GetPersent(IEnumerable<double> nums, double curr)
|
|
|
{
|
|
|
int count = 0;
|
|
|
foreach (var op in nums.OrderBy(x => x))
|
|
@@ -1733,7 +1965,7 @@ namespace HTEX.Lib.ETL.Lesson
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- return count *1.0/ nums.Count() * 100;
|
|
|
+ return (count *1.0/ nums.Count() * 100,count);
|
|
|
}
|
|
|
}
|
|
|
/// <summary>
|
|
@@ -1877,7 +2109,7 @@ namespace HTEX.Lib.ETL.Lesson
|
|
|
/// <summary>
|
|
|
///
|
|
|
/// </summary>
|
|
|
- public List<KeyValuePair<double, List<int>>> clustersInteract { get; set; } = new List<KeyValuePair<double, List<int>>>();
|
|
|
+ public List<KeyValuePair<double, List<double>>> clustersInteract { get; set; } = new List<KeyValuePair<double, List<double>>>();
|
|
|
///// <summary>
|
|
|
/////
|
|
|
///// </summary>
|