That hurts, Jack. What a way to start out.
Although, it doesn't matter what you are "legally". You could have sat on the guys side. Maybe you could have a talk with your teacher and say you identify as male and you'd appreciate some warning next time she does an exercise like that so you and she can discuss where you sit.
There's no law against identifying as male (unless you live in the United Arab Emirates), so don't get hung up on that F on your drivers licence. If someone questions, you just say you're trans and haven't met the requirements to get your documentation changed.
Dennis