judge-server icon indicating copy to clipboard operation
judge-server copied to clipboard

Problem configuration templates

Open Xyene opened this issue 6 years ago • 0 comments

It's often the case that some classes of problems repeat the same input format across all problems. For example, all ECOO problems require the same fd_redirects declaration, and all have exactly the same test-case format. It would be good to add support for "extending" problem YAMLs off some base configuration.

The proposed approach is the addition of an extend key in a problem YAML, that denotes an extension of a user-defined template.

init.yml:

extend: ecoo
...

judge.yml:

id: ...
key: ...
problem_template_directory: /code/problem-templates
...

/code/problem-templates/ecoo.(yml|yaml):

fd_redirects:
    - 0: ...
...

A problem should be allowed to extend multiple templates, in which case extend will be a list, and the templates will be processed in the list's order.

Xyene avatar Dec 08 '18 02:12 Xyene