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
10 changes: 10 additions & 0 deletions judge/judgedaemon.main.php
Original file line number Diff line number Diff line change
Expand Up @@ -1451,6 +1451,16 @@ function judge(array $judgeTask): bool
$passdir = $testcasedir . '/' . $passCnt;
mkdir($passdir, 0755, true);

// In multi-pass problems, all files in the feedback directory
// are guaranteed to persist between passes, except `nextpass.in`.
// So, we recursively copy the feedback directory for every pass
// after the first (note that $passCnt starts at 1).
if ($passCnt > 1) {
$prevPassdir = $testcasedir . '/' . ($passCnt - 1) . '/feedback';
system('cp -R ' . dj_escapeshellarg($prevPassdir) . ' ' . dj_escapeshellarg($passdir . '/'));
system('rm ' . dj_escapeshellarg($passdir . '/feedback/nextpass.in'));
}

// Copy program with all possible additional files to testcase
// dir. Use hardlinks to preserve space with big executables.
$programdir = $passdir . '/execdir';
Expand Down
6 changes: 3 additions & 3 deletions judge/testcase_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ if [ $COMBINED_RUN_COMPARE -eq 1 ]; then
# A combined run and compare script may now already need the
# feedback directory, and perhaps access to the test answers (but
# only the original that lives outside the chroot).
mkdir feedback
mkdir -p feedback
RUNARGS="$RUNARGS $TESTOUT compare.meta feedback"
fi

Expand Down Expand Up @@ -234,8 +234,8 @@ if [ $COMBINED_RUN_COMPARE -eq 0 ]; then

exitcode=0
# Create dir for feedback files and make it writable for $RUNUSER
mkdir feedback
chmod a+w feedback
mkdir -p feedback
chmod -R a+w feedback

runcheck $GAINROOT "$RUNGUARD" ${DEBUG:+-v} $CPUSET_OPT -u "$RUNUSER" -g "$RUNGROUP" \
-m $SCRIPTMEMLIMIT -t $SCRIPTTIMELIMIT --no-core \
Expand Down
Loading