MDL-36051 - Quick Grading in Assignment module does not turn on in some circumstances
authorRex Lorenzo <rex@oid.ucla.edu>
Thu, 8 Nov 2012 00:26:26 +0000 (16:26 -0800)
committerRex Lorenzo <rex@oid.ucla.edu>
Thu, 8 Nov 2012 00:28:02 +0000 (16:28 -0800)
* Fixed bug with quick grading when file submission is turned off

mod/assign/locallib.php
mod/assign/module.js

index 7238b70..1e24886 100644 (file)
@@ -2760,7 +2760,9 @@ class assign {
                                                                  'showquickgrading'=>false));
         if ($formdata = $mform->get_data()) {
             set_user_preference('assign_perpage', $formdata->perpage);
-            set_user_preference('assign_filter', $formdata->filter);
+            if (isset($formdata->filter)) {
+                set_user_preference('assign_filter', $formdata->filter);
+            }
         }
     }
 
index a1cbe07..ec5e071 100644 (file)
@@ -117,9 +117,11 @@ M.mod_assign.init_grading_options = function(Y) {
             Y.one('form.gradingoptionsform').submit();
         });
         var filterelement = Y.one('#id_filter');
-        filterelement.on('change', function(e) {
-            Y.one('form.gradingoptionsform').submit();
-        });
+        if (filterelement) {
+            filterelement.on('change', function(e) {
+                Y.one('form.gradingoptionsform').submit();
+            });
+        }
         var quickgradingelement = Y.one('#id_quickgrading');
         if (quickgradingelement) {
             quickgradingelement.on('change', function(e) {
@@ -139,4 +141,4 @@ M.mod_assign.init_grade_change = function(Y) {
             }
         });
     }
-};
\ No newline at end of file
+};