Commit 6499fad7 by Jonathan Piacenti

Remove redundant fields from events.

parent 98518bc0
......@@ -121,10 +121,7 @@ Fired when the Drag and Drop XBlock is finished loading.
"host": "precise64",
"referer": "http://example.com/courses/course-v1:DnD+DnD+DnD/courseware/ec546c58d2f447b7a9223c57b5de7344/756071f8de7f47c3b0ae726586ebbe16/1?activate_block_id=block-v1%3ADnD%2BDnD%2BDnD%2Btype%40vertical%2Bblock%40d2fc47476ca14c55816c4a1264a27280",
"accept_language": "en;q=1.0, en;q=0.5",
"event": {
"component_id": "6b80ce1e8b78426898b47a834d72ffd3",
"user_id": 5
},
"event": {},
"event_source": "server",
"context": {
"course_user_tags": {},
......@@ -159,8 +156,6 @@ Fired when a student picks up a draggable item.
"accept_language": "en;q=1.0, en;q=0.5",
"event": {
"item_id": 0,
"component_id": "6b80ce1e8b78426898b47a834d72ffd3",
"user_id": 5
},
"event_source": "server",
"context": {
......@@ -195,8 +190,6 @@ Fired when a student drops a draggable item.
"referer": "http://example.com/courses/course-v1:DnD+DnD+DnD/courseware/ec546c58d2f447b7a9223c57b5de7344/756071f8de7f47c3b0ae726586ebbe16/1?activate_block_id=block-v1%3ADnD%2BDnD%2BDnD%2Btype%40vertical%2Bblock%40d2fc47476ca14c55816c4a1264a27280",
"accept_language": "en;q=1.0, en;q=0.5",
"event": {
"component_id": "6b80ce1e8b78426898b47a834d72ffd3",
"user_id": 5,
"is_correct_location": true,
"is_correct": true,
"location": "The Top Zone",
......@@ -237,9 +230,7 @@ Fired when the feedback pop-up is opened.
"accept_language": "en;q=1.0, en;q=0.5",
"event": {
"content": "Correct! This one belongs to The Top Zone.",
"component_id": "6b80ce1e8b78426898b47a834d72ffd3",
"truncated": false,
"user_id": 5
},
"event_source": "server",
"context": {
......@@ -275,8 +266,6 @@ Fired when the feedback popup is closed.
"accept_language": "en;q=1.0, en;q=0.5",
"event": {
"content": "No, this item does not belong here. Try again."
"component_id": "13d1b859a2304c858e1810ccc23f29b2",
"user_id": 5,
"manually": true
"truncated": false,
},
......
......@@ -276,8 +276,6 @@ class DragAndDropBlock(XBlock):
pass
self.runtime.publish(self, 'edx.drag_and_drop_v2.item.dropped', {
'user_id': self.scope_ids.user_id,
'component_id': self._get_unique_id(),
'item_id': item['id'],
'location': attempt.get('zone'),
'input': attempt.get('input'),
......@@ -432,9 +430,6 @@ class DragAndDropBlock(XBlock):
except KeyError:
return {'result': 'error', 'message': 'Missing event_type in JSON data'}
data['user_id'] = self.scope_ids.user_id
data['component_id'] = self._get_unique_id()
self.runtime.publish(self, event_type, data)
return {'result': 'success'}
......
......@@ -353,18 +353,11 @@ class EventsFiredTest(DefaultDataTestMixin, InteractionTestBase, BaseIntegration
scenarios = (
{
'name': 'edx.drag_and_drop_v2.loaded',
'data': {
'component_id': u'drag-and-drop-v2.drag-and-drop-v2.d0.u0',
'user_id': 'student_1'
},
'data': {},
},
{
'name': 'edx.drag_and_drop_v2.item.picked_up',
'data': {
'component_id': u'drag-and-drop-v2.drag-and-drop-v2.d0.u0',
'user_id': 'student_1',
'item_id': 0,
},
'data': {'item_id': 0},
},
{
'name': 'grade',
......@@ -373,29 +366,23 @@ class EventsFiredTest(DefaultDataTestMixin, InteractionTestBase, BaseIntegration
{
'name': 'edx.drag_and_drop_v2.item.dropped',
'data': {
'component_id': u'drag-and-drop-v2.drag-and-drop-v2.d0.u0',
'input': None,
'is_correct': True,
'is_correct_location': True,
'item_id': 0,
'location': u'The Top Zone',
'user_id': 'student_1',
},
},
{
'name': 'edx.drag_and_drop_v2.feedback.opened',
'data': {
'component_id': u'drag-and-drop-v2.drag-and-drop-v2.d0.u0',
'content': u'Correct! This one belongs to The Top Zone.',
'user_id': 'student_1',
'truncated': False,
},
},
{
'name': 'edx.drag_and_drop_v2.feedback.closed',
'data': {
'component_id': u'drag-and-drop-v2.drag-and-drop-v2.d0.u0',
'user_id': 'student_1',
'manually': False,
'content': u'Correct! This one belongs to The Top Zone.',
'truncated': False,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment