Skip to content
Browse files

Merge branch 'MDL-43068_24' of git://github.com/timhunt/moodle into M…

…OODLE_24_STABLE
  • Loading branch information...
2 parents 45c0350 + 2c7a420 commit a6a85dc49b7f882568cca19f326e6db424bafc99 @danpoltawski danpoltawski committed Dec 5, 2013
Showing with 5 additions and 2 deletions.
  1. +5 −2 course/lib.php
View
7 course/lib.php
@@ -2925,13 +2925,16 @@ function set_coursemodule_visible($id, $visible) {
$cminfo->visibleold = $visible;
$DB->update_record('course_modules', $cminfo);
+ require_once($CFG->dirroot . '/mod/' . $modulename . '/lib.php');
+ $functionname = $modulename . '_grade_item_update';
+
// Hide the associated grade items so the teacher doesn't also have to go to the gradebook and hide them there.
// Note that this must be done after updating the row in course_modules, in case
// the modules grade_item_update function needs to access $cm->visible.
if (plugin_supports('mod', $modulename, FEATURE_CONTROLS_GRADE_VISIBILITY) &&
- component_callback_exists('mod_' . $modulename, 'grade_item_update')) {
+ function_exists($functionname)) {
$instance = $DB->get_record($modulename, array('id' => $cm->instance), '*', MUST_EXIST);
- component_callback('mod_' . $modulename, 'grade_item_update', array($instance));
+ $functionname($instance);
} else {
$grade_items = grade_item::fetch_all(array('itemtype'=>'mod', 'itemmodule'=>$modulename, 'iteminstance'=>$cm->instance, 'courseid'=>$cm->course));
if ($grade_items) {

0 comments on commit a6a85dc

Please sign in to comment.
Something went wrong with that request. Please try again.