From: moodler Date: Wed, 1 Jan 2003 06:53:00 +0000 (+0000) Subject: Cleaned up a bit X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=1df0ab5d8d85a2cd5189f8b4043b8f3a6b3b73c0;p=moodle.git Cleaned up a bit --- diff --git a/course/grade.php b/course/grade.php index c7a9d03d24..26274c221f 100644 --- a/course/grade.php +++ b/course/grade.php @@ -25,6 +25,7 @@ $grades = array(); // Collect all grades in this array $maxgrades = array(); // Collect all max grades in this array $totalgrade = 0; + $totalmaxgrade = 0; /// Collect modules data @@ -55,15 +56,21 @@ $columnhtml[] = "$image ". "wwwroot/mod/$mod->modname/view.php?id=$mod->id\">". "$instance->name". - "$maxgrade"; + ""; - $grades[] = $modgrades->grades[$USER->id]; // may be empty, that's ok - - $maxgrades[] = $modgrades->maxgrade; - - if (!empty($modgrades->maxgrade)) { + if (empty($modgrades->grades[$USER->id])) { + $grades[] = ""; + } else { + $grades[] = $modgrades->grades[$USER->id]; $totalgrade += (float)$modgrades->grades[$USER->id]; } + + if (empty($modgrades->maxgrade)) { + $maxgrades[] = ""; + } else { + $maxgrades[] = $modgrades->maxgrade; + $totalmaxgrade += $modgrades->maxgrade; + } } } } @@ -88,7 +95,7 @@ $table->data[] = array($columnhtml[$key], $maxgrades[$key], $grade); } - $table->data[] = array("", get_string("total"), $totalgrade); + $table->data[] = array(get_string("total"), $totalmaxgrade, $totalgrade); print_table($table);