I'd take a look in the plugins under grade reports because I believe there's something already out there that does this. Perhaps you can modify it exactly to your specs.
General developer forum
Create a custom Grade module ?
This discussion has been locked so you can no longer reply to it.