From 70956e3e50d7d57849efa662656c56264e10ef5b Mon Sep 17 00:00:00 2001 From: Cristhian Garcia Date: Fri, 16 Feb 2024 17:11:08 -0500 Subject: [PATCH] test: add fixtures for ccx changes --- .../fixtures/current/play_video.ccx.json | 26 ++++++++++ .../current/problem_check(browser).ccx.json | 21 ++++++++ .../fixtures/expected/play_video.ccx.json | 48 +++++++++++++++++++ .../expected/problem_check(browser).ccx.json | 43 +++++++++++++++++ 4 files changed, 138 insertions(+) create mode 100644 event_routing_backends/processors/tests/fixtures/current/play_video.ccx.json create mode 100644 event_routing_backends/processors/tests/fixtures/current/problem_check(browser).ccx.json create mode 100644 event_routing_backends/processors/xapi/tests/fixtures/expected/play_video.ccx.json create mode 100644 event_routing_backends/processors/xapi/tests/fixtures/expected/problem_check(browser).ccx.json diff --git a/event_routing_backends/processors/tests/fixtures/current/play_video.ccx.json b/event_routing_backends/processors/tests/fixtures/current/play_video.ccx.json new file mode 100644 index 00000000..cbe83e45 --- /dev/null +++ b/event_routing_backends/processors/tests/fixtures/current/play_video.ccx.json @@ -0,0 +1,26 @@ +{ + "context": { + "accept_language": "en-US,en;q=0.9", + "agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36", + "client_id": "667522224.1583394645", + "course_id": "ccx-v1:edX+DemoX+Demo_Course+ccx@1", + "event_source": "browser", + "host": "localhost:18000", + "ip": "172.18.0.1", + "org_id": "edX", + "page": "http://localhost:18000/courses/ccx-block-v1:edX+DemoX+Demo_Course+ccx@1/courseware/d8a6192ade314473a78242dfeedfbf5b/edx_introduction/?activate_block_id=block-v1%3AedX%2BDemoX%2BDemo_Course%2Btype%40sequential%2Bblock%40edx_introduction", + "path": "/event", + "referer": "http://localhost:18000/courses/ccx-block-v1:edX+DemoX+Demo_Course+ccx@1/courseware/d8a6192ade314473a78242dfeedfbf5b/edx_introduction/?activate_block_id=block-v1%3AedX%2BDemoX%2BDemo_Course%2Btype%40sequential%2Bblock%40edx_introduction", + "session": "993110e9c27848a545da74a74114158d", + "user_id": 3, + "username": "edx" + }, + "data": { + "code": "b7xgknqkQk8", + "currentTime": 0.03278805340576172, + "duration": 195, + "id": "0b9e39477cf34507a7a48f74be381fdd" + }, + "name": "play_video", + "timestamp": "2020-07-15T06:52:55.057099+00:00" +} diff --git a/event_routing_backends/processors/tests/fixtures/current/problem_check(browser).ccx.json b/event_routing_backends/processors/tests/fixtures/current/problem_check(browser).ccx.json new file mode 100644 index 00000000..890183b1 --- /dev/null +++ b/event_routing_backends/processors/tests/fixtures/current/problem_check(browser).ccx.json @@ -0,0 +1,21 @@ +{ + "context": { + "accept_language": "en-US,en;q=0.9", + "agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36", + "client_id": "667522224.1583394645", + "course_id": "ccx-v1:edX+DemoX+Demo_Course+ccx@1", + "event_source": "browser", + "host": "localhost:18000", + "ip": "172.18.0.1", + "org_id": "edX", + "page": "http://localhost:18000/courses/ccx-block-v1:edX+DemoX+Demo_Course+ccx@1/courseware/8b66dcd2d6134eda9355089ece4f39f6/ef37eb3cf1724e38b7f88a9ce85a4842/?activate_block_id=block-v1%3AedX%2BDemoX%2BDemo_Course%2Btype%40sequential%2Bblock%40ef37eb3cf1724e38b7f88a9ce85a4842", + "path": "/event", + "referer": "http://localhost:18000/xblock/ccx-block-v1:edX+DemoX+Demo_Course+ccx@1+type@vertical+block@e3601c0abee6427d8c17e6d6f8fdddd1?show_title=0&show_bookmark_button=0&recheck_access=1&view=student_view", + "session": "6ad0a24d8303f49d14409a669d430b6f", + "user_id": 3, + "username": "edx" + }, + "data": "input_3fc5461f86764ad7bdbdf6cbdde61e66_2_1%5B%5D=choice_0&input_3fc5461f86764ad7bdbdf6cbdde61e66_2_1%5B%5D=choice_2", + "name": "problem_check", + "timestamp": "2020-07-14T14:39:26.580443+00:00" +} diff --git a/event_routing_backends/processors/xapi/tests/fixtures/expected/play_video.ccx.json b/event_routing_backends/processors/xapi/tests/fixtures/expected/play_video.ccx.json new file mode 100644 index 00000000..5b21504c --- /dev/null +++ b/event_routing_backends/processors/xapi/tests/fixtures/expected/play_video.ccx.json @@ -0,0 +1,48 @@ +{ + "id": "203e182c-6a2d-5458-9c61-a271297d459a", + "actor": { + "objectType": "Agent", + "account": {"homePage": "http://localhost:18000", "name": "32e08e30-f8ae-4ce2-94a8-c2bfe38a70cb"} + }, + "context": { + "contextActivities": { + "parent": [ + { + "id": "http://localhost:18000/course/ccx-v1:edX+DemoX+Demo_Course+ccx@1", + "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": "993110e9c27848a545da74a74114158d", + "https://w3id.org/xapi/video/extensions/length": 195.0 + } + }, + "object": { + "definition": { + "type": "https://w3id.org/xapi/video/activity-type/video" + }, + "id": "http://localhost:18000/xblock/ccx-block-v1:edX+DemoX+Demo_Course+ccx@1+type@video+block@0b9e39477cf34507a7a48f74be381fdd", + "objectType": "Activity" + }, + "result": { + "extensions": { + "https://w3id.org/xapi/video/extensions/time": 0.033 + } + }, + "timestamp": "2020-07-15T06:52:55.057099+00:00", + "verb": { + "display": { + "en": "played" + }, + "id": "https://w3id.org/xapi/video/verbs/played" + }, + "version": "1.0.3" +} diff --git a/event_routing_backends/processors/xapi/tests/fixtures/expected/problem_check(browser).ccx.json b/event_routing_backends/processors/xapi/tests/fixtures/expected/problem_check(browser).ccx.json new file mode 100644 index 00000000..36031337 --- /dev/null +++ b/event_routing_backends/processors/xapi/tests/fixtures/expected/problem_check(browser).ccx.json @@ -0,0 +1,43 @@ +{ + "id": "2a1f0f7c-6636-52df-913b-59e2f197a58e", + "actor": { + "objectType": "Agent", + "account": {"homePage": "http://localhost:18000", "name": "32e08e30-f8ae-4ce2-94a8-c2bfe38a70cb"} + }, + "context": { + "contextActivities": { + "parent": [ + { + "id": "http://localhost:18000/course/ccx-v1:edX+DemoX+Demo_Course+ccx@1", + "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": "6ad0a24d8303f49d14409a669d430b6f" + } + }, + "object": { + "definition": { + "interactionType": "other", + "type": "http://adlnet.gov/expapi/activities/cmi.interaction" + }, + "id": "http://localhost:18000/xblock/ccx-block-v1:edX+DemoX+Demo_Course+ccx@1+type@problem+block@3fc5461f86764ad7bdbdf6cbdde61e66", + "objectType": "Activity" + }, + "timestamp": "2020-07-14T14:39:26.580443+00:00", + "verb": { + "display": { + "en": "attempted" + }, + "id": "http://adlnet.gov/expapi/verbs/attempted" + }, + "version": "1.0.3" +}