Mask grades on progress page according to "Show Correctness" setting.

This commit is contained in:
Jillian Vogel
2017-05-02 23:11:18 +09:30
committed by Tim Krones
parent e8a36957b1
commit 6ca8a702ae
11 changed files with 481 additions and 47 deletions

View File

@@ -180,12 +180,30 @@ from django.utils.http import urlquote_plus
%endif
</p>
%if len(section.problem_scores.values()) > 0:
<dl class="scores">
<dt class="hd hd-6">${ _("Problem Scores: ") if section.graded else _("Practice Scores: ")}</dt>
%for score in section.problem_scores.values():
<dd>${"{0:.3n}/{1:.3n}".format(float(score.earned),float(score.possible))}</dd>
%endfor
</dl>
%if section.show_grades(staff_access):
<dl class="scores">
<dt class="hd hd-6">${ _("Problem Scores: ") if section.graded else _("Practice Scores: ")}</dt>
%for score in section.problem_scores.values():
<dd>${"{0:.3n}/{1:.3n}".format(float(score.earned),float(score.possible))}</dd>
%endfor
</dl>
%else:
<p class="hide-scores">
%if section.show_correctness == 'past_due':
%if section.graded:
${_("Problem scores are hidden until the due date.")}
%else:
${_("Practice scores are hidden until the due date.")}
%endif
%else:
%if section.graded:
${_("Problem scores are hidden.")}
%else:
${_("Practice scores are hidden.")}
%endif
%endif
</p>
%endif
%else:
<p class="no-scores">${_("No problem scores in this section")}</p>
%endif