feat: PDF-Druck für Sitzplan, Notenliste, Klausur-Notenspiegel, Kompetenzbericht, Dokumentation

QuestPDF als PDF-Bibliothek eingeführt (11.3), bewusst nur in LehrerApp.Desktop referenziert -
zieht SkiaSharp-Native-Binaries mit, die im Server-Docker-Image nichts verloren haben. Neuer
PdfExportService mit gemeinsamem Kopf-/Fußzeilen-Layout (Titel, Stand-Datum, Seitenzahlen) und
schlanken Druck-DTOs statt ViewModels, damit die Erzeugung ohne Avalonia-Bezug testbar bleibt.
Speicherdialog läuft über den bestehenden ExportService (neues PDF-Format).

Fünf Druckvorlagen (11.4) als "Als PDF"-Button direkt in der jeweiligen Ansicht:
- Sitzplan: Raster mit Tafel-Banner, Tischabständen als echte Lücken, ausgeblendeten Plätzen als
  leere Rasterposition.
- Notenliste: druckt exakt die aktuell angezeigte Matrix (Zeitraum/Darstellung/Sortierung).
- Klausur-Notenspiegel: Kennzahlen, Notenverteilung und Aufgabenanalyse mit Balkendiagrammen,
  auffällig schwache Aufgaben rot markiert.
- Kompetenzbericht: Analyse-Tabelle für den ausgewählten Schüler (erledigt zugleich 8.3.3).
- Schülerdokumentation: alle Einträge chronologisch, vertrauliche/Entwurfs-Einträge markiert.

Layout an gerenderten Muster-PDFs visuell geprüft, nicht nur per Unit-Test.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-20 14:27:05 +02:00
co-authored by Claude Sonnet 5
parent 4cce84c7dd
commit 7365947edc
18 changed files with 785 additions and 15 deletions
@@ -21,5 +21,33 @@ public partial class ExamEvaluationDialog : Window
await App.Services.GetRequiredService<ExportService>().SaveAsync(topLevel.StorageProvider, export);
}
private async void OnExportPdfClick(object? sender, RoutedEventArgs e)
{
if (DataContext is not ExamEvaluationDialogViewModel vm) return;
var topLevel = TopLevel.GetTopLevel(this);
if (topLevel is null) return;
var stats = new List<LabelValue>
{
new("Bewertet", vm.GradedCount.ToString()),
new("Abwesend", vm.AbsentCount.ToString()),
new("Durchschnitt", vm.AverageDisplay),
new("Median", vm.MedianDisplay),
};
if (!string.IsNullOrEmpty(vm.BelowThresholdLabel1))
stats.Add(new(vm.BelowThresholdLabel1, vm.BelowThresholdDisplay1));
if (!string.IsNullOrEmpty(vm.BelowThresholdLabel2))
stats.Add(new(vm.BelowThresholdLabel2, vm.BelowThresholdDisplay2));
var data = new ExamStatisticsPrintData(vm.ExamTitle, vm.ExamDateLabel, vm.NiveauLabel, stats,
vm.GradeDistribution.Select(g => new GradeDistributionPrintRow(g.Grade, g.Count,
vm.GradedCount == 0 ? 0 : g.Count * 100.0 / vm.GradedCount)).ToList(),
vm.TaskAnalysis.Select(t => new TaskAnalysisPrintRow(t.Label, t.AvgPercent, t.IsWeak)).ToList());
var pdf = App.Services.GetRequiredService<PdfExportService>().BuildExamStatisticsPdf(data);
await App.Services.GetRequiredService<ExportService>().SaveAsync(topLevel.StorageProvider,
ExportFile.Pdf("Klausurauswertung als PDF speichern", $"Auswertung_{vm.ExamTitle}", pdf));
}
private void OnClose(object? sender, RoutedEventArgs e) => Close();
}