Commit ee2a1c84 by Eric Fischer

Fix for PDF leaderboard files

PDF files cannot be displayed in an `<img>` tag, we should be using the pre-made template.
Also moving the image below the response because it looked weird above. Tests updated.
parent 595f393b
......@@ -17,11 +17,9 @@
</h4>
{% endwith %}
<div class="leaderboard__answer">
{% if topscore.file %}
<img class="leaderboard__score__image" alt="{% trans "The image associated with your peer's submission." %}" src="{{ topscore.file }}" />
{% endif %}
{% trans "Your peer's response to the question above:" as translated_label %}
{% include "openassessmentblock/oa_submission_answer.html" with answer=topscore.submission.answer answer_text_label=translated_label %}
{% include "openassessmentblock/oa_uploaded_file.html" with file_upload_type=file_upload_type file_url=topscore.file class_prefix="submission__answer"%}
</div>
</li>
{% endfor %}
......
......@@ -86,7 +86,7 @@ class LeaderboardMixin(object):
score.pop('content', None)
context = {'topscores': scores, 'allow_latex': self.allow_latex,}
context = {'topscores': scores, 'allow_latex': self.allow_latex, 'file_upload_type': self.file_upload_type,}
return 'openassessmentblock/leaderboard/oa_leaderboard_show.html', context
......
......@@ -242,6 +242,7 @@ class TestLeaderboardRender(XBlockHandlerTransactionTestCase):
{
'topscores': scores,
'allow_latex': xblock.allow_latex,
'file_upload_type': xblock.file_upload_type,
},
workflow_status='done'
)
......
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