Commit 16f44284 by Victor Shnayder

Style cleanup in gradebook

* don't display thousands of '%' characters
* s/percentage/fraction/, since that's what it is
parent 544a564c
......@@ -9,7 +9,7 @@
<%block name="headextra">
<%static:css group='course'/>
<style type="text/css">
.grade_A {color:green;}
.grade_B {color:Chocolate;}
......@@ -17,7 +17,7 @@
.grade_F {color:DimGray;}
.grade_None {color:LightGray;}
</style>
</%block>
<%include file="course_navigation.html" args="active_page=''" />
......@@ -26,14 +26,14 @@
<div class="gradebook-wrapper">
<section class="gradebook-content">
<h1>Gradebook</h1>
%if len(students) > 0:
<table>
<%
templateSummary = students[0]['grade_summary']
%>
<tr> <!-- Header Row -->
<th>Student</th>
%for section in templateSummary['section_breakdown']:
......@@ -41,22 +41,22 @@
%endfor
<th>Total</th>
</tr>
<%def name="percent_data(percentage)">
<%def name="percent_data(fraction)">
<%
letter_grade = 'None'
if percentage > 0:
if fraction > 0:
letter_grade = 'F'
for grade in ['A', 'B', 'C']:
if percentage >= course.grade_cutoffs[grade]:
if fraction >= course.grade_cutoffs[grade]:
letter_grade = grade
break
data_class = "grade_" + letter_grade
%>
<td class="${data_class}" data-percent="${percentage}">${ "{0:.0%}".format( percentage ) }</td>
<td class="${data_class}" data-percent="${fraction}">${ "{0:.0f}".format( 100 * fraction ) }</td>
</%def>
%for student in students:
<tr>
<td><a href="/profile/${student['id']}/">${student['username']}</a></td>
......
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