SA teacher jailed for sex with student