Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-35665: Cherry-pick MDL-35389 : Fix an error when changing locked …

…state of a assignment is changed
  • Loading branch information...
commit b865c07b69a85d6d4720dc66b8745cf8936bcdbb 1 parent 9273bd1
@raymondAntonio raymondAntonio authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 mod/assign/lib.php
View
4 mod/assign/lib.php
@@ -757,7 +757,9 @@ function assign_get_user_grades($assign, $userid=0) {
global $CFG;
require_once($CFG->dirroot . '/mod/assign/locallib.php');
- $assignment = new assign(null, null, null);
+ $cm = get_coursemodule_from_instance('assign', $assign->id, 0, false, MUST_EXIST);
+ $context = context_module::instance($cm->id);
+ $assignment = new assign($context, null, null);
$assignment->set_instance($assign);
return $assignment->get_user_grades_for_gradebook($userid);
}
Please sign in to comment.
Something went wrong with that request. Please try again.