From 123cee67d3165e41897e3a434e83fe930be1dc82 Mon Sep 17 00:00:00 2001 From: james Date: Tue, 6 Apr 2010 18:30:23 +0000 Subject: [PATCH] Check for minimum teams based on language as well.... this causes things to not "add up" properly but that is kind of intended..., ie the "total" doesnt equal "english + french"... but its a lot better than it was (it now tells ottawa that we dont have enough french judges, which is correct.) --- admin/judges_schedulerconfig_check.inc.php | 47 ++++++++++++++-------- 1 file changed, 31 insertions(+), 16 deletions(-) diff --git a/admin/judges_schedulerconfig_check.inc.php b/admin/judges_schedulerconfig_check.inc.php index 0dc87429..8c05d8dc 100644 --- a/admin/judges_schedulerconfig_check.inc.php +++ b/admin/judges_schedulerconfig_check.inc.php @@ -140,32 +140,47 @@ function judges_scheduler_check_judges() $totalteams['total'] = 0; echo "". "". - ""; + ""; echo ""; echo ""; foreach($config['languages'] AS $lkey=>$lname) echo ""; - echo ""; + echo ""; + foreach($config['languages'] AS $lkey=>$lname) + echo ""; echo "\n"; - foreach($jdiv AS $jdiv_id=>$jd) { - $c = $jd['num_projects']['total']; + foreach($jdiv AS $jdiv_id=>$jd) { + $c = $jd['num_projects']['total']; - //total judge teams calculation - $t['total']=ceil($c/$config['max_projects_per_team']*$config['times_judged']); - if($t['total'] < $config['times_judged'] && $c>0) $t['total'] = $config['times_judged']; - $jdiv[$jdiv_id]['num_jteams']['total'] = $t['total']; - $totalteams['total']+=$t['total']; + //total judge teams calculation + $t['total']=ceil($c/$config['max_projects_per_team']*$config['times_judged']); + if($t['total'] < $config['times_judged'] && $c>0) $t['total'] = $config['times_judged']; + $jdiv[$jdiv_id]['num_jteams']['total'] = $t['total']; + $totalteams['total']+=$t['total']; + //language teams calculation + foreach($config['languages'] AS $lkey=>$lname) { + $c = $jd['num_projects'][$lkey]; + $t['total_'.$lkey]=ceil($c/$config['max_projects_per_team']*$config['times_judged']); + if($t['total_'.$lkey] < $config['times_judged'] && $c>0) $t['total_'.$lkey] = $config['times_judged']; + $jdiv[$jdiv_id]['num_jteams']['total_'.$lkey] = $t['total_'.$lkey]; + $totalteams['total_'.$lkey]+=$t['total_'.$lkey]; + } - echo ""; - echo ""; - $langstr=""; - foreach($config['languages'] AS $lkey=>$lname) { - $clang=($jd['num_projects'][$lkey]?$jd['num_projects'][$lkey]:0); - echo ""; + echo ""; + echo ""; + $langstr=""; + foreach($config['languages'] AS $lkey=>$lname) { + $clang=($jd['num_projects'][$lkey]?$jd['num_projects'][$lkey]:0); + echo ""; } echo ""; + foreach($config['languages'] AS $lkey=>$lname) { + $clang=($jd['num_projects'][$lkey]?$jd['num_projects'][$lkey]:0); + //echo ""; + echo ""; + } echo ""; } @@ -182,7 +197,7 @@ function judges_scheduler_check_judges() foreach($config['languages'] AS $lkey=>$lname) { if($minjudges['total'] && $projecttotal) - $minjudges[$lkey]=round($projectlanguagetotal[$lkey]/$projecttotal*$minjudges['total']); + $minjudges[$lkey]=round($totalteams['total_'.$lkey]*$config['min_judges_per_team']); //$projectlanguagetotal[$lkey]/$projecttotal*$minjudges['total']); else $minjudges[$lkey]=0;
".i18n("Projects")."".i18n("Required Teams")."
".i18n("Estimated Required Teams")."
".i18n("Total")."$lkey".i18n("Total")."$lkey
Judging Division Group $jdiv_id$c$clang
Judging Division Group $jdiv_id$c$clang{$t['total']}{$t['total']}{$t['total_'.$lkey]}