Police officer praised for stopping mass shooting