MDL-32909: assign_user_get_grades does not need to lookup context and was doing it wrong

cmidnumber is not the same as coursemodule->id
This commit is contained in:
Damyon Wiese 2012-05-11 15:52:30 +08:00
parent 71d7bc34a8
commit b11808c7d6
2 changed files with 5 additions and 4 deletions

View File

@ -754,8 +754,8 @@ function assign_get_user_grades($assign, $userid=0) {
global $CFG;
require_once($CFG->dirroot . '/mod/assign/locallib.php');
$context = context_module::instance($assign->cmidnumber);
$assignment = new assign($context, null, null);
$assignment = new assign(null, null, null);
$assignment->set_instance($assign);
return $assignment->get_user_grades_for_gradebook($userid);
}

View File

@ -560,7 +560,7 @@ class assign {
if ($this->adminconfig) {
return $this->adminconfig;
}
$this->adminconfig = get_config('mod_assign');
$this->adminconfig = get_config('assign');
return $this->adminconfig;
}
@ -2865,7 +2865,8 @@ class assign {
$grades = array();
$assignmentid = $this->get_instance()->id;
$gradebookpluginname = $CFG->assign_feedback_plugin_for_gradebook;
$adminconfig = $this->get_admin_config();
$gradebookpluginname = $adminconfig->feedback_plugin_for_gradebook;
$gradebookplugin = null;
// find the gradebook plugin