Berechnung korrigiert damit alle Bewerber einberechnet werden und nicht nur die noch nicht aufgenommenen

This commit is contained in:
oesi
2016-06-24 17:15:13 +02:00
parent ad335ad240
commit 673e7a2a2f
+7 -7
View File
@@ -241,17 +241,17 @@
var neededStudentsCount = aqr.selectedStudienplatz.apz - aqr.getAcceptedCount();
var perZGV = aqr.studenten.length;
var zgvElems = [];
var allApplicants = [];
var allCountedStudents = [];
aqr.studenten.forEach(function(j)
{
if(j.applicant)
allApplicants.push(j);
if((j.applicant || j.selected))
allCountedStudents.push(j);
});
var applicantCount = aqr.selectedStudienplatz.apz;
if(applicantCount > allApplicants.length)
applicantCount = allApplicants.length;
if(applicantCount > allCountedStudents.length)
applicantCount = allCountedStudents.length;
zgvs.forEach(function(i)
@@ -259,12 +259,12 @@
var applicantsFromZGV = [];
aqr.studenten.forEach(function(j)
{
if(j.applicant && j.bezeichnung === i)
if((j.applicant || j.selected) && j.bezeichnung === i)
applicantsFromZGV.push(j);
});
// calculate the aliquote reduction for every ZGV
var percent = applicantsFromZGV.length / allApplicants.length * 100;
var percent = applicantsFromZGV.length / allCountedStudents.length * 100;
var neededFromZGV = (applicantCount / 100 * percent) - aqr.getAcceptedCount(i);
if(neededFromZGV < 0)