From 143e821d903b2be999ddebe51ca6e11b07b133f6 Mon Sep 17 00:00:00 2001 From: Zia Fazal Date: Tue, 22 Aug 2023 12:12:06 +0500 Subject: [PATCH] feat: add discussion forum comment interaction events transformers (#334) --- docs/event-mapping/Supported_events.rst | 10 +++++ .../current/edx.forum.comment.created.json | 40 ++++++++++++++++++ .../current/edx.forum.comment.deleted.json | 32 ++++++++++++++ .../current/edx.forum.comment.edited.json | 32 ++++++++++++++ .../current/edx.forum.comment.reported.json | 32 ++++++++++++++ .../current/edx.forum.comment.unreported.json | 33 +++++++++++++++ .../xapi/event_transformers/forum_events.py | 21 ++++++---- .../expected/edx.forum.comment.created.json | 42 +++++++++++++++++++ .../expected/edx.forum.comment.deleted.json | 42 +++++++++++++++++++ .../expected/edx.forum.comment.edited.json | 42 +++++++++++++++++++ .../expected/edx.forum.comment.reported.json | 42 +++++++++++++++++++ .../edx.forum.comment.unreported.json | 42 +++++++++++++++++++ event_routing_backends/settings/common.py | 9 +++- 13 files changed, 410 insertions(+), 9 deletions(-) create mode 100644 event_routing_backends/processors/tests/fixtures/current/edx.forum.comment.created.json create mode 100644 event_routing_backends/processors/tests/fixtures/current/edx.forum.comment.deleted.json create mode 100644 event_routing_backends/processors/tests/fixtures/current/edx.forum.comment.edited.json create mode 100644 event_routing_backends/processors/tests/fixtures/current/edx.forum.comment.reported.json create mode 100644 event_routing_backends/processors/tests/fixtures/current/edx.forum.comment.unreported.json create mode 100644 event_routing_backends/processors/xapi/tests/fixtures/expected/edx.forum.comment.created.json create mode 100644 event_routing_backends/processors/xapi/tests/fixtures/expected/edx.forum.comment.deleted.json create mode 100644 event_routing_backends/processors/xapi/tests/fixtures/expected/edx.forum.comment.edited.json create mode 100644 event_routing_backends/processors/xapi/tests/fixtures/expected/edx.forum.comment.reported.json create mode 100644 event_routing_backends/processors/xapi/tests/fixtures/expected/edx.forum.comment.unreported.json diff --git a/docs/event-mapping/Supported_events.rst b/docs/event-mapping/Supported_events.rst index 6cc53d95..1bf8bae6 100644 --- a/docs/event-mapping/Supported_events.rst +++ b/docs/event-mapping/Supported_events.rst @@ -64,6 +64,11 @@ Forum events * `edx.forum.response.voted`_ | edX `sample <../../event_routing_backends/processors/tests/fixtures/current/edx.forum.response.voted.json>`__ | xAPI `map <./xAPI_mapping.rst#edx.forum.response.voted>`__ , `sample <../../event_routing_backends/processors/xapi/tests/fixtures/expected/edx.forum.response.voted.json>`__ * `edx.forum.response.reported`_ | edX `sample <../../event_routing_backends/processors/tests/fixtures/current/edx.forum.response.reported.json>`__ | xAPI `map <./xAPI_mapping.rst#edx.forum.response.reported>`__ , `sample <../../event_routing_backends/processors/xapi/tests/fixtures/expected/edx.forum.response.reported.json>`__ * `edx.forum.response.unreported`_ | edX `sample <../../event_routing_backends/processors/tests/fixtures/current/edx.forum.response.unreported.json>`__ | xAPI `map <./xAPI_mapping.rst#edx.forum.response.unreported>`__ , `sample <../../event_routing_backends/processors/xapi/tests/fixtures/expected/edx.forum.response.unreported.json>`__ +* `edx.forum.comment.created`_ | edX `sample <../../event_routing_backends/processors/tests/fixtures/current/edx.forum.comment.created.json>`__ | xAPI `map <./xAPI_mapping.rst#edx.forum.comment.created>`__ , `sample <../../event_routing_backends/processors/xapi/tests/fixtures/expected/edx.forum.comment.created.json>`__ +* `edx.forum.comment.edited`_ | edX `sample <../../event_routing_backends/processors/tests/fixtures/current/edx.forum.comment.edited.json>`__ | xAPI `map <./xAPI_mapping.rst#edx.forum.comment.edited>`__ , `sample <../../event_routing_backends/processors/xapi/tests/fixtures/expected/edx.forum.comment.edited.json>`__ +* `edx.forum.comment.deleted`_ | edX `sample <../../event_routing_backends/processors/tests/fixtures/current/edx.forum.comment.deleted.json>`__ | xAPI `map <./xAPI_mapping.rst#edx.forum.comment.deleted>`__ , `sample <../../event_routing_backends/processors/xapi/tests/fixtures/expected/edx.forum.comment.deleted.json>`__ +* `edx.forum.comment.reported`_ | edX `sample <../../event_routing_backends/processors/tests/fixtures/current/edx.forum.comment.reported.json>`__ | xAPI `map <./xAPI_mapping.rst#edx.forum.comment.reported>`__ , `sample <../../event_routing_backends/processors/xapi/tests/fixtures/expected/edx.forum.comment.reported.json>`__ +* `edx.forum.comment.unreported`_ | edX `sample <../../event_routing_backends/processors/tests/fixtures/current/edx.forum.comment.unreported.json>`__ | xAPI `map <./xAPI_mapping.rst#edx.forum.comment.unreported>`__ , `sample <../../event_routing_backends/processors/xapi/tests/fixtures/expected/edx.forum.comment.unreported.json>`__ .. _edx.course.enrollment.activated: http://edx.readthedocs.io/projects/devdata/en/latest/internal_data_formats/tracking_logs/student_event_types.html#edx-course-enrollment-activated-and-edx-course-enrollment-deactivated @@ -101,3 +106,8 @@ Forum events .. _edx.forum.response.voted: https://docs.openedx.org/en/latest/developers/references/internal_data_formats/tracking_logs/student_event_types.html#edx-forum-response-voted .. _edx.forum.response.reported: https://docs.openedx.org/en/latest/developers/references/internal_data_formats/tracking_logs/student_event_types.html#edx-forum-response-reported .. _edx.forum.response.unreported: https://docs.openedx.org/en/latest/developers/references/internal_data_formats/tracking_logs/student_event_types.html#edx-forum-response-unreported +.. _edx.forum.comment.created: https://docs.openedx.org/en/latest/developers/references/internal_data_formats/tracking_logs/student_event_types.html#edx-forum-comment-created +.. _edx.forum.comment.edited: https://docs.openedx.org/en/latest/developers/references/internal_data_formats/tracking_logs/student_event_types.html#edx-forum-comment-edited +.. _edx.forum.comment.deleted: https://docs.openedx.org/en/latest/developers/references/internal_data_formats/tracking_logs/student_event_types.html#edx-forum-comment-deleted +.. _edx.forum.comment.reported: https://docs.openedx.org/en/latest/developers/references/internal_data_formats/tracking_logs/student_event_types.html#edx-forum-comment-reported +.. _edx.forum.comment.unreported: https://docs.openedx.org/en/latest/developers/references/internal_data_formats/tracking_logs/student_event_types.html#edx-forum-comment-unreported diff --git a/event_routing_backends/processors/tests/fixtures/current/edx.forum.comment.created.json b/event_routing_backends/processors/tests/fixtures/current/edx.forum.comment.created.json new file mode 100644 index 00000000..5a2141e6 --- /dev/null +++ b/event_routing_backends/processors/tests/fixtures/current/edx.forum.comment.created.json @@ -0,0 +1,40 @@ +{ + "name": "edx.forum.comment.created", + "timestamp": "2023-08-08T12:09:39.157587+00:00", + "data": { + "discussion": { + "id": "64d1df0887e82a002b35a6f7" + }, + "commentable_id": "course", + "options": { + "followed": false + }, + "from_mfe_sidebar": false, + "response": { + "id": "64d1df2087e82a002b35a6fb" + }, + "truncated": false, + "body": "

First comment

", + "id": "64d2308202808b0030b8afaf", + "url": "http://apps.local.overhang.io:2002/", + "user_forums_roles": [ + "Student" + ], + "user_course_roles": [] + }, + "context": { + "session": "cf416827826486d4986255dd8d4781bc", + "user_id": 5, + "username": "xiaaug24", + "ip": "172.18.0.1", + "host": "local.overhang.io:8000", + "agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/114.0", + "path": "/api/discussion/v1/comments/", + "referer": "http://apps.local.overhang.io:2002/", + "accept_language": "en-US,en;q=0.5", + "client_id": null, + "course_id": "course-v1:TestX+XP101+2023_T1", + "org_id": "TestX", + "enterprise_uuid": "" + } +} diff --git a/event_routing_backends/processors/tests/fixtures/current/edx.forum.comment.deleted.json b/event_routing_backends/processors/tests/fixtures/current/edx.forum.comment.deleted.json new file mode 100644 index 00000000..73d0970b --- /dev/null +++ b/event_routing_backends/processors/tests/fixtures/current/edx.forum.comment.deleted.json @@ -0,0 +1,32 @@ +{ + "name": "edx.forum.comment.deleted", + "timestamp": "2023-08-08T12:07:43.102353+00:00", + "data": { + "body": "

Edit comment

", + "commentable_id": "course", + "content_type": "Comment", + "own_content": true, + "target_username": "xiaaug24", + "id": "64d1df3c87e82a002b35a6fc", + "url": "http://apps.local.overhang.io:2002/", + "user_forums_roles": [ + "Student" + ], + "user_course_roles": [] + }, + "context": { + "session": "cf416827826486d4986255dd8d4781bc", + "user_id": 5, + "username": "xiaaug24", + "ip": "172.18.0.1", + "host": "local.overhang.io:8000", + "agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/114.0", + "path": "/api/discussion/v1/comments/64d1df3c87e82a002b35a6fc/", + "referer": "http://apps.local.overhang.io:2002/", + "accept_language": "en-US,en;q=0.5", + "client_id": null, + "course_id": "course-v1:TestX+XP101+2023_T1", + "org_id": "TestX", + "enterprise_uuid": "" + } +} diff --git a/event_routing_backends/processors/tests/fixtures/current/edx.forum.comment.edited.json b/event_routing_backends/processors/tests/fixtures/current/edx.forum.comment.edited.json new file mode 100644 index 00000000..eb5464cd --- /dev/null +++ b/event_routing_backends/processors/tests/fixtures/current/edx.forum.comment.edited.json @@ -0,0 +1,32 @@ +{ + "name": "edx.forum.comment.edited", + "timestamp": "2023-08-08T12:05:54.453258+00:00", + "data": { + "target_username": "xiaaug24", + "own_content": true, + "content_type": "Comment", + "edit_reason": null, + "commentable_id": "course", + "id": "64d1df3c87e82a002b35a6fc", + "url": "http://apps.local.overhang.io:2002/", + "user_forums_roles": [ + "Student" + ], + "user_course_roles": [] + }, + "context": { + "session": "cf416827826486d4986255dd8d4781bc", + "user_id": 5, + "username": "xiaaug24", + "ip": "172.18.0.1", + "host": "local.overhang.io:8000", + "agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/114.0", + "path": "/api/discussion/v1/comments/64d1df3c87e82a002b35a6fc/", + "referer": "http://apps.local.overhang.io:2002/", + "accept_language": "en-US,en;q=0.5", + "client_id": null, + "course_id": "course-v1:TestX+XP101+2023_T1", + "org_id": "TestX", + "enterprise_uuid": "" + } +} diff --git a/event_routing_backends/processors/tests/fixtures/current/edx.forum.comment.reported.json b/event_routing_backends/processors/tests/fixtures/current/edx.forum.comment.reported.json new file mode 100644 index 00000000..481942bd --- /dev/null +++ b/event_routing_backends/processors/tests/fixtures/current/edx.forum.comment.reported.json @@ -0,0 +1,32 @@ +{ + "name": "edx.forum.comment.reported", + "timestamp": "2023-08-08T12:11:25.068027+00:00", + "data": { + "body": "

First comment

", + "truncated": false, + "commentable_id": "course", + "content_type": "Comment", + "target_username": "xiaaug24", + "id": "64d2308202808b0030b8afaf", + "url": "http://apps.local.overhang.io:2002/", + "user_forums_roles": [ + "Student" + ], + "user_course_roles": [] + }, + "context": { + "session": "cf416827826486d4986255dd8d4781bc", + "user_id": 5, + "username": "xiaaug24", + "ip": "172.18.0.1", + "host": "local.overhang.io:8000", + "agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/114.0", + "path": "/api/discussion/v1/comments/64d2308202808b0030b8afaf/", + "referer": "http://apps.local.overhang.io:2002/", + "accept_language": "en-US,en;q=0.5", + "client_id": null, + "course_id": "course-v1:TestX+XP101+2023_T1", + "org_id": "TestX", + "enterprise_uuid": "" + } +} diff --git a/event_routing_backends/processors/tests/fixtures/current/edx.forum.comment.unreported.json b/event_routing_backends/processors/tests/fixtures/current/edx.forum.comment.unreported.json new file mode 100644 index 00000000..66b37b4c --- /dev/null +++ b/event_routing_backends/processors/tests/fixtures/current/edx.forum.comment.unreported.json @@ -0,0 +1,33 @@ +{ + "name": "edx.forum.comment.unreported", + "timestamp": "2023-08-08T12:12:58.380220+00:00", + "data": { + "body": "

First comment

", + "truncated": false, + "commentable_id": "course", + "content_type": "Comment", + "reported_status_cleared": true, + "target_username": "xiaaug24", + "id": "64d2308202808b0030b8afaf", + "url": "http://apps.local.overhang.io:2002/", + "user_forums_roles": [ + "Student" + ], + "user_course_roles": [] + }, + "context": { + "session": "cf416827826486d4986255dd8d4781bc", + "user_id": 5, + "username": "xiaaug24", + "ip": "172.18.0.1", + "host": "local.overhang.io:8000", + "agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/114.0", + "path": "/api/discussion/v1/comments/64d2308202808b0030b8afaf/", + "referer": "http://apps.local.overhang.io:2002/", + "accept_language": "en-US,en;q=0.5", + "client_id": null, + "course_id": "course-v1:TestX+XP101+2023_T1", + "org_id": "TestX", + "enterprise_uuid": "" + } +} diff --git a/event_routing_backends/processors/xapi/event_transformers/forum_events.py b/event_routing_backends/processors/xapi/event_transformers/forum_events.py index e150f524..92d3cfdc 100644 --- a/event_routing_backends/processors/xapi/event_transformers/forum_events.py +++ b/event_routing_backends/processors/xapi/event_transformers/forum_events.py @@ -63,9 +63,11 @@ def get_context_extensions(self): @XApiTransformersRegistry.register('edx.forum.thread.edited') @XApiTransformersRegistry.register('edx.forum.response.edited') +@XApiTransformersRegistry.register('edx.forum.comment.edited') class ThreadEditedTransformer(BaseForumThreadTransformer): """ - Transformers for event generated when learner modifies a thread/response in discussion forum. + Transformers for event generated when learner modifies a + thread/response/comment in discussion forum. """ verb = Verb( id=constants.XAPI_VERB_EDITED, @@ -86,9 +88,11 @@ class ThreadViewedTransformer(BaseForumThreadTransformer): @XApiTransformersRegistry.register('edx.forum.thread.deleted') @XApiTransformersRegistry.register('edx.forum.response.deleted') +@XApiTransformersRegistry.register('edx.forum.comment.deleted') class ThreadDeletedTransformer(BaseForumThreadTransformer): """ - Transformers for event generated when learner deletes a thread/response in discussion forum. + Transformers for event generated when learner deletes a + thread/response/comment in discussion forum. """ verb = Verb( id=constants.XAPI_VERB_DELETED, @@ -122,10 +126,11 @@ def get_context_extensions(self): @XApiTransformersRegistry.register('edx.forum.response.created') +@XApiTransformersRegistry.register('edx.forum.comment.created') class ThreadResponseCreatedTransformer(BaseForumThreadTransformer): """ Transformer for event generated when learner creates a response - under a thread in discussion forum. + or comment under a thread in discussion forum. """ verb = Verb( id=constants.XAPI_VERB_POSTED, @@ -135,10 +140,11 @@ class ThreadResponseCreatedTransformer(BaseForumThreadTransformer): @XApiTransformersRegistry.register('edx.forum.thread.reported') @XApiTransformersRegistry.register('edx.forum.response.reported') +@XApiTransformersRegistry.register('edx.forum.comment.reported') class ThreadResponseReportedTransformer(BaseForumThreadTransformer): """ - Transformer for event generated when learner reports a thread or response - to a thread as inappropriate. + Transformer for event generated when learner reports a thread, + response or comment as inappropriate. """ verb = Verb( id=constants.XAPI_VERB_REPORTED, @@ -148,10 +154,11 @@ class ThreadResponseReportedTransformer(BaseForumThreadTransformer): @XApiTransformersRegistry.register('edx.forum.thread.unreported') @XApiTransformersRegistry.register('edx.forum.response.unreported') +@XApiTransformersRegistry.register('edx.forum.comment.unreported') class ThreadResponseUnReportedTransformer(BaseForumThreadTransformer): """ - Transformer for event generated when learner unreports a thread or response - to a thread which was earlier reported as inappropriate. + Transformer for event generated when learner unreports a thread, + response or comment which was earlier reported as inappropriate. """ verb = Verb( id=constants.XAPI_VERB_UNREPORTED, diff --git a/event_routing_backends/processors/xapi/tests/fixtures/expected/edx.forum.comment.created.json b/event_routing_backends/processors/xapi/tests/fixtures/expected/edx.forum.comment.created.json new file mode 100644 index 00000000..7f6e60f0 --- /dev/null +++ b/event_routing_backends/processors/xapi/tests/fixtures/expected/edx.forum.comment.created.json @@ -0,0 +1,42 @@ +{ + "id": "6d1f033b-3f70-458c-b53a-e6bb63cbaef9", + "actor": { + "objectType": "Agent", + "account": {"homePage": "http://localhost:18000", "name": "32e08e30-f8ae-4ce2-94a8-c2bfe38a70cb"} + }, + "context": { + "contextActivities": { + "parent": [ + { + "id": "http://localhost:18000/course/course-v1:TestX+XP101+2023_T1", + "objectType": "Activity", + "definition": { + "name": { + "en-US": "Demonstration Course" + }, + "type": "http://adlnet.gov/expapi/activities/course" + } + } + ] + }, + "extensions": { + "https://w3id.org/xapi/openedx/extension/transformer-version": "event-routing-backends@1.1.1", + "https://w3id.org/xapi/openedx/extensions/session-id": "cf416827826486d4986255dd8d4781bc" + } + }, + "object": { + "definition": { + "type": "http://id.tincanapi.com/activitytype/discussion" + }, + "id": "http://localhost:18000/api/discussion/v1/comments/64d2308202808b0030b8afaf", + "objectType": "Activity" + }, + "timestamp": "2023-08-08T12:09:39.157587+00:00", + "verb": { + "display": { + "en": "posted" + }, + "id": "https://w3id.org/xapi/acrossx/verbs/posted" + }, + "version": "1.0.3" +} diff --git a/event_routing_backends/processors/xapi/tests/fixtures/expected/edx.forum.comment.deleted.json b/event_routing_backends/processors/xapi/tests/fixtures/expected/edx.forum.comment.deleted.json new file mode 100644 index 00000000..5e98e8ac --- /dev/null +++ b/event_routing_backends/processors/xapi/tests/fixtures/expected/edx.forum.comment.deleted.json @@ -0,0 +1,42 @@ +{ + "id": "6d1f033b-3f70-458c-b53a-e6bb63cbaef9", + "actor": { + "objectType": "Agent", + "account": {"homePage": "http://localhost:18000", "name": "32e08e30-f8ae-4ce2-94a8-c2bfe38a70cb"} + }, + "context": { + "contextActivities": { + "parent": [ + { + "id": "http://localhost:18000/course/course-v1:TestX+XP101+2023_T1", + "objectType": "Activity", + "definition": { + "name": { + "en-US": "Demonstration Course" + }, + "type": "http://adlnet.gov/expapi/activities/course" + } + } + ] + }, + "extensions": { + "https://w3id.org/xapi/openedx/extension/transformer-version": "event-routing-backends@1.1.1", + "https://w3id.org/xapi/openedx/extensions/session-id": "cf416827826486d4986255dd8d4781bc" + } + }, + "object": { + "definition": { + "type": "http://id.tincanapi.com/activitytype/discussion" + }, + "id": "http://localhost:18000/api/discussion/v1/comments/64d1df3c87e82a002b35a6fc", + "objectType": "Activity" + }, + "timestamp": "2023-08-08T12:07:43.102353+00:00", + "verb": { + "display": { + "en": "deleted" + }, + "id": "https://w3id.org/xapi/dod-isd/verbs/deleted" + }, + "version": "1.0.3" +} diff --git a/event_routing_backends/processors/xapi/tests/fixtures/expected/edx.forum.comment.edited.json b/event_routing_backends/processors/xapi/tests/fixtures/expected/edx.forum.comment.edited.json new file mode 100644 index 00000000..78474a82 --- /dev/null +++ b/event_routing_backends/processors/xapi/tests/fixtures/expected/edx.forum.comment.edited.json @@ -0,0 +1,42 @@ +{ + "id": "6d1f033b-3f70-458c-b53a-e6bb63cbaef9", + "actor": { + "objectType": "Agent", + "account": {"homePage": "http://localhost:18000", "name": "32e08e30-f8ae-4ce2-94a8-c2bfe38a70cb"} + }, + "context": { + "contextActivities": { + "parent": [ + { + "id": "http://localhost:18000/course/course-v1:TestX+XP101+2023_T1", + "objectType": "Activity", + "definition": { + "name": { + "en-US": "Demonstration Course" + }, + "type": "http://adlnet.gov/expapi/activities/course" + } + } + ] + }, + "extensions": { + "https://w3id.org/xapi/openedx/extension/transformer-version": "event-routing-backends@1.1.1", + "https://w3id.org/xapi/openedx/extensions/session-id": "cf416827826486d4986255dd8d4781bc" + } + }, + "object": { + "definition": { + "type": "http://id.tincanapi.com/activitytype/discussion" + }, + "id": "http://localhost:18000/api/discussion/v1/comments/64d1df3c87e82a002b35a6fc", + "objectType": "Activity" + }, + "timestamp": "2023-08-08T12:05:54.453258+00:00", + "verb": { + "display": { + "en": "edited" + }, + "id": "https://w3id.org/xapi/acrossx/verbs/edited" + }, + "version": "1.0.3" +} diff --git a/event_routing_backends/processors/xapi/tests/fixtures/expected/edx.forum.comment.reported.json b/event_routing_backends/processors/xapi/tests/fixtures/expected/edx.forum.comment.reported.json new file mode 100644 index 00000000..a8dd965c --- /dev/null +++ b/event_routing_backends/processors/xapi/tests/fixtures/expected/edx.forum.comment.reported.json @@ -0,0 +1,42 @@ +{ + "id": "6d1f033b-3f70-458c-b53a-e6bb63cbaef9", + "actor": { + "objectType": "Agent", + "account": {"homePage": "http://localhost:18000", "name": "32e08e30-f8ae-4ce2-94a8-c2bfe38a70cb"} + }, + "context": { + "contextActivities": { + "parent": [ + { + "id": "http://localhost:18000/course/course-v1:TestX+XP101+2023_T1", + "objectType": "Activity", + "definition": { + "name": { + "en-US": "Demonstration Course" + }, + "type": "http://adlnet.gov/expapi/activities/course" + } + } + ] + }, + "extensions": { + "https://w3id.org/xapi/openedx/extension/transformer-version": "event-routing-backends@1.1.1", + "https://w3id.org/xapi/openedx/extensions/session-id": "cf416827826486d4986255dd8d4781bc" + } + }, + "object": { + "definition": { + "type": "http://id.tincanapi.com/activitytype/discussion" + }, + "id": "http://localhost:18000/api/discussion/v1/comments/64d2308202808b0030b8afaf", + "objectType": "Activity" + }, + "timestamp": "2023-08-08T12:11:25.068027+00:00", + "verb": { + "display": { + "en": "reported" + }, + "id": "https://w3id.org/xapi/acrossx/verbs/reported" + }, + "version": "1.0.3" +} diff --git a/event_routing_backends/processors/xapi/tests/fixtures/expected/edx.forum.comment.unreported.json b/event_routing_backends/processors/xapi/tests/fixtures/expected/edx.forum.comment.unreported.json new file mode 100644 index 00000000..b7e61193 --- /dev/null +++ b/event_routing_backends/processors/xapi/tests/fixtures/expected/edx.forum.comment.unreported.json @@ -0,0 +1,42 @@ +{ + "id": "6d1f033b-3f70-458c-b53a-e6bb63cbaef9", + "actor": { + "objectType": "Agent", + "account": {"homePage": "http://localhost:18000", "name": "32e08e30-f8ae-4ce2-94a8-c2bfe38a70cb"} + }, + "context": { + "contextActivities": { + "parent": [ + { + "id": "http://localhost:18000/course/course-v1:TestX+XP101+2023_T1", + "objectType": "Activity", + "definition": { + "name": { + "en-US": "Demonstration Course" + }, + "type": "http://adlnet.gov/expapi/activities/course" + } + } + ] + }, + "extensions": { + "https://w3id.org/xapi/openedx/extension/transformer-version": "event-routing-backends@1.1.1", + "https://w3id.org/xapi/openedx/extensions/session-id": "cf416827826486d4986255dd8d4781bc" + } + }, + "object": { + "definition": { + "type": "http://id.tincanapi.com/activitytype/discussion" + }, + "id": "http://localhost:18000/api/discussion/v1/comments/64d2308202808b0030b8afaf", + "objectType": "Activity" + }, + "timestamp": "2023-08-08T12:12:58.380220+00:00", + "verb": { + "display": { + "en": "unreported" + }, + "id": "https://w3id.org/xapi/openedx/verb/unreported" + }, + "version": "1.0.3" +} diff --git a/event_routing_backends/settings/common.py b/event_routing_backends/settings/common.py index 9b72d149..5d78074e 100644 --- a/event_routing_backends/settings/common.py +++ b/event_routing_backends/settings/common.py @@ -75,8 +75,8 @@ def plugin_settings(settings): 'edx.forum.thread.created', 'edx.forum.thread.deleted', 'edx.forum.thread.edited', - 'edx.forum.thread.viewed' - 'edx.forum.response.reported', + 'edx.forum.thread.viewed', + 'edx.forum.thread.reported', 'edx.forum.thread.unreported', 'edx.forum.thread.voted', 'edx.forum.response.created', @@ -85,6 +85,11 @@ def plugin_settings(settings): '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',