|
@@ -179,10 +179,16 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
examResults.Add(item);
|
|
|
}
|
|
|
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);
|
|
|
+ List<KeyValuePair<string, List<(string name, double score, double point, string sId)>>> stuPersent = 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, KeyValuePair<string, List<(string name, double score, double point, string cId)>> key5,
|
|
|
+ KeyValuePair<string, List<(string name, double score, double point, string sId)>> key6) = DoKnowledgePoint(examResults[0], info);
|
|
|
KeyValuePair<string, List<(string id, double sta, double pass, string stu)>> key = DoSubjectScatter(examResults[0]);
|
|
|
pointPersent.Add(key3);
|
|
|
+ stuPersent.Add(key6);
|
|
|
List<(string name, double score, double av)> blockScore = new();
|
|
|
+ List<(string name, double score, double av, string sId)> stuBlockScore = new();
|
|
|
+ List<(string name, double score, double av, string cId)> claBlockScore = new();
|
|
|
foreach (var block in knos)
|
|
|
{
|
|
|
double sc = 0;
|
|
@@ -198,8 +204,50 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ foreach (var (name, score, point, sId) in key6.Value)
|
|
|
+ {
|
|
|
+ double realScore = 0;
|
|
|
+ double realPoint = 0;
|
|
|
+ if (null != block.kno && block.kno.Contains(name))
|
|
|
+ {
|
|
|
+ realScore = score;
|
|
|
+ realPoint = point;
|
|
|
+ }
|
|
|
+ stuBlockScore.Add((block.name, realScore, realPoint, sId));
|
|
|
+ }
|
|
|
+ foreach (var (name, score, point, cId) in key5.Value)
|
|
|
+ {
|
|
|
+ double realScore = 0;
|
|
|
+ double realPoint = 0;
|
|
|
+ if (null != block.kno && block.kno.Contains(name))
|
|
|
+ {
|
|
|
+ realScore = score;
|
|
|
+ realPoint = point;
|
|
|
+ }
|
|
|
+ claBlockScore.Add((block.name, realScore, realPoint, cId));
|
|
|
+ }
|
|
|
blockScore.Add((block.name, sc, av));
|
|
|
}
|
|
|
+ var stuBlock = stuBlockScore.GroupBy(x => x.sId).Select(z => new
|
|
|
+ {
|
|
|
+ z.Key,
|
|
|
+ block = z.ToList().GroupBy(c => c.name).Select(k => new
|
|
|
+ {
|
|
|
+ k.Key,
|
|
|
+ score = k.ToList().Sum(p => p.score),
|
|
|
+ point = k.ToList().Sum(p => p.av)
|
|
|
+ })
|
|
|
+ });
|
|
|
+ var claBlock = claBlockScore.GroupBy(x => x.cId).Select(z => new
|
|
|
+ {
|
|
|
+ z.Key,
|
|
|
+ block = z.ToList().GroupBy(c => c.name).Select(k => new
|
|
|
+ {
|
|
|
+ k.Key,
|
|
|
+ score = k.ToList().Sum(p => p.score),
|
|
|
+ point = k.ToList().Sum(p => p.av)
|
|
|
+ })
|
|
|
+ });
|
|
|
var blk = blockScore.Select(x => new
|
|
|
{
|
|
|
x.name,
|
|
@@ -208,6 +256,39 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
dimension = setting.dimensions.Where(s => s.blocks.Contains(x.name)).Select(x => x.dimension)
|
|
|
});
|
|
|
//获取维度得分率
|
|
|
+ List<(string stuId, double score, double point, string dim)> stuDims = new();
|
|
|
+ List<(string claId, double score, double point, string dim)> claDims = new();
|
|
|
+ foreach (var dimm in setting.dimensions)
|
|
|
+ {
|
|
|
+ double dimScore = 0;
|
|
|
+ double dimPoint = 0;
|
|
|
+ if (dimm.subjectBind.Equals(subjectId.GetString()))
|
|
|
+ {
|
|
|
+ foreach (var stuDim in stuBlock)
|
|
|
+ {
|
|
|
+ foreach (var dd in stuDim.block)
|
|
|
+ {
|
|
|
+ if (dimm.blocks.Contains(dd.Key))
|
|
|
+ {
|
|
|
+ dimScore += dd.score;
|
|
|
+ dimPoint += dd.point;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ stuDims.Add((stuDim.Key, dimScore, dimPoint, dimm.dimension));
|
|
|
+ }
|
|
|
+ foreach (var claDim in claBlock) {
|
|
|
+ foreach (var dd in claDim.block)
|
|
|
+ {
|
|
|
+ if (dimm.blocks.Contains(dd.Key))
|
|
|
+ {
|
|
|
+ dimScore += dd.score;
|
|
|
+ dimPoint += dd.point;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ claDims.Add((claDim.Key, dimScore, dimPoint, dimm.dimension));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
var dim = setting.dimensions.Where(q => q.subjectBind.Equals(subjectId.GetString())).Select(x => new
|
|
|
{
|
|
|
x.dimension,
|
|
@@ -219,6 +300,7 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
}).Sum(o => o.persent) / x.blocks.Count, 2)
|
|
|
});
|
|
|
|
|
|
+
|
|
|
var kno = key4.Value.Select(x => new
|
|
|
{
|
|
|
x.name,
|
|
@@ -237,8 +319,25 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
key.Value.Where(c => c.id.Equals(s.sIds)).FirstOrDefault().sta,
|
|
|
key.Value.Where(c => c.id.Equals(s.sIds)).FirstOrDefault().pass,
|
|
|
key.Value.Where(c => c.id.Equals(s.sIds)).FirstOrDefault().stu,
|
|
|
+ kno = key6.Value.Where(c => c.sId.Equals(s.sIds)).Select(z => new
|
|
|
+ {
|
|
|
+ z.name,
|
|
|
+ persent = Math.Round(z.point > 0 ? z.score / z.point : 0, 2),
|
|
|
+ block = knos.Where(v => null != v.kno && v.kno.Contains(z.name)).Select(x => x.name)
|
|
|
+ }),
|
|
|
+ block = stuBlock.Where(c => c.Key.Equals(s.sIds)).FirstOrDefault().block.Select(x => new
|
|
|
+ {
|
|
|
+ name = x.Key,
|
|
|
+ persent = Math.Round(x.point > 0 ? x.score / x.point : 0, 2)
|
|
|
+ }),
|
|
|
+ dim = stuDims.Where(c => c.stuId.Equals(s.sIds)).Select(z => new
|
|
|
+ {
|
|
|
+ name = z.dim,
|
|
|
+ persent = Math.Round(z.point > 0 ? z.score / z.point : 0, 2)
|
|
|
+ })
|
|
|
+
|
|
|
});
|
|
|
- List<(string cId, double sc, double max, double min, double excellent, double pass)> clsInfo = new();
|
|
|
+ List<(string cId, double sc, double max, double min, double excellent, double pass,double count)> clsInfo = new();
|
|
|
foreach (var cls in classLists)
|
|
|
{
|
|
|
double classTotal = 0;
|
|
@@ -256,7 +355,7 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
double ex = Math.Round(excellentc / scores.Count, 2);
|
|
|
double passc = scores.Where(s => s >= 60).Count();
|
|
|
double pa = Math.Round(passc / scores.Count, 2);
|
|
|
- clsInfo.Add((cls.id, classTotal / scores.Count, maxc, minc, ex, pa));
|
|
|
+ clsInfo.Add((cls.id, classTotal / scores.Count, maxc, minc, ex, pa, scores.Count));
|
|
|
}
|
|
|
//班级信息
|
|
|
var cInfo = clsInfo.Select(x => new
|
|
@@ -268,6 +367,22 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
x.min,
|
|
|
x.excellent,
|
|
|
x.pass,
|
|
|
+ kno = key5.Value.Where(c => c.cId.Equals(x.cId)).Select(z => new
|
|
|
+ {
|
|
|
+ z.name,
|
|
|
+ persent = Math.Round(z.point > 0 ? z.score / x.count / z.point : 0, 2),
|
|
|
+ block = knos.Where(v => null != v.kno && v.kno.Contains(z.name)).Select(x => x.name)
|
|
|
+ }),
|
|
|
+ block = claBlock.Where(c => c.Key.Equals(x.cId)).FirstOrDefault().block.Select(z => new
|
|
|
+ {
|
|
|
+ name = z.Key,
|
|
|
+ persent = Math.Round(z.point > 0 ? z.score / x.count/ z.point : 0, 2)
|
|
|
+ }),
|
|
|
+ dim = claDims.Where(c => c.claId.Equals(x.cId)).Select(z => new
|
|
|
+ {
|
|
|
+ name = z.dim,
|
|
|
+ persent = Math.Round(z.point > 0 ? z.score / x.count / z.point : 0, 2)
|
|
|
+ }),
|
|
|
examResults[0].classes.Where(c => c.id.Equals(x.cId)).FirstOrDefault().gradeId
|
|
|
});
|
|
|
//年级信息
|
|
@@ -372,7 +487,8 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
}
|
|
|
}
|
|
|
//获取知识点得分率
|
|
|
- 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)
|
|
|
+ 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)>>, KeyValuePair<string, List<(string name, double score, double point, string cId)>>, KeyValuePair<string, List<(string name, double score, double point, string sId)>>) DoKnowledgePoint(ExamResult exam, ExamInfo info)
|
|
|
{
|
|
|
|
|
|
HashSet<string> knowledge = new HashSet<string>();
|
|
@@ -407,7 +523,7 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- return (default, default, default, default);
|
|
|
+ return (default, default, default, default, default, default);
|
|
|
}
|
|
|
point = info.papers[index].point;
|
|
|
result = exam.studentScores;
|
|
@@ -438,8 +554,8 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
//学生得分情况
|
|
|
List<double> Score = new List<double>();
|
|
|
List<(string name, double score, double average)> pointScore = new();
|
|
|
- List<(string name, double score,string cId)> classInfo = new();
|
|
|
- List<(string name, double score, string sId)> stuInfo = new();
|
|
|
+ List<(string name, double score, double point, string cId)> classInfo = new();
|
|
|
+ List<(string name, double score, double point, string sId)> stuInfo = new();
|
|
|
List<(string name, double score)> pointTScore = new();
|
|
|
for (int k = 0; k < knowledgeName.Count; k++)
|
|
|
{
|
|
@@ -463,15 +579,16 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
scores += exam.studentScores[index][n] * itemPersent;
|
|
|
stuScore = exam.studentScores[index][n] * itemPersent;
|
|
|
}
|
|
|
- stuInfo.Add((knowledgeName[k], stuScore, id));
|
|
|
+ stuInfo.Add((knowledgeName[k], stuScore, OnePoint, id));
|
|
|
}
|
|
|
- foreach (var cla in exam.classes) {
|
|
|
+ foreach (var cla in exam.classes)
|
|
|
+ {
|
|
|
double classScores = 0;
|
|
|
for (int i = cla.range[0]; i <= cla.range[1]; i++)
|
|
|
{
|
|
|
classScores += exam.studentScores[i][n] * itemPersent;
|
|
|
}
|
|
|
- classInfo.Add((knowledgeName[k],classScores,cla.id));
|
|
|
+ classInfo.Add((knowledgeName[k], classScores, OnePoint, cla.id));
|
|
|
}
|
|
|
}
|
|
|
n++;
|
|
@@ -495,39 +612,14 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
|
|
|
}
|
|
|
|
|
|
- // 获取班级学生知识点得分
|
|
|
- /* foreach (var cla in exam.classes)
|
|
|
- {
|
|
|
- List<(string cId, string kno, double score)> classInfo = new();
|
|
|
- double classScores = 0;
|
|
|
- for (int k = 0; k < knowledgeName.Count; k++)
|
|
|
- {
|
|
|
- double OnePoint = 0;
|
|
|
- int n = 0;
|
|
|
- info.papers[index].knowledge.ForEach(kno =>
|
|
|
- {
|
|
|
- if (kno.Contains(knowledgeName[k]))
|
|
|
- {
|
|
|
- var itemPersent = kno.Count > 0 ? 1 / Convert.ToDouble(kno.Count) : 0;
|
|
|
- OnePoint += point[n] * itemPersent;
|
|
|
- for (int i = cla.range[0]; i < cla.range[1]; i++)
|
|
|
- {
|
|
|
- classScores += exam.studentIds[i][n] * itemPersent;
|
|
|
- }
|
|
|
- }
|
|
|
- n++;
|
|
|
- });
|
|
|
- classInfo.Add((cla.id, knowledgeName[k], classScores));
|
|
|
- }
|
|
|
-
|
|
|
- }*/
|
|
|
-
|
|
|
KeyValuePair<string, List<string>> key1 = new(exam.subjectId, knowledgeName);
|
|
|
KeyValuePair<string, List<string>> key2 = new(exam.subjectId, per);
|
|
|
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, double point, string cId)>> key5 = new(exam.subjectId, classInfo);
|
|
|
+ KeyValuePair<string, List<(string name, double score, double point, string sId)>> key6 = new(exam.subjectId, stuInfo);
|
|
|
//KeyValuePair<string, List<double>> key3 = new KeyValuePair<string, List<double>>(exam.subjectId, allPer);
|
|
|
- return (key1, key2, key3, key4);
|
|
|
+ return (key1, key2, key3, key4, key5, key6);
|
|
|
}
|
|
|
private KeyValuePair<string, List<(string id, double sta, double pass, string stu)>> DoSubjectScatter(ExamResult e)
|
|
|
{
|