Although Mikey has agreed with me, I agree with Scott.
If a teacher has been stressed from previous classes then they certainly shouldn't be taking it out on other pupils because it's nobody else's fault except from the class/pupil which we're causing the disruption. I mean everybody can get stressed but I still do think smacking a ruler on the table is a bit extreme and if the pupil didn't actually do anything, then it sounds to me as if the teacher has more problems than the pupil. There's obviously got to be more behind it though?