Deputies: Teacher arrested for having sex with student