Commit 59e5b494 by Vik Paruchuri

Proper rubric rendering for self assessment

parent 2b492956
from mitxmako.shortcuts import render_to_string from mitxmako.shortcuts import render_to_string
import logging
from lxml import etree
log=logging.getLogger(__name__)
class CombinedOpenEndedRubric: class CombinedOpenEndedRubric:
...@@ -8,6 +12,7 @@ class CombinedOpenEndedRubric: ...@@ -8,6 +12,7 @@ class CombinedOpenEndedRubric:
rubric_categories = CombinedOpenEndedRubric.extract_rubric_categories(rubric_xml) rubric_categories = CombinedOpenEndedRubric.extract_rubric_categories(rubric_xml)
html = render_to_string('open_ended_rubric.html', {'rubric_categories' : rubric_categories}) html = render_to_string('open_ended_rubric.html', {'rubric_categories' : rubric_categories})
except: except:
log.exception("Could not parse the rubric.")
html = rubric_xml html = rubric_xml
return html return html
...@@ -47,7 +52,7 @@ class CombinedOpenEndedRubric: ...@@ -47,7 +52,7 @@ class CombinedOpenEndedRubric:
has_score=False has_score=False
descriptionxml = category[0] descriptionxml = category[0]
scorexml = category[1] scorexml = category[1]
if score_xml.tag == "option": if scorexml.tag == "option":
optionsxml = category[1:] optionsxml = category[1:]
else: else:
optionsxml = category[2:] optionsxml = category[2:]
......
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