Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

MDL-35389: Fix an error when changing locked state of a assignment is…

… changed
  • Loading branch information...
commit 79e7dfcc76810b37ff729b491a3abc32b839ebc7 1 parent a3ab18c
Raymond Antonio Wijaya authored September 12, 2012

Showing 1 changed file with 3 additions and 1 deletion. Show diff stats Hide diff stats

  1. 4  mod/assign/lib.php
4  mod/assign/lib.php
@@ -782,7 +782,9 @@ function assign_get_user_grades($assign, $userid=0) {
782 782
     global $CFG;
783 783
     require_once($CFG->dirroot . '/mod/assign/locallib.php');
784 784
 
785  
-    $assignment = new assign(null, null, null);
  785
+    $cm = get_coursemodule_from_instance('assign', $assign->id, 0, false, MUST_EXIST);
  786
+    $context = context_module::instance($cm->id);
  787
+    $assignment = new assign($context, null, null);
786 788
     $assignment->set_instance($assign);
787 789
     return $assignment->get_user_grades_for_gradebook($userid);
788 790
 }

0 notes on commit 79e7dfc

Please sign in to comment.
Something went wrong with that request. Please try again.