Datenschutzkonforme Einzelansicht für Klausurergebnisse
CI / build-and-test (push) Canceled after 0s

Neuer Dialog ExamRevealDialog: zeigt zunächst nur den Namen eines Schülers,
erst nach „Aufdecken“ Note, Punktzahl und Punkte je Aufgabe. Blättern und
gezielte Auswahl oben; jeder Schülerwechsel deckt wieder zu. Erreichbar über
„Einzelansicht“ im Klausuren-Tab und auf der Klausuren-Hauptseite.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Opus 5.5 committed 2026-10-06 08:15:45 +02:00
1 parent c0f8b98202
commit 4f61c1fbd2
11 files changed
+392

No files matched your search

@@ -0,0 +1,96 @@
<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.ExamRevealDialog"
x:DataType="vm:ExamRevealDialogViewModel"
Title="{Binding ExamTitle}"
Width="680" Height="780" MinWidth="480" MinHeight="420"
CanResize="True" WindowStartupLocation="CenterOwner">
<Grid RowDefinitions="Auto,*,Auto" Margin="24">
<!-- Durchblättern und gezielte Auswahl -->
<Grid Grid.Row="0" ColumnDefinitions="Auto,*,Auto,Auto" IsEnabled="{Binding HasStudents}">
<Button Grid.Column="0" Content="◀ Zurück" Command="{Binding PreviousCommand}"/>
<ComboBox Grid.Column="1" ItemsSource="{Binding Students}" SelectedItem="{Binding SelectedStudent}"
HorizontalAlignment="Stretch" Margin="8,0">
<ComboBox.ItemTemplate>
<DataTemplate x:DataType="vm:ExamRevealStudent">
<TextBlock Text="{Binding ListName}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Grid.Column="2" Text="{Binding PositionLabel}" FontSize="12" Opacity="0.6"
VerticalAlignment="Center" Margin="0,0,8,0"/>
<Button Grid.Column="3" Content="Weiter ▶" Command="{Binding NextCommand}"/>
</Grid>
<TextBlock Grid.Row="1" Text="Für diese Arbeit sind noch keine Ergebnisse eingetragen."
Classes="emptyhint" HorizontalAlignment="Center" VerticalAlignment="Center"
IsVisible="{Binding !HasStudents}"/>
<Grid Grid.Row="1" RowDefinitions="Auto,*" Margin="0,28,0,0" IsVisible="{Binding HasStudents}">
<TextBlock Grid.Row="0" Text="{Binding SelectedStudent.DisplayName}" FontSize="36" FontWeight="SemiBold"
HorizontalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap"/>
<!-- Zugedeckt: nur der Name -->
<Button Grid.Row="1" Content="Aufdecken" Command="{Binding RevealCommand}"
FontSize="20" Padding="36,14" HorizontalAlignment="Center" VerticalAlignment="Center"
IsVisible="{Binding !IsRevealed}"/>
<!-- Aufgedeckt: Note, Punkte, Aufgaben -->
<Grid Grid.Row="1" RowDefinitions="Auto,Auto,*,Auto" IsVisible="{Binding IsRevealed}">
<TextBlock Grid.Row="0" Text="{Binding SelectedStudent.GradeDisplay}" FontSize="110" FontWeight="Bold"
HorizontalAlignment="Center" Margin="0,8,0,0"
IsVisible="{Binding SelectedStudent.HasGrade}"/>
<TextBlock Grid.Row="0" Text="abwesend" FontSize="36" Opacity="0.6"
HorizontalAlignment="Center" Margin="0,48,0,0"
IsVisible="{Binding SelectedStudent.Absent}"/>
<TextBlock Grid.Row="1" Text="{Binding SelectedStudent.PointsDisplay}" FontSize="22"
HorizontalAlignment="Center" Margin="0,0,0,20"
IsVisible="{Binding SelectedStudent.HasGrade}"/>
<ScrollViewer Grid.Row="2" IsVisible="{Binding SelectedStudent.HasGrade}">
<StackPanel MaxWidth="480" Margin="0,0,12,0">
<Grid ColumnDefinitions="*,90,90" Margin="0,0,0,4">
<TextBlock Grid.Column="0" Text="AUFGABE" FontSize="10" FontWeight="Bold" Opacity="0.5"/>
<TextBlock Grid.Column="1" Text="ERREICHT" FontSize="10" FontWeight="Bold" Opacity="0.5"
TextAlignment="Right"/>
<TextBlock Grid.Column="2" Text="MAXIMAL" FontSize="10" FontWeight="Bold" Opacity="0.5"
TextAlignment="Right"/>
</Grid>
<ItemsControl ItemsSource="{Binding SelectedStudent.Tasks}">
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="vm:ExamRevealTaskRow">
<Border BorderBrush="{DynamicResource SystemControlForegroundBaseLowBrush}"
BorderThickness="0,1,0,0" Padding="0,6">
<Grid ColumnDefinitions="*,90,90">
<TextBlock Grid.Column="0" Text="{Binding Label}" FontSize="16"
TextTrimming="CharacterEllipsis"/>
<TextBlock Grid.Column="1" Text="{Binding Points}" FontSize="16" FontWeight="SemiBold"
TextAlignment="Right"/>
<TextBlock Grid.Column="2" Text="{Binding MaxPoints}" FontSize="16" Opacity="0.6"
TextAlignment="Right"/>
</Grid>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</ScrollViewer>
<Button Grid.Row="3" Content="Zudecken" Command="{Binding HideCommand}"
FontSize="16" Padding="28,10" HorizontalAlignment="Center" Margin="0,16,0,0"/>
</Grid>
</Grid>
<Grid Grid.Row="2" ColumnDefinitions="*,Auto" Margin="0,16,0,0">
<TextBlock Grid.Column="0" FontSize="12" Opacity="0.6" VerticalAlignment="Center">
<Run Text="{Binding ExamTitle}"/>
<Run Text=" · "/>
<Run Text="{Binding ExamDateLabel}"/>
</TextBlock>
<Button Grid.Column="1" Content="Schließen" Click="OnClose"/>
</Grid>
</Grid>
</Window>
@@ -0,0 +1,11 @@
using Avalonia.Controls;
using Avalonia.Interactivity;
namespace LehrerApp.Desktop.Views.Groups;
public partial class ExamRevealDialog : Window
{
public ExamRevealDialog() => InitializeComponent();
private void OnClose(object? sender, RoutedEventArgs e) => Close();
}
@@ -118,6 +118,8 @@
IsEnabled="{Binding IsEditable}">
<Button Content="Punkte eingeben" Command="{Binding GradeExamCommand}"/>
<Button Content="Auswertung" Command="{Binding EvaluateExamCommand}"/>
<Button Content="Einzelansicht" Command="{Binding RevealExamCommand}"
ToolTip.Tip="Zeigt das Ergebnis eines einzelnen Schülers – zunächst nur den Namen, erst nach „Aufdecken“ Note und Punkte."/>
<Button Content="Bearbeiten" Command="{Binding EditExamCommand}"/>
<Button Content="Duplizieren" Command="{Binding DuplicateExamCommand}"/>
<SplitButton Content="Status ▸" Command="{Binding AdvanceExamStatusCommand}">
@@ -164,6 +166,7 @@
<ContextMenu>
<MenuItem Header="Punkte eingeben" Command="{Binding GradeExamCommand}"/>
<MenuItem Header="Auswertung" Command="{Binding EvaluateExamCommand}"/>
<MenuItem Header="Einzelansicht" Command="{Binding RevealExamCommand}"/>
<MenuItem Header="Bearbeiten" Command="{Binding EditExamCommand}"/>
<MenuItem Header="Duplizieren" Command="{Binding DuplicateExamCommand}"/>
<MenuItem Header="Status">
@@ -37,6 +37,7 @@ public partial class GroupDetailView : UserControl
vm.OnConfirmDeleteExam = ShowDeleteExamDialog;
vm.OnGradeExam = ShowGradeExamDialog;
vm.OnEvaluateExam = ShowEvaluateExamDialog;
vm.OnRevealExam = ShowRevealExamDialog;
vm.OnConfirmReactivate = ShowReactivateConfirmDialog;
vm.OverviewTab.OnNavigateToWorkload = () =>
App.Services.GetRequiredService<MainWindowViewModel>().NavigateToWorkload();
@@ -304,4 +305,17 @@ public partial class GroupDetailView : UserControl
var owner = TopLevel.GetTopLevel(this) as Window;
if (owner is not null) await dialog.ShowDialog(owner);
}
private async Task ShowRevealExamDialog(Exam exam)
{
var dialogVm = new ExamRevealDialogViewModel(
App.Services.GetRequiredService<IExamResultRepository>(),
App.Services.GetRequiredService<IStudentRepository>(),
App.Services.GetRequiredService<GradingService>(),
exam);
var dialog = new ExamRevealDialog { DataContext = dialogVm };
var owner = TopLevel.GetTopLevel(this) as Window;
if (owner is not null) await dialog.ShowDialog(owner);
}
}