Commit 0c6f6f87 by Victor Shnayder

add a template for a new input type class

parent d0a9b231
# 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 # File: courseware/capa/inputtypes.py
# #
...@@ -366,6 +392,8 @@ class JavascriptInput(InputTypeBase): ...@@ -366,6 +392,8 @@ class JavascriptInput(InputTypeBase):
register_input_class(JavascriptInput) register_input_class(JavascriptInput)
#-----------------------------------------------------------------------------
def textline(element, value, status, render_template, msg=""): def textline(element, value, status, render_template, msg=""):
''' '''
Simple text line input, with optional size specification. Simple text line input, with optional size specification.
...@@ -677,8 +705,8 @@ def imageinput(element, value, status, render_template, msg=''): ...@@ -677,8 +705,8 @@ def imageinput(element, value, status, render_template, msg=''):
'src': src, 'src': src,
'gx': gx, 'gx': gx,
'gy': gy, 'gy': gy,
'state': status, # to change 'state': status, # to change
'msg': msg, # to change 'msg': msg, # to change
} }
html = render_template("imageinput.html", context) html = render_template("imageinput.html", context)
return etree.XML(html) return etree.XML(html)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment