Commit 812810a6 by Bridger Maxwell

Converted gradebook to refactored grading format.

parent 245a3d97
...@@ -16,7 +16,7 @@ Score = namedtuple("Score", "earned possible graded section") ...@@ -16,7 +16,7 @@ Score = namedtuple("Score", "earned possible graded section")
SectionPercentage = namedtuple("SectionPercentage", "percentage label summary") SectionPercentage = namedtuple("SectionPercentage", "percentage label summary")
class CourseGrader: class CourseGrader(object):
def grade(self, grade_sheet): def grade(self, grade_sheet):
raise NotImplementedError raise NotImplementedError
......
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
<style type="text/css"> <style type="text/css">
.grade_a {color:green;} .grade_a {color:green;}
.grade_b {color:Chocolate;} .grade_b {color:Chocolate;}
.grade_c {color:DimGray;} .grade_c {color:DarkSlateGray;}
.grade_f {color:DimGray;}
.grade_none {color:LightGray;} .grade_none {color:LightGray;}
</style> </style>
...@@ -29,16 +30,10 @@ ...@@ -29,16 +30,10 @@
<tr> <!-- Header Row --> <tr> <!-- Header Row -->
<th>Student</th> <th>Student</th>
%for section in templateSummary: %for section in templateSummary['section_breakdown']:
%if 'subscores' in section: <th>${section['label']}</th>
%for subsection in section['subscores']:
<th>${subsection['label']}</th>
%endfor
<th>${section['totallabel']}</th>
%else:
<th>${section['category']}</th>
%endif
%endfor %endfor
<th>Total</th>
</tr> </tr>
<%def name="percent_data(percentage)"> <%def name="percent_data(percentage)">
...@@ -50,6 +45,8 @@ ...@@ -50,6 +45,8 @@
data_class = "grade_b" data_class = "grade_b"
elif percentage > .6: elif percentage > .6:
data_class = "grade_c" data_class = "grade_c"
elif percentage > 0:
data_class = "grade_f"
%> %>
<td class="${data_class}">${ "{0:.0%}".format( percentage ) }</td> <td class="${data_class}">${ "{0:.0%}".format( percentage ) }</td>
</%def> </%def>
...@@ -57,16 +54,10 @@ ...@@ -57,16 +54,10 @@
%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>
%for section in student['grade_info']['grade_summary']: %for section in student['grade_info']['grade_summary']['section_breakdown']:
%if 'subscores' in section: ${percent_data( section['percent'] )}
%for subsection in section['subscores']:
${percent_data( subsection['percentage'] )}
%endfor
${percent_data( section['totalscore'] )}
%else:
${percent_data( section['totalscore'] )}
%endif
%endfor %endfor
<th>${percent_data( student['grade_info']['grade_summary']['percent'])}</th>
</tr> </tr>
%endfor %endfor
</table> </table>
......
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