MDL-33499: Display final grade on the grading form with a link to the grader report
authorDamyon Wiese <damyon.wiese@netspot.com.au>
Tue, 5 Jun 2012 07:30:12 +0000 (15:30 +0800)
committerDamyon Wiese <damyon.wiese@netspot.com.au>
Fri, 15 Jun 2012 06:09:38 +0000 (14:09 +0800)
AMOS BEGIN
 CPY [currentgrade,mod_assignment],[currentgrade,mod_assign]
AMOS END

mod/assign/lang/en/assign.php
mod/assign/locallib.php

index 0daa8ca..21f988b 100644 (file)
@@ -75,6 +75,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?';
@@ -261,4 +262,4 @@ $string['viewownsubmissionform'] = 'View own submit assignment page.';
 $string['viewownsubmissionstatus'] = 'View own submission status page.';
 $string['viewsubmissionforuser'] = 'View submission for user: {$a}';
 $string['viewsubmission'] = 'View submission';
-$string['viewsubmissiongradingtable'] = 'View submission grading table.';
\ No newline at end of file
+$string['viewsubmissiongradingtable'] = 'View submission grading table.';
index 2211bb8..ed7f5e3 100644 (file)
@@ -2875,6 +2875,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