The no sex in class rule is more of a "you need to pay attention" thing, I'm sure some of teachers won't mind if you absolutely need to rub one out, might even bend you over the desk while the give their lesson.