Permalink
Browse files

MDL-19263 assignment: only notify users enrolled in course

  • Loading branch information...
mackensen committed Mar 13, 2012
1 parent b1d3043 commit e89535552b87a0009a4855dc01210000163222bf
Showing with 7 additions and 1 deletion.
  1. +7 −1 mod/assignment/lib.php
View
@@ -1985,8 +1985,14 @@ function send_file($filearea, $args) {
* @return array
*/
function get_graders($user) {
+ global $DB;
+
//potential graders
- $potgraders = get_users_by_capability($this->context, 'mod/assignment:grade', '', '', '', '', '', '', false, false);
+ list($enrolledsql, $params) = get_enrolled_sql($this->context, 'mod/assignment:grade', 0, true);
+ $sql = "SELECT u.*
+ FROM {user} u
+ JOIN ($enrolledsql) je ON je.id = u.id";
+ $potgraders = $DB->get_records_sql($sql, $params);
$graders = array();
if (groups_get_activity_groupmode($this->cm) == SEPARATEGROUPS) { // Separate groups are being used

0 comments on commit e895355

Please sign in to comment.