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

Assignment & quiz notifications sent to all course participants regardless of activity restrictions

XMLWordPrintable

    • MOODLE_405_STABLE
    • MOODLE_405_STABLE
    • MDL-84327-405
    • MDL-84327-main
    • Hide

      Testing instructions 

      Set up: 

      1. Log in as a teacher.
      2. Create 4 users (Student1, Student2, Student3 and Student4 ).
      3. Suspend Student4
      4. Create a course (Course1) and enroll all previous users with role "Student"
      5. Go to groups and create two groups ("Group 1" and "Group 2")
      6. Add Student1 to "Group 1"
      7. Add Student2 to "Group 2"

       

      Test Quiz

      1.  As teacher, go to Course 1
      2. Create a quiz (Quiz 1) with the following options and save it:  
        1. Open date one day from now
        2. In "restrict access" add a restriction for Group 1.
      3. Create a quiz (Quiz 2) with the following options and save it.
        1. Open date = one day from now
      4. Create a quiz (Quiz 3) with "open date" one day from now, and save it
      5. Hide the Quiz 3
      6. Run this scheduled task 

        php admin/cli/scheduled_task.php --execute=\\mod_quiz\\task\\queue_all_quiz_open_notification_tasks 

      7. Execute cron:  

        php admin/cli/cron.php  

      1. Verify that Student1 gets a notification with this subject: 

        Opens on [Tomorrow's date]: Quiz 1 

      1. Verify that Student2 and Student3  didn't get the previous notification.
      2. Verify that Student1, Student2 and Student3 gets a notification with this subject:  

        Opens on [Tomorrow's date]: Quiz 2  

      1. Verify that Student1, Student2, Student3 don't get any notification about Quiz 3 
      2. Verify Student4 didn't get any notification. 
      3. Go to Site administration / Server / Tasks / Ad hoc tasks and verify that there are no related errors.

      Test assignments

      This test simply verifies that notifications in Assignments were previously working fine .

      Assignments due in 7 days notification

      1. As teacher, go to Course 1
      2. Create an Assignment (Assignment 1) with the following options and save it:
        1. set the "Due date" to 7 days from now.
        2. In "restrict access" add a restriction for Group 1.
      3. Create an Assignment (Assignment 2) with the following options and save it:
        1. set the "Due date" to 7 days from now.
      4. Set the Assignment 2 to hidden
      5. Run this scheduled task  

        php admin/cli/scheduled_task.php --execute=\\mod_assign\\task\\queue_all_assignment_due_digest_notification_tasks 

      1. Execute the cron 
      2. Verify that Student1 gets a notification with this subject: 

        "You have assignments due in 7 days"

      3. Verify that Student2 and Student3 didn't get the previous notification. 
      4. Verify Student1, Student2, and Student3 didn't get any notification about Assignment 2
      5. Verify Student4 didn't get any notification. 
      6. Go to Site administration / Server / Tasks / Ad hoc tasks and verify that there are no related errors.

       

      Assignment due soon notification

      1. As teacher, go to Course 1
      2. Create an Assignment (Assignment 3) with the following options and save it:
        1. Set the "Due date" to tomorrow.
        2. In "restrict access" add a restriction for Group 1.
      3. Create an Assignment (Assignment 4) with the following options and save it:
        1. set the "Due date" to 7 days from now.
      4. Set the Assignment 4 to hidden
      5. Run this scheduled task  

        php admin/cli/scheduled_task.php --execute=\\mod_assign\\task\\queue_all_assignment_due_soon_notification_tasks 

      1. Run the cron
      2. Verify that Student1 gets a notification with this subject: 

        "Due on [Tomorrow's date]: Assignment 3

      1. Verify that Student2 and Student3 didn't get the previous notification. 
      2. Verify Student1, Student2, and Student3 didn't get any notification about Assignment 4
      3. Verify Student4 didn't get any notification. 
      4. Go to Site administration / Server / Tasks / Ad hoc tasks and verify that there are no related errors.

        
      Assignment overdue notification

      1. As teacher, go to Course 1
      2. Create an Assignment (Assignment 5) with the following options and save it:
        1. Set to disable Cut-off date
        2. Set to disable Allow submissions from
        3. Set the "Due date" one hour ago from now.
        4. In "restrict access" add a restriction for Group 1.
      3. Create an Assignment (Assignment 6) with the following options and save it:
        1. set the "Due date" to 7 days from now.
      4. Set the Assignment 6 to hidden
      5. Run this scheduled task 

        php admin/cli/scheduled_task.php --execute=\\mod_assign\\task\\queue_all_assignment_overdue_notification_tasks

      1. Run the cron
      2. Verify that Student1 gets a notification with this subject: 

        "Overdue: Assignment 5"

      1. Verify that Student2 and Student3 didn't get the previous notification. 
      2. Verify Student1, Student2, and Student3 didn't get any notification about Assignment 2
      3. Verify Student4 didn't get any notification. 
      4. Go to Site administration / Server / Tasks / Ad hoc tasks and verify that there are no related errors.
      Show
      Testing instructions  Set up:  Log in as a teacher. Create 4 users (Student1, Student2, Student3 and Student4 ). Suspend Student4 Create a course (Course1) and enroll all previous users with role "Student" Go to groups and create two groups ("Group 1" and "Group 2") Add Student1 to "Group 1" Add Student2 to "Group 2"   Test Quiz  As teacher, go to Course 1 Create a quiz (Quiz 1) with the following options and save it:   Open date one day from now In "restrict access" add a restriction for Group 1. Create a quiz (Quiz 2) with the following options and save it. Open date = one day from now Create a quiz (Quiz 3) with "open date" one day from now, and save it Hide the Quiz 3 Run this scheduled task  php admin/cli/scheduled_task.php --execute=\\mod_quiz\\task\\queue_all_quiz_open_notification_tasks Execute cron:   php admin/cli/cron.php Verify that Student1 gets a notification with this subject:  Opens on [Tomorrow's date]: Quiz 1 Verify that Student2 and Student3  didn't get the previous notification. Verify that Student1, Student2 and Student3 gets a notification with this subject:   Opens on [Tomorrow's date]: Quiz 2 Verify that Student1, Student2, Student3 don't get any notification about Quiz 3  Verify Student4 didn't get any notification.  Go to Site administration / Server / Tasks / Ad hoc tasks and verify that there are no related errors. Test assignments This test simply verifies that notifications in Assignments were previously working fine . Assignments due in 7 days notification As teacher, go to Course 1 Create an Assignment (Assignment 1) with the following options and save it: set the "Due date" to 7 days from now. In "restrict access" add a restriction for Group 1. Create an Assignment (Assignment 2) with the following options and save it: set the "Due date" to 7 days from now. Set the Assignment 2 to hidden Run this scheduled task   php admin/cli/scheduled_task.php --execute=\\mod_assign\\task\\queue_all_assignment_due_digest_notification_tasks Execute the cron  Verify that Student1 gets a notification with this subject:  "You have assignments due in 7 days" Verify that Student2 and Student3 didn't get the previous notification.  Verify Student1, Student2, and Student3 didn't get any notification about Assignment 2 Verify Student4 didn't get any notification.  Go to Site administration / Server / Tasks / Ad hoc tasks and verify that there are no related errors.   Assignment due soon notification As teacher, go to Course 1 Create an Assignment (Assignment 3) with the following options and save it: Set the "Due date" to tomorrow. In "restrict access" add a restriction for Group 1. Create an Assignment (Assignment 4) with the following options and save it: set the "Due date" to 7 days from now. Set the Assignment 4 to hidden Run this scheduled task   php admin/cli/scheduled_task.php --execute=\\mod_assign\\task\\queue_all_assignment_due_soon_notification_tasks Run the cron Verify that Student1 gets a notification with this subject:  "Due on [Tomorrow's date]: Assignment 3 Verify that Student2 and Student3 didn't get the previous notification.  Verify Student1, Student2, and Student3 didn't get any notification about Assignment 4 Verify Student4 didn't get any notification.  Go to Site administration / Server / Tasks / Ad hoc tasks and verify that there are no related errors.    Assignment overdue notification As teacher, go to Course 1 Create an Assignment (Assignment 5) with the following options and save it: Set to disable Cut-off date Set to disable Allow submissions from Set the "Due date" one hour ago from now. In "restrict access" add a restriction for Group 1. Create an Assignment (Assignment 6) with the following options and save it: set the "Due date" to 7 days from now. Set the Assignment 6 to hidden Run this scheduled task  php admin/cli/scheduled_task.php --execute=\\mod_assign\\task\\queue_all_assignment_overdue_notification_tasks Run the cron Verify that Student1 gets a notification with this subject:  "Overdue: Assignment 5" Verify that Student2 and Student3 didn't get the previous notification.  Verify Student1, Student2, and Student3 didn't get any notification about Assignment 2 Verify Student4 didn't get any notification.  Go to Site administration / Server / Tasks / Ad hoc tasks and verify that there are no related errors.
    • Hide

      Code verified against automated checks.

      Checked MDL-84327 using repository: https://github.com/raortegar/moodle.git

      More information about this report

      Built on: Thu Feb 20 10:27:17 PM UTC 2025

      Show
      Code verified against automated checks. Checked MDL-84327 using repository: https://github.com/raortegar/moodle.git MOODLE_405_STABLE (0 errors / 0 warnings) [branch: MDL-84327-405 | CI Job ] main (0 errors / 0 warnings) [branch: MDL-84327-main | CI Job ] More information about this report Built on: Thu Feb 20 10:27:17 PM UTC 2025
    • Show
      Launching automatic jobs for branch MDL-84327 -405 https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/18328/ PHPUnit (sqlsrv) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/62687/ Behat (NonJS - boost and classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/62688/ Behat (Firefox - boost) Launching automatic jobs for branch MDL-84327 -main https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/18329/ PHPUnit (sqlsrv) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/62689/ Behat (NonJS - boost and classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/62690/ Behat (Firefox - boost) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/62691/ Behat (Firefox - classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/62692/ App tests (stable app version) --> unrelated failures, please ignore. Built on: Thu Feb 20 10:25:17 PM UTC 2025
    • 6
    • Team Hedgehogs 2025 Sprint 1.1, Team Hedgehogs 2025 Sprint 1.2

      The new quiz/assignment notifications do not take into consideration any restrictions applied to activities. If a quiz/assignment is restricted to just a few students in a course, these notifications will still be sent to all course participants. We tested group, grouping and user profile restrictions, but it is possible all restriction types are affected.

      Affected notifications identified:

      • Assignment due soon notification;
      • Assignment overdue notification;
      • Assignments due in 7 days notification;
      • Quiz opens soon.

      Steps to reproduce issue:

      1. Create a new course;
      2. Enrol at least two students in the course (Student A and Student B)
      3. Create two groups, Group A and Group B.
      4. Add Student A to Group A and Student B to Group B.
      5. Add an assignment and a quiz activity;
      6. Set the assignment due date at least 7 days in the future;
      7. Set the quiz start date at least one day in the future; 
      8. Add a restriction to the assignment to only be available to students from Group A;
      9. Add a restriction to the quiz to only be available to students from Group B;
      10. Save everything and wait;
      11. Student A will incorrectly receive email notifications from both the quiz and the assignment;
      12. Student B will also incorrectly receive email notifications from both the quiz and the assignment;

      This can be reproduced by using a grouping or user profile restriction too, and possibly other restrictions as well.

        1. MDL-84327- 7 days.png
          MDL-84327- 7 days.png
          467 kB
        2. MDL-84327 - due soon.png
          MDL-84327 - due soon.png
          477 kB
        3. MDL-84327-overdue.png
          MDL-84327-overdue.png
          496 kB
        4. MDL-84327-quiz.png
          MDL-84327-quiz.png
          437 kB

            raquel.ortega@moodle.com Raquel Ortega
            dragos5436 dragos5436
            Tim Hunt Tim Hunt
            Huong Nguyen Huong Nguyen
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            29 Vote for this issue
            Watchers:
            31 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 week, 1 hour
                1w 1h

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