Bingo. This isn't a hard problem to solve. There is a perfectly good example of what has worked for almost 50 years on how to prevent terrorist attacks on schools. The PLO was routinely attacking schools in Israel, at least until the Israelis began training and allowing teachers to carry weapons at work. The terrorist attacks stops soon there after. Israel hasn't had an armed attack on a school since 1974.