Implement the compact view (grade_report_aggregationview). Either the individual grade_items are shown, OR their aggregated column. For example, if you have two categories with 4 items in each and the compact view is on, by default you will see 8 columns of grades, one for each item. The two category headers will have a icon which, when clicked, will compact that category into its aggregated version (changing the
to a
) and hiding the 4 items. The result will then be 5 columns of grades, 1 for the category that was compacted, and 4 for the other category which is still expanded.