Klausur: Fach aus Lerngruppe übernehmen, Rückgabedatum erfassen
- Fach kommt jetzt aus der Lerngruppe statt manuell pro Klausur eingegeben zu werden: Fach-Feld im Anlegen-Dialog der Lerngruppe ist nicht mehr auf Typ "Kurs" beschränkt, da eine Gruppe genau ein Fach unterrichtet (bei zwei Fächern legt man zwei Gruppen an). Im Klausur-Dialog ist das Fach dadurch nur noch read-only Kontext statt eines redundanten Eingabefelds. - Neues Feld Exam.ReturnedAt: wird beim Statuswechsel auf "Zurück- gegeben" automatisch mit dem heutigen Datum belegt (und beim Zurücknehmen des Status wieder geleert), ist im Klausur-Dialog aber auch manuell nachträglich korrigierbar. Sichtbar als eigene Spalte im Klausuren-Tab. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -317,6 +317,10 @@ public partial class GroupDetailViewModel : ObservableObject
|
||||
var exam = _exams.GetById(SelectedExam.Id);
|
||||
if (exam is null) return;
|
||||
exam.Status = status;
|
||||
if (status == ExamStatus.Returned)
|
||||
exam.ReturnedAt ??= DateOnly.FromDateTime(DateTime.Today);
|
||||
else
|
||||
exam.ReturnedAt = null;
|
||||
_exams.Save(exam);
|
||||
var id = exam.Id;
|
||||
ReloadExams();
|
||||
@@ -373,10 +377,12 @@ public class ExamSummary
|
||||
public ExamStatus Status { get; }
|
||||
public string StatusLabel { get; }
|
||||
public string StatusColorHex { get; }
|
||||
public string ReturnedAtDisplay { get; }
|
||||
|
||||
public ExamSummary(Core.Models.Exam e)
|
||||
{
|
||||
Id = e.Id; Title = e.Title; Date = e.Date.ToString("dd.MM.yyyy"); Status = e.Status;
|
||||
ReturnedAtDisplay = e.ReturnedAt?.ToString("dd.MM.yyyy") ?? "";
|
||||
StatusLabel = e.Status switch
|
||||
{
|
||||
ExamStatus.Planned => "Geplant",
|
||||
@@ -569,7 +575,7 @@ public partial class AddGroupDialogViewModel : ObservableObject
|
||||
if (string.IsNullOrWhiteSpace(Name)) { ValidationMessage = "Bezeichnung erforderlich."; return; }
|
||||
if (GradeLevel is < 1 or > 13) { ValidationMessage = "Klassenstufe 1–13."; return; }
|
||||
|
||||
string? subjectName = IsKurs && !string.IsNullOrWhiteSpace(Subject) ? Subject.Trim() : null;
|
||||
string? subjectName = !string.IsNullOrWhiteSpace(Subject) ? Subject.Trim() : null;
|
||||
Guid? subjectId = null;
|
||||
|
||||
if (subjectName is not null)
|
||||
|
||||
Reference in New Issue
Block a user