From 006b20f445f9c7622eca6051272f73ace31e1b76 Mon Sep 17 00:00:00 2001 From: Cristhian Garcia Date: Thu, 2 Nov 2023 14:15:36 -0500 Subject: [PATCH] chore: remove unused setting fix: restore event tracking backends settings --- event_routing_backends/settings/common.py | 233 +++++++++++----------- 1 file changed, 121 insertions(+), 112 deletions(-) diff --git a/event_routing_backends/settings/common.py b/event_routing_backends/settings/common.py index 9a597dc9..22fe40d4 100644 --- a/event_routing_backends/settings/common.py +++ b/event_routing_backends/settings/common.py @@ -15,7 +15,6 @@ def plugin_settings(settings): settings.EVENT_ROUTING_BACKEND_COUNTDOWN = 30 settings.EVENT_ROUTING_BACKEND_BULK_DOWNLOAD_MAX_RETRIES = 3 settings.EVENT_ROUTING_BACKEND_BULK_DOWNLOAD_COUNTDOWN = 1 - settings.EVENT_ROUTING_BATCH_SIZE = 5 # .. setting_name: XAPI_AGENT_IFI_TYPE # .. setting_default: 'external_id' @@ -60,119 +59,86 @@ def plugin_settings(settings): 'edx.course.grade.passed.first_time' ] - settings.WHITELIST_EVENTS = { - 'xapi': [ - 'edx.course.enrollment.activated', - 'edx.course.enrollment.deactivated', - 'edx.course.enrollment.mode_changed', - 'edx.grades.subsection.grade_calculated', - 'edx.grades.course.grade_calculated', - 'edx.special_exam.timed.attempt.created', - 'edx.special_exam.timed.attempt.submitted', - 'edx.special_exam.practice.attempt.created', - 'edx.special_exam.practice.attempt.submitted', - 'edx.special_exam.proctored.attempt.created', - 'edx.special_exam.proctored.attempt.submitted', - 'edx.completion.block_completion.changed', - 'edx.forum.thread.created', - 'edx.forum.thread.deleted', - 'edx.forum.thread.edited', - 'edx.forum.thread.viewed', - 'edx.forum.thread.reported', - 'edx.forum.thread.unreported', - 'edx.forum.thread.voted', - 'edx.forum.response.created', - 'edx.forum.response.deleted', - 'edx.forum.response.edited', - 'edx.forum.response.reported', - 'edx.forum.response.unreported', - 'edx.forum.response.voted', - 'edx.forum.comment.created', - 'edx.forum.comment.deleted', - 'edx.forum.comment.edited', - 'edx.forum.comment.reported', - 'edx.forum.comment.unreported', - 'edx.ui.lms.link_clicked', - 'edx.ui.lms.sequence.outline.selected', - 'edx.ui.lms.outline.selected', - 'edx.ui.lms.sequence.next_selected', - 'edx.ui.lms.sequence.previous_selected', - 'edx.ui.lms.sequence.tab_selected', - 'showanswer', - 'edx.problem.hint.demandhint_displayed', - 'problem_check', - 'load_video', - 'edx.video.loaded', - 'play_video', - 'edx.video.played', - 'complete_video', - 'edx.video.completed', - 'stop_video', - 'edx.video.stopped', - 'pause_video', - 'edx.video.paused', - 'seek_video', - 'edx.video.position.changed', - 'hide_transcript', - 'edx.video.transcript.hidden', - 'show_transcript', - 'edx.video.transcript.shown', - 'speed_change_video', - 'video_hide_cc_menu', - 'edx.video.closed_captions.shown', - 'edx.video.closed_captions.hidden', - 'edx.video.language_menu.hidden', - 'video_show_cc_menu', - 'edx.video.language_menu.shown', - 'edx.course.grade.passed.first_time' - ], - 'caliper': [ - 'edx.course.enrollment.activated', - 'edx.course.enrollment.deactivated', - 'edx.ui.lms.link_clicked', - 'edx.ui.lms.sequence.outline.selected', - 'edx.ui.lms.outline.selected', - 'edx.ui.lms.sequence.next_selected', - 'edx.ui.lms.sequence.previous_selected', - 'edx.ui.lms.sequence.tab_selected', - 'showanswer', - 'edx.problem.hint.demandhint_displayed', - 'problem_check', - 'load_video', - 'edx.video.loaded', - 'play_video', - 'edx.video.played', - 'complete_video', - 'edx.video.completed', - 'stop_video', - 'edx.video.stopped', - 'pause_video', - 'edx.video.paused', - 'seek_video', - 'edx.video.position.changed', - 'edx.course.grade.passed.first_time', - 'edx.course.grade.now_passed', - 'edx.course.grade.now_failed' - ], - } - - merged_whitelist = set(settings.WHITELIST_EVENTS['xapi']).union(set(settings.WHITELIST_EVENTS['caliper'])) - settings.EVENT_TRACKING_BACKENDS.update({ - "event_bus": { - "ENGINE": "eventtracking.backends.event_bus.EventBusRoutingBackend", - "OPTIONS": { - "processors": [ + 'xapi': { + 'ENGINE': 'eventtracking.backends.async_routing.AsyncRoutingBackend', + 'OPTIONS': { + 'backend_name': 'xapi', + 'processors': [ { - "ENGINE": "eventtracking.processors.whitelist.NameWhitelistProcessor", - "OPTIONS": { - "whitelist": merged_whitelist + 'ENGINE': 'eventtracking.processors.whitelist.NameWhitelistProcessor', + 'OPTIONS': { + 'whitelist': [ + 'edx.course.enrollment.activated', + 'edx.course.enrollment.deactivated', + 'edx.course.enrollment.mode_changed', + 'edx.grades.subsection.grade_calculated', + 'edx.grades.course.grade_calculated', + 'edx.special_exam.timed.attempt.created', + 'edx.special_exam.timed.attempt.submitted', + 'edx.special_exam.practice.attempt.created', + 'edx.special_exam.practice.attempt.submitted', + 'edx.special_exam.proctored.attempt.created', + 'edx.special_exam.proctored.attempt.submitted', + 'edx.completion.block_completion.changed', + 'edx.forum.thread.created', + 'edx.forum.thread.deleted', + 'edx.forum.thread.edited', + 'edx.forum.thread.viewed', + 'edx.forum.thread.reported', + 'edx.forum.thread.unreported', + 'edx.forum.thread.voted', + 'edx.forum.response.created', + 'edx.forum.response.deleted', + 'edx.forum.response.edited', + 'edx.forum.response.reported', + 'edx.forum.response.unreported', + 'edx.forum.response.voted', + 'edx.forum.comment.created', + 'edx.forum.comment.deleted', + 'edx.forum.comment.edited', + 'edx.forum.comment.reported', + 'edx.forum.comment.unreported', + 'edx.ui.lms.link_clicked', + 'edx.ui.lms.sequence.outline.selected', + 'edx.ui.lms.outline.selected', + 'edx.ui.lms.sequence.next_selected', + 'edx.ui.lms.sequence.previous_selected', + 'edx.ui.lms.sequence.tab_selected', + 'showanswer', + 'edx.problem.hint.demandhint_displayed', + 'problem_check', + 'load_video', + 'edx.video.loaded', + 'play_video', + 'edx.video.played', + 'complete_video', + 'edx.video.completed', + 'stop_video', + 'edx.video.stopped', + 'pause_video', + 'edx.video.paused', + 'seek_video', + 'edx.video.position.changed', + 'hide_transcript', + 'edx.video.transcript.hidden', + 'show_transcript', + 'edx.video.transcript.shown', + 'speed_change_video', + 'video_hide_cc_menu', + 'edx.video.closed_captions.shown', + 'edx.video.closed_captions.hidden', + 'edx.video.language_menu.hidden', + 'video_show_cc_menu', + 'edx.video.language_menu.shown', + 'edx.course.grade.passed.first_time' + ] } - } + }, ], - "backends": { + 'backends': { 'xapi': { - 'ENGINE': 'event_routing_backends.backends.async_events_router.AsyncEventsRouter', + 'ENGINE': 'event_routing_backends.backends.events_router.EventsRouter', 'OPTIONS': { 'processors': [ { @@ -183,9 +149,52 @@ def plugin_settings(settings): ], 'backend_name': 'xapi', } - }, + } + }, + }, + }, + "caliper": { + "ENGINE": "eventtracking.backends.async_routing.AsyncRoutingBackend", + "OPTIONS": { + "backend_name": "caliper", + "processors": [ + { + "ENGINE": "eventtracking.processors.whitelist.NameWhitelistProcessor", + "OPTIONS": { + "whitelist": [ + 'edx.course.enrollment.activated', + 'edx.course.enrollment.deactivated', + 'edx.ui.lms.link_clicked', + 'edx.ui.lms.sequence.outline.selected', + 'edx.ui.lms.outline.selected', + 'edx.ui.lms.sequence.next_selected', + 'edx.ui.lms.sequence.previous_selected', + 'edx.ui.lms.sequence.tab_selected', + 'showanswer', + 'edx.problem.hint.demandhint_displayed', + 'problem_check', + 'load_video', + 'edx.video.loaded', + 'play_video', + 'edx.video.played', + 'complete_video', + 'edx.video.completed', + 'stop_video', + 'edx.video.stopped', + 'pause_video', + 'edx.video.paused', + 'seek_video', + 'edx.video.position.changed', + 'edx.course.grade.passed.first_time', + 'edx.course.grade.now_passed', + 'edx.course.grade.now_failed' + ] + } + } + ], + "backends": { "caliper": { - "ENGINE": "event_routing_backends.backends.async_events_router.AsyncEventsRouter", + "ENGINE": "event_routing_backends.backends.events_router.EventsRouter", "OPTIONS": { "processors": [ { @@ -203,7 +212,7 @@ def plugin_settings(settings): } } ], - "backend_name": "caliper", + "backend_name": "caliper" } } }