Which sin is greater - eating pork or being in khalwah alone with the opposite sex for educational purposes?
Eating pork without any shadow of a doubt is more haraam. The prohibition of pork is by Qur'anic text and hadeeth.
While, the prohibition of khalwah is derived from hadeeth, the Prophet (ﷺ) said:
“When a man and woman are alone, the third is Satan.” 
And also from Fiqh maxims by inference: What leads directly to haraam is itself haraam, or blocking the pathways to haraam (sadd ath-tharaai').
Allah knows best.
 [Narrated by Ahmad, al-Tirmidhi and al-Haakim; classed as saheeh by al-Albaani in Saheeh al-Jaami’ (2546)]< Back to Questions