There is some cases when the teacher's ai may go above 20 and is not hard-capped. And the current difficulty is based on the current challenge selected or playing normal mode. (pure nightmare is 10 difficulty)
Also there is a bug where you wouldn't get hell mode achievement when you get all notebooks wrong in pure nightmare and then exit the school