You're giving an angry, terrorist far too much credit for being able to think clearly.
Man I have been in the army, and it doesn't matter if you are going through basic training, infantry training, or any other training or course, there is always the one guy or woman that gets constantly picked on. I remember the guy who used to bunk in front of me. He was always getting ripped apart during morning inspection. One day he had enough, so he stayed up all night making sure everything was perfect.
Next day the Sgt. Was going over his bunk, lockers, kit etc, and the fucker couldn't find anything wrong. So he took the guys razor and ran it up the towel. He then snapped at the poor guy asking him what all the shit on his razor was? At which point he proceeded to trash the bunk, the lockers and all the kit ended up everywhere in that room. It was horrible and I could actually see tears coming from by buddy's eyes. He snapped after that and we were kind of worried about him, he just had a crazy look about him.
So in this case the guy shoots up everyone in his class, I wouldn't be to fast to call it terrorism until we know more.