feat: add seating plans for learning groups
This commit is contained in:
@@ -21,7 +21,8 @@ public class PersonalDataExportService(
|
||||
IGradeRepository grades,
|
||||
IExamResultRepository examResults,
|
||||
IParticipationRepository participation,
|
||||
IDocumentationRepository documentation)
|
||||
IDocumentationRepository documentation,
|
||||
ISeatingPlanRepository seatingPlans)
|
||||
{
|
||||
public string ExportAsJson(Guid studentId)
|
||||
{
|
||||
@@ -43,6 +44,18 @@ public class PersonalDataExportService(
|
||||
Klausurergebnisse = examResults.GetByStudent(studentId),
|
||||
Mitarbeit = participation.GetByStudent(studentId),
|
||||
Dokumentation = documentation.GetByStudent(studentId),
|
||||
Sitzplaetze = studentGroups
|
||||
.SelectMany(g => seatingPlans.GetByGroup(g!.Id))
|
||||
.SelectMany(plan => plan.Assignments
|
||||
.Where(a => a.StudentId == studentId)
|
||||
.Select(a => new
|
||||
{
|
||||
Sitzplan = plan.Name,
|
||||
plan.Room,
|
||||
Reihe = a.Row + 1,
|
||||
Platz = a.Column + 1,
|
||||
}))
|
||||
.ToList(),
|
||||
};
|
||||
|
||||
return JsonSerializer.Serialize(dto, new JsonSerializerOptions
|
||||
|
||||
Reference in New Issue
Block a user