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

Random student receives notification when group member submits

XMLWordPrintable

    • MOODLE_24_STABLE
    • MOODLE_24_STABLE, MOODLE_25_STABLE
    • MDL-41149-master
    • Hide

      1. Create Group: Group 1, containing Student A, Student B, Student C
      2. Create Grouping: Grouping 1
      3. Add Group 1 to Grouping 1
      4. Set up an assignment with 'Students submit in groups' = Yes
      5. Set 'Grouping for student groups' = Grouping 1
      6. Student A submits a file
      7. Student A receives notification of his/her upload
      8. Student B updates the file
      9. Student B receives notification of his/her upload

      Show
      1. Create Group: Group 1, containing Student A, Student B, Student C 2. Create Grouping: Grouping 1 3. Add Group 1 to Grouping 1 4. Set up an assignment with 'Students submit in groups' = Yes 5. Set 'Grouping for student groups' = Grouping 1 6. Student A submits a file 7. Student A receives notification of his/her upload 8. Student B updates the file 9. Student B receives notification of his/her upload

      1. Create Group: Group 1, containing Student A, Student B, Student C
      2. Create Grouping: Grouping 1
      3. Add Group 1 to Grouping 1
      4. Set up an assignment with 'Students submit in groups' = Yes
      5. Set 'Grouping for student groups' = Grouping 1
      6. Student A submits a file
      7. One random student from the group receives the notification

      The reason for this is that the $submission object is altered before the notification is sent:

      line 328 of /mod/assign/locallib.php: call to assign->process_save_submission()
      line 4039 of /mod/assign/locallib.php: call to assign->update_submission()
      line 3233 of /mod/assign/locallib.php: call to assign->gradebook_item_update() - this function loops through team members and assigns a value $submission->userid for each one

      line 4059 of /mod/assign/locallib.php: call to assign->notify_student_submission_receipt() - this function uses $submission->userid if it exists

      A quick fix would be to use $USER regardless of whether $submission->userid exists:

      ---if ($submission->userid) {
                  $user = $DB->get_record('user', array('id'=>$submission->userid), '*', MUST_EXIST);
              ---} else {
                  ---$user = $USER;
              ---}
              ---$this->send_notification($user, $user, 'submissionreceipt', 'assign_notification', $submission->timemodified);
       
              +++$this->send_notification($USER, $USER, 'submissionreceipt', 'assign_notification', $submission->timemodified);

      Our preferred option would be for all members of the group to receive the notification.

            damyon Damyon Wiese
            amanda.doughty Amanda Doughty
            Dan Poltawski Dan Poltawski
            Frédéric Massart Frédéric Massart
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

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