Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/server/logic/judgements/judge_runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,10 @@ async function judgeTaskData<Type extends TaskType>(
verdict_cache: Map<string, JudgeVerdictTaskData>,
bad_subtask: boolean
): Promise<JudgeVerdictTaskData> {
const cached_verdict = verdict_cache.get(task_data.judge_file_hash);
// An empty task_data.input_file_hash means there is no input file (output-only task)
const cached_verdict = task_data.input_file_hash
? verdict_cache.get(task_data.input_file_hash)
: undefined;
let result: EvaluationResult;
if (bad_subtask) {
result = {
Expand Down Expand Up @@ -337,8 +340,8 @@ async function judgeTaskData<Type extends TaskType>(
running_time_ms: result.running_time_ms,
running_memory_byte: result.running_memory_byte,
};
if (returnResult.verdict !== Verdict.Skipped) {
verdict_cache.set(task_data.judge_file_hash, returnResult);
if (task_data.input_file_hash && returnResult.verdict !== Verdict.Skipped) {
verdict_cache.set(task_data.input_file_hash, returnResult);
}
return returnResult;
}
Expand Down
8 changes: 1 addition & 7 deletions src/server/logic/submissions/judge_submission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,13 +247,7 @@ async function loadSubtasksOutput(
.filter((d) => d.subtask_id == subtask.id)
.map((d) => ({
id: d.id,
/***
* TODO: Perform an overhaul to the DB so that output-only problems can have input files as well
* Currently, our only Output Onlies are TAMa (Project Euler style)
* But more properly, Output-Only in general needs an input file as well, see: https://oj.uz/problem/view/IOI17_nowruz
* (There are no such problems like the above in Hurado _yet_)
* This is just a quick band-aid fix so I can get custom-checkers to work for the others.
**/
// We put an empty string to mean no input file
input_file_name: d.input_file_name ?? '',
input_file_hash: d.input_file_hash ?? '',
judge_file_name: d.judge_file_name,
Expand Down
Loading