Add distinct for biography to prevent duplicate classes.

This happened when teachers taught for multiple sections or hours, in the teacher biography page.

See issue #738.