Skip to content

Commit

Permalink
feat: Added forum thread interaction events (#318)
Browse files Browse the repository at this point in the history
feat: forum thread interaction events
  • Loading branch information
ziafazal authored Jul 19, 2023
1 parent 630cd2f commit f0ac42f
Show file tree
Hide file tree
Showing 16 changed files with 633 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/event-mapping/Supported_events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ Course navigation events
* `edx.ui.lms.sequence.tab_selected`_ | edX `sample <../../event_routing_backends/processors/tests/fixtures/current/edx.ui.lms.sequence.tab_selected.json>`__ | xAPI `map <./xAPI_mapping.rst#edx-ui-lms-sequence-tab-selected>`__ , `sample <../../event_routing_backends/processors/xapi/tests/fixtures/expected/edx.ui.lms.sequence.tab_selected.json>`__ | Caliper `map <./Caliper_mapping.rst#edx-ui-lms-sequence-tab-selected>`__ , `sample <../../event_routing_backends/processors/caliper/tests/fixtures/expected/edx.ui.lms.sequence.tab_selected.json>`__
* `edx.ui.lms.link_clicked`_ | edX `sample <../../event_routing_backends/processors/tests/fixtures/current/edx.ui.lms.link_clicked.json>`__ | xAPI `map <./xAPI_mapping.rst#edx-ui-lms-link-clicked>`__ , `sample <../../event_routing_backends/processors/xapi/tests/fixtures/expected/edx.ui.lms.link_clicked.json>`__ | Caliper `map <./Caliper_mapping.rst#edx-ui-lms-link-clicked>`__ , `sample <../../event_routing_backends/processors/caliper/tests/fixtures/expected/edx.ui.lms.link_clicked.json>`__

Forum events
-----------------

* `edx.forum.thread.created`_ | edX `sample <../../event_routing_backends/processors/tests/fixtures/current/edx.forum.thread.created.json>`__ | xAPI `map <./xAPI_mapping.rst#edx-forum-thread-created>`__ , `sample <../../event_routing_backends/processors/xapi/tests/fixtures/expected/edx.forum.thread.created.json>`__
* `edx.forum.thread.edited`_ | edX `sample <../../event_routing_backends/processors/tests/fixtures/current/edx.forum.thread.edited.json>`__ | xAPI `map <./xAPI_mapping.rst#edx-forum-thread-edited>`__ , `sample <../../event_routing_backends/processors/xapi/tests/fixtures/expected/edx.forum.thread.edited.json>`__
* `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.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
.. _edx.course.enrollment.deactivated: 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 All @@ -71,3 +80,8 @@ Course navigation events
.. _edx.video.transcript.shown: https://docs.openedx.org/en/latest/developers/references/internal_data_formats/tracking_logs/student_event_types.html#show-transcript-edx-video-transcript-shown
.. _edx.video.transcript.hidden: https://docs.openedx.org/en/latest/developers/references/internal_data_formats/tracking_logs/student_event_types.html#hide-transcript-edx-video-transcript-hidden
.. _speed_change_video: https://docs.openedx.org/en/latest/developers/references/internal_data_formats/tracking_logs/student_event_types.html#speed-change-video
.. _edx.forum.thread.created: https://docs.openedx.org/en/latest/developers/references/internal_data_formats/tracking_logs/student_event_types.html#edx-forum-thread-created
.. _edx.forum.thread.edited: https://docs.openedx.org/en/latest/developers/references/internal_data_formats/tracking_logs/student_event_types.html#edx-forum-thread-edited
.. _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
97 changes: 97 additions & 0 deletions docs/event-mapping/xAPI_mapping.rst
Original file line number Diff line number Diff line change
Expand Up @@ -635,3 +635,100 @@ contextActivities [ parent [ id ] ] <LMS_ROOT_URL>/cou
contextActivities [ parent [ definition [ type ] ] ] http://adlnet.gov/expapi/activities/course
contextActivities [ parent [ definition [ name ][ en-US ] ] ] <name of course-run>
============================================================= =============================================

edx.forum.thread.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/threads/<data [ id ]>
objectType Activity
definition [ type ] http://id.tincanapi.com/activitytype/discussion
definition [ extensions [ https://w3id.org/xapi/acrossx/extensions/type ] ] <data [ thread_type ]>
=========================================================================== ======================================================

edx.forum.thread.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/threads/<data [ id ]>
objectType Activity
definition [ type ] http://id.tincanapi.com/activitytype/discussion
=========================================================================== ======================================================

edx.forum.thread.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/threads/<data [ id ]>
objectType Activity
definition [ type ] http://id.tincanapi.com/activitytype/discussion
=========================================================================== ======================================================

edx.forum.thread.viewed
=======================

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

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

=========================================================================== ======================================================
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/threads/<data [ id ]>
objectType Activity
definition [ type ] http://id.tincanapi.com/activitytype/discussion
definition [ extensions [ https://w3id.org/xapi/acrossx/extensions/type ] ] <data [ vote_value ]>
=========================================================================== ======================================================
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "edx.forum.thread.created",
"timestamp": "2023-07-10T09:23:10.354202+00:00",
"data": {
"commentable_id": "856d38cd-a139-4346-bef9-4147a2e4b7bf",
"group_id": null,
"thread_type": "discussion",
"anonymous": false,
"anonymous_to_peers": false,
"options": {
"followed": true
},
"from_mfe_sidebar": false,
"title_truncated": false,
"title": "Another thread in test topic",
"truncated": false,
"body": "<p>Description of another thread in test topic</p>",
"id": "64abcdfee68f35002fd013c6",
"url": "http://apps.local.overhang.io:2002/",
"user_forums_roles": [
"Student"
],
"user_course_roles": []
},
"context": {
"session": "054c9ddcb76d2096f862e66bda3bc308",
"user_id": 16,
"username": "xiajul10",
"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/threads/",
"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": ""
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "edx.forum.thread.deleted",
"timestamp": "2023-07-10T09:23:10.354202+00:00",
"data": {
"body": "<p>Description of another thread in test topic</p>",
"content_type": "Post",
"own_content": true,
"commentable_id": "856d38cd-a139-4346-bef9-4147a2e4b7bf",
"target_username": "xiajul10",
"title_truncated": false,
"title": "Another thread in test topic",
"id": "64abcdfee68f35002fd013c6",
"url": "http://apps.local.overhang.io:2002/",
"user_forums_roles": [
"Student"
],
"user_course_roles": []
},
"context": {
"session": "054c9ddcb76d2096f862e66bda3bc308",
"user_id": 16,
"username": "xiajul10",
"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/threads/64abcdfee68f35002fd013c6/",
"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": ""
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "edx.forum.thread.edited",
"timestamp": "2023-07-10T09:23:10.354202+00:00",
"data": {
"target_username": "xiajul7",
"content_type": "Post",
"own_content": true,
"edit_reason": null,
"commentable_id": "856d38cd-a139-4346-bef9-4147a2e4b7bf",
"id": "64a817fce68f35002fd013c3",
"url": "http://apps.local.overhang.io:2002/",
"user_forums_roles": [
"Student"
],
"user_course_roles": []
},
"context": {
"session": "054c9ddcb76d2096f862e66bda3bc308",
"user_id": 15,
"username": "xiajul7",
"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/threads/64a817fce68f35002fd013c3/",
"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": ""
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "edx.forum.thread.viewed",
"timestamp": "2023-07-10T09:23:10.354202+00:00",
"data": {
"commentable_id": "856d38cd-a139-4346-bef9-4147a2e4b7bf",
"from_mfe_sidebar": false,
"target_username": "xiajul7",
"title_truncated": false,
"title": "This is first post",
"id": "64a817fce68f35002fd013c3",
"url": "http://apps.local.overhang.io:2002/",
"user_forums_roles": [
"Student"
],
"user_course_roles": []
},
"context": {
"session": "054c9ddcb76d2096f862e66bda3bc308",
"user_id": 15,
"username": "xiajul7",
"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": ""
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "edx.forum.thread.voted",
"timestamp": "2023-07-10T09:23:10.354202+00:00",
"data": {
"commentable_id": "856d38cd-a139-4346-bef9-4147a2e4b7bf",
"target_username": "xiajul7",
"undo_vote": false,
"vote_value": "up",
"id": "64a817fce68f35002fd013c3",
"url": "http://apps.local.overhang.io:2002/",
"user_forums_roles": [
"Student"
],
"user_course_roles": []
},
"context": {
"session": "054c9ddcb76d2096f862e66bda3bc308",
"user_id": 16,
"username": "xiajul10",
"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/threads/64a817fce68f35002fd013c3/",
"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": ""
}
}
11 changes: 11 additions & 0 deletions event_routing_backends/processors/xapi/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
XAPI_VERB_FAILED = 'http://adlnet.gov/expapi/verbs/failed'
XAPI_VERB_EXPERIENCED = 'http://adlnet.gov/expapi/verbs/experienced'
XAPI_VERB_NAVIGATED = 'https://w3id.org/xapi/dod-isd/verbs/navigated'
XAPI_VERB_POSTED = 'https://w3id.org/xapi/acrossx/verbs/posted'
XAPI_VERB_EDITED = 'https://w3id.org/xapi/acrossx/verbs/edited'
XAPI_VERB_VIEWED = 'http://id.tincanapi.com/verb/viewed'
XAPI_VERB_DELETED = 'https://w3id.org/xapi/dod-isd/verbs/deleted'
XAPI_VERB_VOTED = 'https://w3id.org/xapi/openedx/verb/voted'

XAPI_VERB_TERMINATED = 'http://adlnet.gov/expapi/verbs/terminated'
XAPI_VERB_ASKED = 'http://adlnet.gov/expapi/verbs/asked'
Expand All @@ -34,6 +39,7 @@
XAPI_ACTIVITY_COURSE = 'http://adlnet.gov/expapi/activities/course'
XAPI_ACTIVITY_MODULE = 'http://adlnet.gov/expapi/activities/module'
XAPI_ACTIVITY_VIDEO = 'https://w3id.org/xapi/video/activity-type/video'
XAPI_ACTIVITY_DISCUSSION = 'http://id.tincanapi.com/activitytype/discussion'
XAPI_ACTIVITY_LINK = 'http://adlnet.gov/expapi/activities/link'
XAPI_ACTIVITY_POSITION = 'http://id.tincanapi.com/extension/position'
XAPI_ACTIVITY_TOTAL_COUNT = 'https://w3id.org/xapi/acrossx/extensions/total-items'
Expand Down Expand Up @@ -82,6 +88,11 @@
PASSED = 'passed'
FAILED = 'failed'
SEEKED = 'seeked'
POSTED = 'posted'
VIEWED = 'viewed'
DELETED = 'deleted'
EDITED = 'edited'
VOTED = 'voted'

TERMINATED = 'terminated'
NAVIGATED = 'navigated'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
EnrollmentActivatedTransformer,
EnrollmentDeactivatedTransformer,
)
from event_routing_backends.processors.xapi.event_transformers.forum_events import (
ThreadCreatedTransformer,
ThreadDeletedTransformer,
ThreadEditedTransformer,
ThreadViewedTransformer,
ThreadVotedTransformer,
)
from event_routing_backends.processors.xapi.event_transformers.navigation_events import (
LinkClickedTransformer,
OutlineSelectedTransformer,
Expand Down
Loading

0 comments on commit f0ac42f

Please sign in to comment.