ANSWER:
A man is the breadwinner of the house. If he is forced to teach in a mixed class, he must lower his gaze and not chitchat or socialize with them.
https://www.assimalhakeem.net/are-boys-allowed-to-study-at-mixed-universities-knowing-that-in-our-country-all-universities-are-mixed-2/