Updated

It's a familiar scenario when a school official hears about a potential danger that's too close for comfort and locks down the building.

For a California elementary school, the quick action is credited with thwarting greater disaster recently when a gunman on a deadly rampage was kept from walking through the door.

Schools have become adept at rapidly shoring up security, measuring responses against the toll it could take on students' learning and sense of safety.

The president of the National Association of School Resource Officers says schools regularly practice safety plans and have gotten good at taking action anytime they hear about a potential threat in or outside the building.

It may be as simple as locking doors or as extreme as having students and teachers barricade themselves in classrooms.