From 8ad459ed586bc3d83e6143467f9336d2ccbf96f5 Mon Sep 17 00:00:00 2001 From: Damyon Wiese Date: Tue, 5 Jun 2012 15:30:12 +0800 Subject: [PATCH] MDL-33499: Display final grade on the grading form with a link to the grader report AMOS BEGIN CPY [currentgrade,mod_assignment],[currentgrade,mod_assign] AMOS END --- mod/assign/lang/en/assign.php | 1 + mod/assign/locallib.php | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/mod/assign/lang/en/assign.php b/mod/assign/lang/en/assign.php index bb2fc384dca..251cff50030 100644 --- a/mod/assign/lang/en/assign.php +++ b/mod/assign/lang/en/assign.php @@ -74,6 +74,7 @@ $string['couldnotconvertsubmission'] = 'Could not convert assignment submission $string['couldnotcreatecoursemodule'] = 'Could not create course module.'; $string['couldnotcreatenewassignmentinstance'] = 'Could not create new assignment instance.'; $string['couldnotfindassignmenttoupgrade'] = 'Could not find old assignment instance to upgrade.'; +$string['currentgrade'] = 'Current grade in gradebook'; $string['defaultplugins'] = 'Default assignment settings'; $string['defaultplugins_help'] = 'These settings define the defaults for all new assignments.'; $string['deletepluginareyousure'] = 'Delete assignment plugin {$a}: are you sure?'; diff --git a/mod/assign/locallib.php b/mod/assign/locallib.php index 28e88300e4d..2fef79b1cda 100644 --- a/mod/assign/locallib.php +++ b/mod/assign/locallib.php @@ -2898,6 +2898,16 @@ class assign { } } + if (has_all_capabilities(array('gradereport/grader:view', 'moodle/grade:viewall'), $this->get_course_context())) { + $grade = $this->output->action_link(new moodle_url('/grade/report/grader/index.php', + array('id'=>$this->get_course()->id)), + $gradinginfo->items[0]->grades[$userid]->str_grade); + } else { + $grade = $gradinginfo->items[0]->grades[$userid]->str_grade; + } + $mform->addElement('static', 'finalgrade', get_string('currentgrade', 'assign').':' ,$grade); + + $mform->addElement('static', 'progress', '', get_string('gradingstudentprogress', 'assign', array('index'=>$rownum+1, 'count'=>count($useridlist)))); // plugins