Mitarbeitsnote-Aggregation (3.2)

Neuer Dialog berechnet aus den Sitzungs-Bewertungen je Schüler eine
Mitarbeitsnote (H1/H2/Gesamtjahr), mit editierbarer Aspekt-Gewichtung,
Trendanzeige und Übernahme als Grade (Category=Participation).
This commit is contained in:
2026-08-12 14:10:04 +02:00
parent 482942ce09
commit 182c386cc5
9 changed files with 392 additions and 7 deletions
@@ -1,7 +1,10 @@
using Avalonia.Controls;
using Avalonia.Controls.Templates;
using Avalonia.Data;
using LehrerApp.Core.Interfaces;
using LehrerApp.Core.Services;
using LehrerApp.Desktop.ViewModels.Groups;
using Microsoft.Extensions.DependencyInjection;
namespace LehrerApp.Desktop.Views.Groups;
@@ -20,6 +23,7 @@ public partial class ParticipationTabView : UserControl
_vm = vm;
vm.OnAddSession = ShowAddSessionDialog;
vm.OnQuickInput = ShowQuickInputDialog;
vm.OnComputeGrade = ShowComputeGradeDialog;
vm.Aspects.CollectionChanged += (_, _) => BuildColumns();
vm.PropertyChanged += (_, pe) =>
{
@@ -141,4 +145,22 @@ public partial class ParticipationTabView : UserControl
if (owner is not null)
await dialog.ShowDialog(owner);
}
private async Task ShowComputeGradeDialog(ParticipationTabViewModel tabVm)
{
var dialogVm = new ParticipationGradeDialogViewModel(
App.Services.GetRequiredService<IParticipationSessionRepository>(),
App.Services.GetRequiredService<IParticipationRepository>(),
App.Services.GetRequiredService<IParticipationAspectRepository>(),
App.Services.GetRequiredService<IStudentRepository>(),
App.Services.GetRequiredService<IEnrollmentRepository>(),
App.Services.GetRequiredService<IGradeRepository>(),
App.Services.GetRequiredService<GradingService>(),
tabVm.GroupId, tabVm.SchoolYear, tabVm.GradingSystem);
var dialog = new ParticipationGradeDialog { DataContext = dialogVm };
var owner = TopLevel.GetTopLevel(this) as Window;
if (owner is not null)
await dialog.ShowDialog(owner);
}
}