Ex-teacher pleads guilty to sex crimes against students