My wife is the librarian at a school and her room is the first door past the reception area. Lots of glass so people can see in. In all likelihood a random shooter would take out her room first before any alarm would be sounded.
However, if the shooter started somewhere else in the building by coming in another door, she has already decided that she would take any children in the library and exit through the rear exterior door to the library. She would then go through the church building whose rear entrance door is only about 25 feet away, out the front of the church, across the street to the police precinct. At any given time she has from 0 to 18 students and 2 to 3 adults in her library. Never more. So safely herding her charges away from the danger is easily doable.
A lot better than hunkering down and waiting to be killed.