diff --git a/common/lib/xmodule/xmodule/combined_open_ended_module.py b/common/lib/xmodule/xmodule/combined_open_ended_module.py index 67c7d15910..a35573032a 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_module.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_module.py @@ -22,6 +22,7 @@ from xmodule.modulestore import Location import self_assessment_module import open_ended_module from combined_open_ended_rubric import CombinedOpenEndedRubric +from .stringify import stringify_children from mitxmako.shortcuts import render_to_string @@ -142,11 +143,11 @@ class CombinedOpenEndedModule(XModule): self._max_score = int(self.metadata.get('max_score', MAX_SCORE)) rubric_renderer = CombinedOpenEndedRubric(True) - success, rubric_feedback = rubric_renderer.render_rubric(True, definition['rubric']) + success, rubric_feedback = rubric_renderer.render_rubric(stringify_children(definition['rubric'])) if not success: error_message="Could not parse rubric : {0}".format(definition['rubric']) log.exception(error_message) - raise Exception(error_message) + raise Exception #Static data is passed to the child modules to render self.static_data = { 'max_score': self._max_score, diff --git a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py index 2146942296..37ce18e4f1 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py @@ -22,7 +22,6 @@ class CombinedOpenEndedRubric: def render_rubric(self, rubric_xml): success = False try: - rubric_xml = rubric_xml.encode('ascii', 'ignore') rubric_categories = self.extract_categories(rubric_xml) html = render_to_string('open_ended_rubric.html', {'categories' : rubric_categories, @@ -53,7 +52,8 @@ class CombinedOpenEndedRubric: {text: "Option 3 Name", points: 2]}] ''' - element = etree.fromstring(element) + if isinstance(element, basestring): + element = etree.fromstring(element) categories = [] for category in element: if category.tag != 'category':