Fix for Issue #1294

Fixed errors in pagination and sorting in grade entry form.

Sorry, there is an extra commit from a previous pull request ('Fix errors in test/functional/rubric...'). I was having some trouble with rebasing and ended up force pushing an old commit.