Filter error handler scores before rendering view statistics page #1747
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Filter out
grader_id
s of-1
before rendering the view statistics page.Motivation and Context
In #1643, scores are marked with a
grader_id
of-1
if an error occurs (for context, see the PR).However, this led to an issue in viewing the view statistics page if any such scores exist.
This is since in
grading.rb
, we map thegrader_ids
with:find_user
, which only handlesgrader_id = 0
specially. As a result, an error occurs on the line@course.course_user_data.find(i)
if agrader_id
of-1
is present.How Has This Been Tested?
First, make a submission that triggers the error handler. e.g. create an assessment whose autograder does not output a score json at the end (e.g. install
hello.tar
, modifysrc/driver.sh
, runmake
). Then submit to it.Afterwards, access the view statistics page.
BEFORE (Error)
![Screenshot 2023-01-30 at 18 05 31](https://user-images.githubusercontent.com/9074856/215617491-eed1cb30-eb65-4b2c-9766-0462cf079c9a.png)
AFTER (Renders)
![Screenshot 2023-01-30 at 18 07 33](https://user-images.githubusercontent.com/9074856/215617504-670513e7-540f-4ad3-a5fe-56415549da4e.png)
Types of changes
Checklist:
overcommit --install && overcommit --sign
to use pre-commit hook for linting