Commit 6e75584d by Vik Paruchuri

Convert templates to mako

parent a20a6c8f
...@@ -24,7 +24,6 @@ import os ...@@ -24,7 +24,6 @@ import os
import subprocess import subprocess
import xml.sax.saxutils as saxutils import xml.sax.saxutils as saxutils
from shapely.geometry import Point, MultiPoint from shapely.geometry import Point, MultiPoint
from django.template.loader import render_to_string
# specific library imports # specific library imports
from calc import evaluator, UndefinedVariable from calc import evaluator, UndefinedVariable
...@@ -2079,9 +2078,9 @@ class OpenEndedResponse(LoncapaResponse): ...@@ -2079,9 +2078,9 @@ class OpenEndedResponse(LoncapaResponse):
feedback=self._convert_longform_feedback_to_html(response_items) feedback=self._convert_longform_feedback_to_html(response_items)
if not response_items['success']: if not response_items['success']:
return render_to_string("open_ended_error.html", {'errors' : feedback}) return self.system.render_template("open_ended_error.html", {'errors' : feedback})
feedback_template=render_to_string("open_ended_feedback.html",{ feedback_template=self.system.render_template("open_ended_feedback.html",{
'grader_type' : response_items['grader_type'], 'grader_type' : response_items['grader_type'],
'score' : response_items['score'], 'score' : response_items['score'],
'feedback' : feedback, 'feedback' : feedback,
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
</div> </div>
<div class="longform"> <div class="longform">
<div class="result-errors"> <div class="result-errors">
{{errors}} ${errors}
</div> </div>
</div> </div>
</section> </section>
\ No newline at end of file
...@@ -2,15 +2,15 @@ ...@@ -2,15 +2,15 @@
<header>Feedback</header> <header>Feedback</header>
<div class="shortform"> <div class="shortform">
<div class="result-output"> <div class="result-output">
<p>Score: {{score}}</p> <p>Score: ${score}</p>
{% if grader_type == "ML" %} % if grader_type == "ML":
<p>Check below for full feedback:</p> <p>Check below for full feedback:</p>
{% endif %} % endif
</div> </div>
</div> </div>
<div class="longform"> <div class="longform">
<div class="result-output"> <div class="result-output">
{% autoescape off %} {{feedback}} {% endautoescape %} ${ feedback | n}
</div> </div>
</div> </div>
</section> </section>
\ No newline at end of file
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