From d56826971f6a0dd74c6c84cb64096cebe8275fc3 Mon Sep 17 00:00:00 2001 From: Arne Gnisa Date: Fri, 5 Jan 2024 14:13:07 +0100 Subject: [PATCH] N21-1563 changes generation of new teachers role --- generateLdif.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/generateLdif.js b/generateLdif.js index 9e60202..c266fb8 100644 --- a/generateLdif.js +++ b/generateLdif.js @@ -203,8 +203,15 @@ for (let schoolId = 0; schoolId < options.numberOfSchools; schoolId += 1) { const r = Math.random(); if (r < 0.1 && admins.length < 10) { admins.push(user.dn); continue; } if (r < 0.1 && ignored.length < 10) { ignored.push(user.dn); continue; } - if (r < 0.2 && substituteTeachers.length < 10) { substituteTeachers.push(user.dn); continue; } - if (r < 0.2) { teachers.push(user.dn); continue; } + if (r < 0.2) { + if (substituteTeachers.length < 10) { + substituteTeachers.push(user.dn); + } else { + teachers.push(user.dn); + } + + continue; + } students.push(user.dn); }