Zwischenstand: vorläufige Noten zu Stichtag und Anlass
CI / build-and-test (push) Canceled after 0s

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:
adminandClaude Opus 5.5 committed 2026-10-06 13:01:34 +02:00
1 parent 67c5a906d1
commit d9eac0d1d2
24 files changed
+1038 -37

No files matched your search

@@ -24,6 +24,8 @@
ToolTip.Tip="Leistungsüberblick mit Zielnoten-Rechner für diesen Schüler"/>
<Button Content="+ Sammelnote" Command="{Binding CollectiveGradeCommand}" IsEnabled="{Binding !IsReadOnly}"/>
<Button Content="Zeugnisnoten" Command="{Binding ReportGradesCommand}" IsEnabled="{Binding !IsReadOnly}"/>
<Button Content="Zwischenstand …" Command="{Binding InterimGradesCommand}" IsEnabled="{Binding !IsReadOnly}"
ToolTip.Tip="Vorläufige Noten zu einem Stichtag notieren (Sprechtag, blauer Brief, Anfrage) — mit markiertem Schüler nur für diesen"/>
<Button Content="Als PDF" Click="OnExportPdfClick" Margin="12,0,0,0"
IsEnabled="{Binding !!Rows.Count}"/>
</StackPanel>
@@ -25,6 +25,10 @@ public partial class GradeOverviewTabView : UserControl
vm.OnManageStudentGrades = ShowStudentGradesDialog;
vm.OnCollectiveGrade = ShowCollectiveGradeDialog;
vm.OnReportGrades = ShowReportGradesDialog;
vm.OnInterimGrades = async studentId =>
{
if (TopLevel.GetTopLevel(this) is Window owner) await ShowInterimRun(owner, studentId);
};
vm.OnShowPerformanceOverview = ShowPerformanceOverviewDialog;
vm.PropertyChanged += (_, pe) =>
{
@@ -75,12 +79,12 @@ public partial class GradeOverviewTabView : UserControl
App.Services.GetRequiredService<GradingService>(),
_vm!.GroupId, _vm.GroupType, _vm.GradingSystem, _vm.GroupLabel, _vm.SchoolYear);
var dialog = new ReportGradeDialog { DataContext = dialogVm, OnOpenAssistant = ShowReportGradeAssistant };
var dialog = new ReportGradeDialog { DataContext = dialogVm, OnOpenAssistant = owner => ShowReportGradeAssistant(owner) };
var owner = TopLevel.GetTopLevel(this) as Window;
if (owner is not null) await dialog.ShowDialog(owner);
}
private async Task ShowReportGradeAssistant(Window owner)
private async Task ShowReportGradeAssistant(Window owner, InterimRunOptions? interim = null)
{
var dialogVm = new ReportGradeAssistantViewModel(
App.Services.GetRequiredService<IGradeRepository>(),
@@ -94,12 +98,42 @@ public partial class GradeOverviewTabView : UserControl
App.Services.GetRequiredService<IParticipationRepository>(),
App.Services.GetRequiredService<IParticipationAspectRepository>(),
App.Services.GetRequiredService<IParticipationSectionRepository>(),
App.Services.GetRequiredService<IInterimGradeRepository>(),
App.Services.GetRequiredService<AttendanceBalanceService>(),
App.Services.GetRequiredService<GradingService>(),
_vm!.GroupId, _vm.GroupType, _vm.GradingSystem, _vm.GroupLabel, _vm.SchoolYear,
App.Services.GetRequiredService<IGroupRepository>().GetById(_vm.GroupId)?.GradeLevel ?? 0);
App.Services.GetRequiredService<IGroupRepository>().GetById(_vm.GroupId)?.GradeLevel ?? 0,
interim: interim);
await new ReportGradeAssistantDialog { DataContext = dialogVm }.ShowDialog(owner);
var dialog = new ReportGradeAssistantDialog { DataContext = dialogVm };
dialogVm.OnStartInterim = studentId => ShowInterimRun(dialog, studentId);
await dialog.ShowDialog(owner);
}
/// Zwischenstand: erst Stichtag, Anlass und Schüler festlegen, dann geht der Assistent genau
/// diese Schüler durch.
private async Task ShowInterimRun(Window owner, Guid? preselectedStudentId)
{
var dialogVm = new InterimRunDialogViewModel(
App.Services.GetRequiredService<IGradeRepository>(),
App.Services.GetRequiredService<IExamRepository>(),
App.Services.GetRequiredService<IExamResultRepository>(),
App.Services.GetRequiredService<IStudentRepository>(),
App.Services.GetRequiredService<IGroupMembershipRepository>(),
App.Services.GetRequiredService<IGradingSchemeRepository>(),
App.Services.GetRequiredService<IReportGradeRepository>(),
App.Services.GetRequiredService<IParticipationSessionRepository>(),
App.Services.GetRequiredService<IParticipationRepository>(),
App.Services.GetRequiredService<IParticipationAspectRepository>(),
App.Services.GetRequiredService<IParticipationSectionRepository>(),
App.Services.GetRequiredService<IInterimGradeRepository>(),
App.Services.GetRequiredService<GradingService>(),
_vm!.GroupId, _vm.GroupType, _vm.GradingSystem, _vm.GroupLabel, _vm.SchoolYear,
preselectedStudentId);
var dialog = new InterimRunDialog { DataContext = dialogVm };
if (await dialog.ShowDialog<bool>(owner) && dialogVm.Result is { } run)
await ShowReportGradeAssistant(owner, run);
}
private async Task ShowPerformanceOverviewDialog(GradeOverviewRow row)
@@ -123,10 +157,13 @@ public partial class GradeOverviewTabView : UserControl
var topLevel = TopLevel.GetTopLevel(this);
if (topLevel is null || _vm is null) return;
// Vorläufige Zwischenstände gehören nicht in die gedruckte Notenliste. Ihre Spalten
// stehen immer am Ende, die Zellen lassen sich also einfach abschneiden.
var printed = _vm.Columns.Where(c => !c.IsInterim).ToList();
var data = new GradeListPrintData(
_vm.GroupLabel, _vm.SchoolYear, _vm.SelectedPeriod.Label,
_vm.Columns.Select(c => c.Header).ToList(),
_vm.Rows.Select(r => new GradeListPrintRow(r.Name, r.Cells, r.TotalDisplay)).ToList());
printed.Select(c => c.Header).ToList(),
_vm.Rows.Select(r => new GradeListPrintRow(r.Name, r.Cells.Take(printed.Count).ToList(), r.TotalDisplay)).ToList());
var pdf = App.Services.GetRequiredService<PdfExportService>().BuildGradeListPdf(data);
await App.Services.GetRequiredService<ExportService>().SaveAsync(topLevel.StorageProvider,
@@ -150,12 +187,15 @@ public partial class GradeOverviewTabView : UserControl
foreach (var (col, i) in _vm.Columns.Select((c, i) => (c, i)))
{
var idx = i;
grid.Columns.Add(new DataGridTextColumn
var column = new DataGridTextColumn
{
Header = col.Header,
Binding = new Binding($"Cells[{idx}]"),
Width = new DataGridLength(120, DataGridLengthUnitType.Pixel),
});
};
// Zwischenstände sind vorläufig — grau, damit sie nicht wie eingetragene Noten wirken.
if (col.IsInterim) column.Foreground = Avalonia.Media.Brushes.Gray;
grid.Columns.Add(column);
}
grid.Columns.Add(new DataGridTextColumn
@@ -0,0 +1,87 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="clr-namespace:LehrerApp.Desktop.ViewModels.Groups"
x:Class="LehrerApp.Desktop.Views.Groups.InterimRunDialog"
x:DataType="vm:InterimRunDialogViewModel"
Title="Zwischenstand"
Width="560" Height="720" MinWidth="480" MinHeight="520"
CanResize="True" WindowStartupLocation="CenterOwner">
<Grid RowDefinitions="Auto,Auto,Auto,*,Auto" Margin="24">
<StackPanel Grid.Row="0" Spacing="2">
<TextBlock Text="{Binding GroupLabel}" FontSize="13" Opacity="0.5"/>
<TextBlock Text="Zwischenstand notieren" Classes="dialogtitle"/>
<TextBlock FontSize="12" Opacity="0.6" TextWrapping="Wrap"
Text="Vorläufige Noten zu einem Stichtag — für Sprechtage, blaue Briefe, Konferenzen oder einzelne Anfragen. Die Zeugnisnoten bleiben unberührt."/>
</StackPanel>
<StackPanel Grid.Row="1" Spacing="8" Margin="0,14,0,0">
<StackPanel Spacing="2" IsVisible="{Binding HasExistingRuns}">
<TextBlock Text="Begonnenen Durchgang fortsetzen" FontSize="11" Opacity="0.6"/>
<ComboBox ItemsSource="{Binding ExistingRuns}" SelectedItem="{Binding SelectedExistingRun}"
PlaceholderText="Neuer Durchgang" HorizontalAlignment="Stretch"/>
</StackPanel>
<Grid ColumnDefinitions="130,170,*" ColumnSpacing="8">
<StackPanel Grid.Column="0" Spacing="2">
<TextBlock Text="Stichtag" FontSize="11" Opacity="0.6"/>
<TextBox Text="{Binding DateText}" PlaceholderText="TT.MM.JJJJ"/>
<TextBlock Text="{Binding DateTextError}" Foreground="Red" FontSize="11" TextWrapping="Wrap"
IsVisible="{Binding DateTextError, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
</StackPanel>
<StackPanel Grid.Column="1" Spacing="2">
<TextBlock Text="Anlass" FontSize="11" Opacity="0.6"/>
<ComboBox ItemsSource="{Binding OccasionOptions}" SelectedItem="{Binding OccasionName}"
HorizontalAlignment="Stretch"/>
</StackPanel>
<StackPanel Grid.Column="2" Spacing="2">
<TextBlock Text="Ergänzung (optional)" FontSize="11" Opacity="0.6"/>
<TextBox Text="{Binding OccasionDetail}" PlaceholderText="z. B. 1. Elternsprechtag"/>
</StackPanel>
</Grid>
</StackPanel>
<StackPanel Grid.Row="2" Spacing="4" Margin="0,16,0,6">
<TextBlock Text="Schüler" FontSize="13" FontWeight="SemiBold"/>
<StackPanel Orientation="Horizontal" Spacing="6">
<Button Content="Alle" Command="{Binding SelectAllCommand}" FontSize="11" Padding="8,3"/>
<Button Content="Keine" Command="{Binding SelectNoneCommand}" FontSize="11" Padding="8,3"/>
<Button Content="{Binding AtRiskLabel}" Command="{Binding SelectAtRiskCommand}" FontSize="11"
Padding="8,3" Margin="10,0,0,0"
ToolTip.Tip="Wählt genau die Schüler aus, deren vorläufige Note zum Stichtag diese Schwelle erreicht"/>
<TextBox Text="{Binding ThresholdText}" Width="48" FontSize="11"/>
</StackPanel>
<TextBlock Text="{Binding ThresholdTextError}" Foreground="Red" FontSize="11"
IsVisible="{Binding ThresholdTextError, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
</StackPanel>
<Border Grid.Row="3" BorderBrush="{DynamicResource SystemControlForegroundBaseLowBrush}"
BorderThickness="1" CornerRadius="6">
<ScrollViewer>
<ItemsControl ItemsSource="{Binding Students}" Margin="8,4">
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="vm:InterimRunStudentRow">
<Grid ColumnDefinitions="*,Auto,50" Margin="0,1">
<CheckBox Grid.Column="0" Content="{Binding Name}" IsChecked="{Binding IsSelected}" FontSize="13"/>
<TextBlock Grid.Column="1" Text="{Binding NotedDisplay}" FontSize="11" Foreground="#2E86DE"
VerticalAlignment="Center" Margin="8,0"/>
<TextBlock Grid.Column="2" Text="{Binding ProvisionalDisplay}" FontSize="14" FontWeight="SemiBold"
VerticalAlignment="Center" HorizontalAlignment="Right"
ToolTip.Tip="Vorläufige Note zum Stichtag"/>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Border>
<Grid Grid.Row="4" ColumnDefinitions="*,Auto,Auto" Margin="0,14,0,0">
<TextBlock Grid.Column="0" Text="{Binding SelectionError}" Foreground="Red" FontSize="11"
VerticalAlignment="Center"
IsVisible="{Binding SelectionError, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
<Button Grid.Column="1" Content="Abbrechen" Click="OnCancel" Margin="0,0,8,0"/>
<Button Grid.Column="2" Content="Schüler durchgehen ▸" Click="OnConfirm"/>
</Grid>
</Grid>
</Window>
@@ -0,0 +1,17 @@
using Avalonia.Controls;
using Avalonia.Interactivity;
using LehrerApp.Desktop.ViewModels.Groups;
namespace LehrerApp.Desktop.Views.Groups;
public partial class InterimRunDialog : Window
{
public InterimRunDialog() => InitializeComponent();
private void OnConfirm(object? sender, RoutedEventArgs e)
{
if (DataContext is InterimRunDialogViewModel vm && vm.Confirm()) Close(true);
}
private void OnCancel(object? sender, RoutedEventArgs e) => Close(false);
}
@@ -4,7 +4,7 @@
xmlns:views="clr-namespace:LehrerApp.Desktop.Views.Groups"
x:Class="LehrerApp.Desktop.Views.Groups.ReportGradeAssistantDialog"
x:DataType="vm:ReportGradeAssistantViewModel"
Title="Zeugnisnoten-Assistent"
Title="{Binding WindowTitle}"
Width="1280" Height="880" MinWidth="980" MinHeight="640"
CanResize="True" WindowStartupLocation="CenterOwner">
@@ -19,7 +19,9 @@
<StackPanel Grid.Row="1" Spacing="6" Margin="0,12,0,10">
<ComboBox ItemsSource="{Binding PeriodOptions}" SelectedItem="{Binding SelectedPeriod}"
HorizontalAlignment="Stretch"/>
HorizontalAlignment="Stretch" IsVisible="{Binding IsReportMode}"/>
<TextBlock Text="{Binding InterimTitle}" FontSize="13" FontWeight="SemiBold" TextWrapping="Wrap"
Foreground="#D98200" IsVisible="{Binding IsInterimMode}"/>
<Grid ColumnDefinitions="Auto,*" ColumnSpacing="6">
<TextBlock Grid.Column="0" Text="Rundung:" VerticalAlignment="Center" FontSize="12"/>
<ComboBox Grid.Column="1" ItemsSource="{Binding RoundingOptions}"
@@ -96,16 +98,53 @@
</ItemsControl>
<StackPanel Grid.Column="2" HorizontalAlignment="Right">
<TextBlock Text="Zeugnisnote" FontSize="11" Opacity="0.6" HorizontalAlignment="Right"/>
<TextBlock Text="Zeugnisnote" FontSize="11" Opacity="0.6" HorizontalAlignment="Right"
IsVisible="{Binding IsReportMode}"/>
<TextBlock Text="{Binding FinalDisplay}" FontSize="34" FontWeight="SemiBold"
HorizontalAlignment="Right"/>
HorizontalAlignment="Right" IsVisible="{Binding IsReportMode}"/>
<TextBlock Text="{Binding AbsenceRateDisplay}" FontSize="11" HorizontalAlignment="Right"
Foreground="{Binding AbsenceRateColorHex}"
ToolTip.Tip="Fehlquote im gewählten Zeitraum — ab 50 % darf laut Schulrecht unabhängig von der fachlichen Leistung eine 5 vergeben werden."/>
</StackPanel>
</Grid>
<Grid ColumnDefinitions="150,*,Auto" ColumnSpacing="6">
<!-- Zwischenstand: vorläufige Noten zum Stichtag, getrennt von der Zeugnisnote -->
<StackPanel Spacing="6" IsVisible="{Binding IsInterimMode}">
<TextBlock FontSize="11" Opacity="0.6" TextWrapping="Wrap"
Text="Vorläufige Noten zum Stichtag — vorbelegt mit dem berechneten Stand, frei anpassbar. Die Zeugnisnote bleibt davon unberührt."/>
<Grid ColumnDefinitions="110,110,110,*" ColumnSpacing="6">
<StackPanel Grid.Column="0" Spacing="2">
<TextBlock Text="Schriftlich" FontSize="11" Opacity="0.6"/>
<TextBox Text="{Binding InterimWritten}"/>
<TextBlock Text="{Binding InterimWrittenError}" Foreground="Red" FontSize="11"
IsVisible="{Binding InterimWrittenError, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
</StackPanel>
<StackPanel Grid.Column="1" Spacing="2">
<TextBlock Text="Mündlich" FontSize="11" Opacity="0.6"/>
<TextBox Text="{Binding InterimOral}"/>
<TextBlock Text="{Binding InterimOralError}" Foreground="Red" FontSize="11"
IsVisible="{Binding InterimOralError, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
</StackPanel>
<StackPanel Grid.Column="2" Spacing="2">
<TextBlock Text="Gesamt" FontSize="11" FontWeight="SemiBold"/>
<TextBox Text="{Binding InterimOverall}"/>
<TextBlock Text="{Binding InterimOverallError}" Foreground="Red" FontSize="11" TextWrapping="Wrap"
IsVisible="{Binding InterimOverallError, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
</StackPanel>
<StackPanel Grid.Column="3" Spacing="2">
<TextBlock Text="Notiz" FontSize="11" Opacity="0.6"/>
<TextBox Text="{Binding InterimNote}" PlaceholderText="z. B. was besprochen wurde"/>
</StackPanel>
</Grid>
<StackPanel Orientation="Horizontal" Spacing="6" HorizontalAlignment="Right">
<Button Content="Entfernen" Command="{Binding RemoveInterimCommand}"
IsVisible="{Binding HasInterimEntry}"/>
<Button Content="Notieren" Command="{Binding NoteInterimCommand}"/>
<Button Content="Notieren &amp; weiter" Command="{Binding NoteInterimAndNextCommand}"/>
</StackPanel>
</StackPanel>
<Grid ColumnDefinitions="150,*,Auto" ColumnSpacing="6" IsVisible="{Binding IsReportMode}">
<TextBox Grid.Column="0" Text="{Binding OverrideValue}" PlaceholderText="Übersteuern (optional)"
IsEnabled="{Binding !IsLocked}"/>
<TextBox Grid.Column="1" Text="{Binding OverrideReason}" PlaceholderText="Begründung"
@@ -154,6 +193,42 @@
</StackPanel>
</Border>
<!-- Zwischenstände -->
<StackPanel Spacing="6">
<Grid ColumnDefinitions="*,Auto">
<TextBlock Grid.Column="0" Text="Zwischenstände" FontSize="13" FontWeight="SemiBold"
VerticalAlignment="Center"/>
<Button Grid.Column="1" Content="Zwischenstand notieren …" Command="{Binding StartInterimCommand}"
IsVisible="{Binding IsReportMode}" FontSize="11" Padding="8,3"
ToolTip.Tip="Vorläufige Note für diesen Schüler zu einem Stichtag und Anlass festhalten"/>
</Grid>
<TextBlock Text="Noch keine Zwischenstände notiert." FontSize="12" Opacity="0.5"
IsVisible="{Binding !HasInterimEntries}"/>
<ItemsControl ItemsSource="{Binding InterimEntries}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate><WrapPanel/></ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="vm:AssistantInterimRow">
<Border BorderBrush="#D98200" BorderThickness="1" CornerRadius="6" Padding="10,5"
Margin="0,0,8,6" MaxWidth="320">
<Grid ColumnDefinitions="*,Auto">
<StackPanel Grid.Column="0">
<TextBlock Text="{Binding Title}" FontSize="12"/>
<TextBlock Text="{Binding Detail}" FontSize="10" Opacity="0.65"
IsVisible="{Binding Detail, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
<TextBlock Text="{Binding Note}" FontSize="10" FontStyle="Italic" TextWrapping="Wrap"
IsVisible="{Binding Note, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
</StackPanel>
<TextBlock Grid.Column="1" Text="{Binding OverallValue}" FontSize="17" FontWeight="SemiBold"
VerticalAlignment="Center" Margin="10,0,0,0"/>
</Grid>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
<!-- Mitarbeit -->
<StackPanel Spacing="6">
<Grid ColumnDefinitions="Auto,*,Auto">