Course grade calculation

When an assignment is marked graded, the course average is calculated
and stored. (It's shown up on the view course page for ages but now they
don't all say N/A)
Recent database updates: the assignments and categories tables both have
a new column called 'grade' of type 'float'