MDL-33475: Fix javascript error when advanced grading is used in mod_assign
authorDamyon Wiese <damyon.wiese@netspot.com.au>
Thu, 7 Jun 2012 02:52:05 +0000 (10:52 +0800)
committerDamyon Wiese <damyon.wiese@netspot.com.au>
Thu, 7 Jun 2012 02:52:05 +0000 (10:52 +0800)
mod/assign/module.js

index d361b32..5786e1e 100644 (file)
@@ -140,9 +140,11 @@ M.mod_assign.init_grading_options = function(Y) {
             Y.one('form.gradingoptionsform').submit();
         });
         var quickgradingelement = Y.one('#id_quickgrading');
-        quickgradingelement.on('change', function(e) {
-            Y.one('form.gradingoptionsform').submit();
-        });
+        if (quickgradingelement) {
+            quickgradingelement.on('change', function(e) {
+                Y.one('form.gradingoptionsform').submit();
+            });
+        }
 
     });