It would have to fall under the legal definition of penalties as defined in the Geneva Conventions. Also, the authority giving the punishment would need to fit certain criteria. Not positive but I'm pretty sure almost no punishment given in a classroom will fall under that definition. A school teacher would lack the needed authority and means to induce the type collective punishment needed to fall under the Geneva Conventions purview. Side note it's a common practice in the military to use collective punishment as a form of corrective training.
When I was 13, my English teacher forced us all to stay for a couple of recesses because someone left a dead bee in her desk and, apparently, no one knew who had done it. O could have told her she was going against the Geneva Convention
anyway, dis is old, but guud.