Fixed `n^2` loop in view_assignment.

* Removed nested loop
* Added mapping from test_result's `ObjectID` to submission.