I have an epic Chemistry teacher! We are on-topic most times, but we can usually divert his attention to something else - he makes chemistry fun (especially with a running joke in the class when he says something like "We know how hydrogen reacts with flame" or "We know how methane reacts when burned", and then we'll say "Nah sir, we did it yesterday but I forgot. Can you show us again?" 99% of the time he'll get the equipment out and do it again) and he'll be going into my autobiography if I write one up.
Besides, my maths teacher put past-HSC questions into our paper and we weren't complaining. If you define that as "Year 12" questions, then your teacher has every right to do it if he can show the question was related to the syllabus.
Also, I know what a non-serious attempt is. At this other school I attend (my school has a student-share program), this guy was caught by my teacher playing table tennis during the Legal exam time. So he tells him to do the exam. My teacher walks past the table tennis room again in 15 minutes and he's there, and the guy says, "He's finished". Fast forward to exam give back day, he got 11%. He sat there for 10 minutes, did a few questions and on the marked paper, the presiding teacher wrote "Exam Start: 11:30, arrived 10 mins. late, handed back at 11:50". That is a non-attempt. However my teacher didn't award it, after all, it's Prelim HSC anyway. Well, at least he didn't announce he was giving him a non-attempt to the class...