he apparently tried to enter the first classroom he came to , but a quick-thinking teacher , mr. hainsley , pushed the door shut from the inside and held it , exhorting his students to flee by the window .