From 7ba5026436eb969c3a7a408876eab93c3553a5dc Mon Sep 17 00:00:00 2001 From: oesi Date: Tue, 14 Jun 2016 17:09:49 +0200 Subject: [PATCH] =?UTF-8?q?Personen=20ohne=20RTGesamtpunkte=20werden=20nic?= =?UTF-8?q?ht=20ber=C3=BCcksichtigt=20Wenn=20zu=20weniger=20Bewerber=20als?= =?UTF-8?q?=20APZ=20vorhanden=20sind=20wird=20die=20Anzahl=20der=20Persone?= =?UTF-8?q?n=20aufgrund=20der=20Gesamtzahl=20der=20Bewerber=20berechnet=20?= =?UTF-8?q?anstatt=20anhand=20der=20APZ?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vilesci/personen/aliquote_reduktion.php | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/vilesci/personen/aliquote_reduktion.php b/vilesci/personen/aliquote_reduktion.php index b46ee84a1..dd2f86df2 100644 --- a/vilesci/personen/aliquote_reduktion.php +++ b/vilesci/personen/aliquote_reduktion.php @@ -197,7 +197,7 @@ aqr.studenten=res; aqr.studenten.forEach(function(i) { - if((i.laststatus=='Wartender'||i.laststatus=='Bewerber') && i.rt_gesamtpunkte !== null) + if((i.laststatus=='Wartender'||i.laststatus=='Bewerber') && i.rt_gesamtpunkte !== null && i.rt_gesamtpunkte > 0) i.applicant = true; else if(i.laststatus=='Student'||i.laststatus=='Aufgenommener') i.selected=true; @@ -249,6 +249,11 @@ allApplicants.push(j); }); + var applicantCount = aqr.selectedStudienplatz.apz; + if(applicantCount > allApplicants.length) + applicantCount = allApplicants.length; + + zgvs.forEach(function(i) { var applicantsFromZGV = []; @@ -260,12 +265,12 @@ // calculate the aliquote reduction for every ZGV var percent = applicantsFromZGV.length / allApplicants.length * 100; - var neededFromZGV = (aqr.selectedStudienplatz.apz / 100 * percent) - aqr.getAcceptedCount(i); + var neededFromZGV = (applicantCount / 100 * percent) - aqr.getAcceptedCount(i); if(neededFromZGV < 0) neededFromZGV = 0; - zgvElems.push({name:i, needed:neededFromZGV, percent:percent, accepted: aqr.getAcceptedCount(i), neededSum: (aqr.selectedStudienplatz.apz / 100 * percent)}); + zgvElems.push({name:i, needed:neededFromZGV, percent:percent, accepted: aqr.getAcceptedCount(i), neededSum: (applicantCount / 100 * percent)}); }); aqr.zgvElems = JSON.parse(JSON.stringify(zgvElems)); @@ -314,7 +319,7 @@ { var beginNeeded = needed; - //distribute the remainig applicants to the present ZGVs + //distribute the applicants to the present ZGVs for(var i=0; i < zgvElems.length; i++) { for(var j in aqr.studenten) @@ -325,7 +330,8 @@ && parseInt(zgvElems[i].needed) > 0 && aqr.studenten[j].bezeichnung == zgvElems[i].name && !aqr.studenten[j].seqPlace - && !aqr.studenten[j].selected) + && !aqr.studenten[j].selected + && aqr.studenten[j].applicant) { aqr.setSequence(aqr.studenten[j]); zgvElems[i].needed --; @@ -342,7 +348,7 @@ //distribute the rest of the applicants, WITH a ZGV group for(var j in aqr.studenten) { - if(!aqr.studenten[j].selected && aqr.studenten[j].bezeichnung) + if(!aqr.studenten[j].selected && aqr.studenten[j].bezeichnung && aqr.studenten[j].applicant) { aqr.setSequence(aqr.studenten[j]); if(needed > 0 && (aqr.studenten[j].laststatus=='Wartender'||aqr.studenten[j].laststatus=='Bewerber')) @@ -355,7 +361,7 @@ //distribute the rest of the applicants, WITHOUT a ZGV group for(var j in aqr.studenten) { - if(!aqr.studenten[j].selected && !aqr.studenten[j].bezeichnung) + if(!aqr.studenten[j].selected && !aqr.studenten[j].bezeichnung && aqr.studenten[j].applicant) { aqr.setSequence(aqr.studenten[j]); if(needed > 0 && (aqr.studenten[j].laststatus=='Wartender'||aqr.studenten[j].laststatus=='Bewerber')) @@ -490,7 +496,7 @@ {{zgv.needed | parseInt}} - Summe + Gesamt {{aqr.selectedStudienplatz.apz}} {{aqr.getAcceptedCount()}} @@ -499,7 +505,7 @@ -

Bereits aufgenommene

+

Restliche Studenten