From what I have read, none of the accounts state fully what happened. At first, the police stated that they observed her on video propping the door open with a rock and the shooter came in. Now they say that she kicked the rock out and the door shut but did not lock. Probably did not close all the way. Is there video? Not read that there is.
So why did she prop the door out back open and go outside? My guess, to smoke. I used to see this all the time in offices that I worked in that did not allow you to smoke inside. Rather than going out a normal entrance and everyone see you leave to smoke, some people opted to go out a door that is not normally used for entering, like out back, and therefore had to be propped open else the person would have to walk all the way around to the front entrance.
If she is a teacher and left to smoke, she probably gave the kids something easy to do, like coloring to keep them quiet and occupied, especially since it was the last few days of school. If this is the case, and I am just speculating here, then she probably was not allowed to leave her class alone.
Another thing, did the shooter go directly to that door? Or did he try other doors and they were locked?
As far as a sensor on the door, they probably do have contact sensors for an alarm system. But it may only be used after hours, may not alert during the day, or may have just not been working.