Notenschlüssel-Editor (1.3) und Einstellungen in Tabs strukturiert

- Notenschlüssel-Editor im ExamDialog: Stufen (Note/Prozentgrenze)
  bearbeitbar, Vorbelegung passend zum GradingSystem der Gruppe,
  Live-Anzeige der absoluten Punktegrenze je Stufe, Validierung
  (lückenlos, keine Dopplungen) über GradingService.ValidateGradingKey.
- Neues Modell GradingKeyTemplate + Repository: Notenschlüssel als
  Vorlage speichern/anwenden, direkt aus dem ExamDialog heraus.
- Einstellungen: Fächer / Kompetenzen / Notenschlüssel-Vorlagen sind
  jetzt eigene Tabs statt einer gemeinsam wachsenden Liste. Vorlagen
  zeigen nur noch eine kompakte Zeile; die Stufen-Bearbeitung läuft
  über ein Popup-Fenster (GradingKeyTemplateDialog).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-12 00:34:43 +02:00
co-authored by Claude Sonnet 5
parent d00cea0bfe
commit 3fc506adc1
15 changed files with 631 additions and 148 deletions
+2
View File
@@ -26,6 +26,7 @@ public class LiteDbContext : IDisposable
public ILiteCollection<Exam> Exams => _db.GetCollection<Exam>("exams");
public ILiteCollection<ExamResult> ExamResults => _db.GetCollection<ExamResult>("exam_results");
public ILiteCollection<Grade> Grades => _db.GetCollection<Grade>("grades");
public ILiteCollection<GradingKeyTemplate> GradingKeyTemplates => _db.GetCollection<GradingKeyTemplate>("grading_key_templates");
public ILiteCollection<Unit> Units => _db.GetCollection<Unit>("units");
public ILiteCollection<Lesson> Lessons => _db.GetCollection<Lesson>("lessons");
public ILiteCollection<Documentation> Documentation => _db.GetCollection<Documentation>("documentation");
@@ -67,6 +68,7 @@ public class LiteDbContext : IDisposable
ExamResults.EnsureIndex(x => x.StudentId);
Grades.EnsureIndex(x => x.StudentId);
Grades.EnsureIndex(x => x.GroupId);
GradingKeyTemplates.EnsureIndex(x => x.GradingSystem);
Units.EnsureIndex(x => x.GroupId);
Lessons.EnsureIndex(x => x.UnitId);
Lessons.EnsureIndex(x => x.GroupId);
@@ -114,6 +114,17 @@ public class ExamResultRepository(LiteDbContext db) : IExamResultRepository
}
}
public class GradingKeyTemplateRepository(LiteDbContext db) : IGradingKeyTemplateRepository
{
public List<GradingKeyTemplate> GetAll() =>
db.GradingKeyTemplates.FindAll().OrderBy(t => t.Name).ToList();
public List<GradingKeyTemplate> GetByGradingSystem(GradingSystem system) =>
db.GradingKeyTemplates.Find(t => t.GradingSystem == system).OrderBy(t => t.Name).ToList();
public GradingKeyTemplate? GetById(Guid id) => db.GradingKeyTemplates.FindById(id);
public void Save(GradingKeyTemplate t) { t.UpdatedAt = DateTime.UtcNow; db.GradingKeyTemplates.Upsert(t); }
public void Delete(Guid id) => db.GradingKeyTemplates.Delete(id);
}
public class GradeRepository(LiteDbContext db) : IGradeRepository
{
public List<Grade> GetByStudentAndGroup(Guid sid, Guid gid) =>