Skip to content
Browse files

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
  • Loading branch information...
1 parent 4db0616 commit 787ad881430e9bb0c20f8e6ffc1a17ecf1d07b0b Damyon Wiese committed
Showing with 12 additions and 1 deletion.
  1. +2 −1 mod/assign/lang/en/assign.php
  2. +10 −0 mod/assign/locallib.php
View
3 mod/assign/lang/en/assign.php
@@ -75,6 +75,7 @@
$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?';
@@ -261,4 +262,4 @@
$string['viewownsubmissionstatus'] = 'View own submission status page.';
$string['viewsubmissionforuser'] = 'View submission for user: {$a}';
$string['viewsubmission'] = 'View submission';
-$string['viewsubmissiongradingtable'] = 'View submission grading table.';
+$string['viewsubmissiongradingtable'] = 'View submission grading table.';
View
10 mod/assign/locallib.php
@@ -2875,6 +2875,16 @@ public function add_grade_form_elements(MoodleQuickForm $mform, stdClass $data,
}
}
+ 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

0 comments on commit 787ad88

Please sign in to comment.
Something went wrong with that request. Please try again.