online-judge
online-judge copied to clipboard
Add support for archiving a submission
fixes #1767
an admin needs judge.archive_submission to archive submissions. there are 2 ways to archive a submission:
- go to
/problem/<code>/manage/submission, turn on "Archive locked submissions", and click "Rejudge selected submissions"- my approach is to include locked submissions in the query, and then let
Submissions.judgesetis_archivedto true
- my approach is to include locked submissions in the query, and then let
- go to
/admin/judge/submission/<code>/change/and toggle "Is archived"
user-facing changes when a submission is archived:
- during point recalculation (e.g.
/admin/judge/profile/ > Action > Recalculate scores): submission is not considered when recalculating points, problems solved, and pp /user/<name>/solved: submission no longer appears in "Points breakdown" and in the problems solved table/problem/<code>/rank/: submission no longer appears as a best solution/submissions/and/problem/<code>/submissions/: submission becomes partly transparent and gets an archive icon. see screenshot.
there are no admin-facing changes when a submission is archived
Codecov Report
Attention: Patch coverage is 47.72727% with 23 lines in your changes missing coverage. Please review.
Project coverage is 47.71%. Comparing base (
fd7fb05) to head (7d1ef6b). Report is 75 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #2411 +/- ##
==========================================
+ Coverage 46.76% 47.71% +0.94%
==========================================
Files 251 261 +10
Lines 13317 13769 +452
==========================================
+ Hits 6228 6570 +342
- Misses 7089 7199 +110
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
Overall ty for working on this, it looks great :)
- allow access to "Archive locked submissions". don't put this behind the "judge.archive_submission" permission.
- add
is_archived=Falseto more queries
I remember the reason we wanted "rejudge" to be "rejudge and archive" was because in most cases, you'd want to do both simultaneously. I think a compromise solution might be to have a button for "rejudge and archive", and possibly separate buttons for "rejudge" and "mark archived"?
Thoughts? @int-y1 @quantum5 @Ninjaclasher
changes:
- rebased the migration to 0151
- moved the archiving code from
Submission.judgetoSubmission.archive rejudge_problem_filterwill determine if the submission is rejudged or archived
i didn't add a button for only "mark archived" because it's not needed yet