I remember when my Islamiat teacher in school use to go to mosque at the time of prayer when he was suppose to teach us. This happened for 2 months then we all went to Headmaster and talked about it. Then our period time was changed.
The thing is, what should be priority, prayer or the job...