Maybe a transatlantic discrepancy, but i would say...
"on her Science exam/test"
"in Science class"
"How did Jane do on her math test?"
"John got an A on his English exam"
My English is 100% American, so it's more than possible they say "in" in the UK and Ireland.
although you can't ''do well'' for something, it must be in or on.
I think maths in plural sounds awkward and for me ''She got a good mark for her maths paper'' at least to my American ears sounds totally unnatural.
Sure you can. It's a different context, but you can do well for something.
He pitches pretty well for a first baseman.
She plays the violin very well for a drummer.
But I digress, as it is a different usage all together.