-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Divide by 0 errors on problem interaction events
- Loading branch information
Showing
6 changed files
with
252 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
Various backends for receiving edX LMS events.. | ||
""" | ||
|
||
__version__ = '5.5.2' | ||
__version__ = '5.5.3' |
32 changes: 32 additions & 0 deletions
32
...s/processors/tests/fixtures/current/edx.grades.problem.submitted.weighted_possible_0.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"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": "course-v1:edX+DemoX+Demo_Course", | ||
"course_user_tags": {}, | ||
"host": "localhost:18000", | ||
"ip": "172.18.0.1", | ||
"module": { | ||
"display_name": "Checkboxes", | ||
"usage_key": "block-v1:edX+DemoX+Demo_Course+type@problem+block@3fc5461f86764ad7bdbdf6cbdde61e66" | ||
}, | ||
"org_id": "edX", | ||
"path": "/courses/course-v1:edX+DemoX+Demo_Course/xblock/block-v1:edX+DemoX+Demo_Course+type@problem+block@3fc5461f86764ad7bdbdf6cbdde61e66/handler/xmodule_handler/problem_check", | ||
"referer": "http://localhost:18000/courses/course-v1:edX+DemoX+Demo_Course/courseware/8b66dcd2d6134eda9355089ece4f39f6/ef37eb3cf1724e38b7f88a9ce85a4842/?activate_block_id=block-v1%3AedX%2BDemoX%2BDemo_Course%2Btype%40sequential%2Bblock%40ef37eb3cf1724e38b7f88a9ce85a4842", | ||
"session": "993110e9c27848a545da74a74114158d", | ||
"user_id": 3, | ||
"username": "edx" | ||
}, | ||
"data": { | ||
"course_id": "course-v1:edX+DemoX+Demo_Course", | ||
"event_transaction_id": "07adb7b7-db7e-4cfd-9d69-5474a4c5774c", | ||
"event_transaction_type": "edx.grades.problem.submitted", | ||
"problem_id": "block-v1:edX+DemoX+Demo_Course+type@problem+block@3fc5461f86764ad7bdbdf6cbdde61e66", | ||
"user_id": "3", | ||
"weighted_earned": 0, | ||
"weighted_possible": 0 | ||
}, | ||
"name": "edx.grades.problem.submitted", | ||
"timestamp": "2020-07-15T05:59:29.700909+00:00" | ||
} |
91 changes: 91 additions & 0 deletions
91
...routing_backends/processors/tests/fixtures/current/problem_check(server).max_grade_0.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
{ | ||
"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", | ||
"asides": {}, | ||
"client_id": "667522224.1583394645", | ||
"course_id": "course-v1:edX+DemoX+Demo_Course", | ||
"course_user_tags": {}, | ||
"event_source": "server", | ||
"host": "localhost:18000", | ||
"ip": "172.18.0.1", | ||
"module": { | ||
"display_name": "Checkboxes", | ||
"usage_key": "block-v1:edX+DemoX+Demo_Course+type@problem+block@3fc5461f86764ad7bdbdf6cbdde61e66" | ||
}, | ||
"org_id": "edX", | ||
"page": "x_module", | ||
"path": "/courses/course-v1:edX+DemoX+Demo_Course/xblock/block-v1:edX+DemoX+Demo_Course+type@problem+block@3fc5461f86764ad7bdbdf6cbdde61e66/handler/xmodule_handler/problem_check", | ||
"referer": "http://localhost:18000/courses/course-v1:edX+DemoX+Demo_Course/courseware/8b66dcd2d6134eda9355089ece4f39f6/ef37eb3cf1724e38b7f88a9ce85a4842/?activate_block_id=block-v1%3AedX%2BDemoX%2BDemo_Course%2Btype%40sequential%2Bblock%40ef37eb3cf1724e38b7f88a9ce85a4842", | ||
"session": "6ad0a24d8303f49d14409a669d430b6f", | ||
"user_id": 3, | ||
"username": "edx" | ||
}, | ||
"data": { | ||
"answers": { | ||
"3fc5461f86764ad7bdbdf6cbdde61e66_2_1": [ | ||
"choice_0", | ||
"choice_2" | ||
] | ||
}, | ||
"attempts": 10, | ||
"correct_map": { | ||
"3fc5461f86764ad7bdbdf6cbdde61e66_2_1": { | ||
"answervariable": null, | ||
"correctness": "incorrect", | ||
"hint": "", | ||
"hintmode": null, | ||
"msg": "", | ||
"npoints": null, | ||
"queuestate": null | ||
} | ||
}, | ||
"grade": 0, | ||
"max_grade": 0, | ||
"problem_id": "block-v1:edX+DemoX+Demo_Course+type@problem+block@3fc5461f86764ad7bdbdf6cbdde61e66", | ||
"state": { | ||
"correct_map": { | ||
"3fc5461f86764ad7bdbdf6cbdde61e66_2_1": { | ||
"answervariable": null, | ||
"correctness": "incorrect", | ||
"hint": "", | ||
"hintmode": null, | ||
"msg": "", | ||
"npoints": null, | ||
"queuestate": null | ||
} | ||
}, | ||
"done": true, | ||
"has_saved_answers": false, | ||
"input_state": { | ||
"3fc5461f86764ad7bdbdf6cbdde61e66_2_1": {} | ||
}, | ||
"seed": 1, | ||
"student_answers": { | ||
"3fc5461f86764ad7bdbdf6cbdde61e66_2_1": [ | ||
"choice_0", | ||
"choice_1", | ||
"choice_2", | ||
"choice_3" | ||
] | ||
} | ||
}, | ||
"submission": { | ||
"3fc5461f86764ad7bdbdf6cbdde61e66_2_1": { | ||
"answer": [ | ||
"a correct answer", | ||
"an incorrect answer" | ||
], | ||
"correct": false, | ||
"group_label": "", | ||
"input_type": "checkboxgroup", | ||
"question": "Add the question text, or prompt, here. This text is required.", | ||
"response_type": "choiceresponse", | ||
"variant": "" | ||
} | ||
}, | ||
"success": "incorrect" | ||
}, | ||
"name": "problem_check", | ||
"timestamp": "2020-07-14T14:39:26.906232+00:00" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...essors/xapi/tests/fixtures/expected/edx.grades.problem.submitted.weighted_possible_0.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{ | ||
"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:edX+DemoX+Demo_Course", | ||
"objectType": "Activity", | ||
"definition": { | ||
"name": { | ||
"en-US": "Demonstration Course" | ||
}, | ||
"type": "http://adlnet.gov/expapi/activities/course" | ||
} | ||
} | ||
] | ||
}, | ||
"extensions": { | ||
"https://w3id.org/xapi/openedx/extension/transformer-version": "[email protected]", | ||
"https://w3id.org/xapi/openedx/extensions/session-id": "993110e9c27848a545da74a74114158d" | ||
} | ||
}, | ||
"object": { | ||
"definition": { | ||
"type": "http://adlnet.gov/expapi/activities/question" | ||
}, | ||
"id": "http://localhost:18000/xblock/block-v1:edX+DemoX+Demo_Course+type@problem+block@3fc5461f86764ad7bdbdf6cbdde61e66", | ||
"objectType": "Activity" | ||
}, | ||
"result": { | ||
"score": { | ||
"max": 0.0, | ||
"min": 0.0, | ||
"raw": 0.0, | ||
"scaled": 0.0 | ||
}, | ||
"success": true | ||
}, | ||
"timestamp": "2020-07-15T05:59:29.700909+00:00", | ||
"verb": { | ||
"display": { | ||
"en": "attempted" | ||
}, | ||
"id": "http://adlnet.gov/expapi/verbs/attempted" | ||
}, | ||
"version": "1.0.3" | ||
} |
59 changes: 59 additions & 0 deletions
59
...g_backends/processors/xapi/tests/fixtures/expected/problem_check(server).max_grade_0.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{ | ||
"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:edX+DemoX+Demo_Course", | ||
"objectType": "Activity", | ||
"definition": { | ||
"name": { | ||
"en-US": "Demonstration Course" | ||
}, | ||
"type": "http://adlnet.gov/expapi/activities/course" | ||
} | ||
} | ||
] | ||
}, | ||
"extensions": { | ||
"https://w3id.org/xapi/openedx/extension/transformer-version": "[email protected]", | ||
"https://w3id.org/xapi/openedx/extensions/session-id": "6ad0a24d8303f49d14409a669d430b6f" | ||
} | ||
}, | ||
"object": { | ||
"definition": { | ||
"extensions":{ | ||
"http://id.tincanapi.com/extension/attempt-id": 10 | ||
}, | ||
"description": { | ||
"en-US": "Add the question text, or prompt, here. This text is required." | ||
}, | ||
"interactionType": "choice", | ||
"type": "http://adlnet.gov/expapi/activities/cmi.interaction" | ||
}, | ||
"id": "http://localhost:18000/xblock/block-v1:edX+DemoX+Demo_Course+type@problem+block@3fc5461f86764ad7bdbdf6cbdde61e66", | ||
"objectType": "Activity" | ||
}, | ||
"result": { | ||
"response": "['a correct answer', 'an incorrect answer']", | ||
"score": { | ||
"max": 0, | ||
"min": 0, | ||
"raw": 0, | ||
"scaled": 0 | ||
}, | ||
"success": false | ||
}, | ||
"timestamp": "2020-07-14T14:39:26.906232+00:00", | ||
"verb": { | ||
"display": { | ||
"en": "evaluated" | ||
}, | ||
"id": "https://w3id.org/xapi/acrossx/verbs/evaluated" | ||
}, | ||
"version": "1.0.3" | ||
} |