Teacher jailed 26 months for having underage sex with student