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.
Merge pull request #491 from bellotastudios/assignments

Unify assignments queries in student dashboard.