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
708c11a1
Commit
708c11a1
authored
Oct 09, 2012
by
Александр
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added input type
parent
758e76dc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
common/lib/capa/capa/inputtypes.py
+18
-0
common/lib/capa/capa/templates/crystallography.html
+11
-0
No files found.
common/lib/capa/capa/inputtypes.py
View file @
708c11a1
...
...
@@ -624,3 +624,20 @@ def imageinput(element, value, status, render_template, msg=''):
}
html
=
render_template
(
"imageinput.html"
,
context
)
return
etree
.
XML
(
html
)
#-----------------------------------------------------------------------------
@register_render_function
def
crystallography
(
element
,
value
,
status
,
render_template
,
msg
=
''
):
eid
=
element
.
get
(
'id'
)
height
=
element
.
get
(
'height'
)
width
=
element
.
get
(
'width'
)
display_file
=
element
.
get
(
'display_file'
)
context
=
{
'id'
:
eid
,
'width'
:
width
,
'height'
:
height
,
'display_file'
:
display_file
,
}
html
=
render_template
(
"crystallography.html"
,
context
)
return
etree
.
XML
(
html
)
\ No newline at end of file
common/lib/capa/capa/templates/crystallography.html
0 → 100644
View file @
708c11a1
<section
id=
"cryst_${id}"
class=
"cryst"
>
<div
id=
"holder"
style=
"width:${width};height:${height}"
></div>
<div
class=
"script_placeholder"
data-src=
"/static/js/jquery.js"
></div>
<div
class=
"script_placeholder"
data-src=
"/static/js/raphael.js"
></div><div
class=
"script_placeholder"
data-src=
"/static/js/sylvester.js"
></div><div
class=
"script_placeholder"
data-src=
"/static/js/underscore-min.js"
></div>
<div
class=
"script_placeholder"
data-src=
"/static/js/${display_file}"
></div>
<input
type=
"hidden"
name=
"answer_${id}"
id=
"answer_${id}"
class=
"asnwer"
/>
</section>
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