Skip to content

[Feature:Notifications] Released Gradeable Notification#11897

Merged
bmcutler merged 53 commits into
mainfrom
gradeable-submission-notification
Aug 9, 2025
Merged

[Feature:Notifications] Released Gradeable Notification#11897
bmcutler merged 53 commits into
mainfrom
gradeable-submission-notification

Conversation

@jeffrey-cordero

@jeffrey-cordero jeffrey-cordero commented Jul 22, 2025

Copy link
Copy Markdown
Contributor

Why is this Change Important & Necessary?

Notifications for grade releases were originally introduced within #10358. Still, students have asked for more types of notifications tied to gradeables, such as receiving one when submissions are open for a given gradeable.

What is the New Behavior?

This extends the existing hourly cron job to check for electronic gradeables with pending submission-related notifications ready for release to all active course users. By default, site notifications are enabled, while email notifications are disabled to help minimize email fatigue. For assignments with prerequisites, such as a crash course, the student will only be notified if the minimum autograding score for the gradeable dependency is met.

image

This is the site notification, which compacts the due date and late day information into a single line.

image

This is the email notification, including all relevant information on a separate line for readability.

[Subject]
Submissions Open: release_testing
[Content]
Submissions are now being accepted for "release_testing" in course SAMPLE.

Deadline: 2025-08-01 @ 09:13 AM
Late Days: 2 remaining, 5 allowed

Click here for more info: http://localhost:1511/courses/f25/sample/gradeable/release_testing

Additionally, the Email Status page may have multiple entries for a gradeable as the content includes the unique students' remaining late days, along with the applicable late days, and deadline for the assignment.

image

What steps should a reviewer take to reproduce or test the bug or new feature?

  1. Run the required migration via submitty_install
  2. Create a new electronic gradeable for an active course
  3. Release the electronic gradeable for students to submit
  4. Run sudo -u "submitty_daemon" python3 sbin/send_notification.py
  5. Visit the notification tab (email setting is off by default; thus, this should be manually set for testing)

Automated Testing & Documentation

I will create an issue for us to introduce a new Cypress file, notifications.spec.js, within the Cypress-Feature workflow to handle all types of notifications, including verification of their release through the cron job script.

Other information

Existing variable and function names related to score notifications have been refactored for improved readability and to better support integration of additional notification types.

@jeffrey-cordero jeffrey-cordero moved this from Awaiting Maintainer Review to In Review in Submitty Development Jul 25, 2025
@jeffrey-cordero

Copy link
Copy Markdown
Contributor Author

This should remain blocked until SQLAlchemy v2 is fully integrated into the main branch, updating deprecated methods as needed.

@JManion32 JManion32 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please note I was unable to test the email notification as it seems my local version doesn't have logs right now (probably from running recreate_sample_course and only creating sample), but they still showed up on the status page when I ran send_notification.py.
image

Other than my local issue with the mailbox, everything worked as expected. I commented a few stylistic changes that I think would benefit the PR, but feel free to push back.

Additionally, if there is going to be multiple entries on the email status page as described in the PR description, we should create an issue since it could add a lot of bloat if many students have the email for this type of notification toggled.

Overall, great work!

Comment thread sbin/send_notification.py Outdated
def construct_notifications(term, course, pending):
def format_timestamp(timestamp):
"""Format a timestamp into a readable string."""
return timestamp.strftime("%B %d, %Y at %I:%M %p")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If possible, we should use YYYY-MM-DD formatting for dates to be consistent with the rest of the site.

Comment thread sbin/send_notification.py Outdated
notification_content = (
f"{email_subject} (Due {format_timestamp(gradeable['submission_due_date'])} - "
f"{format_late_days(gradeable['remaining_late_days'])} remaining, "
f"{format_late_days(gradeable['max_late_days'])} allowed)"

@JManion32 JManion32 Jul 29, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can make the notification more concise and readable. How about:

Submissions Open: Gradeable | Due: 2025-08-05 @ 11:59 PM | 0 late days remaining (0 allowed)
Submissions Open: Gradeable | Due: 2025-08-05 @ 11:59 PM | 0/0 late days

I'm personally a fan of the latter as it is the most concise while still conveying all relevant information to the user. It may not be immediately clear, but I don't think users would struggle to figure it out. Adding late days to the notification should only be a small portion of it 1) because there is already so much information here 2) it is not the main focus. Additionally, I added vertical bars to separate everything a little clearer.

Additionally, we could make the email more concise with something like:

Late Days: 2 remaining, 5 allowed

(not sure if you already changed this)

@jeffrey-cordero jeffrey-cordero moved this from In Review to Work in Progress in Submitty Development Jul 29, 2025

@bmcutler bmcutler left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeffrey-cordero

I haven't tested myself yet, but how does this handle gradeables with a prerequisite?
For example, our crash course in C++ has a set of work-at-your-own-pace gradeables that are available at start of term, but a student can only submit to the first one. Do we alert the student about all of them at the start of term? It might be better to alert them one at a time, only when they have met the prerequisite?

@jeffrey-cordero jeffrey-cordero moved this from Work in Progress to In Review in Submitty Development Jul 30, 2025

@JManion32 JManion32 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notifications and Emails look and work well!

One case that I don't think should hold up this PR but is worth thinking about:
Should a gradeable's notifications still go out to staff if they haven't satisfied that gradeable's prerequisite?

A consideration for a future PR (I can do it when I port the notifications page to Vue):
submissions open notifications page

For gradeable notifications, it would be nice to leave space for an icon even if we don't have one so they line up with forum notifications.

@github-project-automation github-project-automation Bot moved this from In Review to Awaiting Maintainer Review in Submitty Development Jul 31, 2025

@williamjallen williamjallen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take a closer look later, but here's what I noticed on an initial pass.

Comment thread sbin/send_notification.py
Comment on lines -212 to +272
course_db.commit()
master_db.commit()
course_db.commit()
master_db.commit()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this change intentional? At first glance, it looks like the original indentation was correct.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's reverting the change in #11578, but both positions are valid as gradeables should always be non-empty when calling this method.

@bmcutler
bmcutler merged commit 78312ac into main Aug 9, 2025
24 of 25 checks passed
@bmcutler
bmcutler deleted the gradeable-submission-notification branch August 9, 2025 03:07
bmcutler pushed a commit that referenced this pull request Apr 10, 2026
### Why is this Change Important & Necessary?

Students previously had to manually click a notification or visit the
notification page to mark gradeable release and grade release
notifications when visiting the respective page via a link, which is a
poor-quality-of-life experience.

### What is the New Behavior?

When a student visits a gradeable page, any unseen grading notifications
for that gradeable (submission open or grade release) are automatically
marked as seen in a single database update.

### What steps should a reviewer take to reproduce or test the bug or
new feature?

1. Run the respective course migration.
2. Trigger a gradeable release or grade release notification via
`send_notification.py` (`udo -u "submitty_daemon" python3
sbin/send_notification.py`: #11897 and #10358 have more in-depth
explanations).
3. Log in as the notified student (notification bell should show
unread).
4. Navigate to the gradeable page.
5. Verify the notification is now marked as seen (bell clears,
notification panel shows read).

### Automated Testing & Documentation
<!-- Is this feature sufficiently tested by unit tests and end-to-end
tests?
If this PR does not add/update the necessary automated tests, write a
new GitHub issue and link it below.
Is this feature sufficiently documented on submitty.org?
Link related PRs or new GitHub issue to update documentation. -->

Unit tests have been added, but an issue will be made to extend this
notification feature to end-to-end testing coverage.

### Other information

N/A

---------

Co-authored-by: Justin Manion <[email protected]>
GarvitKhandelwal31 pushed a commit to GarvitKhandelwal31/Submitty that referenced this pull request Apr 13, 2026
…itty#12658)

### Why is this Change Important & Necessary?

Students previously had to manually click a notification or visit the
notification page to mark gradeable release and grade release
notifications when visiting the respective page via a link, which is a
poor-quality-of-life experience.

### What is the New Behavior?

When a student visits a gradeable page, any unseen grading notifications
for that gradeable (submission open or grade release) are automatically
marked as seen in a single database update.

### What steps should a reviewer take to reproduce or test the bug or
new feature?

1. Run the respective course migration.
2. Trigger a gradeable release or grade release notification via
`send_notification.py` (`udo -u "submitty_daemon" python3
sbin/send_notification.py`: Submitty#11897 and Submitty#10358 have more in-depth
explanations).
3. Log in as the notified student (notification bell should show
unread).
4. Navigate to the gradeable page.
5. Verify the notification is now marked as seen (bell clears,
notification panel shows read).

### Automated Testing & Documentation
<!-- Is this feature sufficiently tested by unit tests and end-to-end
tests?
If this PR does not add/update the necessary automated tests, write a
new GitHub issue and link it below.
Is this feature sufficiently documented on submitty.org?
Link related PRs or new GitHub issue to update documentation. -->

Unit tests have been added, but an issue will be made to extend this
notification feature to end-to-end testing coverage.

### Other information

N/A

---------

Co-authored-by: Justin Manion <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants