Re-marking of a quiz can be a lengthy operation. It must be ensured that the re-marking finishes even when the teacher closes the page. Probably the requires a database table where quizzes to be re-marked are entered and only cleared when re-marking has finished successfully. The cron script should check for outstanding remarking and do it. Also attempts.php (that is the new name for the script producing the list of student attempts for the teacher) should check for outstanding remarking jobs and offer the teacher to do them right then and there.
This is something for Julian after the question types are all in.