Commit 9ac13a06 authored by liudong1993's avatar liudong1993

1

parent 92a18ae3
...@@ -129,22 +129,26 @@ namespace EduSpider.Services ...@@ -129,22 +129,26 @@ namespace EduSpider.Services
AvgScore = Math.Round(x.AvgScore, 6, MidpointRounding.AwayFromZero), AvgScore = Math.Round(x.AvgScore, 6, MidpointRounding.AwayFromZero),
AvgScoreRate = Math.Round(x.AvgScore / x.QScore, 2, MidpointRounding.AwayFromZero), AvgScoreRate = Math.Round(x.AvgScore / x.QScore, 2, MidpointRounding.AwayFromZero),
}), }),
ModuleList = sExamModel?.ScoreList.GroupBy(x => new { x.KnowledgePoint }).Take(8).Select(x => new ModuleList = sExamModel?.ScoreList.GroupBy(x => new { x.KnowledgePoint }).Select(x => new
{ {
Module = x.Key.KnowledgePoint.Length > 6 ? x.Key.KnowledgePoint.Substring(0, 6) + ".." : x.Key.KnowledgePoint, Module = x.Key.KnowledgePoint.Length > 6 ? x.Key.KnowledgePoint.Substring(0, 6) + ".." : x.Key.KnowledgePoint,
Score = x.Sum(y => y.QScore), Score = x.Sum(y => y.QScore),
ScoreRate = Math.Round(x.Sum(y => y.Score) / x.Sum(y => y.QScore), 2, MidpointRounding.AwayFromZero), ScoreRate = Math.Round(x.Sum(y => y.Score) / x.Sum(y => y.QScore), 2, MidpointRounding.AwayFromZero),
AvgScoreRate = Math.Round(x.Sum(y => y.AvgScore) / x.Sum(y => y.QScore), 2, MidpointRounding.AwayFromZero), AvgScoreRate = Math.Round(x.Sum(y => y.AvgScore) / x.Sum(y => y.QScore), 2, MidpointRounding.AwayFromZero),
PScore = x.Sum(y => y.Score),
AvgScore = x.Sum(y => y.AvgScore)
}), }),
GroupModuleList = examModel.Type == 2 ? sExamModel?.ScoreList.GroupBy(z => new { z.GroupName }).Select(z => new GroupModuleList = examModel.Type == 2 ? sExamModel?.ScoreList.GroupBy(z => new { z.GroupName }).Select(z => new
{ {
GroupName = z.Key, GroupName = z.Key,
GroupList = z.GroupBy(x => new { x.KnowledgePoint }).Take(8).Select(x => new GroupList = z.GroupBy(x => new { x.KnowledgePoint }).Select(x => new
{ {
Module = x.Key.KnowledgePoint.Length > 6 ? x.Key.KnowledgePoint.Substring(0, 6) + ".." : x.Key.KnowledgePoint, Module = x.Key.KnowledgePoint.Length > 6 ? x.Key.KnowledgePoint.Substring(0, 6) + ".." : x.Key.KnowledgePoint,
Score = x.Sum(y => y.QScore), Score = x.Sum(y => y.QScore),
ScoreRate = Math.Round(x.Sum(y => y.Score) / x.Sum(y => y.QScore), 2, MidpointRounding.AwayFromZero), ScoreRate = Math.Round(x.Sum(y => y.Score) / x.Sum(y => y.QScore), 2, MidpointRounding.AwayFromZero),
AvgScoreRate = Math.Round(x.Sum(y => y.AvgScore) / x.Sum(y => y.QScore), 2, MidpointRounding.AwayFromZero), AvgScoreRate = Math.Round(x.Sum(y => y.AvgScore) / x.Sum(y => y.QScore), 2, MidpointRounding.AwayFromZero),
PScore = x.Sum(y => y.Score),
AvgScore = x.Sum(y => y.AvgScore)
}) })
}) : null, }) : null,
DifficultyList = sExamModel?.ScoreList.GroupBy(x => new { x.Difficulty }).Select(x => new DifficultyList = sExamModel?.ScoreList.GroupBy(x => new { x.Difficulty }).Select(x => new
...@@ -554,6 +558,7 @@ namespace EduSpider.Services ...@@ -554,6 +558,7 @@ namespace EduSpider.Services
ExamName = item.ExamName, ExamName = item.ExamName,
GroupName = groupName, GroupName = groupName,
Score = esList.Where(x => x.StuId == stuId).FirstOrDefault()?.ARank ?? 0, Score = esList.Where(x => x.StuId == stuId).FirstOrDefault()?.ARank ?? 0,
TScore = esList.Where(x => x.StuId == stuId).FirstOrDefault()?.AScore ?? 0,
GroupNum = groupNum GroupNum = groupNum
}); });
} }
...@@ -581,7 +586,8 @@ namespace EduSpider.Services ...@@ -581,7 +586,8 @@ namespace EduSpider.Services
StuId = stuId, StuId = stuId,
Sort = ExamNum, Sort = ExamNum,
ExamName = item.ExamName, ExamName = item.ExamName,
Score = esList.Where(x => x.StuId == stuId).FirstOrDefault()?.Rank ?? 0 Score = esList.Where(x => x.StuId == stuId).FirstOrDefault()?.Rank ?? 0,
TScore = esList.Where(x => x.StuId == stuId).FirstOrDefault()?.TScore ?? 0,
}); });
} }
ExamNum++; ExamNum++;
...@@ -686,13 +692,15 @@ namespace EduSpider.Services ...@@ -686,13 +692,15 @@ namespace EduSpider.Services
y.GroupNum, y.GroupNum,
y.Sort, y.Sort,
y.ExamName, y.ExamName,
y.Score y.Score,
y.TScore
}), }),
TRankScoreList = statModel.TRankScoreList.Select(x => new TRankScoreList = statModel.TRankScoreList.Select(x => new
{ {
x.Sort, x.Sort,
x.ExamName, x.ExamName,
x.Score x.Score,
x.TScore
}) })
}), }),
TScore = rmodel.TScore, TScore = rmodel.TScore,
...@@ -778,14 +786,16 @@ namespace EduSpider.Services ...@@ -778,14 +786,16 @@ namespace EduSpider.Services
{ {
ExamNum = y.Sort, ExamNum = y.Sort,
y.ExamName, y.ExamName,
Rank = y.Score Rank = y.Score,
y.TScore
}) })
}), }),
TRankScoreList = statList.TRankScoreList.Select(x => new TRankScoreList = statList.TRankScoreList.Select(x => new
{ {
ExamNum = x.Sort, ExamNum = x.Sort,
x.ExamName, x.ExamName,
Rank = x.Score Rank = x.Score,
x.TScore
}) })
}; };
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment