Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-10973

deprecatedlib get_group_teacher doesn't work as expected

XMLWordPrintable

    • MOODLE_17_STABLE
    • MOODLE_18_STABLE

      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;
      }

            skodak Petr Skoda
            petcheverry Pablo Etcheverry
            Nobody Nobody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.