Commit eb31a163 by Bridger Maxwell

Added percentages to sections in profile

parent 9c94ef9c
...@@ -107,10 +107,17 @@ $(function() { ...@@ -107,10 +107,17 @@ $(function() {
<div class="scores"> <div class="scores">
<h3><a href="${reverse('courseware_section', args=format_url_params([hw['course'], hw['chapter'], hw['section']])) }"> <h3><a href="${reverse('courseware_section', args=format_url_params([hw['course'], hw['chapter'], hw['section']])) }">
${ hw['section'] }</a> ${"({0}/{1})".format( hw['section_total'][0], hw['section_total'][1] )}</h3> <%
earned = hw['section_total'][0]
total = hw['section_total'][1]
percentageString = "{:.0%}".format( float(earned)/total) if earned > 0 else ""
%>
${ hw['section'] }</a> ${"({}/{}) {}".format( earned, total, percentageString )}</h3>
<ul> <ul>
%if len(hw['scores']) > 0:
Problem Scores:
%endif
% for score in hw['scores']: % for score in hw['scores']:
<li>${ score[0] }/${ score[1] }</li> <li>${ score[0] }/${ score[1] }</li>
% endfor % endfor
......
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