Permalink
Browse files

MDL-30144 Assignmnet 2.2: fixed context retrival

  • Loading branch information...
Rajesh Taneja authored and danpoltawski committed Feb 6, 2013
1 parent 9cb6ecd commit 377d577f2dfa5d47468303364d7f7d18f54f8c6c
Showing with 2 additions and 1 deletion.
  1. +2 −1 mod/assignment/lib.php
View
@@ -3553,7 +3553,8 @@ function assignment_get_all_submissions($assignment, $sort="", $dir="DESC") {
if ($assignment->course == SITEID) {
$select = '';
}*/
- $context = context_module::instance($assignment->id);
+ $cm = get_coursemodule_from_instance('assignment', $assignment->id, $assignment->course);
+ $context = context_module::instance($cm->id);
list($enroledsql, $params) = get_enrolled_sql($context, 'mod/assignment:submit');
$params['assignmentid'] = $assignment->id;
return $DB->get_records_sql("SELECT a.*

0 comments on commit 377d577

Please sign in to comment.