Unify assignments queries in student dashboard.

Unify assignments queries in the student dashboard. Memoize the group by assignment type that is performed three times.

Closes #485.