Teacher jailed for 4½ years