Skip to content

Commit a002f08

Browse files
author
Mark Saroufim
committed
Fix PRIVATE mode submissions incorrectly receiving scores
PRIVATE mode runs return timing info but should not affect leaderboard ranking. This change restricts score computation to only PUBLIC and SECRET modes, ensuring PRIVATE submissions have score=None as intended.
1 parent d47bad7 commit a002f08

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

src/libkernelbot/backend.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,16 @@ async def submit_leaderboard( # noqa: C901
142142

143143
if result.success:
144144
score = None
145-
# Check for the mode's result key (public or secret)
146145
mode_key = mode.value
147-
if (
148-
mode_key in result.runs
149-
and result.runs[mode_key].run.success
150-
and result.runs[mode_key].run.passed
151-
):
152-
score = compute_score(result, task, submission_id, mode_key)
146+
# Only compute scores for ranked modes (PUBLIC and SECRET), not PRIVATE
147+
# PRIVATE runs return timing info but don't affect leaderboard ranking
148+
if mode in (SubmissionMode.PUBLIC, SubmissionMode.SECRET):
149+
if (
150+
mode_key in result.runs
151+
and result.runs[mode_key].run.success
152+
and result.runs[mode_key].run.passed
153+
):
154+
score = compute_score(result, task, submission_id, mode_key)
153155

154156
# verifyruns uses a fake submission id of -1
155157
if submission_id != -1:

0 commit comments

Comments
 (0)