Skip to content

fix: missing team report system#492

Open
hadiafifah wants to merge 6 commits intomainfrom
fix/missing-team-report
Open

fix: missing team report system#492
hadiafifah wants to merge 6 commits intomainfrom
fix/missing-team-report

Conversation

@hadiafifah
Copy link
Copy Markdown
Contributor

@hadiafifah hadiafifah commented Apr 16, 2026

Summary

This PR adds an admin recovery flow for missing teams: admins can now mark a team as present and restore it back to relevant judges’ queues.

What Changed

Backend

  • Added restoreMissingTeam(team_id) in the teams missing-report action module.
  • Enforced admin-only access inside the action (auth() + role check).
  • Restore logic now:
    • Collects unique judge IDs from team.reports.
    • For each reporting judge, requeues the team to the end only if: the submission exists for that judge/team, and is_scored === false.
    • Skips scored submissions (existing judged work is preserved).
    • Sets team.active = true.
    • Clears team.reports after successful processing.

Admin UI (/admin/teams)

  • Added a team-level action button and helper text on reported teams
  • Added confirmation prompt before execution

Behavior Notes

  • Only judges who reported the team missing and still have an unscored submission are requeued.
  • Non-reporting judges are unaffected.
  • Scored submissions are not modified.

Fixes #466

Copy link
Copy Markdown
Member

@ReehalS ReehalS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looked this over, changes look good, @hadiafifah I assume you've tested this already, if you want me to do the full flow testing as well lmk.

Copy link
Copy Markdown
Member

@ReehalS ReehalS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add Tests to verify this functionality actually works. (including for code you didn't write for the missing teams functionality), the person who initially wrote this likely fully vibecoded it

@ReehalS
Copy link
Copy Markdown
Member

ReehalS commented Apr 24, 2026

When teams are to be marked present, also mark the team's active=true regardless of what it was before, and move that team back into all of the judges whose queues that team has been marked missing with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix missing team report system

2 participants