Ex-teacher is jailed for sex attack on teen boy