English Translation
My friends didn’t understand the teacher’s explanation, so they decided to leave abruptly before the exam started.
Wiktionary has this to say about irse por la patilla:
(vulgar, colloquial, idiomatic) to shit oneself
Synonym: irse por la pata abajo
https://en.m.wiktionary.org/wiki/irse_por_la_patilla#Spanish