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
1451
1451
$ passdir = $ testcasedir . '/ ' . $ passCnt ;
1452
1452
mkdir ($ passdir , 0755 , true );
1453
1453
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
+
1454
1464
// Copy program with all possible additional files to testcase
1455
1465
// dir. Use hardlinks to preserve space with big executables.
1456
1466
$ programdir = $ passdir . '/execdir ' ;
Original file line number Diff line number Diff line change @@ -197,7 +197,7 @@ if [ $COMBINED_RUN_COMPARE -eq 1 ]; then
197
197
# A combined run and compare script may now already need the
198
198
# feedback directory, and perhaps access to the test answers (but
199
199
# only the original that lives outside the chroot).
200
- mkdir feedback
200
+ mkdir -p feedback
201
201
RUNARGS=" $RUNARGS $TESTOUT compare.meta feedback"
202
202
fi
203
203
@@ -234,8 +234,8 @@ if [ $COMBINED_RUN_COMPARE -eq 0 ]; then
234
234
235
235
exitcode=0
236
236
# 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
239
239
240
240
runcheck $GAINROOT " $RUNGUARD " ${DEBUG: +-v} $CPUSET_OPT -u " $RUNUSER " -g " $RUNGROUP " \
241
241
-m $SCRIPTMEMLIMIT -t $SCRIPTTIMELIMIT --no-core \
You can’t perform that action at this time.
0 commit comments