|
@@ -869,11 +869,11 @@ namespace TEAMModelOS.Controllers
|
|
{
|
|
{
|
|
perName = ptype,
|
|
perName = ptype,
|
|
name = x.Key,
|
|
name = x.Key,
|
|
- max = x.score.Max(s => s),
|
|
|
|
- min = x.score.Min(s => s),
|
|
|
|
- excellent = Math.Round(x.score.Where(s => s >= 80).Count() * 1.0 / x.count, 2),
|
|
|
|
- pass = Math.Round(x.score.Where(s => s >= 60).Count() * 1.0 / x.count, 2),
|
|
|
|
- average = Math.Round(x.score.Sum() * 1.0 / x.count, 2)
|
|
|
|
|
|
+ max = x.score.Any() ? x.score.Max(s => s) : 0,
|
|
|
|
+ min = x.score.Any() ? x.score.Min(s => s) : 0,
|
|
|
|
+ excellent = x.score.Any() ? Math.Round(x.score.Where(s => s >= 80).Count() * 1.0 / x.count, 2) : 0,
|
|
|
|
+ pass = x.score.Any() ? Math.Round(x.score.Where(s => s >= 60).Count() * 1.0 / x.count, 2) : 0,
|
|
|
|
+ average = x.score.Any() ? Math.Round(x.score.Sum() * 1.0 / x.count, 2) : 0
|
|
});
|
|
});
|
|
var pschoolScore = psc.GroupBy(g => (g.code, g.artId, g.examId, g.classes)).Select(x => new
|
|
var pschoolScore = psc.GroupBy(g => (g.code, g.artId, g.examId, g.classes)).Select(x => new
|
|
{
|
|
{
|
|
@@ -895,11 +895,11 @@ namespace TEAMModelOS.Controllers
|
|
}).GroupBy(g => g.subjectId).Select(n => new
|
|
}).GroupBy(g => g.subjectId).Select(n => new
|
|
{
|
|
{
|
|
subjectId = n.Key,
|
|
subjectId = n.Key,
|
|
- max = n.ToList().SelectMany(c => c.scores).ToList().Max(s => s),
|
|
|
|
- min = n.ToList().SelectMany(c => c.scores).ToList().Min(s => s),
|
|
|
|
- excellent = Math.Round(n.ToList().SelectMany(c => c.scores).ToList().Where(s => s >= 80).Count() * 1.0 / n.ToList().SelectMany(c => c.scores).ToList().Count, 2),
|
|
|
|
- pass = Math.Round(n.ToList().SelectMany(c => c.scores).ToList().Where(s => s >= 60).Count() * 1.0 / n.ToList().SelectMany(c => c.scores).ToList().Count, 2),
|
|
|
|
- average = Math.Round(n.ToList().SelectMany(c => c.scores).ToList().Sum() * 1.0 / n.ToList().SelectMany(c => c.scores).ToList().Count, 2)
|
|
|
|
|
|
+ max = n.ToList().SelectMany(c => c.scores).ToList().Count > 0 ? n.ToList().SelectMany(c => c.scores).ToList().Max(s => s) : 0,
|
|
|
|
+ min = n.ToList().SelectMany(c => c.scores).ToList().Count > 0 ? n.ToList().SelectMany(c => c.scores).ToList().Min(s => s) : 0,
|
|
|
|
+ excellent = n.ToList().SelectMany(c => c.scores).ToList().Count > 0 ? Math.Round(n.ToList().SelectMany(c => c.scores).ToList().Where(s => s >= 80).Count() * 1.0 / n.ToList().SelectMany(c => c.scores).ToList().Count, 2) : 0,
|
|
|
|
+ pass = n.ToList().SelectMany(c => c.scores).ToList().Count > 0 ? Math.Round(n.ToList().SelectMany(c => c.scores).ToList().Where(s => s >= 60).Count() * 1.0 / n.ToList().SelectMany(c => c.scores).ToList().Count, 2): 0,
|
|
|
|
+ average = n.ToList().SelectMany(c => c.scores).ToList().Count > 0 ? Math.Round(n.ToList().SelectMany(c => c.scores).ToList().Sum() * 1.0 / n.ToList().SelectMany(c => c.scores).ToList().Count, 2) : 0
|
|
})
|
|
})
|
|
});
|
|
});
|
|
scCount = pschoolScore.Count();
|
|
scCount = pschoolScore.Count();
|
|
@@ -1285,11 +1285,11 @@ namespace TEAMModelOS.Controllers
|
|
}).GroupBy(g => g.subjectId).Select(z => new
|
|
}).GroupBy(g => g.subjectId).Select(z => new
|
|
{
|
|
{
|
|
name = z.Key,
|
|
name = z.Key,
|
|
- max = z.ToList().SelectMany(c => c.scores).ToList().Max(s => s),
|
|
|
|
- min = z.ToList().SelectMany(c => c.scores).ToList().Min(s => s),
|
|
|
|
- excellent = Math.Round(z.ToList().SelectMany(c => c.scores).ToList().Where(s => s >= 80).Count() * 1.0 / z.ToList().SelectMany(c => c.scores).ToList().Count, 2),
|
|
|
|
- pass = Math.Round(z.ToList().SelectMany(c => c.scores).ToList().Where(s => s >= 60).Count() * 1.0 / z.ToList().SelectMany(c => c.scores).ToList().Count, 2),
|
|
|
|
- average = Math.Round(z.ToList().SelectMany(c => c.scores).ToList().Sum() * 1.0 / z.ToList().SelectMany(c => c.scores).ToList().Count, 2),
|
|
|
|
|
|
+ max = z.ToList().SelectMany(c => c.scores).ToList().Count > 0 ? z.ToList().SelectMany(c => c.scores).ToList().Max(s => s) : 0,
|
|
|
|
+ min = z.ToList().SelectMany(c => c.scores).ToList().Count > 0 ? z.ToList().SelectMany(c => c.scores).ToList().Min(s => s) : 0,
|
|
|
|
+ excellent = z.ToList().SelectMany(c => c.scores).ToList().Count > 0 ? Math.Round(z.ToList().SelectMany(c => c.scores).ToList().Where(s => s >= 80).Count() * 1.0 / z.ToList().SelectMany(c => c.scores).ToList().Count, 2) : 0,
|
|
|
|
+ pass = z.ToList().SelectMany(c => c.scores).ToList().Count > 0 ? Math.Round(z.ToList().SelectMany(c => c.scores).ToList().Where(s => s >= 60).Count() * 1.0 / z.ToList().SelectMany(c => c.scores).ToList().Count, 2) : 0,
|
|
|
|
+ average = z.ToList().SelectMany(c => c.scores).ToList().Count > 0 ? Math.Round(z.ToList().SelectMany(c => c.scores).ToList().Sum() * 1.0 / z.ToList().SelectMany(c => c.scores).ToList().Count, 2) : 0,
|
|
perName = periodType.GetString()
|
|
perName = periodType.GetString()
|
|
|
|
|
|
});
|
|
});
|