Well, when a teacher rapes a student virgin, legally it's a huge mess. The law doesn't tolerate this at all. There are laws specifically against sexual abuse of minors (assuming the student is a minor). The teacher will be prosecuted under criminal law. He might get life imprisonment in some cases. His teaching license will be revoked for sure. And there will be a lot of support for the victim to ensure she or he can recover from this traumatic event, both psychologically and physically. The whole community will be in shock, and there will be a demand for better safety measures in schools.
If a teacher rapes a student, it is a very serious crime. The teacher will likely face criminal charges such as sexual assault. In a school setting, this would also lead to immediate termination of employment. The legal system will ensure that the perpetrator is punished severely to protect the victim and send a strong message against such heinous acts.