Commit 2b492956 by Vik Paruchuri

Fix up rubric rendering

parent 0567e8f0
......@@ -2,9 +2,13 @@ from mitxmako.shortcuts import render_to_string
class CombinedOpenEndedRubric:
def render_rubric(self, rubric_xml):
rubric_categories = CombinedOpenEndedRubric.extract_rubric_categories(rubric_xml)
html = render_to_string('open_ended_rubric.html', {'rubric_categories' : rubric_categories})
@staticmethod
def render_rubric(rubric_xml):
try:
rubric_categories = CombinedOpenEndedRubric.extract_rubric_categories(rubric_xml)
html = render_to_string('open_ended_rubric.html', {'rubric_categories' : rubric_categories})
except:
html = rubric_xml
return html
@staticmethod
......
......@@ -21,6 +21,8 @@ from .xml_module import XmlDescriptor
from xmodule.modulestore import Location
import openendedchild
from combined_open_ended_rubric import CombinedOpenEndedRubric
log = logging.getLogger("mitx.courseware")
class SelfAssessmentModule(openendedchild.OpenEndedChild):
......@@ -120,8 +122,10 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild):
if self.state == self.INITIAL:
return ''
rubric_html = CombinedOpenEndedRubric.render_rubric(self.rubric)
# we'll render it
context = {'rubric': self.rubric,
context = {'rubric': rubric_html,
'max_score': self._max_score,
}
......
<div class="assessment">
<div class="rubric">
<h3>Self-assess your answer with this rubric:</h3>
${rubric}
${rubric | n }
</div>
% if not read_only:
......
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