Commit e9468a0e by Piotr Mitros

Modular refactor: Very minor changes (comments, etc.)

parent d95a5e46
...@@ -240,7 +240,7 @@ class LoncapaProblem(object): ...@@ -240,7 +240,7 @@ class LoncapaProblem(object):
# used to be # used to be
# if problemtree.tag in html_special_response: # if problemtree.tag in html_special_response:
if problemtree.tag in inputtypes.SimpleInput.get_xml_tags(): if problemtree.tag in inputtypes.get_input_xml_tags():
# status is currently the answer for the problem ID for the input element, # status is currently the answer for the problem ID for the input element,
# but it will turn into a dict containing both the answer and any associated message # but it will turn into a dict containing both the answer and any associated message
# for the problem ID for the input element. # for the problem ID for the input element.
...@@ -267,6 +267,8 @@ class LoncapaProblem(object): ...@@ -267,6 +267,8 @@ class LoncapaProblem(object):
# print "[courseware.capa.capa_problem.extract_html] msg = ",msg # print "[courseware.capa.capa_problem.extract_html] msg = ",msg
# do the rendering # do the rendering
# This should be broken out into a helper function
# that handles all input objects
render_object = inputtypes.SimpleInput(system = self.system, render_object = inputtypes.SimpleInput(system = self.system,
xml = problemtree, xml = problemtree,
state = {'value':value, state = {'value':value,
......
...@@ -32,6 +32,10 @@ from lxml import etree ...@@ -32,6 +32,10 @@ from lxml import etree
from mitxmako.shortcuts import render_to_string from mitxmako.shortcuts import render_to_string
def get_input_xml_tags():
''' Eventually, this will be for all registered input types '''
return SimpleInput.get_xml_tags()
class SimpleInput():# XModule class SimpleInput():# XModule
''' Type for simple inputs -- plain HTML with a form element ''' Type for simple inputs -- plain HTML with a form element
State is a dictionary with optional keys: State is a dictionary with optional keys:
......
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