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
0c6f6f87
Commit
0c6f6f87
authored
Oct 24, 2012
by
Victor Shnayder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a template for a new input type class
parent
d0a9b231
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
2 deletions
+30
-2
common/lib/capa/capa/inputtypes.py
+30
-2
No files found.
common/lib/capa/capa/inputtypes.py
View file @
0c6f6f87
# template:
'''
class ClassName(InputTypeBase):
"""
"""
template = "tagname.html"
tags = ['tagname']
def __init__(self, system, xml, state):
super(ClassName, self).__init__(system, xml, state)
def _get_render_context(self):
context = {'id': self.id,
}
return context
register_input_class(ClassName)
'''
#
# File: courseware/capa/inputtypes.py
#
...
...
@@ -366,6 +392,8 @@ class JavascriptInput(InputTypeBase):
register_input_class
(
JavascriptInput
)
#-----------------------------------------------------------------------------
def
textline
(
element
,
value
,
status
,
render_template
,
msg
=
""
):
'''
Simple text line input, with optional size specification.
...
...
@@ -677,8 +705,8 @@ def imageinput(element, value, status, render_template, msg=''):
'src'
:
src
,
'gx'
:
gx
,
'gy'
:
gy
,
'state'
:
status
,
# to change
'msg'
:
msg
,
# to change
'state'
:
status
,
# to change
'msg'
:
msg
,
# to change
}
html
=
render_template
(
"imageinput.html"
,
context
)
return
etree
.
XML
(
html
)
...
...
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