Whatever class my child was in, I would want the teacher to retrieve gun from electronic safe and have it pointed at their classroom door when they heard shots.And what is the teacher going to do ask the shooter to wait while he gets his weapon?
Most shootings will be over before you could load a gun much less open a safe.