Prison time for teacher accused of having sex with student