Fixed bugs in grader

I caught a couple of minor problems in this branch

basically grading wasn't working right because I bonked a sql query

and some scores were not displaying correctly because I wasn't ordering them correctly