MDL-31731 Advanced Grading: Marking Guide: fix bug with check to display warning about discrepency between module maxgrade and number of marks in Marking Guide.

This commit is contained in:
Dan Marsden 2012-05-04 09:12:29 +12:00
parent e529ec8c09
commit b4b1d49044

View File

@ -331,7 +331,6 @@ class gradingform_guide_controller extends gradingform_controller {
}
}
$comments->close();
if (empty($this->moduleinstance)) { // Only set if empty.
$modulename = $this->get_component();
$context = $this->get_context();
@ -339,7 +338,8 @@ class gradingform_guide_controller extends gradingform_controller {
$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));
}
}
}