I’m thinking that if all the class rushed at the same time it would confuse the shooter and make him reflex and spoil his aim. Classes might want to get together at the beginning of each semester and pre-plan.
You have a good idea. Even though he has the gun, he was outnumbered. If a group of people were able to act in unison, they could overwhelm an armed gunman.
If the alternative is certain death as he shoots everyone one by one, the outcome couldn’t be any worse if everyone were trained to rush the gunman.
Some students throw objects at him, and some rush. If four or five male students charge the shooter using their desks for shields, one or two should be able to get to him.
What is the other choice? Sit there and wait to be shot. Obviously, when bullets start flying, if there is no plan, many people are going to be killed. Even if things are planned, it's risky. But I'd rather rush than sit there and take a bullet.