Add animated classroom grouping with saved editable plans
CI / build-and-test (push) Canceled after 0s
CI / build-and-test (push) Canceled after 0s
This commit is contained in:
1 parent
d4b1419f9a
commit
f0462bd2a1
27 files changed
+775
-46
No files matched your search
@@ -29,6 +29,14 @@ public interface ISeatingPlanRepository
|
||||
/// wieder her (14.3). Tut nichts, falls der Papierkorb-Eintrag nicht (mehr) existiert.</summary>
|
||||
void Restore(Guid trashId);
|
||||
}
|
||||
public interface IStudentGroupPlanRepository
|
||||
{
|
||||
StudentGroupPlan? GetById(Guid id);
|
||||
List<StudentGroupPlan> GetByGroup(Guid groupId);
|
||||
List<StudentGroupPlan> GetByStudent(Guid studentId);
|
||||
void Save(StudentGroupPlan plan);
|
||||
void Delete(Guid id);
|
||||
}
|
||||
public interface IGroupMembershipRepository
|
||||
{
|
||||
List<GroupMembership> GetByStudent(Guid studentId);
|
||||
|
||||
@@ -52,9 +52,10 @@ public sealed record StudentReferenceSummary(
|
||||
int Grades,
|
||||
int ReportGrades,
|
||||
int ParticipationEntries,
|
||||
int DocumentationEntries)
|
||||
int DocumentationEntries,
|
||||
int StudentGroupPlans = 0)
|
||||
{
|
||||
public int Total => Memberships + ExamResults + Grades + ReportGrades
|
||||
+ ParticipationEntries + DocumentationEntries;
|
||||
+ ParticipationEntries + DocumentationEntries + StudentGroupPlans;
|
||||
public bool HasReferences => Total > 0;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
namespace LehrerApp.Core.Models;
|
||||
|
||||
/// <summary>Eine wiederverwendbare Einteilung innerhalb einer Lerngruppe.</summary>
|
||||
public class StudentGroupPlan
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
public Guid GroupId { get; set; }
|
||||
public string Name { get; set; } = "";
|
||||
public List<StudentGroupPlanGroup> Groups { get; set; } = [];
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public class StudentGroupPlanGroup
|
||||
{
|
||||
public List<Guid> StudentIds { get; set; } = [];
|
||||
}
|
||||
@@ -22,7 +22,8 @@ public class PersonalDataExportService(
|
||||
IExamResultRepository examResults,
|
||||
IParticipationRepository participation,
|
||||
IDocumentationRepository documentation,
|
||||
ISeatingPlanRepository seatingPlans)
|
||||
ISeatingPlanRepository seatingPlans,
|
||||
IStudentGroupPlanRepository? studentGroupPlans = null)
|
||||
{
|
||||
public string ExportAsJson(Guid studentId)
|
||||
{
|
||||
@@ -56,6 +57,16 @@ public class PersonalDataExportService(
|
||||
Platz = a.Column + 1,
|
||||
}))
|
||||
.ToList(),
|
||||
GespeicherteGruppeneinteilungen = (studentGroupPlans?.GetByStudent(studentId) ?? [])
|
||||
.SelectMany(plan => plan.Groups.Select((subgroup, index) => new
|
||||
{
|
||||
Einteilung = plan.Name,
|
||||
Gruppe = index + 1,
|
||||
Enthalten = subgroup.StudentIds.Contains(studentId),
|
||||
}))
|
||||
.Where(entry => entry.Enthalten)
|
||||
.Select(entry => new { entry.Einteilung, entry.Gruppe })
|
||||
.ToList(),
|
||||
};
|
||||
|
||||
return JsonSerializer.Serialize(dto, new JsonSerializerOptions
|
||||
|
||||
Reference in new issue
Block a user