diff --git a/examples/guess/output_validators/guess_validator/validate.cc b/examples/guess/output_validator/guess_validator/validate.cc similarity index 100% rename from examples/guess/output_validators/guess_validator/validate.cc rename to examples/guess/output_validator/guess_validator/validate.cc diff --git a/examples/guess/output_validators/guess_validator/validate.h b/examples/guess/output_validator/guess_validator/validate.h similarity index 100% rename from examples/guess/output_validators/guess_validator/validate.h rename to examples/guess/output_validator/guess_validator/validate.h diff --git a/examples/guess/problem.yaml b/examples/guess/problem.yaml index 877468d4..860b1fff 100644 --- a/examples/guess/problem.yaml +++ b/examples/guess/problem.yaml @@ -1,11 +1,14 @@ +problem_format_version: 2023-07-draft +uuid: 5ca6ba5b-36d5-4eff-8aa7-d967cbc4375e source: Kattis license: cc by-sa -validation: custom interactive +type: interactive name: Guess the Number # Override standard limits: say that the TLE solutions provided should # be at least 4 times above the time limit in order for us to be # happy. limits: - time_safety_margin: 4 + time_multipliers: + time_limit_to_tle: 4 diff --git a/examples/guess/problem_statement/problem.en.tex b/examples/guess/statement/problem.en.tex similarity index 100% rename from examples/guess/problem_statement/problem.en.tex rename to examples/guess/statement/problem.en.tex diff --git a/examples/guess/problem_statement/problem.sv.md b/examples/guess/statement/problem.sv.md similarity index 98% rename from examples/guess/problem_statement/problem.sv.md rename to examples/guess/statement/problem.sv.md index c1edbd67..9c49030c 100644 --- a/examples/guess/problem_statement/problem.sv.md +++ b/examples/guess/statement/problem.sv.md @@ -4,7 +4,7 @@ var för stor, för liten eller rätt. Du får bara $10$ gissningar, använd dem klokt! -## Interaktion +# Interaktion Ditt program ska skriva ut gissningar om talet. En gissning är en rad som enbart innehåller ett heltal mellan $1$ och $1000$. Efter varje gissning måste du flusha standard out. diff --git a/examples/oddecho/problem.yaml b/examples/oddecho/problem.yaml index 2129dd93..dde683a1 100644 --- a/examples/oddecho/problem.yaml +++ b/examples/oddecho/problem.yaml @@ -1,7 +1,7 @@ +problem_format_version: 2023-07-draft +uuid: 025dfeea-eb85-4532-94d1-3108ec03c80f license: cc by-sa -author: Johan Sannemo +credits: Johan Sannemo source: Principles of Algorithmic Problem Solving type: scoring name: Odd Echo -grading: - show_test_data_groups: true diff --git a/examples/oddecho/problem_statement/cave.jpg b/examples/oddecho/statement/cave.jpg similarity index 100% rename from examples/oddecho/problem_statement/cave.jpg rename to examples/oddecho/statement/cave.jpg diff --git a/examples/oddecho/problem_statement/problem.en.tex b/examples/oddecho/statement/problem.en.tex similarity index 100% rename from examples/oddecho/problem_statement/problem.en.tex rename to examples/oddecho/statement/problem.en.tex diff --git a/examples/oddecho/problem_statement/problem.sv.md b/examples/oddecho/statement/problem.sv.md similarity index 100% rename from examples/oddecho/problem_statement/problem.sv.md rename to examples/oddecho/statement/problem.sv.md diff --git a/guess.pdf b/guess.pdf new file mode 100644 index 00000000..a0b4baeb Binary files /dev/null and b/guess.pdf differ diff --git a/problemtools/problem2pdf.py b/problemtools/problem2pdf.py index a2ee466d..99a72e65 100644 --- a/problemtools/problem2pdf.py +++ b/problemtools/problem2pdf.py @@ -45,6 +45,8 @@ def md2pdf(options: argparse.Namespace) -> bool: print(f'Error compiling Markdown to pdf: {e.stderr}') return False + # If success is not assigned somehow, it is considered a failure + success = False try: with open(temp_tex_file, 'r', encoding='utf-8') as f: tex = f.read() @@ -88,13 +90,11 @@ def replacer(match): with open(temp_tex_file, 'w', encoding='utf-8') as f: f.write(tex) - status = latex2pdf(options) - if status != 0: - return False + success = latex2pdf(options) finally: temp_tex_file.unlink() - return status == 0 + return success def latex2pdf(options: argparse.Namespace) -> bool: diff --git a/problemtools/verifyproblem.py b/problemtools/verifyproblem.py index 70478316..bafe9514 100644 --- a/problemtools/verifyproblem.py +++ b/problemtools/verifyproblem.py @@ -1227,6 +1227,12 @@ class OutputValidators(ProblemPart): PART_NAME = 'output_validator' def setup(self): + if ( + self.problem.format.name != formatversion.VERSION_LEGACY + and (Path(self.problem.probdir) / 'output_validators').exists() + ): + self.error('output_validators is not supported after Legacy; please use output_validator instead') + self._validators = run.find_programs( os.path.join(self.problem.probdir, self.problem.format.output_validator_directory), language_config=self.problem.language_config,