MDL-31917 Improve assigment submission usability
authorRuslan Kabalin <ruslan.kabalin@luns.net.uk>
Tue, 6 Mar 2012 14:50:55 +0000 (14:50 +0000)
committerRuslan Kabalin <ruslan.kabalin@luns.net.uk>
Tue, 6 Mar 2012 15:43:07 +0000 (15:43 +0000)
Say 'View' if assignment has been graded via gradebook and changing
grades via submissions interface is not possible.

mod/assignment/lib.php

index 207386e..8f51fdd 100644 (file)
@@ -1411,6 +1411,7 @@ class assignment_base {
             $offset = $page * $perpage;
             $strupdate = get_string('update');
             $strgrade  = get_string('grade');
+            $strview  = get_string('view');
             $grademenu = make_grades_menu($this->assignment->grade);
 
             if ($ausers !== false) {
@@ -1527,6 +1528,9 @@ class assignment_base {
                         }
 
                         $buttontext = ($auser->status == 1) ? $strupdate : $strgrade;
+                        if ($final_grade->locked or $final_grade->overridden) {
+                            $buttontext = $strview;
+                        }
 
                         ///No more buttons, we use popups ;-).
                         $popup_url = '/mod/assignment/submissions.php?id='.$this->cm->id