From e9468a0e5e2b71e35a9b1d1f387e4bb8ccd4526f Mon Sep 17 00:00:00 2001 From: Piotr Mitros Date: Sun, 20 May 2012 15:22:39 -0400 Subject: [PATCH] Modular refactor: Very minor changes (comments, etc.) --- djangoapps/courseware/capa/capa_problem.py | 4 +++- djangoapps/courseware/capa/inputtypes.py | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/djangoapps/courseware/capa/capa_problem.py b/djangoapps/courseware/capa/capa_problem.py index 346a4842b3..b8361acdd5 100644 --- a/djangoapps/courseware/capa/capa_problem.py +++ b/djangoapps/courseware/capa/capa_problem.py @@ -240,7 +240,7 @@ class LoncapaProblem(object): # used to be # 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, # but it will turn into a dict containing both the answer and any associated message # for the problem ID for the input element. @@ -267,6 +267,8 @@ class LoncapaProblem(object): # print "[courseware.capa.capa_problem.extract_html] msg = ",msg # do the rendering + # This should be broken out into a helper function + # that handles all input objects render_object = inputtypes.SimpleInput(system = self.system, xml = problemtree, state = {'value':value, diff --git a/djangoapps/courseware/capa/inputtypes.py b/djangoapps/courseware/capa/inputtypes.py index 8fd82d7885..0b05971771 100644 --- a/djangoapps/courseware/capa/inputtypes.py +++ b/djangoapps/courseware/capa/inputtypes.py @@ -32,6 +32,10 @@ from lxml import etree 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 ''' Type for simple inputs -- plain HTML with a form element State is a dictionary with optional keys: