Klausurvarianten, Bonuspunkte und Wiederholungen ergänzen

This commit is contained in:
admin committed 2026-09-26 10:42:11 +02:00
1 parent 54ad7f7419
commit 431d023c1a
22 files changed
+522 -40

No files matched your search

@@ -206,11 +206,15 @@ public partial class GroupOverviewViewModel : ObservableObject
private (double Average, int Count)? ComputeExamAverage(Guid groupId)
{
var system = _groups.GetById(groupId)?.GradingSystem ?? GradingSystem.Grades1To6;
var grades = _exams.GetByGroup(groupId)
.SelectMany(e => _examResults.GetByExam(e.Id))
.Where(r => !r.Absent && !string.IsNullOrWhiteSpace(r.Grade))
.Select(r => (Grade: r.Grade!, Weight: 1.0))
.ToList();
.SelectMany(e => _examResults.GetByExam(e.Id)
.Where(r => !r.Absent && !string.IsNullOrWhiteSpace(r.Grade))
.Select(r => (r.StudentId, Exam: e, Grade: r.Grade!)))
.GroupBy(x => x.StudentId)
.SelectMany(g => ExamScoringService.EffectiveGrades(
g.Select(x => (x.Exam, x.Grade)), system))
.Select(grade => (Grade: grade, Weight: 1.0)).ToList();
return grades.Count == 0 ? null : (_grading.WeightedAverage(grades), grades.Count);
}