|
@@ -157,11 +157,11 @@ namespace HTEX.Test.Controllers
|
|
"timeCount":
|
|
"timeCount":
|
|
*/
|
|
*/
|
|
bool loadLocal = true;
|
|
bool loadLocal = true;
|
|
- LessonDataAnlysis lessonDataAnlysis = new LessonDataAnlysis();
|
|
|
|
- var files_anlysis = files.Where(x => x.EndsWith("anlysis.json")).Take(1).FirstOrDefault();
|
|
|
|
|
|
+ LessonDataAnalysis lessonDataAnalysis = new LessonDataAnalysis();
|
|
|
|
+ var files_anlysis = files.Where(x => x.EndsWith("analysis.json")).Take(1).FirstOrDefault();
|
|
if (files_anlysis!=null) {
|
|
if (files_anlysis!=null) {
|
|
string jsons = await System.IO.File.ReadAllTextAsync(files_anlysis);
|
|
string jsons = await System.IO.File.ReadAllTextAsync(files_anlysis);
|
|
- lessonDataAnlysis= jsons.ToObject<LessonDataAnlysis>();
|
|
|
|
|
|
+ lessonDataAnalysis= jsons.ToObject<LessonDataAnalysis>();
|
|
loadLocal=false;
|
|
loadLocal=false;
|
|
}
|
|
}
|
|
if (loadLocal) {
|
|
if (loadLocal) {
|
|
@@ -203,106 +203,106 @@ namespace HTEX.Test.Controllers
|
|
Console.WriteLine($"techCounts:{techCounts.Count}");
|
|
Console.WriteLine($"techCounts:{techCounts.Count}");
|
|
//标准差偏差N倍,视为异常数据
|
|
//标准差偏差N倍,视为异常数据
|
|
int thresholdMultiplier = 2;
|
|
int thresholdMultiplier = 2;
|
|
- lessonDataAnlysis.pscore = techCounts.SelectMany(x =>x.pscore);
|
|
|
|
- lessonDataAnlysis.pscore= CleanDataBySDThreshold(lessonDataAnlysis.pscore, thresholdMultiplier).OrderBy(x => x);
|
|
|
|
|
|
+ lessonDataAnalysis.pscore = techCounts.SelectMany(x =>x.pscore);
|
|
|
|
+ lessonDataAnalysis.pscore= CleanDataBySDThreshold(lessonDataAnalysis.pscore, thresholdMultiplier).OrderBy(x => x);
|
|
List<KeyValuePair<double, List<double>>> clustersDataPscore = new();
|
|
List<KeyValuePair<double, List<double>>> clustersDataPscore = new();
|
|
- var clusterPscore = KMeansService.KMeans(lessonDataAnlysis.pscore.Select(x => x).OrderBy(x => x));
|
|
|
|
|
|
+ var clusterPscore = KMeansService.KMeans(lessonDataAnalysis.pscore.Select(x => x).OrderBy(x => x));
|
|
foreach (var item in clusterPscore)
|
|
foreach (var item in clusterPscore)
|
|
{
|
|
{
|
|
Console.WriteLine($"dp:{item.Key} ,avg: {item.Value.Average()}, count: {item.Value.Count}, min:{item.Value.Min()}, max:{item.Value.Max()}");
|
|
Console.WriteLine($"dp:{item.Key} ,avg: {item.Value.Average()}, count: {item.Value.Count}, min:{item.Value.Min()}, max:{item.Value.Max()}");
|
|
}
|
|
}
|
|
- Console.WriteLine($"avg: {lessonDataAnlysis.pscore.Average()}");
|
|
|
|
|
|
+ Console.WriteLine($"avg: {lessonDataAnalysis.pscore.Average()}");
|
|
|
|
|
|
foreach (var s in clusterPscore.OrderBy(x => x.Key))
|
|
foreach (var s in clusterPscore.OrderBy(x => x.Key))
|
|
{
|
|
{
|
|
clustersDataPscore.Add(s);
|
|
clustersDataPscore.Add(s);
|
|
}
|
|
}
|
|
- lessonDataAnlysis.clustersPscore=clustersDataPscore;
|
|
|
|
|
|
+ lessonDataAnalysis.clustersPscore=clustersDataPscore;
|
|
|
|
|
|
- lessonDataAnlysis.gscore = techCounts.SelectMany(x => x.gscore);
|
|
|
|
- lessonDataAnlysis.gscore= CleanDataBySDThreshold(lessonDataAnlysis.gscore, thresholdMultiplier).OrderBy(x => x);
|
|
|
|
|
|
+ lessonDataAnalysis.gscore = techCounts.SelectMany(x => x.gscore);
|
|
|
|
+ lessonDataAnalysis.gscore= CleanDataBySDThreshold(lessonDataAnalysis.gscore, thresholdMultiplier).OrderBy(x => x);
|
|
List<KeyValuePair<double, List<double>>> clustersDataGscore = new();
|
|
List<KeyValuePair<double, List<double>>> clustersDataGscore = new();
|
|
- var clusterGscore = KMeansService.KMeans(lessonDataAnlysis.gscore.Select(x => x).OrderBy(x => x));
|
|
|
|
|
|
+ var clusterGscore = KMeansService.KMeans(lessonDataAnalysis.gscore.Select(x => x).OrderBy(x => x));
|
|
foreach (var item in clusterGscore)
|
|
foreach (var item in clusterGscore)
|
|
{
|
|
{
|
|
Console.WriteLine($"dp:{item.Key} ,avg: {item.Value.Average()}, count: {item.Value.Count}, min:{item.Value.Min()}, max:{item.Value.Max()}");
|
|
Console.WriteLine($"dp:{item.Key} ,avg: {item.Value.Average()}, count: {item.Value.Count}, min:{item.Value.Min()}, max:{item.Value.Max()}");
|
|
}
|
|
}
|
|
- Console.WriteLine($"avg: {lessonDataAnlysis.gscore.Average()}");
|
|
|
|
|
|
+ Console.WriteLine($"avg: {lessonDataAnalysis.gscore.Average()}");
|
|
|
|
|
|
foreach (var s in clusterGscore.OrderBy(x => x.Key))
|
|
foreach (var s in clusterGscore.OrderBy(x => x.Key))
|
|
{
|
|
{
|
|
clustersDataGscore.Add(s);
|
|
clustersDataGscore.Add(s);
|
|
}
|
|
}
|
|
- lessonDataAnlysis.clustersGscore=clustersDataGscore;
|
|
|
|
|
|
+ lessonDataAnalysis.clustersGscore=clustersDataGscore;
|
|
|
|
|
|
|
|
|
|
- lessonDataAnlysis.tscore = techCounts.SelectMany(x => x.tscore);
|
|
|
|
- lessonDataAnlysis.tscore= CleanDataBySDThreshold(lessonDataAnlysis.tscore, thresholdMultiplier).OrderBy(x => x);
|
|
|
|
|
|
+ lessonDataAnalysis.tscore = techCounts.SelectMany(x => x.tscore);
|
|
|
|
+ lessonDataAnalysis.tscore= CleanDataBySDThreshold(lessonDataAnalysis.tscore, thresholdMultiplier).OrderBy(x => x);
|
|
List<KeyValuePair<double, List<double>>> clustersDataTscore = new();
|
|
List<KeyValuePair<double, List<double>>> clustersDataTscore = new();
|
|
- var clusterTscore = KMeansService.KMeans(lessonDataAnlysis.tscore.Select(x => x).OrderBy(x => x));
|
|
|
|
|
|
+ var clusterTscore = KMeansService.KMeans(lessonDataAnalysis.tscore.Select(x => x).OrderBy(x => x));
|
|
foreach (var item in clusterTscore)
|
|
foreach (var item in clusterTscore)
|
|
{
|
|
{
|
|
Console.WriteLine($"dp:{item.Key} ,avg: {item.Value.Average()}, count: {item.Value.Count}, min:{item.Value.Min()}, max:{item.Value.Max()}");
|
|
Console.WriteLine($"dp:{item.Key} ,avg: {item.Value.Average()}, count: {item.Value.Count}, min:{item.Value.Min()}, max:{item.Value.Max()}");
|
|
}
|
|
}
|
|
- Console.WriteLine($"avg: {lessonDataAnlysis.tscore.Average()}");
|
|
|
|
|
|
+ Console.WriteLine($"avg: {lessonDataAnalysis.tscore.Average()}");
|
|
foreach (var s in clusterTscore.OrderBy(x => x.Key))
|
|
foreach (var s in clusterTscore.OrderBy(x => x.Key))
|
|
{
|
|
{
|
|
clustersDataTscore.Add(s);
|
|
clustersDataTscore.Add(s);
|
|
}
|
|
}
|
|
- lessonDataAnlysis.clustersTscore=clustersDataTscore;
|
|
|
|
|
|
+ lessonDataAnalysis.clustersTscore=clustersDataTscore;
|
|
|
|
|
|
|
|
|
|
- lessonDataAnlysis.cowork = techCounts.Where(x => x.coworkCount>0).Select(x => (double)x.coworkCount);
|
|
|
|
- lessonDataAnlysis.cowork= CleanDataBySDThreshold(lessonDataAnlysis.cowork, thresholdMultiplier);
|
|
|
|
|
|
+ lessonDataAnalysis.cowork = techCounts.Where(x => x.coworkCount>0).Select(x => (double)x.coworkCount);
|
|
|
|
+ lessonDataAnalysis.cowork= CleanDataBySDThreshold(lessonDataAnalysis.cowork, thresholdMultiplier);
|
|
|
|
|
|
- lessonDataAnlysis.coworkBase = techCounts.Where(x => x.coworkCountBase>0).Select(x => (double)x.coworkCountBase);
|
|
|
|
- lessonDataAnlysis.coworkBase= CleanDataBySDThreshold(lessonDataAnlysis.coworkBase, thresholdMultiplier);
|
|
|
|
|
|
+ lessonDataAnalysis.coworkBase = techCounts.Where(x => x.coworkCountBase>0).Select(x => (double)x.coworkCountBase);
|
|
|
|
+ lessonDataAnalysis.coworkBase= CleanDataBySDThreshold(lessonDataAnalysis.coworkBase, thresholdMultiplier);
|
|
|
|
|
|
- lessonDataAnlysis.task = techCounts.Where(x => x.taskCount > 0).Select(x => (double)x.taskCount);
|
|
|
|
- lessonDataAnlysis.task= CleanDataBySDThreshold(lessonDataAnlysis.task, thresholdMultiplier);
|
|
|
|
|
|
+ lessonDataAnalysis.task = techCounts.Where(x => x.taskCount > 0).Select(x => (double)x.taskCount);
|
|
|
|
+ lessonDataAnalysis.task= CleanDataBySDThreshold(lessonDataAnalysis.task, thresholdMultiplier);
|
|
|
|
|
|
- lessonDataAnlysis.taskBase = techCounts.Where(x => x.taskCountBase > 0).Select(x => (double)x.taskCountBase);
|
|
|
|
- lessonDataAnlysis.taskBase = CleanDataBySDThreshold(lessonDataAnlysis.taskBase, thresholdMultiplier);
|
|
|
|
|
|
+ lessonDataAnalysis.taskBase = techCounts.Where(x => x.taskCountBase > 0).Select(x => (double)x.taskCountBase);
|
|
|
|
+ lessonDataAnalysis.taskBase = CleanDataBySDThreshold(lessonDataAnalysis.taskBase, thresholdMultiplier);
|
|
|
|
|
|
|
|
|
|
- lessonDataAnlysis.exam = techCounts.Where(x => x.examCount > 0).Select(x => (double)x.examCount);
|
|
|
|
- lessonDataAnlysis.exam = CleanDataBySDThreshold(lessonDataAnlysis.exam, thresholdMultiplier);
|
|
|
|
|
|
+ lessonDataAnalysis.exam = techCounts.Where(x => x.examCount > 0).Select(x => (double)x.examCount);
|
|
|
|
+ lessonDataAnalysis.exam = CleanDataBySDThreshold(lessonDataAnalysis.exam, thresholdMultiplier);
|
|
|
|
|
|
- lessonDataAnlysis.examBase = techCounts.Where(x => x.examCountBase > 0).Select(x => (double)x.examCountBase);
|
|
|
|
- lessonDataAnlysis.examBase = CleanDataBySDThreshold(lessonDataAnlysis.examBase, thresholdMultiplier);
|
|
|
|
|
|
+ lessonDataAnalysis.examBase = techCounts.Where(x => x.examCountBase > 0).Select(x => (double)x.examCountBase);
|
|
|
|
+ lessonDataAnalysis.examBase = CleanDataBySDThreshold(lessonDataAnalysis.examBase, thresholdMultiplier);
|
|
|
|
|
|
|
|
|
|
- lessonDataAnlysis.smartRating = techCounts.Where(x => x.smartRatingCount > 0).Select(x => (double)x.smartRatingCount);
|
|
|
|
- lessonDataAnlysis.smartRating = CleanDataBySDThreshold(lessonDataAnlysis.smartRating, thresholdMultiplier);
|
|
|
|
|
|
+ lessonDataAnalysis.smartRating = techCounts.Where(x => x.smartRatingCount > 0).Select(x => (double)x.smartRatingCount);
|
|
|
|
+ lessonDataAnalysis.smartRating = CleanDataBySDThreshold(lessonDataAnalysis.smartRating, thresholdMultiplier);
|
|
|
|
|
|
- lessonDataAnlysis.smartRatingBase = techCounts.Where(x => x.smartRatingCountBase > 0).Select(x => (double)x.smartRatingCountBase);
|
|
|
|
- lessonDataAnlysis.smartRatingBase = CleanDataBySDThreshold(lessonDataAnlysis.smartRatingBase, thresholdMultiplier);
|
|
|
|
|
|
+ lessonDataAnalysis.smartRatingBase = techCounts.Where(x => x.smartRatingCountBase > 0).Select(x => (double)x.smartRatingCountBase);
|
|
|
|
+ lessonDataAnalysis.smartRatingBase = CleanDataBySDThreshold(lessonDataAnalysis.smartRatingBase, thresholdMultiplier);
|
|
|
|
|
|
- lessonDataAnlysis.irs = techCounts.Where(x => x.irsCount > 0).Select(x => (double)x.irsCount);
|
|
|
|
- lessonDataAnlysis.irs = CleanDataBySDThreshold(lessonDataAnlysis.irs, thresholdMultiplier);
|
|
|
|
|
|
+ lessonDataAnalysis.irs = techCounts.Where(x => x.irsCount > 0).Select(x => (double)x.irsCount);
|
|
|
|
+ lessonDataAnalysis.irs = CleanDataBySDThreshold(lessonDataAnalysis.irs, thresholdMultiplier);
|
|
|
|
|
|
|
|
|
|
- lessonDataAnlysis.interactNormal = techCounts.Where(x => x.interactNormalCount > 0).Select(x => (double)x.interactNormalCount);
|
|
|
|
|
|
+ lessonDataAnalysis.interactNormal = techCounts.Where(x => x.interactNormalCount > 0).Select(x => (double)x.interactNormalCount);
|
|
|
|
|
|
- Console.WriteLine($"interactNormal{lessonDataAnlysis.interactNormal.Count()}");
|
|
|
|
- lessonDataAnlysis.interactNormal= CleanDataBySDThreshold(lessonDataAnlysis.interactNormal, thresholdMultiplier).OrderBy(x => x);
|
|
|
|
- Console.WriteLine($"interactNormal{lessonDataAnlysis.interactNormal.Count()}");
|
|
|
|
|
|
+ Console.WriteLine($"interactNormal{lessonDataAnalysis.interactNormal.Count()}");
|
|
|
|
+ lessonDataAnalysis.interactNormal= CleanDataBySDThreshold(lessonDataAnalysis.interactNormal, thresholdMultiplier).OrderBy(x => x);
|
|
|
|
+ Console.WriteLine($"interactNormal{lessonDataAnalysis.interactNormal.Count()}");
|
|
|
|
|
|
|
|
|
|
var tcount = techCounts.Where(x => x.coworkCount > 0 || x.taskCount>0 || x.interactNormalCount>0|| x.examCount>0 || x.smartRatingCount>0);
|
|
var tcount = techCounts.Where(x => x.coworkCount > 0 || x.taskCount>0 || x.interactNormalCount>0|| x.examCount>0 || x.smartRatingCount>0);
|
|
- double coworkWeight = lessonDataAnlysis.cowork.Count()*1.0/tcount.Count();
|
|
|
|
- lessonDataAnlysis.coworkWeight=coworkWeight;
|
|
|
|
- double taskWeight = lessonDataAnlysis.task.Count()*1.0/tcount.Count();
|
|
|
|
- lessonDataAnlysis.taskWeight=taskWeight;
|
|
|
|
- double interactWeight = lessonDataAnlysis.interactNormal.Count()*1.0/tcount.Count();
|
|
|
|
- lessonDataAnlysis.interactWeight=interactWeight;
|
|
|
|
- double examWeight = lessonDataAnlysis. exam.Count()*1.0/tcount.Count();
|
|
|
|
- lessonDataAnlysis.examWeight=examWeight;
|
|
|
|
- double smartRatingWeight = lessonDataAnlysis. smartRating.Count()*1.0/tcount.Count();
|
|
|
|
- lessonDataAnlysis.smartRatingWeight=smartRatingWeight;
|
|
|
|
|
|
+ double coworkWeight = lessonDataAnalysis.cowork.Count()*1.0/tcount.Count();
|
|
|
|
+ lessonDataAnalysis.coworkWeight=coworkWeight;
|
|
|
|
+ double taskWeight = lessonDataAnalysis.task.Count()*1.0/tcount.Count();
|
|
|
|
+ lessonDataAnalysis.taskWeight=taskWeight;
|
|
|
|
+ double interactWeight = lessonDataAnalysis.interactNormal.Count()*1.0/tcount.Count();
|
|
|
|
+ lessonDataAnalysis.interactWeight=interactWeight;
|
|
|
|
+ double examWeight = lessonDataAnalysis. exam.Count()*1.0/tcount.Count();
|
|
|
|
+ lessonDataAnalysis.examWeight=examWeight;
|
|
|
|
+ double smartRatingWeight = lessonDataAnalysis. smartRating.Count()*1.0/tcount.Count();
|
|
|
|
+ lessonDataAnalysis.smartRatingWeight=smartRatingWeight;
|
|
|
|
|
|
List<KeyValuePair<double, List<int>>> clustersDataInteract = new();
|
|
List<KeyValuePair<double, List<int>>> clustersDataInteract = new();
|
|
- var clusterInteract = KMeansService.KMeans(lessonDataAnlysis.interactNormal.Select(x => (int)x).OrderBy(x => x));
|
|
|
|
|
|
+ var clusterInteract = KMeansService.KMeans(lessonDataAnalysis.interactNormal.Select(x => (int)x).OrderBy(x => x));
|
|
foreach (var item in clusterInteract)
|
|
foreach (var item in clusterInteract)
|
|
{
|
|
{
|
|
Console.WriteLine($"dp:{item.Key} ,avg: {item.Value.Average()}, count: {item.Value.Count}, min:{item.Value.Min()}, max:{item.Value.Max()}");
|
|
Console.WriteLine($"dp:{item.Key} ,avg: {item.Value.Average()}, count: {item.Value.Count}, min:{item.Value.Min()}, max:{item.Value.Max()}");
|
|
@@ -311,7 +311,7 @@ namespace HTEX.Test.Controllers
|
|
{
|
|
{
|
|
clustersDataInteract.Add(s);
|
|
clustersDataInteract.Add(s);
|
|
}
|
|
}
|
|
- lessonDataAnlysis.clustersInteract=clustersDataInteract;
|
|
|
|
|
|
+ lessonDataAnalysis.clustersInteract=clustersDataInteract;
|
|
var groups = techCounts.SelectMany(x => x.timeCount).GroupBy(x => x.code).Select(x => new { key = x.Key, list = x.ToList() });
|
|
var groups = techCounts.SelectMany(x => x.timeCount).GroupBy(x => x.code).Select(x => new { key = x.Key, list = x.ToList() });
|
|
Dictionary<string, IEnumerable<double>> techDict = new Dictionary<string, IEnumerable<double>>();
|
|
Dictionary<string, IEnumerable<double>> techDict = new Dictionary<string, IEnumerable<double>>();
|
|
foreach (var group in groups)
|
|
foreach (var group in groups)
|
|
@@ -320,7 +320,7 @@ namespace HTEX.Test.Controllers
|
|
array = CleanDataBySDThreshold(array, thresholdMultiplier);
|
|
array = CleanDataBySDThreshold(array, thresholdMultiplier);
|
|
techDict.Add(group.key, array);
|
|
techDict.Add(group.key, array);
|
|
}
|
|
}
|
|
- System.IO. File.WriteAllText(Path.Combine(path, "anlysis.json"), lessonDataAnlysis.ToJsonString());
|
|
|
|
|
|
+ System.IO. File.WriteAllText(Path.Combine(path, "analysis.json"), lessonDataAnalysis.ToJsonString());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -343,7 +343,7 @@ namespace HTEX.Test.Controllers
|
|
if (techCount != null)
|
|
if (techCount != null)
|
|
{
|
|
{
|
|
|
|
|
|
- IEnumerable<double> interact = lessonDataAnlysis.interactNormal;
|
|
|
|
|
|
+ IEnumerable<double> interact = lessonDataAnalysis.interactNormal;
|
|
int interactCount = techCount.interactNormalCount;
|
|
int interactCount = techCount.interactNormalCount;
|
|
//当前课例的互动次数在互动总列表超过N%;
|
|
//当前课例的互动次数在互动总列表超过N%;
|
|
//var persent = GetPersent(interact, interactCount);
|
|
//var persent = GetPersent(interact, interactCount);
|
|
@@ -370,21 +370,24 @@ namespace HTEX.Test.Controllers
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//个人计分最大值
|
|
//个人计分最大值
|
|
- var q = lessonDataAnlysis.pscore.Max();
|
|
|
|
|
|
+ var q = lessonDataAnalysis.pscore.Max();
|
|
//互动计分最大值
|
|
//互动计分最大值
|
|
- var t = lessonDataAnlysis.tscore.Max();
|
|
|
|
|
|
+ var t = lessonDataAnalysis.tscore.Max();
|
|
if (studentLessonData.interactRecord.interactRecords.Count==interactCount && interactCount>0)
|
|
if (studentLessonData.interactRecord.interactRecords.Count==interactCount && interactCount>0)
|
|
{
|
|
{
|
|
//互动次数
|
|
//互动次数
|
|
var n = studentLessonData.interactRecord.interactRecords.Count()*1.0;
|
|
var n = studentLessonData.interactRecord.interactRecords.Count()*1.0;
|
|
//聚类分数量大和数量小的类群。判断当前出题数在两个类群的最大范围内,再取其质心。
|
|
//聚类分数量大和数量小的类群。判断当前出题数在两个类群的最大范围内,再取其质心。
|
|
- var m = n<=lessonDataAnlysis.clustersInteract.First().Value.Max() ? lessonDataAnlysis.clustersInteract.First().Key*1.0 : lessonDataAnlysis.clustersInteract.Last().Key *1.0;
|
|
|
|
|
|
+ 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 w = studentLessonData.interactRecord.interactRecords.Where(x => x.resultWeight>=InteractWeight.T1).Count()*1.0;
|
|
- var r = studentLessonData.interactRecord.interactRecords.Where(x => x.resultWeight>InteractWeight.TT).Count()*1.0;
|
|
|
|
- var p = InteractWeight.TT;
|
|
|
|
|
|
+ var r = studentLessonData.interactRecord.interactRecords.Where(x => x.resultWeight>InteractWeight.T1).Count()*1.0;
|
|
|
|
+ var k = studentLessonData.interactRecord.interactRecords.Where(x => x.resultWeight>=InteractWeight.T1).Sum(x=> x.itemScore*1.0);
|
|
|
|
+ var e = studentLessonData.interactRecord.interactRecords.Where(x => x.resultWeight>InteractWeight.T1).Sum(x => x.itemScore*1.0);
|
|
var j = InteractWeight.T1;
|
|
var j = InteractWeight.T1;
|
|
//学习成效算法
|
|
//学习成效算法
|
|
- x=((i/t) + ((n/m)*(w*(w/n)+(p/j)* (r/n) *r)))/n;
|
|
|
|
|
|
+ //x=((i/t) + ((n/m)*(w*(w/n)+(p/j)* (r/n) *r)))/n;
|
|
|
|
+ x=((i/t) +(w*k)/(j*m) +(r*e)/(j*m) )/n;
|
|
|
|
+
|
|
y=((n/m)*(w*(w/n)+ (r/n) *r))/n;
|
|
y=((n/m)*(w*(w/n)+ (r/n) *r))/n;
|
|
// var rate = w*100.0/interactCount;
|
|
// var rate = w*100.0/interactCount;
|
|
// studentLessonData.interactRecord.interactScore=data;
|
|
// studentLessonData.interactRecord.interactScore=data;
|
|
@@ -419,10 +422,10 @@ namespace HTEX.Test.Controllers
|
|
return Ok(new
|
|
return Ok(new
|
|
{
|
|
{
|
|
lessons,
|
|
lessons,
|
|
- interactNormal = lessonDataAnlysis.interactNormal.OrderByDescending(x=>x),
|
|
|
|
- cowork = lessonDataAnlysis.cowork.OrderByDescending(x => x),
|
|
|
|
- exam = lessonDataAnlysis.exam.OrderByDescending(x => x),
|
|
|
|
- smartRating = lessonDataAnlysis.smartRating.OrderByDescending(x => x),
|
|
|
|
|
|
+ interactNormal = lessonDataAnalysis.interactNormal.OrderByDescending(x=>x),
|
|
|
|
+ cowork = lessonDataAnalysis.cowork.OrderByDescending(x => x),
|
|
|
|
+ exam = lessonDataAnalysis.exam.OrderByDescending(x => x),
|
|
|
|
+ smartRating = lessonDataAnalysis.smartRating.OrderByDescending(x => x),
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
@@ -491,7 +494,7 @@ namespace HTEX.Test.Controllers
|
|
return filePaths;
|
|
return filePaths;
|
|
}
|
|
}
|
|
|
|
|
|
- public class LessonDataAnlysis
|
|
|
|
|
|
+ public class LessonDataAnalysis
|
|
{
|
|
{
|
|
public long updateTime { get; set; }
|
|
public long updateTime { get; set; }
|
|
public IEnumerable<double> cowork { get; set; } = new List<double>();
|
|
public IEnumerable<double> cowork { get; set; } = new List<double>();
|
|
@@ -1686,6 +1689,7 @@ namespace HTEX.Test.Controllers
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
private List<StudentLessonData> GetCoworkData( LessonBase lessonBase, TimeLineData timeLineData, List<CoworkData> coworkDatas, List<StudentLessonData> studentLessonDatas)
|
|
private List<StudentLessonData> GetCoworkData( LessonBase lessonBase, TimeLineData timeLineData, List<CoworkData> coworkDatas, List<StudentLessonData> studentLessonDatas)
|
|
{
|
|
{
|
|
|
|
+ int p = 0;
|
|
foreach (var coworkData in coworkDatas)
|
|
foreach (var coworkData in coworkDatas)
|
|
{
|
|
{
|
|
var keys = coworkData.participateLevelList.Keys;
|
|
var keys = coworkData.participateLevelList.Keys;
|
|
@@ -1699,8 +1703,8 @@ namespace HTEX.Test.Controllers
|
|
//不能完全依赖
|
|
//不能完全依赖
|
|
if (score>0)
|
|
if (score>0)
|
|
{
|
|
{
|
|
- itemRecord.resultWeight = InteractWeight.T1;
|
|
|
|
- itemRecord.resultType = InteractReultType.T1;
|
|
|
|
|
|
+ itemRecord.resultWeight = InteractWeight.TP;
|
|
|
|
+ itemRecord.resultType = InteractReultType.TP;
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
itemRecord.resultWeight = InteractWeight.T0;
|
|
itemRecord.resultWeight = InteractWeight.T0;
|
|
@@ -1709,7 +1713,29 @@ namespace HTEX.Test.Controllers
|
|
student.coworkRecord.itemRecords.Add(itemRecord);
|
|
student.coworkRecord.itemRecords.Add(itemRecord);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ var order = studentLessonDatas.OrderByDescending(x => x.coworkRecord.itemRecords[p].itemScore);
|
|
|
|
+ var maxItems = studentLessonDatas.FindAll(x => x.coworkRecord.itemRecords[p].itemScore==order.First().coworkRecord.itemRecords[p].itemScore);
|
|
|
|
+ var max = studentLessonDatas.FindAll(x => x.coworkRecord.itemRecords[p].itemScore==order.First().coworkRecord.itemRecords[p].itemScore).First().coworkRecord.itemRecords[p].itemScore;
|
|
|
|
+ var min = studentLessonDatas.FindAll(x => x.coworkRecord.itemRecords[p].itemScore==order.Last().coworkRecord.itemRecords[p].itemScore).First().coworkRecord.itemRecords[p].itemScore;
|
|
|
|
+ var sum = studentLessonDatas.Sum(x => x.coworkRecord.itemRecords[p].itemScore);
|
|
|
|
+ foreach (var student in studentLessonDatas)
|
|
|
|
+ {
|
|
|
|
+ if (student.attend==1 && student.coworkRecord.itemRecords.Count>=p+1 && student.coworkRecord.itemRecords[p].itemScore>0)
|
|
|
|
+ {
|
|
|
|
+ student.coworkRecord.itemRecords[p].resultType=InteractReultType.TP;
|
|
|
|
+ var data = MinMaxNormalization(min, max, student.coworkRecord.itemRecords[p].itemScore);
|
|
|
|
+ student.coworkRecord.itemRecords[p].resultWeight=InteractWeight.T1+ data * 1.0 / 100 * (InteractWeight.TT-InteractWeight.T1);
|
|
|
|
+ if (maxItems.Select(x => x.seatID).Contains(student.seatID))
|
|
|
|
+ {
|
|
|
|
+ student.coworkRecord.itemRecords[p].resultType= InteractReultType.TT;
|
|
|
|
+ student.coworkRecord.itemRecords[p].resultWeight= InteractWeight.TT;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ p++;
|
|
}
|
|
}
|
|
|
|
+
|
|
return studentLessonDatas;
|
|
return studentLessonDatas;
|
|
}
|
|
}
|
|
|
|
|