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
#
......@@ -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)
......
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