Ein Zwischenstand ist ein Durchgang aus Stichtag, Anlass und Schülerauswahl (ganze Gruppe, Teilgruppe oder Einzelfall, mit Schnellfilter für gefährdete Schüler). Der Zeugnisnoten-Assistent geht die gewählten Schüler im Zwischenstand-Modus durch und notiert vorläufige schriftliche, mündliche und Gesamtnote samt Notiz. Gespeichert wird das als eigenes Modell InterimGrade, getrennt von der Zeugnisnote. Die Berechnung endet am Stichtag und rechnet den laufenden Mitarbeits-Abschnitt mit ein. Zwischenstände erscheinen im Assistenten als Liste und Marker im Verlauf sowie als graue Spalte in der Notenübersicht (nicht in "Gesamt", nicht im PDF). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
67c5a906d1
commit
d9eac0d1d2
24 files changed
+1038
-37
No files matched your search
@@ -32,6 +32,9 @@ public partial class ReportGradeAssistantViewModel : ObservableObject
|
||||
private readonly GradingService _grading;
|
||||
private readonly ParticipationTimelineBuilder _timeline;
|
||||
private readonly ReportGradeCalculator _calculator;
|
||||
private readonly InterimGradeCalculator _interimCalculator;
|
||||
private readonly IInterimGradeRepository _interimGrades;
|
||||
private readonly InterimRunOptions? _interim;
|
||||
private readonly Guid _groupId;
|
||||
private readonly int _gradeLevel;
|
||||
private readonly DateOnly _today;
|
||||
@@ -125,11 +128,13 @@ public partial class ReportGradeAssistantViewModel : ObservableObject
|
||||
IGradingSchemeRepository schemes, IReportGradeRepository reportGrades,
|
||||
IParticipationSessionRepository participationSessions, IParticipationRepository participation,
|
||||
IParticipationAspectRepository aspects, IParticipationSectionRepository sections,
|
||||
IInterimGradeRepository interimGrades,
|
||||
AttendanceBalanceService attendanceBalance, GradingService grading,
|
||||
Guid groupId, GroupType groupType, GradingSystem gradingSystem, string groupLabel, string schoolYear,
|
||||
int gradeLevel, DateOnly? today = null)
|
||||
int gradeLevel, DateOnly? today = null, InterimRunOptions? interim = null)
|
||||
{
|
||||
_reportGrades = reportGrades; _participation = participation;
|
||||
_interimGrades = interimGrades; _interim = interim;
|
||||
_attendanceBalance = attendanceBalance; _grading = grading;
|
||||
_groupId = groupId; _gradeLevel = gradeLevel;
|
||||
_today = today ?? DateOnly.FromDateTime(DateTime.Today);
|
||||
@@ -143,9 +148,11 @@ public partial class ReportGradeAssistantViewModel : ObservableObject
|
||||
_calculator = new ReportGradeCalculator(grades, exams, results, schemes, reportGrades,
|
||||
_membershipsByStudent, grading, groupId, groupType, gradingSystem, schoolYear);
|
||||
|
||||
// Vorbelegung: das Halbjahr, in dem wir uns gerade befinden.
|
||||
var (h1From, h1To) = _calculator.Range(ParticipationPeriod.H1);
|
||||
_selectedPeriod = _today >= h1From && _today <= h1To ? PeriodOptions[0] : PeriodOptions[1];
|
||||
_interimCalculator = new InterimGradeCalculator(_calculator, _timeline, _sections);
|
||||
|
||||
// Vorbelegung: das Halbjahr, in dem wir uns gerade befinden — bzw. das des Stichtags.
|
||||
var half = _interimCalculator.HalfOf(_interim?.Date ?? _today);
|
||||
_selectedPeriod = PeriodOptions.First(p => p.Period == half);
|
||||
Reload();
|
||||
}
|
||||
|
||||
@@ -190,6 +197,7 @@ public partial class ReportGradeAssistantViewModel : ObservableObject
|
||||
{
|
||||
OverrideReasonError = ""; ProjectExamGradeError = ""; OralExamGradeError = "";
|
||||
WrittenExamGradeError = ""; AdditionalOralExamGradeError = "";
|
||||
InterimWrittenError = ""; InterimOralError = ""; InterimOverallError = "";
|
||||
}
|
||||
|
||||
// ── Laden ────────────────────────────────────────────────────────────────
|
||||
@@ -206,6 +214,7 @@ public partial class ReportGradeAssistantViewModel : ObservableObject
|
||||
Students.Clear();
|
||||
foreach (var student in _allStudents)
|
||||
{
|
||||
if (_interim is not null && !_interim.StudentIds.Contains(student.Id)) continue;
|
||||
if (_membershipsByStudent.TryGetValue(student.Id, out var membership)
|
||||
&& !GroupMembershipService.Overlaps(membership, from, to)) continue;
|
||||
var item = new AssistantStudentItem(student.Id, student.FullName);
|
||||
@@ -223,6 +232,7 @@ public partial class ReportGradeAssistantViewModel : ObservableObject
|
||||
|
||||
private void RefreshItem(AssistantStudentItem item)
|
||||
{
|
||||
if (_interim is not null) { RefreshInterimItem(item); return; }
|
||||
var record = _reportGrades.GetByStudentGroupPeriod(item.StudentId, _groupId, SelectedPeriod.Label);
|
||||
var calculated = record is { IsLocked: true }
|
||||
? NullIfEmpty(record.CalculatedValue)
|
||||
@@ -251,6 +261,8 @@ public partial class ReportGradeAssistantViewModel : ObservableObject
|
||||
Tiles.Clear();
|
||||
CalculatedDisplay = "–"; CalculationDetail = ""; BorderlineHint = ""; AbsenceRateDisplay = "";
|
||||
OverrideValue = null; OverrideReason = null; IsLocked = false;
|
||||
InterimEntries.Clear();
|
||||
OnPropertyChanged(nameof(HasInterimEntries));
|
||||
_sectionViews = [];
|
||||
ApplyChartMode();
|
||||
NotifyLists();
|
||||
@@ -259,9 +271,12 @@ public partial class ReportGradeAssistantViewModel : ObservableObject
|
||||
|
||||
var studentId = SelectedStudent.StudentId;
|
||||
var (from, to) = _calculator.Range(SelectedPeriod.Period);
|
||||
// Zwischenstand: alles nach dem Stichtag bleibt außen vor, auch in der Anzeige.
|
||||
if (_interim is not null && _interim.Date < to) to = _interim.Date;
|
||||
_membershipsByStudent.TryGetValue(studentId, out var membership);
|
||||
|
||||
var record = _reportGrades.GetByStudentGroupPeriod(studentId, _groupId, SelectedPeriod.Label);
|
||||
var record = _interim is null
|
||||
? _reportGrades.GetByStudentGroupPeriod(studentId, _groupId, SelectedPeriod.Label) : null;
|
||||
_showing = true;
|
||||
IsLocked = record is { IsLocked: true };
|
||||
OverrideValue = record?.OverrideValue;
|
||||
@@ -272,7 +287,8 @@ public partial class ReportGradeAssistantViewModel : ObservableObject
|
||||
AdditionalOralExamGrade = CanEnterExamGrades ? record?.AdditionalOralExamGrade : null;
|
||||
_showing = false;
|
||||
|
||||
ShowCalculation();
|
||||
if (_interim is not null) ShowInterim(studentId); else ShowCalculation();
|
||||
LoadInterimEntries(studentId);
|
||||
ShowAbsenceRate(studentId, from, to);
|
||||
|
||||
// Im 2. Halbjahr auf Wunsch das Vorhalbjahr als Kontext mitzeigen — ohne Einfluss auf die Note.
|
||||
@@ -411,6 +427,13 @@ public partial class ReportGradeAssistantViewModel : ObservableObject
|
||||
private void BuildSections(Guid studentId, DateOnly displayFrom, DateOnly to)
|
||||
{
|
||||
var points = _timeline.BuildPoints(studentId).Where(p => p.Date >= displayFrom && p.Date <= to).ToList();
|
||||
// Notierte Zwischenstände erscheinen als Marker im Verlauf.
|
||||
points.AddRange(_interimGrades.GetByStudentAndGroup(studentId, _groupId)
|
||||
.Where(g => g.Date >= displayFrom && g.Date <= to)
|
||||
.Select(g => new WizardTimelinePoint(g.Date, isExam: true, ratingLabel: "",
|
||||
examLabel: $"Zwischenstand: {g.OverallValue}", hasNote: false,
|
||||
tooltip: $"{g.Date:dd.MM.yyyy} · {g.Occasion} · Zwischenstand {g.OverallValue}")));
|
||||
points = points.OrderBy(p => p.Date).ToList();
|
||||
var sectionGrades = _calculator.Grades
|
||||
.Where(g => g.StudentId == studentId && g.Category == GradeCategory.Participation && g.Note is not null)
|
||||
.ToList();
|
||||
@@ -430,13 +453,16 @@ public partial class ReportGradeAssistantViewModel : ObservableObject
|
||||
|
||||
// Der laufende Abschnitt endet erst mit dem nächsten Abschluss im Mitarbeits-Assistenten;
|
||||
// bis dahin gibt es nur einen Vorschlag aus den bisherigen Sitzungen.
|
||||
var openStart = _timeline.OpenStart(_sections, _today);
|
||||
var asOf = _interim?.Date ?? _today;
|
||||
// Ohne jeden abgeschlossenen Abschnitt gehört der ganze Zeitraum zum laufenden — sonst
|
||||
// fielen Arbeiten und Zwischenstände vor der ersten Mitarbeit-Sitzung aus dem Verlauf.
|
||||
var openStart = _sections.Count == 0 ? displayFrom : _timeline.OpenStart(_sections, asOf);
|
||||
if (openStart <= to)
|
||||
{
|
||||
var group = new WizardSectionGroup(ParticipationTimelineBuilder.OpenBandLabel(openStart), isOpen: true);
|
||||
foreach (var point in points.Where(p => p.Date >= openStart))
|
||||
group.Points.Add(point);
|
||||
var end = _today < to ? _today : to;
|
||||
var end = asOf < to ? asOf : to;
|
||||
var suggestion = _timeline.ComputeSuggestion(studentId, openStart < displayFrom ? displayFrom : openStart, end);
|
||||
views.Add(new SectionView(group,
|
||||
$"Laufender Abschnitt seit {openStart:dd.MM.} · " +
|
||||
@@ -595,7 +621,7 @@ public partial class ReportGradeAssistantViewModel : ObservableObject
|
||||
|
||||
// ── Bausteine ────────────────────────────────────────────────────────────────
|
||||
|
||||
public enum AssistantGradeStatus { Open, Saved, Locked }
|
||||
public enum AssistantGradeStatus { Open, Saved, Locked, Noted }
|
||||
|
||||
public partial class AssistantStudentItem(Guid studentId, string name) : ObservableObject
|
||||
{
|
||||
@@ -609,13 +635,14 @@ public partial class AssistantStudentItem(Guid studentId, string name) : Observa
|
||||
{
|
||||
AssistantGradeStatus.Locked => "festgeschrieben",
|
||||
AssistantGradeStatus.Saved => "gespeichert",
|
||||
AssistantGradeStatus.Noted => "notiert",
|
||||
_ => "offen",
|
||||
};
|
||||
|
||||
public string StatusColorHex => Status switch
|
||||
{
|
||||
AssistantGradeStatus.Locked => "#2E9D57",
|
||||
AssistantGradeStatus.Saved => "#2E86DE",
|
||||
AssistantGradeStatus.Saved or AssistantGradeStatus.Noted => "#2E86DE",
|
||||
_ => "#8A8A8A",
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user