All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
It is impermissible to watch movies containing what is forbidden such as music, indecent scenes, and the like. Please refer to Fatwa 89099. The fact that the teacher asked his students to watch such movies as an assignment is not a valid excuse for watching them. In fact, it is impermissible for the students to obey their teacher in this respect because there is no obedience to a created being if it involves disobedience to the Creator. ‘Ali reported that the Prophet, sallallaahu ‘alayhi wa sallam, said: “There is no obedience in matters involving disobedience to Allaah. Obedience is only in matters which are good.” [Al-Bukhari and Muslim]
If the teacher insists that the student watches these movies, and if failing to do this assignment would not cause severe harm to the student, then he should not do it. However, if it would cause harm, then one should choose the least evil movie and fear Allaah, The Exalted, to the best of his ability. One should lower one's gaze from indecent scenes and turn off the sound when there is music.
Allaah Knows best.