Klausurvarianten, Bonuspunkte und Wiederholungen ergänzen
This commit is contained in:
1 parent
54ad7f7419
commit
431d023c1a
22 files changed
+522
-40
No files matched your search
@@ -427,6 +427,11 @@ public partial class GroupDetailViewModel : ObservableObject
|
||||
if (SelectedExam is null || OnConfirmDeleteExam is null) return;
|
||||
var selected = SelectedExam;
|
||||
if (!await OnConfirmDeleteExam(selected)) return;
|
||||
foreach (var repeat in _exams.GetByGroup(Group!.Id).Where(e => e.RepeatOfExamId == selected.Id))
|
||||
{
|
||||
repeat.RepeatOfExamId = null;
|
||||
_exams.Save(repeat);
|
||||
}
|
||||
_exams.Delete(selected.Id);
|
||||
SelectedExam = null;
|
||||
ReloadExams();
|
||||
@@ -618,12 +623,15 @@ public class ExamSummary
|
||||
public string StatusColorHex { get; }
|
||||
public string ReturnedAtDisplay { get; }
|
||||
public string NiveauLabel { get; }
|
||||
public string TypeLabel { 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") ?? "";
|
||||
NiveauLabel = e.Niveau.HasValue ? NiveauDisplay.ToName(e.Niveau) : "alle";
|
||||
TypeLabel = e.RepeatOfExamId is not null ? (e.Tasks.Any(t => t.Variant is not null) ? "Wdh. · A/B" : "Wiederholung")
|
||||
: e.Tasks.Any(t => t.Variant is not null) ? "A/B" : "Klausur";
|
||||
StatusLabel = e.Status switch
|
||||
{
|
||||
ExamStatus.Planned => "Geplant",
|
||||
|
||||
Reference in new issue
Block a user