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
a3944196
Commit
a3944196
authored
Dec 21, 2012
by
Alexander Kryklia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updates
parent
c7add85c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
+17
-4
common/lib/capa/capa/inputtypes.py
+14
-2
common/lib/capa/capa/templates/drag_and_drop_input.html
+3
-2
No files found.
common/lib/capa/capa/inputtypes.py
View file @
a3944196
...
...
@@ -44,6 +44,7 @@ from lxml import etree
import
re
import
shlex
# for splitting quoted strings
import
sys
import
os
from
registry
import
TagRegistry
...
...
@@ -802,12 +803,23 @@ class DragAndDropInput(InputTypeBase):
"""
Note: height, width, images_directory_path are required.
"""
images_directory_path
=
Attribute
(
'images_directory_path'
)
# import ipdb; ipdb.set_trace(
)
return
[
Attribute
(
'height'
),
Attribute
(
'width'
),
images_directory_path
,
Attribute
(
'images_directory_path'
)
,
]
def
setup
(
self
):
# import ipdb; ipdb.set_trace()
imagepath
=
self
.
loaded_attributes
[
'images_directory_path'
]
# import ipdb; ipdb.set_trace()
try
:
images_list
=
self
.
system
.
filestore
.
listdir
(
os
.
path
.
join
(
'static'
,
'images'
,
imagepath
))
except
:
images_list
=
[]
self
.
loaded_attributes
[
'images_list'
]
=
images_list
registry
.
register
(
DragAndDropInput
)
#--------------------------------------------------------------------------------------------------------------------
common/lib/capa/capa/templates/drag_and_drop_input.html
View file @
a3944196
<section
id=
"inputtype_${id}"
class=
"capa_inputtype"
>
<div
class=
"drag_and_drop_problem"
id=
"drag_and_drop_div_${id}"
style=
"width:${width};height:${height}"
>
% if item
<p>
${images_list}
</p>
% if images_list:
<ul>
% for item in images_
directory_path
:
% for item in images_
list
:
<li>
${item}
</li>
% endfor
</ul>
...
...
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