Skip to content

Commit

Permalink
feat: [ACI-75] new public events
Browse files Browse the repository at this point in the history
  • Loading branch information
kyrylo-kh committed Dec 22, 2023
1 parent 1a5f9ca commit 83b377d
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
13 changes: 13 additions & 0 deletions openedx_events/learning/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,3 +469,16 @@ 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 UserCourseData:
"""
Attributes defined for Open edX user course data object.
Arguments:
user (UserData): user associated with the Course Enrollment.
course (CourseData): course where the user is enrolled in.
"""

user = attr.ib(type=UserData)
course = attr.ib(type=CourseData)
23 changes: 23 additions & 0 deletions openedx_events/learning/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
UserData,
UserNotificationData,
XBlockSkillVerificationData,
UserCourseData,
)
from openedx_events.tooling import OpenEdxPublicSignal

Expand Down Expand Up @@ -327,3 +328,25 @@
"course_notification_data": CourseNotificationData,
}
)

# .. event_type: org.openedx.learning.course.grade.now.passed.v1
# .. event_name: COURSE_GRADE_NOW_PASSED
# .. event_description: Emmited when course grade is passed.
# .. event_data: UserCourseData
COURSE_GRADE_NOW_PASSED = OpenEdxPublicSignal(
event_type="org.openedx.learning.course.grade.now.passed.v1",
data={
"user_course_data": UserCourseData,
}
)

# .. event_type: org.openedx.learning.course.grade.now.failed.v1
# .. event_name: COURSE_GRADE_NOW_FAILED
# .. event_description: Emmited when course grade is failed.
# .. event_data: UserCourseData
COURSE_GRADE_NOW_FAILED = OpenEdxPublicSignal(
event_type="org.openedx.learning.course.grade.now.failed.v1",
data={
"user_course_data": UserCourseData,
}
)

0 comments on commit 83b377d

Please sign in to comment.