Skip to content

Commit 2d19ef7

Browse files
feat: added ora reminder notification
1 parent a487617 commit 2d19ef7

6 files changed

Lines changed: 69 additions & 0 deletions

File tree

lms/envs/common.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2350,6 +2350,36 @@
23502350
# .. setting_description: Amount of time before a lease on a staff submission expires
23512351
ORA_STAFF_LEASE_EXPIRATION_HOURS = 8
23522352

2353+
# .. setting_name: ORA_REMINDER_MAX_COUNT
2354+
# .. setting_default: 3
2355+
# .. setting_description: Maximum number of reminder notifications sent per learner per ORA
2356+
# for incomplete peer/self review steps.
2357+
ORA_REMINDER_MAX_COUNT = 3
2358+
2359+
# .. setting_name: ORA_REMINDER_INTERVAL_HOURS
2360+
# .. setting_default: 48
2361+
# .. setting_description: Number of hours between consecutive ORA reminder notifications.
2362+
ORA_REMINDER_INTERVAL_HOURS = 48
2363+
2364+
# .. setting_name: ORA_REMINDER_INITIAL_DELAY_HOURS
2365+
# .. setting_default: 0
2366+
# .. setting_description: Number of hours after ORA submission before the first reminder
2367+
# notification is sent. Set to 0 for an immediate first reminder upon submission.
2368+
ORA_REMINDER_INITIAL_DELAY_HOURS = 0
2369+
2370+
# .. setting_name: ORA_REMINDER_SWEEP_INTERVAL_SECONDS
2371+
# .. setting_default: 1800
2372+
# .. setting_description: How often (in seconds) the platform-wide ORA reminder sweeper
2373+
# task re-schedules itself. Each sweep picks up all reminders whose next_reminder_at
2374+
# has passed. Default is 1800 (30 minutes).
2375+
ORA_REMINDER_SWEEP_INTERVAL_SECONDS = 1800
2376+
2377+
# .. setting_name: ORA_REMINDER_SWEEP_BATCH_SIZE
2378+
# .. setting_default: 1000
2379+
# .. setting_description: Maximum number of ORA reminder rows processed per sweep cycle.
2380+
# If more are due, the remaining will be picked up in the next sweep.
2381+
ORA_REMINDER_SWEEP_BATCH_SIZE = 1000
2382+
23532383
##### LMS DEADLINE DISPLAY TIME_ZONE #######
23542384
TIME_ZONE_DISPLAYED_FOR_DEADLINES = 'UTC'
23552385

openedx/core/djangoapps/notifications/base_notification.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,25 @@ class NotificationType(TypedDict):
274274

275275
'filters': [FILTER_AUDIT_EXPIRED_USERS_WITH_NO_ROLE],
276276
},
277+
'ora_reminder': {
278+
'notification_app': 'grading',
279+
'name': 'ora_reminder',
280+
281+
'info': 'Reminder notifications for learners who have pending self or peer review steps in an ORA.',
282+
'web': True,
283+
'email': True,
284+
'push': False,
285+
'email_cadence': EmailCadence.DAILY,
286+
'non_editable': ['push'],
287+
'content_template': _('<{p}>You have <{strong}>{pending_step}</{strong}> to complete for assessment '
288+
'<{strong}>{ora_name}</{strong}></{p}>'),
289+
'content_context': {
290+
'ora_name': 'Name of ORA in course',
291+
'pending_step': 'Pending step description (e.g. "self review" or "peer reviews")',
292+
},
293+
294+
'filters': [FILTER_AUDIT_EXPIRED_USERS_WITH_NO_ROLE],
295+
},
277296
'new_instructor_all_learners_post': {
278297
'notification_app': 'discussion',
279298
'name': 'new_instructor_all_learners_post',

openedx/core/djangoapps/notifications/config/waffle.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,17 @@
3838
# .. toggle_target_removal_date: 2026-05-27
3939
# .. toggle_warning: When the flag is ON, Notifications will go through ace push channels.
4040
ENABLE_PUSH_NOTIFICATIONS = CourseWaffleFlag(f'{WAFFLE_NAMESPACE}.enable_push_notifications', __name__)
41+
42+
# .. toggle_name: notifications.enable_ora_reminders
43+
# .. toggle_implementation: WaffleFlag
44+
# .. toggle_default: False
45+
# .. toggle_description: Waffle flag to enable ORA reminder notifications for learners
46+
# who have pending self or peer review steps after submitting an ORA response.
47+
# .. toggle_use_cases: open_edx
48+
# .. toggle_creation_date: 2026-03-26
49+
# .. toggle_target_removal_date: None
50+
# .. toggle_warning: When the flag is ON, learners will receive periodic reminders
51+
# for incomplete peer/self review steps.
52+
# .. toggle_tickets: None
53+
ENABLE_ORA_REMINDERS = WaffleFlag(f'{WAFFLE_NAMESPACE}.enable_ora_reminders', __name__)
54+

openedx/core/djangoapps/notifications/docs/settings.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ Notification keys are listed in the table below. More notifications may be added
4747
| 12 | updates | course_updates | False | Course updates |
4848
| 13 | grading | ora_staff_notifications | False | New ORA submission for staff |
4949
| 14 | grading | ora_grade_assigned | False | ORA grade received |
50+
| 15 | grading | ora_reminder | False | ORA peer/self review reminder |
5051

5152
### Example configuration for overriding notification preferences:
5253

openedx/core/djangoapps/notifications/email/notification_icons.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def get_icon_name_for_notification_type(cls, notification_type, default="POST_OU
3636
"course_updates": cls.NEWSPAPER,
3737
"ora_staff_notifications": cls.OPEN_RESPONSE_OUTLINE,
3838
"ora_grade_assigned": cls.OPEN_RESPONSE_OUTLINE,
39+
"ora_reminder": cls.OPEN_RESPONSE_OUTLINE,
3940
}
4041
return notification_type_dict.get(notification_type, default)
4142

openedx/core/djangoapps/notifications/handlers.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
User = get_user_model()
2525
log = logging.getLogger(__name__)
2626

27+
# Notification type emitted by ora2 on submission for ORAs with peer/self review steps.
28+
# This type is used only as a trigger; it is not stored as a notification itself.
29+
ORA_SUBMISSION_NOTIFICATION_TYPE = 'ora_submission_created'
30+
2731
AUDIENCE_FILTER_CLASSES = {
2832
'discussion_roles': ForumRoleAudienceFilter,
2933
'course_roles': CourseRoleAudienceFilter,

0 commit comments

Comments
 (0)