Police say social studies teacher Jesse Randall Davidson warned people away before firing a shot in the classroom