# By Gary Anderson for MDL-18010
# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
# It uses platform neutral UTF-8 encoding.
# Above lines and this line are ignored by the patching process.
Index: moodle/lang/en_utf8/assignment.php
--- moodle/lang/en_utf8/assignment.php Base (1.14.2.11)
+++ moodle/lang/en_utf8/assignment.php Locally Modified (Based On 1.14.2.11)
@@ -108,6 +108,8 @@
 $string['reviewed'] = 'Reviewed';
 $string['saveallfeedback'] = 'Save all my feedback';
 $string['sendformarking'] = 'Send for marking';
+$string['setmax'] = 'Set grades to max';
+$string['setmin'] = 'Set grades to min';
 $string['showrecentsubmissions'] = 'Show recent submissions';
 $string['submission'] = 'Submission';
 $string['submissiondraft'] = 'Submission draft';
Index: moodle/mod/assignment/lib.php
--- moodle/mod/assignment/lib.php Base (1.277.2.47)
+++ moodle/mod/assignment/lib.php Locally Modified (Based On 1.277.2.47)
@@ -1312,6 +1312,32 @@
         /// Print quickgrade form around the table
         if ($quickgrade){
             echo '<form action="submissions.php" id="fastg" method="post">';
+            $str_submit = get_string('saveallfeedback', 'assignment');
+            $str_set_max = get_string('setmax', 'assignment');
+            $str_set_min = get_string('setmin', 'assignment');
+
+       echo <<<E0D
+        <script language="JavaScript">
+            function set_minmax(which){
+                for (i=0; i<=document.getElementById('fastg').length-1; i++){
+                    if (document.getElementById('fastg').elements[i].type=='select-one' && document.getElementById('fastg').elements[i].name!='gradecategory'){
+                        select = document.getElementById('fastg').elements[i];
+                        if (select.value == -1){
+                            option = (which == 'min') ? select.options.length-1 : 1;
+                            select.options[option].selected = true;
+                        }
+                    }
+                }
+            }
+        </script>
+            <br>
+            <p align="center">
+            <input type="button" name="btn_set_min" value="{$str_set_min}" onclick="javascript:set_minmax('min')" />
+            <input type="button" name="btn_set_max" value="{$str_set_max}" onclick="javascript:set_minmax('max')" />
+            <input type="submit" name="fastg" value="{$str_submit}" />
+            </p>
+E0D;
+
             echo '<div>';
             echo '<input type="hidden" name="id" value="'.$this->cm->id.'" />';
             echo '<input type="hidden" name="mode" value="fastgrade" />';
