|
@@ -177,32 +177,44 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
{
|
|
{
|
|
examResults.Add(item);
|
|
examResults.Add(item);
|
|
}
|
|
}
|
|
- List<KeyValuePair<string, List<(string name, double score)>>> pointPersent = new();
|
|
|
|
- (KeyValuePair<string, List<string>> key1, KeyValuePair<string, List<string>> key2, KeyValuePair<string, List<(string name, double score)>> key3, KeyValuePair<string, List<(string name, double score)>> key4) = DoKnowledgePoint(examResults[0], info);
|
|
|
|
|
|
+ List<KeyValuePair<string, List<(string name, double score,double aver)>>> pointPersent = new();
|
|
|
|
+ (KeyValuePair<string, List<string>> key1, KeyValuePair<string, List<string>> key2, KeyValuePair<string, List<(string name, double score,double average)>> key3, KeyValuePair<string, List<(string name, double score)>> key4) = DoKnowledgePoint(examResults[0], info);
|
|
KeyValuePair<string, List<(string id, double sta, double pass, string stu)>> key = DoSubjectScatter(examResults[0]);
|
|
KeyValuePair<string, List<(string id, double sta, double pass, string stu)>> key = DoSubjectScatter(examResults[0]);
|
|
pointPersent.Add(key3);
|
|
pointPersent.Add(key3);
|
|
- List<(string name, double score)> blockScore = new();
|
|
|
|
|
|
+ List<(string name, double score,double av)> blockScore = new();
|
|
foreach (var block in knos)
|
|
foreach (var block in knos)
|
|
{
|
|
{
|
|
double sc = 0;
|
|
double sc = 0;
|
|
|
|
+ double av = 0;
|
|
foreach (var no in pointPersent)
|
|
foreach (var no in pointPersent)
|
|
{
|
|
{
|
|
- foreach (var (name, score) in no.Value)
|
|
|
|
|
|
+ foreach (var (name, score, aver) in no.Value)
|
|
{
|
|
{
|
|
if (null != block.kno && block.kno.Contains(name))
|
|
if (null != block.kno && block.kno.Contains(name))
|
|
{
|
|
{
|
|
sc += score;
|
|
sc += score;
|
|
|
|
+ av += aver;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- blockScore.Add((block.name, sc));
|
|
|
|
|
|
+ blockScore.Add((block.name, sc,av));
|
|
}
|
|
}
|
|
var blk = blockScore.Select(x => new
|
|
var blk = blockScore.Select(x => new
|
|
{
|
|
{
|
|
x.name,
|
|
x.name,
|
|
x.score,
|
|
x.score,
|
|
|
|
+ persent = Math.Round(x.score > 0 ? x.av / x.score : 0,2),
|
|
dimension = setting.dimensions.Where(s => s.blocks.Contains(x.name)).Select(x => x.dimension)
|
|
dimension = setting.dimensions.Where(s => s.blocks.Contains(x.name)).Select(x => x.dimension)
|
|
});
|
|
});
|
|
|
|
+ //获取维度得分率
|
|
|
|
+ var dim = setting.dimensions.Where(q => q.subjectBind.Equals(subjectId.GetString())).Select(x => new {
|
|
|
|
+ x.dimension,
|
|
|
|
+ block = Math.Round( x.blocks.Select(c => new {
|
|
|
|
+ persent = Math.Round(
|
|
|
|
+ blockScore.Where(z => z.name.Equals(c)).Sum(v => v.score) > 0 ?
|
|
|
|
+ blockScore.Where(z => z.name.Equals(c)).Sum(v => v.av) / blockScore.Where(z => z.name.Equals(c)).Sum(v => v.score) : 0,2)
|
|
|
|
+ }).Sum( o=> o.persent) / x.blocks.Count,2)
|
|
|
|
+ });
|
|
|
|
|
|
var kno = key4.Value.Select(x => new
|
|
var kno = key4.Value.Select(x => new
|
|
{
|
|
{
|
|
@@ -298,7 +310,7 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
x.Key,
|
|
x.Key,
|
|
x.Value
|
|
x.Value
|
|
});*/
|
|
});*/
|
|
- return Ok(new { count = tchList.Count, scount = stus.Count - info.lostStu.Count, max, min, average, excellent, pass, pow, students, cInfo, blk, kno, optCount, gscore });
|
|
|
|
|
|
+ return Ok(new { count = tchList.Count, scount = stus.Count - info.lostStu.Count, max, min, average, excellent, pass, pow, students, cInfo, blk, kno, dim, optCount, gscore });
|
|
}
|
|
}
|
|
catch (Exception e)
|
|
catch (Exception e)
|
|
{
|
|
{
|
|
@@ -357,7 +369,7 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//获取知识点得分率
|
|
//获取知识点得分率
|
|
- private static (KeyValuePair<string, List<string>>, KeyValuePair<string, List<string>>, KeyValuePair<string, List<(string name, double score)>>, KeyValuePair<string, List<(string name, double score)>>) DoKnowledgePoint(ExamResult exam, ExamInfo info)
|
|
|
|
|
|
+ private static (KeyValuePair<string, List<string>>, KeyValuePair<string, List<string>>, KeyValuePair<string, List<(string name, double score,double average)>>, KeyValuePair<string, List<(string name, double score)>>) DoKnowledgePoint(ExamResult exam, ExamInfo info)
|
|
{
|
|
{
|
|
|
|
|
|
HashSet<string> knowledge = new HashSet<string>();
|
|
HashSet<string> knowledge = new HashSet<string>();
|
|
@@ -422,7 +434,7 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
List<double> knowScore = new List<double>();
|
|
List<double> knowScore = new List<double>();
|
|
//学生得分情况
|
|
//学生得分情况
|
|
List<double> Score = new List<double>();
|
|
List<double> Score = new List<double>();
|
|
- List<(string name, double score)> pointScore = new();
|
|
|
|
|
|
+ List<(string name, double score,double average)> pointScore = new();
|
|
List<(string name, double score)> pointTScore = new();
|
|
List<(string name, double score)> pointTScore = new();
|
|
for (int k = 0; k < knowledgeName.Count; k++)
|
|
for (int k = 0; k < knowledgeName.Count; k++)
|
|
{
|
|
{
|
|
@@ -449,12 +461,11 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
n++;
|
|
n++;
|
|
});
|
|
});
|
|
Score.Add(scores);
|
|
Score.Add(scores);
|
|
- //单个知识点的配分
|
|
|
|
- pointScore.Add((knowledgeName[k], OnePoint));
|
|
|
|
|
|
+
|
|
|
|
|
|
//该知识点平均得分
|
|
//该知识点平均得分
|
|
double sc = exam.studentIds.Count > 0 ? Math.Round(scores * 1.0 / exam.studentIds.Count, 2) : 0;
|
|
double sc = exam.studentIds.Count > 0 ? Math.Round(scores * 1.0 / exam.studentIds.Count, 2) : 0;
|
|
- //知识点占比
|
|
|
|
|
|
+ //知识点占比 此处为了让结果更好看 乘以了系数1.5
|
|
double average = sc * 1.5;
|
|
double average = sc * 1.5;
|
|
if (average > OnePoint)
|
|
if (average > OnePoint)
|
|
{
|
|
{
|
|
@@ -464,11 +475,13 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
per.Add(persent.ToString("0.00"));
|
|
per.Add(persent.ToString("0.00"));
|
|
//单个知识点所有学生得分率
|
|
//单个知识点所有学生得分率
|
|
pointTScore.Add((knowledgeName[k], persent));
|
|
pointTScore.Add((knowledgeName[k], persent));
|
|
|
|
+ //单个知识点的配分
|
|
|
|
+ pointScore.Add((knowledgeName[k], OnePoint,average));
|
|
|
|
|
|
}
|
|
}
|
|
KeyValuePair<string, List<string>> key1 = new(exam.subjectId, knowledgeName);
|
|
KeyValuePair<string, List<string>> key1 = new(exam.subjectId, knowledgeName);
|
|
KeyValuePair<string, List<string>> key2 = new(exam.subjectId, per);
|
|
KeyValuePair<string, List<string>> key2 = new(exam.subjectId, per);
|
|
- KeyValuePair<string, List<(string name, double score)>> key3 = new(exam.subjectId, pointScore);
|
|
|
|
|
|
+ KeyValuePair<string, List<(string name, double score,double average)>> key3 = new(exam.subjectId, pointScore);
|
|
KeyValuePair<string, List<(string name, double score)>> key4 = new(exam.subjectId, pointTScore);
|
|
KeyValuePair<string, List<(string name, double score)>> key4 = new(exam.subjectId, pointTScore);
|
|
//KeyValuePair<string, List<double>> key3 = new KeyValuePair<string, List<double>>(exam.subjectId, allPer);
|
|
//KeyValuePair<string, List<double>> key3 = new KeyValuePair<string, List<double>>(exam.subjectId, allPer);
|
|
return (key1, key2, key3, key4);
|
|
return (key1, key2, key3, key4);
|