Gradebook

%if len(students) > 0: <% templateSummary = students[0]['grade_info']['grade_summary'] %> %for section in templateSummary: %if 'subscores' in section: %for subsection in section['subscores']: %endfor %else: %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" %> %for student in students: %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
Student${subsection['label']}${section['totallabel']}${section['category']}
${ "{0:.0%}".format( percentage ) }
${student['username']}
%endif