Middle school teacher accused of hitting child