Skip to content

Commit

Permalink
feat: add ora submission created event
Browse files Browse the repository at this point in the history
  • Loading branch information
BryanttV committed Feb 5, 2024
1 parent 5d340fd commit e0e9c0c
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
19 changes: 19 additions & 0 deletions openedx_events/learning/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,3 +487,22 @@ class CourseNotificationData:
content_url = attr.ib(type=str)
content_context = attr.ib(type=dict, factory=dict)
audience_filters = attr.ib(type=dict, factory=dict)


@attr.s(frozen=True)
class ORASubmissionData:
"""
Attributes defined to represent event when a user submits an ORA assignment.
Arguments:
id (str): identifier of the ORA submission.
file_downloads (List[dict]): list of related files in the ORA submission. Each dict
contains the following keys:
* download_url (str): URL to download the file.
* description (str): Description of the file.
* name (str): Name of the file.
* size (int): Size of the file.
"""

id = attr.ib(type=str)
file_downloads = attr.ib(type=List[dict])
14 changes: 14 additions & 0 deletions openedx_events/learning/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
UserData,
UserNotificationData,
XBlockSkillVerificationData,
ORASubmissionData,
)
from openedx_events.tooling import OpenEdxPublicSignal

Expand Down Expand Up @@ -350,3 +351,16 @@
"course_notification_data": CourseNotificationData,
}
)


# .. event_type: org.openedx.learning.ora.submission.created.v1
# .. event_name: ORA_SUBMISSION_CREATED
# .. event_description: Emitted when a new ORA submission is created
# .. event_data: ORASubmissionData
# Warning: This event is currently incompatible with the event bus, list/dict cannot be serialized yet
ORA_SUBMISSION_CREATED = OpenEdxPublicSignal(
event_type="org.openedx.learning.ora.submission.created.v1",
data={
"submission": ORASubmissionData,
},
)

0 comments on commit e0e9c0c

Please sign in to comment.