Fixed tablesorting for past exams, updated special times text, averages not always shown

Averages only shown when more than 80% of students have written the
exam or when >100 students have written the exam or if the professor
has released the results