-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: emit the EXAM_ATTEMPT_SUBMITTED Open edX event when an exam is …
…submitted
- Loading branch information
1 parent
bf28d14
commit f6be2f9
Showing
4 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from openedx_events.learning.data import ExamAttemptData, UserData, UserPersonalData | ||
from openedx_events.learning.signals import EXAM_ATTEMPT_SUBMITTED | ||
|
||
|
||
def emit_exam_attempt_submitted_event(user, course_key, usage_key): | ||
# .. event_implemented_name: EXAM_ATTEMPT_SUBMITTED | ||
EXAM_ATTEMPT_SUBMITTED.send_event( | ||
exam_attempt=ExamAttemptData( | ||
student_user=UserData( | ||
id=user.id, | ||
is_active=user.is_active, | ||
pii=UserPersonalData( | ||
username=user.username, | ||
email=user.email, | ||
name=user.full_name | ||
) | ||
), | ||
course_key=course_key, | ||
usage_key=usage_key, | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters