Skip to content

Commit

Permalink
refactor: [ACI-820] simplify course grade status event payload (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
wowkalucky authored Mar 29, 2024
1 parent c10437e commit c72e3a9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,6 @@
]
}
},
{
"name": "update_timestamp",
"type": "string"
},
{
"name": "grading_policy_hash",
"type": "string"
},
{
"name": "course",
"type": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,6 @@
}
]
}
},
{
"name": "update_timestamp",
"type": "string"
},
{
"name": "grading_policy_hash",
"type": "string"
}
]
}
Expand Down
11 changes: 4 additions & 7 deletions openedx_events/learning/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,13 +475,12 @@ class CourseNotificationData:
@attr.s(frozen=True)
class CoursePassingStatusData:
"""
Represents the event data when a user's grade crosses a grading policy threshold in a course.
Represents the event data when a user's grade is updated, indicates if current grade is enough for course passing.
Attributes:
user (UserData): An instance of UserData containing information about the user whose grade crossed the threshold.
course (CourseData): An instance of CourseData containing details about the course in which the grade threshold was crossed.
update_timestamp (datetime): The timestamp when the grade crossing event was recorded.
grading_policy_hash (str): A hash of the course's grading policy at the time of the event, used for verifying the grading policy has not changed.
status (str): A string containing information about user's current course grade value in comparison to the grading policy threshold.
user (UserData): An instance of UserData containing information about the user whose grade was updated.
course (CourseData): An instance of CourseData containing details about the course in which the grade was updated.
"""
PASSING = 'passing'
FAILING = 'failing'
Expand All @@ -490,8 +489,6 @@ class CoursePassingStatusData:
status = attr.ib(type=str, validator=in_(STATUSES))
course = attr.ib(type=CourseData)
user = attr.ib(type=UserData)
update_timestamp = attr.ib(type=datetime)
grading_policy_hash = attr.ib(type=str)


@attr.s(frozen=True)
Expand Down

0 comments on commit c72e3a9

Please sign in to comment.