The chances of accidents would be miniscule as teacher would be trained to carry the gun and would keep it with them at all times when in the classroom so there would be no chance of the students playing with the gun. The deterrence effect of having guns in school is likely to mean that the number of shootings will go down rather than up. Finally if it was an armed teacher who perpetrated the shooting then they would have been able to commit that atrocity regardless of whether s/he was allowed to carry a gun in school.