From 0bfbab47e6f00b4d0c7d93abd879676fb18c0942 Mon Sep 17 00:00:00 2001 From: skodak Date: Thu, 30 Aug 2007 08:26:04 +0000 Subject: [PATCH] minor refactoring in grade export lib - part 2 --- grade/export/lib.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/grade/export/lib.php b/grade/export/lib.php index 91db8e6be3b..a40be8ef060 100755 --- a/grade/export/lib.php +++ b/grade/export/lib.php @@ -58,13 +58,7 @@ class grade_export { * @note Exporting as letters will lead to data loss if that exported set it re-imported. */ function grade_export($id, $itemids = null, $export_letters=false, $publish=false) { - global $CFG, $COURSE; - - if ($export_letters) { - require_once($CFG->dirroot . '/grade/report/lib.php'); - $report = new grade_report($COURSE->id, null, null); - $letters = $report->get_grade_letters(); - } + global $CFG; $this->publish = $publish; $this->strgrades = get_string("grades"); @@ -87,6 +81,12 @@ class grade_export { $this->id = $id; $this->course = $course; + if ($export_letters) { + require_once($CFG->dirroot . '/grade/report/lib.php'); + $report = new grade_report($this->id, null, null); + $letters = $report->get_grade_letters(); + } + // first make sure we have all final grades // TODO: check that no grade_item has needsupdate set grade_regrade_final_grades($id);