During the history exam, she started feeling sick and got permission to leave for the restroom.
Literal
History [of-の] exam during, she [topic-は] feeling [subject-が] became-bad so restroom [to-に] receive-permission-to-stand-up [favor-てもらった].
お手洗いにたたせてもらった is a layered courteous construction: たたせる is causative of 立つ (stand up, here 'leave one's seat') + てもらう (receive the favor). 立たせてもらう literally 'receive the favor of being allowed to stand up' = 'got permission to leave.' A polite way to describe asking to step out.