Skip to content

Commit

Permalink
feat: Add thread response transformers
Browse files Browse the repository at this point in the history
  • Loading branch information
ziafazal committed Aug 1, 2023
1 parent f0ac42f commit f83e28a
Show file tree
Hide file tree
Showing 27 changed files with 843 additions and 11 deletions.
16 changes: 16 additions & 0 deletions docs/event-mapping/Supported_events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ Forum events
* `edx.forum.thread.viewed`_ | edX `sample <../../event_routing_backends/processors/tests/fixtures/current/edx.forum.thread.viewed.json>`__ | xAPI `map <./xAPI_mapping.rst#edx-forum-thread-viewed>`__ , `sample <../../event_routing_backends/processors/xapi/tests/fixtures/expected/edx.forum.thread.viewed.json>`__
* `edx.forum.thread.deleted`_ | edX `sample <../../event_routing_backends/processors/tests/fixtures/current/edx.forum.thread.deleted.json>`__ | xAPI `map <./xAPI_mapping.rst#edx-forum-thread-deleted>`__ , `sample <../../event_routing_backends/processors/xapi/tests/fixtures/expected/edx.forum.thread.deleted.json>`__
* `edx.forum.thread.voted`_ | edX `sample <../../event_routing_backends/processors/tests/fixtures/current/edx.forum.thread.voted.json>`__ | xAPI `map <./xAPI_mapping.rst#edx-forum-thread-voted>`__ , `sample <../../event_routing_backends/processors/xapi/tests/fixtures/expected/edx.forum.thread.voted.json>`__
* `edx.forum.thread.reported`_ | edX `sample <../../event_routing_backends/processors/tests/fixtures/current/edx.forum.thread.reported.json>`__ | xAPI `map <./xAPI_mapping.rst#edx-forum-thread-reported>`__ , `sample <../../event_routing_backends/processors/xapi/tests/fixtures/expected/edx.forum.thread.reported.json>`__
* `edx.forum.thread.unreported`_ | edX `sample <../../event_routing_backends/processors/tests/fixtures/current/edx.forum.thread.unreported.json>`__ | xAPI `map <./xAPI_mapping.rst#edx-forum-thread-unreported>`__ , `sample <../../event_routing_backends/processors/xapi/tests/fixtures/expected/edx.forum.thread.unreported.json>`__
* `edx.forum.response.created`_ | edX `sample <../../event_routing_backends/processors/tests/fixtures/current/edx.forum.response.created.json>`__ | xAPI `map <./xAPI_mapping.rst#edx.forum.response.created>`__ , `sample <../../event_routing_backends/processors/xapi/tests/fixtures/expected/edx.forum.response.created.json>`__
* `edx.forum.response.edited`_ | edX `sample <../../event_routing_backends/processors/tests/fixtures/current/edx.forum.response.edited.json>`__ | xAPI `map <./xAPI_mapping.rst#edx.forum.response.edited>`__ , `sample <../../event_routing_backends/processors/xapi/tests/fixtures/expected/edx.forum.response.edited.json>`__
* `edx.forum.response.deleted`_ | edX `sample <../../event_routing_backends/processors/tests/fixtures/current/edx.forum.response.deleted.json>`__ | xAPI `map <./xAPI_mapping.rst#edx.forum.response.deleted>`__ , `sample <../../event_routing_backends/processors/xapi/tests/fixtures/expected/edx.forum.response.deleted.json>`__
* `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.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
Expand Down Expand Up @@ -85,3 +93,11 @@ Forum events
.. _edx.forum.thread.viewed: https://docs.openedx.org/en/latest/developers/references/internal_data_formats/tracking_logs/student_event_types.html#edx-forum-thread-viewed
.. _edx.forum.thread.deleted: https://docs.openedx.org/en/latest/developers/references/internal_data_formats/tracking_logs/student_event_types.html#edx-forum-thread-deleted
.. _edx.forum.thread.voted: https://docs.openedx.org/en/latest/developers/references/internal_data_formats/tracking_logs/student_event_types.html#edx-forum-thread-voted
.. _edx.forum.thread.reported: https://docs.openedx.org/en/latest/developers/references/internal_data_formats/tracking_logs/student_event_types.html#edx-forum-thread-reported
.. _edx.forum.thread.unreported: https://docs.openedx.org/en/latest/developers/references/internal_data_formats/tracking_logs/student_event_types.html#edx-forum-thread-unreported
.. _edx.forum.response.created: https://docs.openedx.org/en/latest/developers/references/internal_data_formats/tracking_logs/student_event_types.html#edx-forum-response-created
.. _edx.forum.response.edited: https://docs.openedx.org/en/latest/developers/references/internal_data_formats/tracking_logs/student_event_types.html#edx-forum-response-edited
.. _edx.forum.response.deleted: https://docs.openedx.org/en/latest/developers/references/internal_data_formats/tracking_logs/student_event_types.html#edx-forum-response-deleted
.. _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
155 changes: 154 additions & 1 deletion docs/event-mapping/xAPI_mapping.rst
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ objectType Acti
definition [ type ] http://id.tincanapi.com/activitytype/discussion
=========================================================================== =======================================================

edx.forum.thread.created
edx.forum.thread.voted
========================

=========================================================================== ======================================================
Expand All @@ -732,3 +732,156 @@ objectType Acti
definition [ type ] http://id.tincanapi.com/activitytype/discussion
definition [ extensions [ https://w3id.org/xapi/acrossx/extensions/type ] ] <data [ vote_value ]>
=========================================================================== ======================================================

edx.forum.thread.reported
=========================

=========================================================================== =======================================================
xAPI Key Value
=========================================================================== =======================================================
``Actor``
objectType Agent
account [ homePage ] <LMS_ROOT_URL>
account [ name ] <external_id[ XAPI ]>
``Verb``
id https://w3id.org/xapi/acrossx/verbs/reported
display [ en-US ] reported
``Object``
id <LMS_ROOT_URL>/api/discussion/v1/threads/<data [ id ]>
objectType Activity
definition [ type ] http://id.tincanapi.com/activitytype/discussion
=========================================================================== =======================================================

edx.forum.thread.unreported
===========================

=========================================================================== =======================================================
xAPI Key Value
=========================================================================== =======================================================
``Actor``
objectType Agent
account [ homePage ] <LMS_ROOT_URL>
account [ name ] <external_id[ XAPI ]>
``Verb``
id https://w3id.org/xapi/openedx/verb/unreported
display [ en-US ] unreported
``Object``
id <LMS_ROOT_URL>/api/discussion/v1/threads/<data [ id ]>
objectType Activity
definition [ type ] http://id.tincanapi.com/activitytype/discussion
=========================================================================== =======================================================

edx.forum.response.created
==========================

=========================================================================== =======================================================
xAPI Key Value
=========================================================================== =======================================================
``Actor``
objectType Agent
account [ homePage ] <LMS_ROOT_URL>
account [ name ] <external_id[ XAPI ]>
``Verb``
id https://w3id.org/xapi/acrossx/verbs/posted
display [ en-US ] posted
``Object``
id <LMS_ROOT_URL>/api/discussion/v1/comments/<data [ id ]>
objectType Activity
definition [ type ] http://id.tincanapi.com/activitytype/discussion
=========================================================================== =======================================================

edx.forum.response.edited
=========================

=========================================================================== =======================================================
xAPI Key Value
=========================================================================== =======================================================
``Actor``
objectType Agent
account [ homePage ] <LMS_ROOT_URL>
account [ name ] <external_id[ XAPI ]>
``Verb``
id https://w3id.org/xapi/acrossx/verbs/edited
display [ en-US ] edited
``Object``
id <LMS_ROOT_URL>/api/discussion/v1/comments/<data [ id ]>
objectType Activity
definition [ type ] http://id.tincanapi.com/activitytype/discussion
=========================================================================== =======================================================

edx.forum.response.deleted
==========================

=========================================================================== =======================================================
xAPI Key Value
=========================================================================== =======================================================
``Actor``
objectType Agent
account [ homePage ] <LMS_ROOT_URL>
account [ name ] <external_id[ XAPI ]>
``Verb``
id https://w3id.org/xapi/dod-isd/verbs/deleted
display [ en-US ] deleted
``Object``
id <LMS_ROOT_URL>/api/discussion/v1/comments/<data [ id ]>
objectType Activity
definition [ type ] http://id.tincanapi.com/activitytype/discussion
=========================================================================== =======================================================

edx.forum.response.voted
==========================

=========================================================================== =======================================================
xAPI Key Value
=========================================================================== =======================================================
``Actor``
objectType Agent
account [ homePage ] <LMS_ROOT_URL>
account [ name ] <external_id[ XAPI ]>
``Verb``
id https://w3id.org/xapi/openedx/verb/voted
display [ en-US ] voted
``Object``
id <LMS_ROOT_URL>/api/discussion/v1/comments/<data [ id ]>
objectType Activity
definition [ type ] http://id.tincanapi.com/activitytype/discussion
definition [ extensions [ https://w3id.org/xapi/acrossx/extensions/type ] ] <data [ vote_value ]>
=========================================================================== =======================================================

edx.forum.response.reported
===========================

=========================================================================== =======================================================
xAPI Key Value
=========================================================================== =======================================================
``Actor``
objectType Agent
account [ homePage ] <LMS_ROOT_URL>
account [ name ] <external_id[ XAPI ]>
``Verb``
id https://w3id.org/xapi/acrossx/verbs/reported
display [ en-US ] reported
``Object``
id <LMS_ROOT_URL>/api/discussion/v1/comments/<data [ id ]>
objectType Activity
definition [ type ] http://id.tincanapi.com/activitytype/discussion
=========================================================================== =======================================================

edx.forum.response.unreported
=============================

=========================================================================== =======================================================
xAPI Key Value
=========================================================================== =======================================================
``Actor``
objectType Agent
account [ homePage ] <LMS_ROOT_URL>
account [ name ] <external_id[ XAPI ]>
``Verb``
id https://w3id.org/xapi/openedx/verb/unreported
display [ en-US ] unreported
``Object``
id <LMS_ROOT_URL>/api/discussion/v1/comments/<data [ id ]>
objectType Activity
definition [ type ] http://id.tincanapi.com/activitytype/discussion
=========================================================================== =======================================================
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "edx.forum.response.created",
"timestamp": "2023-07-19T10:09:04.464412+00:00",
"data": {
"discussion": {
"id": "64b7b2bee68f35003369092d"
},
"commentable_id": "7d6d6f11-537b-47c6-8575-ad3e315c0e06",
"options": {
"followed": false
},
"from_mfe_sidebar": false,
"truncated": false,
"body": "<p>Response 1</p>",
"id": "64b7b640e68f350033690932",
"url": "http://apps.local.overhang.io:2002/",
"user_forums_roles": [
"Student"
],
"user_course_roles": []
},
"context": {
"session": "9be7677aefad3235abeb0241f2bea142",
"user_id": 18,
"username": "response",
"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+XAPI101+2019_T2",
"org_id": "testX",
"enterprise_uuid": ""
}
}
Loading

0 comments on commit f83e28a

Please sign in to comment.