From 41ef46deaf00be207a14f76ea51617245fd425fc Mon Sep 17 00:00:00 2001 From: Erik Date: Wed, 18 Oct 2023 21:02:33 +0200 Subject: [PATCH] Fixed double allocating on multiple calls. --- alg/TimeDistribution/AllocateGroupsToItems.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/alg/TimeDistribution/AllocateGroupsToItems.ts b/alg/TimeDistribution/AllocateGroupsToItems.ts index c37fa55..1bb53da 100644 --- a/alg/TimeDistribution/AllocateGroupsToItems.ts +++ b/alg/TimeDistribution/AllocateGroupsToItems.ts @@ -7,6 +7,7 @@ function allocateGroupsToItems( items: Item[], groups: Group[] ): void { + items.forEach((item) => (item.studentIds = [])); paths.forEach((path) => { if (path.valueForDistributingOfStudents !== 0) { const groupId = path.groupId;