Skip to content

i_1231 Handle ignore_sample if no sample folder in root#1260

Open
johnbrvc wants to merge 1 commit into
i1006_point_scoringfrom
i1231_ignore_sample_but_no_sample
Open

i_1231 Handle ignore_sample if no sample folder in root#1260
johnbrvc wants to merge 1 commit into
i1006_point_scoringfrom
i1231_ignore_sample_but_no_sample

Conversation

@johnbrvc
Copy link
Copy Markdown
Collaborator

Description of what the PR does

If a misconfigured contest specifies ignore_sample and there is no sample folder we log a message and handle it as if the ignore_sample was not present. That is, this is no loner a fatal error.

Noticed during the NAC2026 Challenge. This PR was (successfully) used during the NAC2026 Challenge to address this issue.

Issue which the PR addresses

Fixes #1231

Environment in which the PR was developed (OS,IDE, Java version, etc.)

java version "1.8.0_321"
Java(TM) SE Runtime Environment (build 1.8.0_321-b07)
Java HotSpot(TM) 64-Bit Server VM (build 25.321-b07, mixed mode)

Ubuntu 24.04.3

Precise steps for testing the PR (i.e., how to demonstrate that it works correctly)

Preface: It took me a GREAT DEAL of time to write and configure this test procedure. I am trying to take the difficultly out of the testing equation by supplying as much "turn-key" testing tools as possible now. This test procedure includes a ZIP File attached here. The zip file is "Windows" centric, meaning, it is meant to be used on Windows. This is not to say you can't test this on Linux, of course you can, but you will have to make some changes to the configuration: specifically, the problem.yaml, to make use of the non-windows, non-.exe version of the output validator. In addition, you'll have to modify the judge's data path accordingly. Also, you'll have to copy the system-linux.yaml over system.yaml so you use Linux compilers instead of Windows based ones. The mode of the "validate" program in the output_validators/validator folder will likely have to be changed to make it executable.

If you are going to test on Windows, nothing in the configuration has to be changed unless you choose NOT to locate the extracted ZIP file in C:\tmp. If you want this test procedure to be as painless as possible, I suggest you extract this ZIP File in a folder called C:\tmp. Extracting it there will create: C:\tmp\i1231-contest which is a FULL one problem contest to test this PR. The problem came from the NAC2026 Challenge (specifically, the "ComputeAllocation" problem.) I have precompiled the validator and preconfigured the problem.yaml to use the validator. All that being said, if you have problems testing this PR I will be extremely surprised.

Prerequisite: You must have g++ installed on your PC. From a command prompt, you should be able to type g++ --version and get valid output. If not, good luck and all bets are off and you are on your own:

C:\tmp>g++ --version
g++ (x86_64-win32-seh-rev2, Built by MinGW-Builds project) 14.2.0
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  1. Extract the attached zip in the C:\tmp folder to produce: C:\tmp\i1231-contest
  2. Start a clean server using the extracted contest - you can paste this command line into Eclipse's arguments for the server: --server --login s --contestpassword contest --load /tmp/i1231-contest
  3. Start the contest from the Times tab on the server by pressing Start All
  4. Start up a pc2team client and log in as team1 with password team1.
  5. On the team client Submit Run tab, choose the only problem, language C++ and select the main file: C:\tmp\i1231-contest\config\computeallocation\submissions\accepted\tourist.cpp - this is one of the judge's accepted solutions.
  6. Press the Submit button. You should get back an submitted acknowledgment.
  7. Start up a pc2judge client and log in as judge1 with password judge1.
  8. Immediately, the judge should start judging the submissions. The team should get back an Accepted judgment.
  9. In the pc2v9 main folder (where the judge is run from), you should find the execute folder for the run. It will be called: ex_1_A_computeallocation_1_cpp_judge1
  10. Browse to this folder and find the graderLog-data.txt file and open it with notepad or cat or whatever viewing program you want. You should see the following, indicating the PR has worked properly. (Note the Notice: message.)

Grader Settings:
  verdictMode = worst_error
  scoringMode = sum
  acceptIfAnyAccepted = false
  ignoreSample = true
TestCases:
  1:AC 50.0
Notice: ignore_sample specified, but no sample group - ignoring it.

RESULT:AC 50.0

I misconfigured contest that specifies ignore_sample with no sample folder shouldn't cause an error.  We should log a message and handle it as if the ignore_sample was not present.
@johnbrvc johnbrvc added this to the 9.11.0 milestone Apr 15, 2026
@johnbrvc johnbrvc self-assigned this Apr 15, 2026
Copy link
Copy Markdown
Contributor

@clevengr clevengr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed the code changes; they all look reasonable to me.
I followed the test procedure specified in the PR and it worked as intended.
I also started up a WTI team client and verified that it works as intended with WTI submissions as well (not that I expected it wouldn't; just being thorough).

Kudos for providing the fully-configured sample contest; it made test extremely easy (it took only about 10 minutes) when otherwise I think it would have taken me hours to figure out how to set up a valid test. Nicely done!

I approve the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants