Michael Green was attacked when he confronted two ex-pupils of Northcliffe school, in Conisbrough, near Doncaster, South Yorkshire, after they came on to the premises last September.
The 54-year-old physics teacher, who is an ex-miner, was hit with a pole and then knocked unconscious by a bottle which was thrown at his head when he confronted Steven Thorpe and Matthew Godsmark.
Thorpe, 18, of no fixed abode was sent to a young offenders institution for six months this week at Doncaster crown court after admitting causing grievous bodily harm.
The judge told the court he wanted to give him a longer sentence but his hands were tied because he was only 17 at the time of the incident.
Godsmark, 18, of Chambers Avenue, Conisbrough, will be sentenced at a later date.
David Martin, head of Northcliffe, said: "What we wanted was a very clear message to deter others and to say that this kind of thing is just not acceptable.
"That's what we were hoping for. No school should have to go through what we went through. The question is whether this sentence gives that message."
He said Mr Green went out to make sure the two intruders did not get back into the school after they had already abused staff inside, then interfered with a PE class outside.
Mr Martin paid tribute to Mr Green, who came to teaching relatively late in life and returned to his classroom two weeks after the attack despite his serious injuries.
"He is a dedicated teacher," Mr Martin said said. "Many people would have decided not to come back at all but not Mick."