Gradebook
%if len(students) > 0:
<%
templateSummary = students[0]['grade_info']['grade_summary']
%>
Student |
%for section in templateSummary:
%if 'subscores' in section:
%for subsection in section['subscores']:
${subsection['label']} |
%endfor
${section['totallabel']} |
%else:
${section['category']} |
%endif
%endfor
<%def name="percent_data(percentage)">
<%
data_class = "grade_none"
if percentage > .87:
data_class = "grade_a"
elif percentage > .70:
data_class = "grade_b"
elif percentage > .6:
data_class = "grade_c"
%>
${ "{0:.0%}".format( percentage ) } |
%def>
%for student in students:
${student['username']} |
%for section in student['grade_info']['grade_summary']:
%if 'subscores' in section:
%for subsection in section['subscores']:
${percent_data( subsection['percentage'] )}
%endfor
${percent_data( section['totalscore'] )}
%else:
${percent_data( section['totalscore'] )}
%endif
%endfor
%endfor
%endif