Advertisement
Guest User

mod/assign/locallib.php-patch

a guest
Sep 19th, 2012
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.04 KB | None | 0 0
  1. --- moodle/mod/assign/locallib.php  2012-08-16 20:06:14.000000000 -0400
  2. +++ html/mod/assign/locallib.php    2012-09-19 11:23:10.000000000 -0400
  3. @@ -1062,11 +1062,17 @@
  4.              $sort = "a.$sort $dir";
  5.          }  
  6.  
  7. +        $currentgroup = groups_get_activity_group($this->get_course_module(), true);
  8. +        $users = array_keys( $this->list_participants($currentgroup, true));
  9. +        list($userwhere, $userparams) = $DB->get_in_or_equal($users, SQL_PARAMS_QM, 'user');
  10. +        $where = 'u.id ' . $userwhere;
  11. +
  12.          return $DB->get_records_sql("SELECT a.*
  13.                                         FROM {assign_submission} a, {user} u
  14.                                        WHERE u.id = a.userid
  15.                                              AND a.assignment = ?
  16. -                                   ORDER BY $sort", array($this->get_instance()->id));
  17. +                                            AND $where
  18. +                                   ORDER BY $sort", array_merge(array($this->get_instance()->id), $userparams));
  19.  
  20.      }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement