Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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
edx
edx-platform
Commits
9efe1c0a
Commit
9efe1c0a
authored
Dec 26, 2012
by
Alexander Kryklia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added parameters and rename
parent
c5d4f54a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
common/lib/capa/capa/inputtypes.py
+14
-2
No files found.
common/lib/capa/capa/inputtypes.py
View file @
9efe1c0a
...
...
@@ -824,6 +824,7 @@ class DragAndDropInput(InputTypeBase):
tag_attrs
=
dict
()
tag_attrs
[
'draggable'
]
=
{
'id'
:
Attribute
.
_sentinel
,
'label'
:
""
,
'icon'
:
""
}
tag_attrs
[
'target'
]
=
{
'id'
:
Attribute
.
_sentinel
,
'x'
:
Attribute
.
_sentinel
,
'y'
:
Attribute
.
_sentinel
,
...
...
@@ -842,13 +843,24 @@ class DragAndDropInput(InputTypeBase):
return
dic
to_js
=
dict
()
to_js
[
'target_container'
]
=
Attribute
(
'img'
)
.
parse_from_xml
(
self
.
xml
)
# image drag and drop onto
to_js
[
'base_image'
]
=
Attribute
(
'img'
)
.
parse_from_xml
(
self
.
xml
)
# problem subtype: targets or positions
to_js
[
'use_targets'
]
=
Attribute
(
'targets'
,
default
=
"True"
)
.
parse_from_xml
(
self
.
xml
)
# outline places on image where to drag adn drop
to_js
[
'target_outline'
]
=
Attribute
(
'target_outline'
,
default
=
"False"
)
.
parse_from_xml
(
self
.
xml
)
# one draggable per target?
to_js
[
'one_per_target'
]
=
Attribute
(
'one_per_target'
,
default
=
"True"
)
.
parse_from_xml
(
self
.
xml
)
to_js
[
'draggable'
]
=
[
parse
(
draggable
,
'draggable'
)
for
draggable
in
# list of draggables
to_js
[
'draggables'
]
=
[
parse
(
draggable
,
'draggable'
)
for
draggable
in
self
.
xml
.
iterchildren
(
'draggable'
)]
# list of targets
to_js
[
'targets'
]
=
[
parse
(
target
,
'target'
)
for
target
in
self
.
xml
.
iterchildren
(
'target'
)]
...
...
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