Former high school teacher appears in court for allegedly having sex with student