diff --git a/profile.html b/profile.html
index 422d21f2b8..a3280e8f01 100644
--- a/profile.html
+++ b/profile.html
@@ -91,49 +91,43 @@ $(function() {
-
- <%
- lastChapter = None
- %>
- % for hw in homeworks:
+
+ %for chapter in chapters:
-
- %if hw['chapter'] != lastChapter:
-
- <% lastChapter = hw['chapter'] %>
- %else:
-
-
- %endif
-
-
-
- ${hw['subtitle']}
- % if 'due' in hw and hw['due']!="":
- due ${hw['due']}
- % endif
-
-
- %if len(hw['scores']) > 0:
- %if hw['graded']:
- Problem Scores:
- %else:
- Practice Scores:
- %endif
- % for score in hw['scores']:
- - ${ score[0] }/${ score[1] }
- % endfor
+
+
+
+ %for section in chapter['sections']:
+ -
+ <%
+ earned = section['section_total'][0]
+ total = section['section_total'][1]
+ percentageString = "{0:.0%}".format( float(earned)/total) if earned > 0 else ""
+ %>
+
+
+ ${ section['section'] } ${"({0}/{1}) {2}".format( earned, total, percentageString )}
+ ${section['subtitle']}
+ %if 'due' in section and section['due']!="":
+ due ${section['due']}
%endif
-
-
-
- % endfor
-
+
+ %if len(section['scores']) > 0:
+
+ ${ "Problem Scores: " if section['graded'] else "Practice Scores: "}
+ %for score in section['scores']:
+ - ${ score[0] }/${ score[1] }
+ %endfor
+
+ %endif
+
+
+ %endfor
+
+
+ %endfor
+