Permalink
Browse files

MDL-31731 Advanced Grading: Marking Guide: fix bug with check to disp…

…lay warning about discrepency between module maxgrade and number of marks in Marking Guide.
  • Loading branch information...
1 parent e529ec8 commit b4b1d49044323f919dc84ba9246738bff74a1914 @danmarsden danmarsden committed May 3, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 grade/grading/form/guide/lib.php
@@ -331,15 +331,15 @@ protected function load_definition() {
}
}
$comments->close();
-
if (empty($this->moduleinstance)) { // Only set if empty.
$modulename = $this->get_component();
$context = $this->get_context();
if (strpos($modulename, 'mod_') === 0) {
$dbman = $DB->get_manager();
$modulename = substr($modulename, 4);
if ($dbman->table_exists($modulename)) {
- $this->moduleinstance = $DB->get_record($modulename, array('id' => $context->instanceid));
+ $cm = get_coursemodule_from_id('assignment', $context->instanceid);
+ $this->moduleinstance = $DB->get_record($modulename, array("id"=>$cm->instance));
}
}
}

0 comments on commit b4b1d49

Please sign in to comment.