Is it abusing teachers code of conduct if…?
It is doubtful that the teacher broke any written rule or law, simply because no school or government has the time or resources to create and enforce rules against any possible abuse of a teacher’s power. However, what the teacher did, assuming you are reporting it accurately, was still wrong. My advice: tell your parent(s) what happened, show them this answer (Hello, parents, I’m a teacher myself), and then go, as a group, and meet with an administrator to complain about this teacher’s behavior, for it certainly should not be tolerated. Also, on behalf of my profession, I apologize. Teachers like that embarrass me.