-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1eecdff
commit 0294c36
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import argparse | ||
|
||
from sinol_make import util | ||
from sinol_make.helpers import package_util | ||
from sinol_make.contest_types.default import DefaultContest | ||
|
||
|
||
class OIJContest(DefaultContest): | ||
""" | ||
Contest type for Polish Junior Olympiad in Informatics. | ||
""" | ||
|
||
def get_type(self) -> str: | ||
return "oij" | ||
|
||
def argument_overrides(self, args: argparse.Namespace) -> argparse.Namespace: | ||
""" | ||
Add arguments for features required by OIJ contest | ||
""" | ||
args.export_ocen = True | ||
return args | ||
|
||
def verify_pre_gen(self): | ||
""" | ||
Verify if scores sum up to 100. | ||
""" | ||
config = package_util.get_config() | ||
if 'scores' not in config: | ||
util.exit_with_error("Scores are not defined in config.yml.") | ||
total_score = sum(config['scores'].values()) | ||
if total_score != 100: | ||
util.exit_with_error(f"Total score in config is {total_score}, but should be 100.") |