Penalty is a disguised form of corporal punishment and is illegal.
"Law on the Protection of Minors"
Article 21: Faculty and staff in schools, kindergartens and nurseries shall respect the personal dignity of minors and shall not impose corporal punishment on minors , disguised corporal punishment or other behaviors that insult human dignity.
Article 63 If ??a school, kindergarten or nursery infringes upon the legitimate rights and interests of minors, the education administrative department or other relevant departments shall order it to make corrections; if the case is serious, the directly responsible person in charge and other persons directly responsible shall be ordered to make corrections. Personnel will be punished in accordance with the law.
If school, kindergarten, or nursery school staff members impose corporal punishment, disguised corporal punishment, or other humiliating behavior on minors, they shall be ordered to make corrections by their units or superior authorities; if the circumstances are serious, they shall be punished in accordance with the law.
"Compulsory Education Law"
Article 29: Teachers should treat students equally in education and teaching, pay attention to students' individual differences, teach students in accordance with their aptitude, and promote students' full development.
Teachers should respect the personality of students and must not discriminate against students. They must not impose corporal punishment, disguised corporal punishment or other behaviors that insult their personal dignity, and must not infringe on students' legitimate rights and interests.