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

deprecatedlib get_group_teacher doesn't work as expected

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.7.2
    • Fix Version/s: 1.8.1
    • Component/s: Assignment (2.2), 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;
      }

        Attachments

          Activity

            People

            • Assignee:
              skodak Petr Skoda
              Reporter:
              petcheverry Pablo Etcheverry
              Tester:
              Nobody
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                11/Jun/07