I would try grounding yourself next time, on something outside your own body? I sit on my couch and rub my hand on the arm, it's a "rough" cloth. Or I go outside and really look at/watch the cars go by and see the other people in them, literally hug a tree, etc. Not something you can do in a class

Maybe feel under the desk and see if there's gum under there or something :-) that will distract you from your problems wonderfully I imagine! I'd "scrape" my chair and process the sound, go ask the instructor a question? Just try to break yourself out of whatever is going on.
But if you faint every so often, I'd still go see your doctor and get blood/fluid tests to rule out anything wrong with you physically. You might be dehydrated or have a blood pressure problem or sugar problem, etc.