Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.7.2
-
Fix Version/s: 1.8.1
-
Component/s: Assignment, Libraries
-
Labels:None
-
Affected Branches:MOODLE_17_STABLE
-
Fixed Branches:MOODLE_18_STABLE
Description
Group separated assignments don't notify teachers of students' uploads. This problem comes from deprecatedlib, which is not role-aware. I suggest this new get_group_teachers function (of course, I tested and it worked).
function get_group_teachers_new( $courseid, $groupid) {
if ( $teachers = get_course_teachers( $courseid)) {
foreach ( $teachers as $key => $teacher) {
if ( ( has_capability( 'mod/assignment:grade',get_context_instance( CONTEXT_COURSE, $courseid),$teacher->id)) and ismember( $groupid, $teacher->id)){
continue;
}
unset( $teachers[$key]);
}
}
return $teachers;
}
Petr can you fix this? Not with a new core get_group_teacher function ... we just need to replace the deprecated call with proper logic that uses capabilities.