Please contribute generously in order to ensure the continuity of our website InshaAllah.
Praise be to Allah.
In several previous answers we have discussed the ruling on mixing at work and in places of study. Please see the answer to question no. 1200 and 103044.
With regard to your problem, if you cannot leave school because of your social situation, then you must look for another branch or faculty of the university where the opportunities to deal with males and mix with them will be less, because the basic principle of sharee’ah is that if evil cannot be warded off entirely, then it must be reduced as much as possible.
If you cannot manage to make this change that we have suggested, then you have to observe complete hijab, lower your gaze and be chaste of speech in all circumstances, and reduce the opportunities of mixing with males. If you need something, then ask females for it, and try to work out something with your professor so that your projects will be done with female classmates.
If that is not possible, then it will be your responsibility to careful and mix less with men; beware of being alone with one of them, even if it is for the purpose of study, and keep your dealings with males to a minimum. If you are able to refuse to mix with them sometimes or for some work, then do that. Let your dealings be serious and do not let them get to know you or let the conversation go beyond the topic of study.
If you feel that you are becoming fond of someone or he is becoming fond of you, then leave this group and join another, even if your grades fall or your level of academic achievement is affected, within bearable limits.
Ask Allaah to protect you and help you to avoid temptations both obvious and hidden, and seek help with patience, prayer, fasting and remembrance of Allaah (dhikr).
See also the answer to question no. 72448.