extra security check for results page

- if student hasn't written the exam yet and the exam can still be
written, redirect them back to courses (they shouldnt be able to get to
the page without rewriting url anyway)