mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-67093 grading: Fetch cm with get_fast_modinfo
This commit is contained in:
parent
e04a73ccc0
commit
f2a901173e
@ -339,8 +339,10 @@ class grading_manager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else if ($this->get_context()->contextlevel == CONTEXT_MODULE) {
|
} else if ($this->get_context()->contextlevel == CONTEXT_MODULE) {
|
||||||
list($context, $course, $cm) = get_context_info_array($this->get_context()->id);
|
$modulecontext = $this->get_context();
|
||||||
return self::available_areas('mod_'.$cm->modname);
|
$coursecontext = $modulecontext->get_course_context();
|
||||||
|
$cm = get_fast_modinfo($coursecontext->instanceid)->get_cm($modulecontext->instanceid);
|
||||||
|
return self::available_areas("mod_{$cm->modname}");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
throw new coding_exception('Unsupported gradable area context level');
|
throw new coding_exception('Unsupported gradable area context level');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user