Teacher sentenced to three years in prison after having relations with 14-year-old student