Fix up rubric rendering
This commit is contained in:
@@ -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,
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<div class="assessment">
|
||||
<div class="rubric">
|
||||
<h3>Self-assess your answer with this rubric:</h3>
|
||||
${rubric}
|
||||
${rubric | n }
|
||||
</div>
|
||||
|
||||
% if not read_only:
|
||||
|
||||
Reference in New Issue
Block a user