mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
minor refactoring in grade export lib - part 2
This commit is contained in:
parent
350770f466
commit
0bfbab47e6
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user