Skip to content

Commit

Permalink
Only set expected results during problem import.
Browse files Browse the repository at this point in the history
Otherwise, if you edit and resubmit or replay submissions (even when
submitting as other teams) it would show up in the judging verifier.
  • Loading branch information
meisterT committed Apr 9, 2024
1 parent 2e16f78 commit 350e43b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions gitlab/integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,15 @@ section_end judging

# We expect
# - two submissions with ambiguous outcome,
# - no submissions without magic string,
# - one submissions submitted through the submit client, and thus the magic string ignored,
# - and all submissions to be judged.
if [ $NUMNOTVERIFIED -ne 2 ] || [ $NUMNOMAGIC -ne 0 ] || [ $NUMSUBS -gt $((NUMVERIFIED+NUMNOTVERIFIED)) ]; then
if [ $NUMNOTVERIFIED -ne 2 ] || [ $NUMNOMAGIC -ne 1 ] || [ $NUMSUBS -gt $((NUMVERIFIED+NUMNOTVERIFIED)) ]; then
section_start error "Short error description"
# We error out below anyway, so no need to fail earlier than that.
set +e
echo "verified subs: $NUMVERIFIED, unverified subs: $NUMNOTVERIFIED, total subs: $NUMSUBS"
echo "(expected 2 submissions to be unverified, but all to be processed)"
echo "Of these $NUMNOMAGIC do not have the EXPECTED_RESULTS string (should be 0)."
echo "Of these $NUMNOMAGIC do not have the EXPECTED_RESULTS string (should be 1)."
curl $CURLOPTS "http://localhost/domjudge/jury/judging-verifier?verify_multiple=1" | w3m -dump -T text/html
section_end error

Expand Down
4 changes: 3 additions & 1 deletion webapp/src/Service/SubmissionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,9 @@ public function submitSolution(

// First look up any expected results in all submission files to minimize the
// SQL transaction time below.
if ($this->dj->checkrole('jury')) {
// Only do this for problem import submissions, as we do not want this for re-submitted submissions nor
// submissions that come through the API, e.g. when doing a replay of an old contest.
if ($this->dj->checkrole('jury') && $source == 'problem import') {
$results = null;
foreach ($files as $file) {
$fileResult = self::getExpectedResults(file_get_contents($file->getRealPath()),
Expand Down

0 comments on commit 350e43b

Please sign in to comment.