MDL-37168 grade: Debugging if gradebook callbacks are not both present

This commit is contained in:
John Okely
2017-03-20 16:31:31 +08:00
parent e078aa1351
commit be52d0dace
+3 -2
View File
@@ -1379,9 +1379,10 @@ function grade_update_mod_grades($modinstance, $userid=0) {
//new grading supported, force updating of grades
$updateitemfunc($modinstance);
$updategradesfunc($modinstance, $userid);
} else {
} else if (function_exists($updategradesfunc) xor function_exists($updateitemfunc)) {
// Module does not support grading?
debugging("You have declared one of $updateitemfunc and $updategradesfunc but not both. " .
"This will cause broken behaviour.", DEBUG_DEVELOPER);
}
return true;