From eba009ea63fcd07b50f182eddcfbafe18faf877d Mon Sep 17 00:00:00 2001 From: Damyon Wiese Date: Thu, 7 Jun 2012 10:52:05 +0800 Subject: [PATCH] MDL-33475: Fix javascript error when advanced grading is used in mod_assign --- mod/assign/module.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mod/assign/module.js b/mod/assign/module.js index d361b329331..5786e1e79b4 100644 --- a/mod/assign/module.js +++ b/mod/assign/module.js @@ -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(); + }); + } });