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