File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -1451,6 +1451,16 @@ function judge(array $judgeTask): bool
14511451 $ passdir = $ testcasedir . '/ ' . $ passCnt ;
14521452 mkdir ($ passdir , 0755 , true );
14531453
1454+ // In multi-pass problems, all files in the feedback directory
1455+ // are guaranteed to persist between passes, except `nextpass.in`.
1456+ // So, we recursively copy the feedback directory for every pass
1457+ // after the first (note that $passCnt starts at 1).
1458+ if ($ passCnt > 1 ) {
1459+ $ prevPassdir = $ testcasedir . '/ ' . ($ passCnt - 1 ) . '/feedback ' ;
1460+ system ('cp -R ' . dj_escapeshellarg ($ prevPassdir ) . ' ' . dj_escapeshellarg ($ passdir . '/ ' ));
1461+ system ('rm ' . dj_escapeshellarg ($ passdir . '/feedback/nextpass.in ' ));
1462+ }
1463+
14541464 // Copy program with all possible additional files to testcase
14551465 // dir. Use hardlinks to preserve space with big executables.
14561466 $ programdir = $ passdir . '/execdir ' ;
Original file line number Diff line number Diff line change @@ -197,7 +197,7 @@ if [ $COMBINED_RUN_COMPARE -eq 1 ]; then
197197 # A combined run and compare script may now already need the
198198 # feedback directory, and perhaps access to the test answers (but
199199 # only the original that lives outside the chroot).
200- mkdir feedback
200+ mkdir -p feedback
201201 RUNARGS=" $RUNARGS $TESTOUT compare.meta feedback"
202202fi
203203
@@ -234,8 +234,8 @@ if [ $COMBINED_RUN_COMPARE -eq 0 ]; then
234234
235235 exitcode=0
236236 # Create dir for feedback files and make it writable for $RUNUSER
237- mkdir feedback
238- chmod a+w feedback
237+ mkdir -p feedback
238+ chmod -R a+w feedback
239239
240240 runcheck $GAINROOT " $RUNGUARD " ${DEBUG: +-v} $CPUSET_OPT -u " $RUNUSER " -g " $RUNGROUP " \
241241 -m $SCRIPTMEMLIMIT -t $SCRIPTTIMELIMIT --no-core \
You can’t perform that action at this time.
0 commit comments