diff --git a/lms/djangoapps/grades/events.py b/lms/djangoapps/grades/events.py index 21693b12d81a..9e648fa04ec7 100644 --- a/lms/djangoapps/grades/events.py +++ b/lms/djangoapps/grades/events.py @@ -6,11 +6,8 @@ from crum import get_current_user from django.conf import settings from eventtracking import tracker -from openedx_events.learning.data import UserCourseData, CourseData, UserData, UserPersonalData -from openedx_events.learning.signals import ( - COURSE_GRADE_NOW_PASSED as COURSE_GRADE_NOW_PASSED_PUBLIC, - COURSE_GRADE_NOW_FAILED as COURSE_GRADE_NOW_FAILED_PUBLIC, -) +from openedx_events.learning.data import CcxCoursePassingStatusData, CourseData, CoursePassingStatusData, UserData, UserPersonalData +from openedx_events.learning.signals import CCX_COURSE_PASSING_STATUS_UPDATED, COURSE_PASSING_STATUS_UPDATED from common.djangoapps.course_modes.models import CourseMode from common.djangoapps.student.models import CourseEnrollment @@ -196,8 +193,9 @@ def course_grade_now_passed(user, course_id): ) # produce to event bus - COURSE_GRADE_NOW_PASSED_PUBLIC.send_event( - user_course_data=UserCourseData( + COURSE_PASSING_STATUS_UPDATED.send_event( + course_passing_status=CoursePassingStatusData( + status=CoursePassingStatusData.PASSING, user=UserData( pii=UserPersonalData( username=user.username, @@ -210,6 +208,8 @@ def course_grade_now_passed(user, course_id): course=CourseData( course_key=course_id, ), + update_timestamp=None, + grading_policy_hash=None, ) ) @@ -233,8 +233,9 @@ def course_grade_now_failed(user, course_id): ) # produce to event bus - COURSE_GRADE_NOW_FAILED_PUBLIC.send_event( - user_course_data=UserCourseData( + COURSE_PASSING_STATUS_UPDATED.send_event( + course_passing_status=CoursePassingStatusData( + status = CoursePassingStatusData.FAILING, user=UserData( pii=UserPersonalData( username=user.username, @@ -247,6 +248,8 @@ def course_grade_now_failed(user, course_id): course=CourseData( course_key=course_id, ), + update_timestamp=None, + grading_policy_hash=None, ) ) diff --git a/lms/envs/common.py b/lms/envs/common.py index 0d57934d5b9e..7b79221a9449 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -5498,15 +5498,15 @@ def _should_send_certificate_events(settings): 'course-authoring-xblock-lifecycle': {'event_key_field': 'xblock_info.usage_key', 'enabled': False}, }, - "org.openedx.learning.course.grade.now.passed.v1": { + "org.openedx.learning.course.passing.status.v1": { "learning-badges-lifecycle": { - "event_key_field": "user_course_data.course.course_key", + "event_key_field": "course_passing_status.course.course_key", "enabled": True, }, }, - "org.openedx.learning.course.grade.now.failed.v1": { + "org.openedx.learning.ccx.course.passing.status.v1": { "learning-badges-lifecycle": { - "event_key_field": "user_course_data.course.course_key", + "event_key_field": "course_passing_status.course.course_key", "enabled": True, }, },