When my students have to use the bathroom they use tickets. Throughout the day if students are doing a good job I give them tickets. When they need to use the bathroom, get a drink, go to lockers or anything outside the classroom they put two fingers up and they put their tickets in a jar by the door and go. At the end of the day the students hand in unused tickets and put them in a jar. Then I pick three students out of the jar to eat lunch in the classroom with me the following day. This works great so students don't try to get out of the classroom for no reason.