Place a system of metal gate type barriers that roll down from the ceiling at the beginning and end of each hall. Place a couple more spaced about 10 feet in from the entrance and exit gates. Have all the class doors fitted with ballistic plates, windows, and reinforced strikers. Put the gates rapid drop down function and all of the schools internal locks on an emergency system that is accessible in every room like a fire alarm. Have cameras inside the school that monitor so that if something begins it gets locked down immediately. This would obviously be costly but it would stop and trap a gunman in their tracks.