Ex-teacher accused of having sexual relationship with student