They just muck with the average and standard deviation to make sure the results fit a bell curve. It would take around 30 seconds.
For the school marks, what they do is if your school 'earns' 100 A's, 50 B's, 70 C's and 10 D's then the top 100 will get an A, next 50 a B etc.