I'm going to constantly shake my leg during class.
Are you shaking your leg on purpose or is it involuntary?
Oh it's on purpose. I want to annoy my teacher and classmates by making noise.
You should not be doing things that bother others in class. People are there trying to learn, not to be distracted.
So I'm not allowed to move my leg?!
There's nothing wrong with moving your leg, but if you are intentionally doing something that is annoying your fellow students and the teacher, that's rude. If you don't care about paying attention in class, that's your prerogative. Don't force other people to struggle to learn too though by making noise.