Fixes #1765; csv grade export messed up

Re-written to conform to new tables.
Merge pull request #1768 from Stanford-Online/dca_new_working2

Fixes #1765; csv grade export messed up