Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xblock-drag-and-drop-v2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
xblock-drag-and-drop-v2
Commits
6499fad7
Commit
6499fad7
authored
Jan 15, 2016
by
Jonathan Piacenti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove redundant fields from events.
parent
98518bc0
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
32 deletions
+3
-32
README.md
+1
-12
drag_and_drop_v2/drag_and_drop_v2.py
+0
-5
tests/integration/test_interaction.py
+2
-15
No files found.
README.md
View file @
6499fad7
...
@@ -121,10 +121,7 @@ Fired when the Drag and Drop XBlock is finished loading.
...
@@ -121,10 +121,7 @@ Fired when the Drag and Drop XBlock is finished loading.
"host": "precise64",
"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",
"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",
"accept_language": "en;q=1.0, en;q=0.5",
"event": {
"event": {},
"component_id": "6b80ce1e8b78426898b47a834d72ffd3",
"user_id": 5
},
"event_source": "server",
"event_source": "server",
"context": {
"context": {
"course_user_tags": {},
"course_user_tags": {},
...
@@ -159,8 +156,6 @@ Fired when a student picks up a draggable item.
...
@@ -159,8 +156,6 @@ Fired when a student picks up a draggable item.
"accept_language": "en;q=1.0, en;q=0.5",
"accept_language": "en;q=1.0, en;q=0.5",
"event": {
"event": {
"item_id": 0,
"item_id": 0,
"component_id": "6b80ce1e8b78426898b47a834d72ffd3",
"user_id": 5
},
},
"event_source": "server",
"event_source": "server",
"context": {
"context": {
...
@@ -195,8 +190,6 @@ Fired when a student drops a draggable item.
...
@@ -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",
"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",
"accept_language": "en;q=1.0, en;q=0.5",
"event": {
"event": {
"component_id": "6b80ce1e8b78426898b47a834d72ffd3",
"user_id": 5,
"is_correct_location": true,
"is_correct_location": true,
"is_correct": true,
"is_correct": true,
"location": "The Top Zone",
"location": "The Top Zone",
...
@@ -237,9 +230,7 @@ Fired when the feedback pop-up is opened.
...
@@ -237,9 +230,7 @@ Fired when the feedback pop-up is opened.
"accept_language": "en;q=1.0, en;q=0.5",
"accept_language": "en;q=1.0, en;q=0.5",
"event": {
"event": {
"content": "Correct! This one belongs to The Top Zone.",
"content": "Correct! This one belongs to The Top Zone.",
"component_id": "6b80ce1e8b78426898b47a834d72ffd3",
"truncated": false,
"truncated": false,
"user_id": 5
},
},
"event_source": "server",
"event_source": "server",
"context": {
"context": {
...
@@ -275,8 +266,6 @@ Fired when the feedback popup is closed.
...
@@ -275,8 +266,6 @@ Fired when the feedback popup is closed.
"accept_language": "en;q=1.0, en;q=0.5",
"accept_language": "en;q=1.0, en;q=0.5",
"event": {
"event": {
"content": "No, this item does not belong here. Try again."
"content": "No, this item does not belong here. Try again."
"component_id": "13d1b859a2304c858e1810ccc23f29b2",
"user_id": 5,
"manually": true
"manually": true
"truncated": false,
"truncated": false,
},
},
...
...
drag_and_drop_v2/drag_and_drop_v2.py
View file @
6499fad7
...
@@ -276,8 +276,6 @@ class DragAndDropBlock(XBlock):
...
@@ -276,8 +276,6 @@ class DragAndDropBlock(XBlock):
pass
pass
self
.
runtime
.
publish
(
self
,
'edx.drag_and_drop_v2.item.dropped'
,
{
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'
],
'item_id'
:
item
[
'id'
],
'location'
:
attempt
.
get
(
'zone'
),
'location'
:
attempt
.
get
(
'zone'
),
'input'
:
attempt
.
get
(
'input'
),
'input'
:
attempt
.
get
(
'input'
),
...
@@ -432,9 +430,6 @@ class DragAndDropBlock(XBlock):
...
@@ -432,9 +430,6 @@ class DragAndDropBlock(XBlock):
except
KeyError
:
except
KeyError
:
return
{
'result'
:
'error'
,
'message'
:
'Missing event_type in JSON data'
}
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
)
self
.
runtime
.
publish
(
self
,
event_type
,
data
)
return
{
'result'
:
'success'
}
return
{
'result'
:
'success'
}
...
...
tests/integration/test_interaction.py
View file @
6499fad7
...
@@ -353,18 +353,11 @@ class EventsFiredTest(DefaultDataTestMixin, InteractionTestBase, BaseIntegration
...
@@ -353,18 +353,11 @@ class EventsFiredTest(DefaultDataTestMixin, InteractionTestBase, BaseIntegration
scenarios
=
(
scenarios
=
(
{
{
'name'
:
'edx.drag_and_drop_v2.loaded'
,
'name'
:
'edx.drag_and_drop_v2.loaded'
,
'data'
:
{
'data'
:
{},
'component_id'
:
u'drag-and-drop-v2.drag-and-drop-v2.d0.u0'
,
'user_id'
:
'student_1'
},
},
},
{
{
'name'
:
'edx.drag_and_drop_v2.item.picked_up'
,
'name'
:
'edx.drag_and_drop_v2.item.picked_up'
,
'data'
:
{
'data'
:
{
'item_id'
:
0
},
'component_id'
:
u'drag-and-drop-v2.drag-and-drop-v2.d0.u0'
,
'user_id'
:
'student_1'
,
'item_id'
:
0
,
},
},
},
{
{
'name'
:
'grade'
,
'name'
:
'grade'
,
...
@@ -373,29 +366,23 @@ class EventsFiredTest(DefaultDataTestMixin, InteractionTestBase, BaseIntegration
...
@@ -373,29 +366,23 @@ class EventsFiredTest(DefaultDataTestMixin, InteractionTestBase, BaseIntegration
{
{
'name'
:
'edx.drag_and_drop_v2.item.dropped'
,
'name'
:
'edx.drag_and_drop_v2.item.dropped'
,
'data'
:
{
'data'
:
{
'component_id'
:
u'drag-and-drop-v2.drag-and-drop-v2.d0.u0'
,
'input'
:
None
,
'input'
:
None
,
'is_correct'
:
True
,
'is_correct'
:
True
,
'is_correct_location'
:
True
,
'is_correct_location'
:
True
,
'item_id'
:
0
,
'item_id'
:
0
,
'location'
:
u'The Top Zone'
,
'location'
:
u'The Top Zone'
,
'user_id'
:
'student_1'
,
},
},
},
},
{
{
'name'
:
'edx.drag_and_drop_v2.feedback.opened'
,
'name'
:
'edx.drag_and_drop_v2.feedback.opened'
,
'data'
:
{
'data'
:
{
'component_id'
:
u'drag-and-drop-v2.drag-and-drop-v2.d0.u0'
,
'content'
:
u'Correct! This one belongs to The Top Zone.'
,
'content'
:
u'Correct! This one belongs to The Top Zone.'
,
'user_id'
:
'student_1'
,
'truncated'
:
False
,
'truncated'
:
False
,
},
},
},
},
{
{
'name'
:
'edx.drag_and_drop_v2.feedback.closed'
,
'name'
:
'edx.drag_and_drop_v2.feedback.closed'
,
'data'
:
{
'data'
:
{
'component_id'
:
u'drag-and-drop-v2.drag-and-drop-v2.d0.u0'
,
'user_id'
:
'student_1'
,
'manually'
:
False
,
'manually'
:
False
,
'content'
:
u'Correct! This one belongs to The Top Zone.'
,
'content'
:
u'Correct! This one belongs to The Top Zone.'
,
'truncated'
:
False
,
'truncated'
:
False
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment