From 25ebc87db80187b7d6544f8b2642a228f56574c5 Mon Sep 17 00:00:00 2001 From: Dinh Date: Thu, 23 Jan 2020 20:32:46 -0600 Subject: [PATCH] add custom checker --- .gitignore | 2 + | 393 ++++++++++++++++++++ judge/migrations/0098_auto_20200123_2136.py | 155 ++++++++ judge/migrations/0099_auto_20200123_2228.py | 30 ++ judge/models/problem_data.py | 8 +- judge/utils/problem_data.py | 5 + judge/views/problem_data.py | 2 +- templates/problem/data.html | 8 + 8 files changed, 601 insertions(+), 2 deletions(-) create mode 100644 create mode 100644 judge/migrations/0098_auto_20200123_2136.py create mode 100644 judge/migrations/0099_auto_20200123_2228.py diff --git a/.gitignore b/.gitignore index de1d76b..8cfbd3f 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,5 @@ resources/content-description.css resources/ranks.css resources/table.css sass_processed + + diff --git a/ b/ new file mode 100644 index 0000000..6f7e5d5 --- /dev/null +++ b/ @@ -0,0 +1,393 @@ +INFO 2020-01-23 20:59:54,926 judgehandler Judge connected from: ('127.0.0.1', 49606) +INFO 2020-01-23 20:59:54,927 judgehandler Judge authenticated: ('127.0.0.1', 49606) (judge1) +INFO 2020-01-23 21:00:43,918 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:00:43,922 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:00:43,963 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:01:03,244 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:01:10,754 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:01:10,794 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:01:16,007 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:01:20,593 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:01:42,596 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:01:42,734 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:01:56,433 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:01:56,435 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:01:56,474 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:02:32,321 judgelist Free judges: 1 +INFO 2020-01-23 21:02:32,322 judgelist Dispatched submission 34 to: judge1 +INFO 2020-01-23 21:02:32,346 judgehandler Submission acknowledged: 34 +INFO 2020-01-23 21:02:32,443 judgehandler judge1: Grading has begun on: 34 +ERROR 2020-01-23 21:02:32,602 judgehandler Judge judge1 failed while handling submission 34 +Traceback (most recent call last): + File "/home/cuom1999/DMOJ/site/judge/bridge/judgehandler.py", line 230, in on_internal_error + raise ValueError('\n\n' + packet['message']) +ValueError: + +Traceback (most recent call last): + File "/usr/local/lib/python3.6/dist-packages/dmoj/judge.py", line 164, in grading_cleanup_wrapper + self._block_and_grade(problem, language, source, short_circuit, meta, report=report) + File "/usr/local/lib/python3.6/dist-packages/dmoj/judge.py", line 116, in _block_and_grade + short_circuit=short_circuit): + File "/usr/local/lib/python3.6/dist-packages/dmoj/judge.py", line 208, in grade_cases + result = grader.grade(case) + File "/usr/local/lib/python3.6/dist-packages/dmoj/graders/standard.py", line 41, in grade + check = self.check_result(case, result) + File "/usr/local/lib/python3.6/dist-packages/dmoj/graders/standard.py", line 104, in check_result + execution_time=result.execution_time) +TypeError: check() got an unexpected keyword argument 'submission_source' + +INFO 2020-01-23 21:02:32,908 judgelist Judge available after grading 34: judge1 +INFO 2020-01-23 21:03:00,574 judgelist Free judges: 1 +INFO 2020-01-23 21:03:00,574 judgelist Dispatched submission 34 to: judge1 +INFO 2020-01-23 21:03:00,585 judgehandler Submission acknowledged: 34 +INFO 2020-01-23 21:03:00,625 judgehandler judge1: Grading has begun on: 34 +ERROR 2020-01-23 21:03:00,713 judgehandler Judge judge1 failed while handling submission 34 +Traceback (most recent call last): + File "/home/cuom1999/DMOJ/site/judge/bridge/judgehandler.py", line 230, in on_internal_error + raise ValueError('\n\n' + packet['message']) +ValueError: + +Traceback (most recent call last): + File "/usr/local/lib/python3.6/dist-packages/dmoj/judge.py", line 164, in grading_cleanup_wrapper + self._block_and_grade(problem, language, source, short_circuit, meta, report=report) + File "/usr/local/lib/python3.6/dist-packages/dmoj/judge.py", line 116, in _block_and_grade + short_circuit=short_circuit): + File "/usr/local/lib/python3.6/dist-packages/dmoj/judge.py", line 208, in grade_cases + result = grader.grade(case) + File "/usr/local/lib/python3.6/dist-packages/dmoj/graders/standard.py", line 41, in grade + check = self.check_result(case, result) + File "/usr/local/lib/python3.6/dist-packages/dmoj/graders/standard.py", line 104, in check_result + execution_time=result.execution_time) +TypeError: check() got an unexpected keyword argument 'submission_source' + +INFO 2020-01-23 21:03:00,724 judgelist Judge available after grading 34: judge1 +INFO 2020-01-23 21:05:00,306 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:05:00,341 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:05:09,432 judgelist Free judges: 1 +INFO 2020-01-23 21:05:09,433 judgelist Dispatched submission 34 to: judge1 +INFO 2020-01-23 21:05:09,500 judgehandler Submission acknowledged: 34 +INFO 2020-01-23 21:05:09,535 judgehandler judge1: Grading has begun on: 34 +ERROR 2020-01-23 21:05:09,605 judgehandler Judge judge1 failed while handling submission 34 +Traceback (most recent call last): + File "/home/cuom1999/DMOJ/site/judge/bridge/judgehandler.py", line 230, in on_internal_error + raise ValueError('\n\n' + packet['message']) +ValueError: + +Traceback (most recent call last): + File "/usr/local/lib/python3.6/dist-packages/dmoj/judge.py", line 164, in grading_cleanup_wrapper + self._block_and_grade(problem, language, source, short_circuit, meta, report=report) + File "/usr/local/lib/python3.6/dist-packages/dmoj/judge.py", line 116, in _block_and_grade + short_circuit=short_circuit): + File "/usr/local/lib/python3.6/dist-packages/dmoj/judge.py", line 208, in grade_cases + result = grader.grade(case) + File "/usr/local/lib/python3.6/dist-packages/dmoj/graders/standard.py", line 41, in grade + check = self.check_result(case, result) + File "/usr/local/lib/python3.6/dist-packages/dmoj/graders/standard.py", line 104, in check_result + execution_time=result.execution_time) +TypeError: check() got an unexpected keyword argument 'submission_source' + +INFO 2020-01-23 21:05:09,614 judgelist Judge available after grading 34: judge1 +INFO 2020-01-23 21:05:26,728 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:05:26,764 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:05:30,048 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:05:30,086 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:05:44,198 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:05:44,200 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:05:44,234 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:05:46,193 judgelist Free judges: 1 +INFO 2020-01-23 21:05:46,194 judgelist Dispatched submission 34 to: judge1 +INFO 2020-01-23 21:05:46,210 judgehandler Submission acknowledged: 34 +INFO 2020-01-23 21:05:46,248 judgehandler judge1: Grading has begun on: 34 +INFO 2020-01-23 21:05:46,413 judgehandler judge1: 3 test case(s) completed on: 34 +INFO 2020-01-23 21:05:46,511 judgehandler judge1: Grading has ended on: 34 +INFO 2020-01-23 21:05:46,511 judgelist Judge available after grading 34: judge1 +INFO 2020-01-23 21:06:10,809 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:06:10,852 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:06:20,552 judgelist Free judges: 1 +INFO 2020-01-23 21:06:20,552 judgelist Dispatched submission 34 to: judge1 +INFO 2020-01-23 21:06:20,568 judgehandler Submission acknowledged: 34 +INFO 2020-01-23 21:06:20,599 judgehandler judge1: Grading has begun on: 34 +ERROR 2020-01-23 21:06:20,761 judgehandler Judge judge1 failed while handling submission 34 +Traceback (most recent call last): + File "/home/cuom1999/DMOJ/site/judge/bridge/judgehandler.py", line 230, in on_internal_error + raise ValueError('\n\n' + packet['message']) +ValueError: + +Traceback (most recent call last): + File "/usr/local/lib/python3.6/dist-packages/dmoj/judge.py", line 164, in grading_cleanup_wrapper + self._block_and_grade(problem, language, source, short_circuit, meta, report=report) + File "/usr/local/lib/python3.6/dist-packages/dmoj/judge.py", line 116, in _block_and_grade + short_circuit=short_circuit): + File "/usr/local/lib/python3.6/dist-packages/dmoj/judge.py", line 208, in grade_cases + result = grader.grade(case) + File "/usr/local/lib/python3.6/dist-packages/dmoj/graders/standard.py", line 41, in grade + check = self.check_result(case, result) + File "/usr/local/lib/python3.6/dist-packages/dmoj/graders/standard.py", line 104, in check_result + execution_time=result.execution_time) +TypeError: check() got an unexpected keyword argument 'submission_source' + +INFO 2020-01-23 21:06:20,797 judgelist Judge available after grading 34: judge1 +INFO 2020-01-23 21:06:40,778 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:06:41,412 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:07:05,264 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:07:05,306 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:07:08,465 judgelist Free judges: 1 +INFO 2020-01-23 21:07:08,465 judgelist Dispatched submission 34 to: judge1 +INFO 2020-01-23 21:07:08,482 judgehandler Submission acknowledged: 34 +INFO 2020-01-23 21:07:08,521 judgehandler judge1: Grading has begun on: 34 +ERROR 2020-01-23 21:07:08,597 judgehandler Judge judge1 failed while handling submission 34 +Traceback (most recent call last): + File "/home/cuom1999/DMOJ/site/judge/bridge/judgehandler.py", line 230, in on_internal_error + raise ValueError('\n\n' + packet['message']) +ValueError: + +Traceback (most recent call last): + File "/usr/local/lib/python3.6/dist-packages/dmoj/judge.py", line 164, in grading_cleanup_wrapper + self._block_and_grade(problem, language, source, short_circuit, meta, report=report) + File "/usr/local/lib/python3.6/dist-packages/dmoj/judge.py", line 116, in _block_and_grade + short_circuit=short_circuit): + File "/usr/local/lib/python3.6/dist-packages/dmoj/judge.py", line 208, in grade_cases + result = grader.grade(case) + File "/usr/local/lib/python3.6/dist-packages/dmoj/graders/standard.py", line 41, in grade + check = self.check_result(case, result) + File "/usr/local/lib/python3.6/dist-packages/dmoj/graders/standard.py", line 104, in check_result + execution_time=result.execution_time) +TypeError: check() got an unexpected keyword argument 'judge_input' + +INFO 2020-01-23 21:07:08,607 judgelist Judge available after grading 34: judge1 +INFO 2020-01-23 21:07:34,312 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:07:34,601 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:07:42,576 judgelist Free judges: 1 +INFO 2020-01-23 21:07:42,577 judgelist Dispatched submission 34 to: judge1 +INFO 2020-01-23 21:07:42,581 judgehandler Submission acknowledged: 34 +INFO 2020-01-23 21:07:42,619 judgehandler judge1: Grading has begun on: 34 +ERROR 2020-01-23 21:07:42,758 judgehandler Judge judge1 failed while handling submission 34 +Traceback (most recent call last): + File "/home/cuom1999/DMOJ/site/judge/bridge/judgehandler.py", line 230, in on_internal_error + raise ValueError('\n\n' + packet['message']) +ValueError: + +Traceback (most recent call last): + File "/usr/local/lib/python3.6/dist-packages/dmoj/judge.py", line 164, in grading_cleanup_wrapper + self._block_and_grade(problem, language, source, short_circuit, meta, report=report) + File "/usr/local/lib/python3.6/dist-packages/dmoj/judge.py", line 116, in _block_and_grade + short_circuit=short_circuit): + File "/usr/local/lib/python3.6/dist-packages/dmoj/judge.py", line 208, in grade_cases + result = grader.grade(case) + File "/usr/local/lib/python3.6/dist-packages/dmoj/graders/standard.py", line 46, in grade + check = CheckerResult(check, case.points if check else 0.0) + File "/usr/local/lib/python3.6/dist-packages/dmoj/result.py", line 73, in __init__ + assert isinstance(passed, bool) +AssertionError + +INFO 2020-01-23 21:07:42,779 judgelist Judge available after grading 34: judge1 +INFO 2020-01-23 21:07:52,845 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:07:52,879 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:07:56,775 judgelist Free judges: 1 +INFO 2020-01-23 21:07:56,776 judgelist Dispatched submission 34 to: judge1 +INFO 2020-01-23 21:07:56,792 judgehandler Submission acknowledged: 34 +INFO 2020-01-23 21:07:56,830 judgehandler judge1: Grading has begun on: 34 +INFO 2020-01-23 21:07:56,900 judgehandler judge1: 1 test case(s) completed on: 34 +INFO 2020-01-23 21:07:57,003 judgehandler judge1: 2 test case(s) completed on: 34 +INFO 2020-01-23 21:07:57,071 judgehandler judge1: Grading has ended on: 34 +INFO 2020-01-23 21:07:57,071 judgelist Judge available after grading 34: judge1 +INFO 2020-01-23 21:08:16,944 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:08:16,982 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:08:19,552 judgelist Free judges: 1 +INFO 2020-01-23 21:08:19,552 judgelist Dispatched submission 34 to: judge1 +INFO 2020-01-23 21:08:19,622 judgehandler Submission acknowledged: 34 +INFO 2020-01-23 21:08:19,656 judgehandler judge1: Grading has begun on: 34 +INFO 2020-01-23 21:08:19,779 judgehandler judge1: 3 test case(s) completed on: 34 +INFO 2020-01-23 21:08:19,850 judgehandler judge1: Grading has ended on: 34 +INFO 2020-01-23 21:08:19,850 judgelist Judge available after grading 34: judge1 +INFO 2020-01-23 21:08:45,463 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:08:45,502 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:08:47,928 judgelist Free judges: 1 +INFO 2020-01-23 21:08:47,928 judgelist Dispatched submission 34 to: judge1 +INFO 2020-01-23 21:08:47,945 judgehandler Submission acknowledged: 34 +INFO 2020-01-23 21:08:47,986 judgehandler judge1: Grading has begun on: 34 +INFO 2020-01-23 21:08:48,171 judgehandler judge1: 2 test case(s) completed on: 34 +INFO 2020-01-23 21:08:48,256 judgehandler judge1: 1 test case(s) completed on: 34 +INFO 2020-01-23 21:08:48,326 judgehandler judge1: Grading has ended on: 34 +INFO 2020-01-23 21:08:48,326 judgelist Judge available after grading 34: judge1 +INFO 2020-01-23 21:09:44,861 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:09:44,902 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:09:45,340 judgelist Free judges: 1 +INFO 2020-01-23 21:09:45,340 judgelist Dispatched submission 34 to: judge1 +INFO 2020-01-23 21:09:45,379 judgehandler Submission acknowledged: 34 +INFO 2020-01-23 21:09:45,477 judgehandler judge1: Grading has begun on: 34 +ERROR 2020-01-23 21:09:45,549 judgehandler Judge judge1 failed while handling submission 34 +Traceback (most recent call last): + File "/home/cuom1999/DMOJ/site/judge/bridge/judgehandler.py", line 230, in on_internal_error + raise ValueError('\n\n' + packet['message']) +ValueError: + +Traceback (most recent call last): + File "/usr/local/lib/python3.6/dist-packages/dmoj/judge.py", line 164, in grading_cleanup_wrapper + self._block_and_grade(problem, language, source, short_circuit, meta, report=report) + File "/usr/local/lib/python3.6/dist-packages/dmoj/judge.py", line 116, in _block_and_grade + short_circuit=short_circuit): + File "/usr/local/lib/python3.6/dist-packages/dmoj/judge.py", line 208, in grade_cases + result = grader.grade(case) + File "/usr/local/lib/python3.6/dist-packages/dmoj/graders/standard.py", line 41, in grade + check = self.check_result(case, result) + File "/usr/local/lib/python3.6/dist-packages/dmoj/graders/standard.py", line 104, in check_result + execution_time=result.execution_time) + File "/home/cuom1999/DMOJ/problems/aplusb/checker.py", line 3, in check + print(a[0]) +TypeError: 'map' object is not subscriptable + +INFO 2020-01-23 21:09:45,567 judgelist Judge available after grading 34: judge1 +INFO 2020-01-23 21:10:05,615 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:10:05,654 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:14:10,308 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:14:10,345 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:14:19,207 judgelist Free judges: 1 +INFO 2020-01-23 21:14:19,207 judgelist Dispatched submission 34 to: judge1 +INFO 2020-01-23 21:14:19,274 judgehandler Submission acknowledged: 34 +INFO 2020-01-23 21:14:19,310 judgehandler judge1: Grading has begun on: 34 +INFO 2020-01-23 21:14:19,394 judgehandler judge1: 1 test case(s) completed on: 34 +INFO 2020-01-23 21:14:19,482 judgehandler judge1: 2 test case(s) completed on: 34 +INFO 2020-01-23 21:14:19,551 judgehandler judge1: Grading has ended on: 34 +INFO 2020-01-23 21:14:19,551 judgelist Judge available after grading 34: judge1 +INFO 2020-01-23 21:15:36,115 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:15:36,120 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:15:36,152 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:15:43,219 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:15:43,222 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:15:43,418 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:17:00,163 judgelist Free judges: 1 +INFO 2020-01-23 21:17:00,163 judgelist Dispatched submission 34 to: judge1 +INFO 2020-01-23 21:17:00,179 judgehandler Submission acknowledged: 34 +INFO 2020-01-23 21:17:00,221 judgehandler judge1: Grading has begun on: 34 +ERROR 2020-01-23 21:17:00,497 judgehandler Judge judge1 failed while handling submission 34 +Traceback (most recent call last): + File "/home/cuom1999/DMOJ/site/judge/bridge/judgehandler.py", line 230, in on_internal_error + raise ValueError('\n\n' + packet['message']) +ValueError: + +Traceback (most recent call last): + File "/usr/local/lib/python3.6/dist-packages/dmoj/judge.py", line 164, in grading_cleanup_wrapper + self._block_and_grade(problem, language, source, short_circuit, meta, report=report) + File "/usr/local/lib/python3.6/dist-packages/dmoj/judge.py", line 116, in _block_and_grade + short_circuit=short_circuit): + File "/usr/local/lib/python3.6/dist-packages/dmoj/judge.py", line 208, in grade_cases + result = grader.grade(case) + File "/usr/local/lib/python3.6/dist-packages/dmoj/graders/standard.py", line 41, in grade + check = self.check_result(case, result) + File "/usr/local/lib/python3.6/dist-packages/dmoj/graders/standard.py", line 90, in check_result + checker = case.checker() + File "/usr/local/lib/python3.6/dist-packages/dmoj/problem.py", line 345, in checker + checker = self.problem.load_checker(name) + File "/usr/local/lib/python3.6/dist-packages/dmoj/problem.py", line 152, in load_checker + self._checkers[name] = checker = load_module_from_file(os.path.join(get_problem_root(self.id), name)) + File "/usr/local/lib/python3.6/dist-packages/dmoj/utils/module.py", line 18, in load_module_from_file + return load_module(name, f.read(), os.path.abspath(filename)) + File "/usr/local/lib/python3.6/dist-packages/dmoj/utils/module.py", line 9, in load_module + exec(compile(code, filename or '', 'exec'), mod.__dict__) + File "/home/cuom1999/DMOJ/problems/aplusb/checker.py", line 6, in + validator_path = os.path.join(get_problem_root('problem_id'), 'validator.cpp') + File "/usr/lib/python3.6/posixpath.py", line 80, in join + a = os.fspath(a) +TypeError: expected str, bytes or os.PathLike object, not NoneType + +INFO 2020-01-23 21:17:00,535 judgelist Judge available after grading 34: judge1 +INFO 2020-01-23 21:17:21,510 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:17:21,579 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:17:24,798 judgelist Free judges: 1 +INFO 2020-01-23 21:17:24,798 judgelist Dispatched submission 34 to: judge1 +INFO 2020-01-23 21:17:24,867 judgehandler Submission acknowledged: 34 +INFO 2020-01-23 21:17:24,903 judgehandler judge1: Grading has begun on: 34 +ERROR 2020-01-23 21:17:24,972 judgehandler Judge judge1 failed while handling submission 34 +Traceback (most recent call last): + File "/home/cuom1999/DMOJ/site/judge/bridge/judgehandler.py", line 230, in on_internal_error + raise ValueError('\n\n' + packet['message']) +ValueError: + +Traceback (most recent call last): + File "/usr/local/lib/python3.6/dist-packages/dmoj/problem.py", line 345, in checker + checker = self.problem.load_checker(name) + File "/usr/local/lib/python3.6/dist-packages/dmoj/problem.py", line 152, in load_checker + self._checkers[name] = checker = load_module_from_file(os.path.join(get_problem_root(self.id), name)) + File "/usr/local/lib/python3.6/dist-packages/dmoj/utils/module.py", line 18, in load_module_from_file + return load_module(name, f.read(), os.path.abspath(filename)) + File "/usr/local/lib/python3.6/dist-packages/dmoj/utils/module.py", line 9, in load_module + exec(compile(code, filename or '', 'exec'), mod.__dict__) + File "/home/cuom1999/DMOJ/problems/aplusb/checker.py", line 8, in + with open(validator_path, 'r') as validator_source: +FileNotFoundError: [Errno 2] No such file or directory: '/home/cuom1999/DMOJ/problems/aplusb/validator.cpp' + +During handling of the above exception, another exception occurred: + +Traceback (most recent call last): + File "/usr/local/lib/python3.6/dist-packages/dmoj/judge.py", line 164, in grading_cleanup_wrapper + self._block_and_grade(problem, language, source, short_circuit, meta, report=report) + File "/usr/local/lib/python3.6/dist-packages/dmoj/judge.py", line 116, in _block_and_grade + short_circuit=short_circuit): + File "/usr/local/lib/python3.6/dist-packages/dmoj/judge.py", line 208, in grade_cases + result = grader.grade(case) + File "/usr/local/lib/python3.6/dist-packages/dmoj/graders/standard.py", line 41, in grade + check = self.check_result(case, result) + File "/usr/local/lib/python3.6/dist-packages/dmoj/graders/standard.py", line 90, in check_result + checker = case.checker() + File "/usr/local/lib/python3.6/dist-packages/dmoj/problem.py", line 347, in checker + raise InvalidInitException('checker module path does not exist: %s' % name) +dmoj.config.InvalidInitException: checker module path does not exist: checker.py + +INFO 2020-01-23 21:17:24,983 judgelist Judge available after grading 34: judge1 +INFO 2020-01-23 21:17:52,746 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:18:03,849 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:18:09,694 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:18:16,110 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:18:20,167 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:19:15,956 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:19:26,564 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:19:26,816 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:20:12,863 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:20:21,939 judgehandler judge1: Updated problem list +INFO 2020-01-23 21:40:39,960 judgehandler judge1: Updated problem list +INFO 2020-01-23 22:03:01,200 judgehandler judge1: Updated problem list +INFO 2020-01-23 22:29:50,843 judgehandler judge1: Updated problem list +INFO 2020-01-23 22:29:52,146 judgehandler judge1: Updated problem list +INFO 2020-01-23 22:29:58,702 judgehandler judge1: Updated problem list +INFO 2020-01-23 22:30:10,710 judgehandler judge1: Updated problem list +INFO 2020-01-23 22:30:18,273 judgehandler judge1: Updated problem list +INFO 2020-01-23 22:46:52,907 judgehandler judge1: Updated problem list +INFO 2020-01-24 01:35:15,083 judgehandler Judge connected from: ('127.0.0.1', 34192) +INFO 2020-01-24 01:35:15,233 judgehandler Judge authenticated: ('127.0.0.1', 34192) (judge1) +INFO 2020-01-24 01:43:09,664 judgehandler judge1: Updated problem list +INFO 2020-01-24 01:43:09,702 judgehandler judge1: Updated problem list +INFO 2020-01-24 01:46:03,455 judgehandler judge1: Updated problem list +INFO 2020-01-24 01:46:05,299 judgehandler judge1: Updated problem list +INFO 2020-01-24 02:04:07,710 judgehandler judge1: Updated problem list +INFO 2020-01-24 02:04:24,555 judgehandler judge1: Updated problem list +INFO 2020-01-24 02:04:24,734 judgehandler judge1: Updated problem list +INFO 2020-01-24 02:04:24,736 judgehandler judge1: Updated problem list +INFO 2020-01-24 02:06:10,732 judgehandler judge1: Updated problem list +INFO 2020-01-24 02:08:53,761 judgehandler judge1: Updated problem list +INFO 2020-01-24 02:13:33,309 judgehandler judge1: Updated problem list +INFO 2020-01-24 02:14:44,095 judgehandler judge1: Updated problem list +INFO 2020-01-24 02:18:49,742 judgehandler judge1: Updated problem list +INFO 2020-01-24 02:18:53,139 judgehandler judge1: Updated problem list +INFO 2020-01-24 02:24:48,195 judgehandler judge1: Updated problem list +INFO 2020-01-24 02:24:49,403 judgehandler judge1: Updated problem list +INFO 2020-01-24 02:25:12,704 judgehandler judge1: Updated problem list +INFO 2020-01-24 02:25:18,194 judgehandler judge1: Updated problem list +INFO 2020-01-24 02:26:24,931 judgehandler judge1: Updated problem list +INFO 2020-01-24 02:26:26,742 judgehandler judge1: Updated problem list +INFO 2020-01-24 02:26:40,852 judgehandler judge1: Updated problem list +INFO 2020-01-24 02:26:55,225 judgelist Free judges: 1 +INFO 2020-01-24 02:26:55,226 judgelist Dispatched submission 35 to: judge1 +INFO 2020-01-24 02:26:55,247 judgehandler Submission acknowledged: 35 +INFO 2020-01-24 02:26:55,292 judgehandler judge1: Grading has begun on: 35 +INFO 2020-01-24 02:26:55,454 judgehandler judge1: 3 test case(s) completed on: 35 +INFO 2020-01-24 02:26:55,581 judgehandler judge1: Grading has ended on: 35 +INFO 2020-01-24 02:26:55,581 judgelist Judge available after grading 35: judge1 +INFO 2020-01-24 02:28:19,521 judgehandler judge1: Updated problem list +INFO 2020-01-24 02:28:30,526 judgelist Free judges: 1 +INFO 2020-01-24 02:28:30,526 judgelist Dispatched submission 36 to: judge1 +INFO 2020-01-24 02:28:30,545 judgehandler Submission acknowledged: 36 +INFO 2020-01-24 02:28:30,582 judgehandler judge1: Grading has begun on: 36 +INFO 2020-01-24 02:28:30,714 judgehandler judge1: 3 test case(s) completed on: 36 +INFO 2020-01-24 02:28:30,783 judgehandler judge1: Grading has ended on: 36 +INFO 2020-01-24 02:28:30,784 judgelist Judge available after grading 36: judge1 diff --git a/judge/migrations/0098_auto_20200123_2136.py b/judge/migrations/0098_auto_20200123_2136.py new file mode 100644 index 0000000..87f54c1 --- /dev/null +++ b/judge/migrations/0098_auto_20200123_2136.py @@ -0,0 +1,155 @@ +# Generated by Django 2.2.9 on 2020-01-23 21:36 + +import django.core.validators +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('judge', '0097_participation_is_disqualified'), + ] + + operations = [ + migrations.AlterField( + model_name='comment', + name='level', + field=models.PositiveIntegerField(editable=False), + ), + migrations.AlterField( + model_name='comment', + name='lft', + field=models.PositiveIntegerField(editable=False), + ), + migrations.AlterField( + model_name='comment', + name='rght', + field=models.PositiveIntegerField(editable=False), + ), + migrations.AlterField( + model_name='contest', + name='format_name', + field=models.CharField(choices=[('atcoder', 'AtCoder'), ('default', 'Default'), ('ecoo', 'ECOO'), ('ioi', 'IOI')], default='default', help_text='The contest format module to use.', max_length=32, verbose_name='contest format'), + ), + migrations.AlterField( + model_name='judge', + name='auth_key', + field=models.CharField(help_text='A key to authenticate this judge', max_length=100, verbose_name='authentication key'), + ), + migrations.AlterField( + model_name='language', + name='description', + field=models.TextField(blank=True, help_text='Use this field to inform users of quirks with your environment, additional restrictions, etc.', verbose_name='language description'), + ), + migrations.AlterField( + model_name='languagelimit', + name='memory_limit', + field=models.IntegerField(validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1048576)], verbose_name='memory limit'), + ), + migrations.AlterField( + model_name='languagelimit', + name='time_limit', + field=models.FloatField(validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(60)], verbose_name='time limit'), + ), + migrations.AlterField( + model_name='navigationbar', + name='level', + field=models.PositiveIntegerField(editable=False), + ), + migrations.AlterField( + model_name='navigationbar', + name='lft', + field=models.PositiveIntegerField(editable=False), + ), + migrations.AlterField( + model_name='navigationbar', + name='rght', + field=models.PositiveIntegerField(editable=False), + ), + migrations.AlterField( + model_name='problem', + name='allowed_languages', + field=models.ManyToManyField(help_text='List of allowed submission languages.', to='judge.Language', verbose_name='allowed languages'), + ), + migrations.AlterField( + model_name='problem', + name='authors', + field=models.ManyToManyField(blank=True, help_text='These users will be able to edit the problem, and be listed as authors.', related_name='authored_problems', to='judge.Profile', verbose_name='creators'), + ), + migrations.AlterField( + model_name='problem', + name='code', + field=models.CharField(help_text='A short, unique code for the problem, used in the url after /problem/', max_length=20, unique=True, validators=[django.core.validators.RegexValidator('^[a-z0-9]+$', 'Problem code must be ^[a-z0-9]+$')], verbose_name='problem code'), + ), + migrations.AlterField( + model_name='problem', + name='curators', + field=models.ManyToManyField(blank=True, help_text='These users will be able to edit the problem, but not be listed as authors.', related_name='curated_problems', to='judge.Profile', verbose_name='curators'), + ), + migrations.AlterField( + model_name='problem', + name='group', + field=models.ForeignKey(help_text='The group of problem, shown under Category in the problem list.', on_delete=django.db.models.deletion.CASCADE, to='judge.ProblemGroup', verbose_name='problem group'), + ), + migrations.AlterField( + model_name='problem', + name='is_manually_managed', + field=models.BooleanField(db_index=True, default=False, help_text='Whether judges should be allowed to manage data or not.', verbose_name='manually managed'), + ), + migrations.AlterField( + model_name='problem', + name='license', + field=models.ForeignKey(blank=True, help_text='The license under which this problem is published.', null=True, on_delete=django.db.models.deletion.SET_NULL, to='judge.License'), + ), + migrations.AlterField( + model_name='problem', + name='memory_limit', + field=models.PositiveIntegerField(help_text='The memory limit for this problem, in kilobytes (e.g. 64mb = 65536 kilobytes).', validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1048576)], verbose_name='memory limit'), + ), + migrations.AlterField( + model_name='problem', + name='name', + field=models.CharField(db_index=True, help_text='The full name of the problem, as shown in the problem list.', max_length=100, verbose_name='problem name'), + ), + migrations.AlterField( + model_name='problem', + name='points', + field=models.FloatField(help_text="Points awarded for problem completion. Points are displayed with a 'p' suffix if partial.", validators=[django.core.validators.MinValueValidator(0)], verbose_name='points'), + ), + migrations.AlterField( + model_name='problem', + name='testers', + field=models.ManyToManyField(blank=True, help_text='These users will be able to view the private problem, but not edit it.', related_name='tested_problems', to='judge.Profile', verbose_name='testers'), + ), + migrations.AlterField( + model_name='problem', + name='time_limit', + field=models.FloatField(help_text='The time limit for this problem, in seconds. Fractional seconds (e.g. 1.5) are supported.', validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(60)], verbose_name='time limit'), + ), + migrations.AlterField( + model_name='problem', + name='types', + field=models.ManyToManyField(help_text="The type of problem, as shown on the problem's page.", to='judge.ProblemType', verbose_name='problem types'), + ), + migrations.AlterField( + model_name='problemdata', + name='checker', + field=models.CharField(blank=True, choices=[('standard', 'Standard'), ('floats', 'Floats'), ('floatsabs', 'Floats (absolute)'), ('floatsrel', 'Floats (relative)'), ('rstripped', 'Non-trailing spaces'), ('sorted', 'Unordered'), ('identical', 'Byte identical'), ('linecount', 'Line-by-line'), ('checker.py', 'Custom checker')], max_length=10, verbose_name='checker'), + ), + migrations.AlterField( + model_name='problemtestcase', + name='checker', + field=models.CharField(blank=True, choices=[('standard', 'Standard'), ('floats', 'Floats'), ('floatsabs', 'Floats (absolute)'), ('floatsrel', 'Floats (relative)'), ('rstripped', 'Non-trailing spaces'), ('sorted', 'Unordered'), ('identical', 'Byte identical'), ('linecount', 'Line-by-line'), ('checker.py', 'Custom checker')], max_length=10, verbose_name='checker'), + ), + migrations.AlterField( + model_name='problemtranslation', + name='language', + field=models.CharField(choices=[('de', 'German'), ('en', 'English'), ('es', 'Spanish'), ('fr', 'French'), ('hr', 'Croatian'), ('hu', 'Hungarian'), ('ja', 'Japanese'), ('ko', 'Korean'), ('pt', 'Brazilian Portuguese'), ('ro', 'Romanian'), ('ru', 'Russian'), ('sr-latn', 'Serbian (Latin)'), ('tr', 'Turkish'), ('vi', 'Vietnamese'), ('zh-hans', 'Simplified Chinese'), ('zh-hant', 'Traditional Chinese')], max_length=7, verbose_name='language'), + ), + migrations.AlterField( + model_name='profile', + name='timezone', + field=models.CharField(choices=[('Africa', [('Africa/Abidjan', 'Abidjan'), ('Africa/Accra', 'Accra'), ('Africa/Addis_Ababa', 'Addis_Ababa'), ('Africa/Algiers', 'Algiers'), ('Africa/Asmara', 'Asmara'), ('Africa/Asmera', 'Asmera'), ('Africa/Bamako', 'Bamako'), ('Africa/Bangui', 'Bangui'), ('Africa/Banjul', 'Banjul'), ('Africa/Bissau', 'Bissau'), ('Africa/Blantyre', 'Blantyre'), ('Africa/Brazzaville', 'Brazzaville'), ('Africa/Bujumbura', 'Bujumbura'), ('Africa/Cairo', 'Cairo'), ('Africa/Casablanca', 'Casablanca'), ('Africa/Ceuta', 'Ceuta'), ('Africa/Conakry', 'Conakry'), ('Africa/Dakar', 'Dakar'), ('Africa/Dar_es_Salaam', 'Dar_es_Salaam'), ('Africa/Djibouti', 'Djibouti'), ('Africa/Douala', 'Douala'), ('Africa/El_Aaiun', 'El_Aaiun'), ('Africa/Freetown', 'Freetown'), ('Africa/Gaborone', 'Gaborone'), ('Africa/Harare', 'Harare'), ('Africa/Johannesburg', 'Johannesburg'), ('Africa/Juba', 'Juba'), ('Africa/Kampala', 'Kampala'), ('Africa/Khartoum', 'Khartoum'), ('Africa/Kigali', 'Kigali'), ('Africa/Kinshasa', 'Kinshasa'), ('Africa/Lagos', 'Lagos'), ('Africa/Libreville', 'Libreville'), ('Africa/Lome', 'Lome'), ('Africa/Luanda', 'Luanda'), ('Africa/Lubumbashi', 'Lubumbashi'), ('Africa/Lusaka', 'Lusaka'), ('Africa/Malabo', 'Malabo'), ('Africa/Maputo', 'Maputo'), ('Africa/Maseru', 'Maseru'), ('Africa/Mbabane', 'Mbabane'), ('Africa/Mogadishu', 'Mogadishu'), ('Africa/Monrovia', 'Monrovia'), ('Africa/Nairobi', 'Nairobi'), ('Africa/Ndjamena', 'Ndjamena'), ('Africa/Niamey', 'Niamey'), ('Africa/Nouakchott', 'Nouakchott'), ('Africa/Ouagadougou', 'Ouagadougou'), ('Africa/Porto-Novo', 'Porto-Novo'), ('Africa/Sao_Tome', 'Sao_Tome'), ('Africa/Timbuktu', 'Timbuktu'), ('Africa/Tripoli', 'Tripoli'), ('Africa/Tunis', 'Tunis'), ('Africa/Windhoek', 'Windhoek')]), ('America', [('America/Adak', 'Adak'), ('America/Anchorage', 'Anchorage'), ('America/Anguilla', 'Anguilla'), ('America/Antigua', 'Antigua'), ('America/Araguaina', 'Araguaina'), ('America/Argentina/Buenos_Aires', 'Argentina/Buenos_Aires'), ('America/Argentina/Catamarca', 'Argentina/Catamarca'), ('America/Argentina/ComodRivadavia', 'Argentina/ComodRivadavia'), ('America/Argentina/Cordoba', 'Argentina/Cordoba'), ('America/Argentina/Jujuy', 'Argentina/Jujuy'), ('America/Argentina/La_Rioja', 'Argentina/La_Rioja'), ('America/Argentina/Mendoza', 'Argentina/Mendoza'), ('America/Argentina/Rio_Gallegos', 'Argentina/Rio_Gallegos'), ('America/Argentina/Salta', 'Argentina/Salta'), ('America/Argentina/San_Juan', 'Argentina/San_Juan'), ('America/Argentina/San_Luis', 'Argentina/San_Luis'), ('America/Argentina/Tucuman', 'Argentina/Tucuman'), ('America/Argentina/Ushuaia', 'Argentina/Ushuaia'), ('America/Aruba', 'Aruba'), ('America/Asuncion', 'Asuncion'), ('America/Atikokan', 'Atikokan'), ('America/Atka', 'Atka'), ('America/Bahia', 'Bahia'), ('America/Bahia_Banderas', 'Bahia_Banderas'), ('America/Barbados', 'Barbados'), ('America/Belem', 'Belem'), ('America/Belize', 'Belize'), ('America/Blanc-Sablon', 'Blanc-Sablon'), ('America/Boa_Vista', 'Boa_Vista'), ('America/Bogota', 'Bogota'), ('America/Boise', 'Boise'), ('America/Buenos_Aires', 'Buenos_Aires'), ('America/Cambridge_Bay', 'Cambridge_Bay'), ('America/Campo_Grande', 'Campo_Grande'), ('America/Cancun', 'Cancun'), ('America/Caracas', 'Caracas'), ('America/Catamarca', 'Catamarca'), ('America/Cayenne', 'Cayenne'), ('America/Cayman', 'Cayman'), ('America/Chicago', 'Chicago'), ('America/Chihuahua', 'Chihuahua'), ('America/Coral_Harbour', 'Coral_Harbour'), ('America/Cordoba', 'Cordoba'), ('America/Costa_Rica', 'Costa_Rica'), ('America/Creston', 'Creston'), ('America/Cuiaba', 'Cuiaba'), ('America/Curacao', 'Curacao'), ('America/Danmarkshavn', 'Danmarkshavn'), ('America/Dawson', 'Dawson'), ('America/Dawson_Creek', 'Dawson_Creek'), ('America/Denver', 'Denver'), ('America/Detroit', 'Detroit'), ('America/Dominica', 'Dominica'), ('America/Edmonton', 'Edmonton'), ('America/Eirunepe', 'Eirunepe'), ('America/El_Salvador', 'El_Salvador'), ('America/Ensenada', 'Ensenada'), ('America/Fort_Nelson', 'Fort_Nelson'), ('America/Fort_Wayne', 'Fort_Wayne'), ('America/Fortaleza', 'Fortaleza'), ('America/Glace_Bay', 'Glace_Bay'), ('America/Godthab', 'Godthab'), ('America/Goose_Bay', 'Goose_Bay'), ('America/Grand_Turk', 'Grand_Turk'), ('America/Grenada', 'Grenada'), ('America/Guadeloupe', 'Guadeloupe'), ('America/Guatemala', 'Guatemala'), ('America/Guayaquil', 'Guayaquil'), ('America/Guyana', 'Guyana'), ('America/Halifax', 'Halifax'), ('America/Havana', 'Havana'), ('America/Hermosillo', 'Hermosillo'), ('America/Indiana/Indianapolis', 'Indiana/Indianapolis'), ('America/Indiana/Knox', 'Indiana/Knox'), ('America/Indiana/Marengo', 'Indiana/Marengo'), ('America/Indiana/Petersburg', 'Indiana/Petersburg'), ('America/Indiana/Tell_City', 'Indiana/Tell_City'), ('America/Indiana/Vevay', 'Indiana/Vevay'), ('America/Indiana/Vincennes', 'Indiana/Vincennes'), ('America/Indiana/Winamac', 'Indiana/Winamac'), ('America/Indianapolis', 'Indianapolis'), ('America/Inuvik', 'Inuvik'), ('America/Iqaluit', 'Iqaluit'), ('America/Jamaica', 'Jamaica'), ('America/Jujuy', 'Jujuy'), ('America/Juneau', 'Juneau'), ('America/Kentucky/Louisville', 'Kentucky/Louisville'), ('America/Kentucky/Monticello', 'Kentucky/Monticello'), ('America/Knox_IN', 'Knox_IN'), ('America/Kralendijk', 'Kralendijk'), ('America/La_Paz', 'La_Paz'), ('America/Lima', 'Lima'), ('America/Los_Angeles', 'Los_Angeles'), ('America/Louisville', 'Louisville'), ('America/Lower_Princes', 'Lower_Princes'), ('America/Maceio', 'Maceio'), ('America/Managua', 'Managua'), ('America/Manaus', 'Manaus'), ('America/Marigot', 'Marigot'), ('America/Martinique', 'Martinique'), ('America/Matamoros', 'Matamoros'), ('America/Mazatlan', 'Mazatlan'), ('America/Mendoza', 'Mendoza'), ('America/Menominee', 'Menominee'), ('America/Merida', 'Merida'), ('America/Metlakatla', 'Metlakatla'), ('America/Mexico_City', 'Mexico_City'), ('America/Miquelon', 'Miquelon'), ('America/Moncton', 'Moncton'), ('America/Monterrey', 'Monterrey'), ('America/Montevideo', 'Montevideo'), ('America/Montreal', 'Montreal'), ('America/Montserrat', 'Montserrat'), ('America/Nassau', 'Nassau'), ('America/New_York', 'New_York'), ('America/Nipigon', 'Nipigon'), ('America/Nome', 'Nome'), ('America/Noronha', 'Noronha'), ('America/North_Dakota/Beulah', 'North_Dakota/Beulah'), ('America/North_Dakota/Center', 'North_Dakota/Center'), ('America/North_Dakota/New_Salem', 'North_Dakota/New_Salem'), ('America/Ojinaga', 'Ojinaga'), ('America/Panama', 'Panama'), ('America/Pangnirtung', 'Pangnirtung'), ('America/Paramaribo', 'Paramaribo'), ('America/Phoenix', 'Phoenix'), ('America/Port-au-Prince', 'Port-au-Prince'), ('America/Port_of_Spain', 'Port_of_Spain'), ('America/Porto_Acre', 'Porto_Acre'), ('America/Porto_Velho', 'Porto_Velho'), ('America/Puerto_Rico', 'Puerto_Rico'), ('America/Punta_Arenas', 'Punta_Arenas'), ('America/Rainy_River', 'Rainy_River'), ('America/Rankin_Inlet', 'Rankin_Inlet'), ('America/Recife', 'Recife'), ('America/Regina', 'Regina'), ('America/Resolute', 'Resolute'), ('America/Rio_Branco', 'Rio_Branco'), ('America/Rosario', 'Rosario'), ('America/Santa_Isabel', 'Santa_Isabel'), ('America/Santarem', 'Santarem'), ('America/Santiago', 'Santiago'), ('America/Santo_Domingo', 'Santo_Domingo'), ('America/Sao_Paulo', 'Sao_Paulo'), ('America/Scoresbysund', 'Scoresbysund'), ('America/Shiprock', 'Shiprock'), ('America/Sitka', 'Sitka'), ('America/St_Barthelemy', 'St_Barthelemy'), ('America/St_Johns', 'St_Johns'), ('America/St_Kitts', 'St_Kitts'), ('America/St_Lucia', 'St_Lucia'), ('America/St_Thomas', 'St_Thomas'), ('America/St_Vincent', 'St_Vincent'), ('America/Swift_Current', 'Swift_Current'), ('America/Tegucigalpa', 'Tegucigalpa'), ('America/Thule', 'Thule'), ('America/Thunder_Bay', 'Thunder_Bay'), ('America/Tijuana', 'Tijuana'), ('America/Toronto', 'Toronto'), ('America/Tortola', 'Tortola'), ('America/Vancouver', 'Vancouver'), ('America/Virgin', 'Virgin'), ('America/Whitehorse', 'Whitehorse'), ('America/Winnipeg', 'Winnipeg'), ('America/Yakutat', 'Yakutat'), ('America/Yellowknife', 'Yellowknife')]), ('Antarctica', [('Antarctica/Casey', 'Casey'), ('Antarctica/Davis', 'Davis'), ('Antarctica/DumontDUrville', 'DumontDUrville'), ('Antarctica/Macquarie', 'Macquarie'), ('Antarctica/Mawson', 'Mawson'), ('Antarctica/McMurdo', 'McMurdo'), ('Antarctica/Palmer', 'Palmer'), ('Antarctica/Rothera', 'Rothera'), ('Antarctica/South_Pole', 'South_Pole'), ('Antarctica/Syowa', 'Syowa'), ('Antarctica/Troll', 'Troll'), ('Antarctica/Vostok', 'Vostok')]), ('Arctic', [('Arctic/Longyearbyen', 'Longyearbyen')]), ('Asia', [('Asia/Aden', 'Aden'), ('Asia/Almaty', 'Almaty'), ('Asia/Amman', 'Amman'), ('Asia/Anadyr', 'Anadyr'), ('Asia/Aqtau', 'Aqtau'), ('Asia/Aqtobe', 'Aqtobe'), ('Asia/Ashgabat', 'Ashgabat'), ('Asia/Ashkhabad', 'Ashkhabad'), ('Asia/Atyrau', 'Atyrau'), ('Asia/Baghdad', 'Baghdad'), ('Asia/Bahrain', 'Bahrain'), ('Asia/Baku', 'Baku'), ('Asia/Bangkok', 'Bangkok'), ('Asia/Barnaul', 'Barnaul'), ('Asia/Beirut', 'Beirut'), ('Asia/Bishkek', 'Bishkek'), ('Asia/Brunei', 'Brunei'), ('Asia/Calcutta', 'Calcutta'), ('Asia/Chita', 'Chita'), ('Asia/Choibalsan', 'Choibalsan'), ('Asia/Chongqing', 'Chongqing'), ('Asia/Chungking', 'Chungking'), ('Asia/Colombo', 'Colombo'), ('Asia/Dacca', 'Dacca'), ('Asia/Damascus', 'Damascus'), ('Asia/Dhaka', 'Dhaka'), ('Asia/Dili', 'Dili'), ('Asia/Dubai', 'Dubai'), ('Asia/Dushanbe', 'Dushanbe'), ('Asia/Famagusta', 'Famagusta'), ('Asia/Gaza', 'Gaza'), ('Asia/Harbin', 'Harbin'), ('Asia/Hebron', 'Hebron'), ('Asia/Ho_Chi_Minh', 'Ho_Chi_Minh'), ('Asia/Hong_Kong', 'Hong_Kong'), ('Asia/Hovd', 'Hovd'), ('Asia/Irkutsk', 'Irkutsk'), ('Asia/Istanbul', 'Istanbul'), ('Asia/Jakarta', 'Jakarta'), ('Asia/Jayapura', 'Jayapura'), ('Asia/Jerusalem', 'Jerusalem'), ('Asia/Kabul', 'Kabul'), ('Asia/Kamchatka', 'Kamchatka'), ('Asia/Karachi', 'Karachi'), ('Asia/Kashgar', 'Kashgar'), ('Asia/Kathmandu', 'Kathmandu'), ('Asia/Katmandu', 'Katmandu'), ('Asia/Khandyga', 'Khandyga'), ('Asia/Kolkata', 'Kolkata'), ('Asia/Krasnoyarsk', 'Krasnoyarsk'), ('Asia/Kuala_Lumpur', 'Kuala_Lumpur'), ('Asia/Kuching', 'Kuching'), ('Asia/Kuwait', 'Kuwait'), ('Asia/Macao', 'Macao'), ('Asia/Macau', 'Macau'), ('Asia/Magadan', 'Magadan'), ('Asia/Makassar', 'Makassar'), ('Asia/Manila', 'Manila'), ('Asia/Muscat', 'Muscat'), ('Asia/Nicosia', 'Nicosia'), ('Asia/Novokuznetsk', 'Novokuznetsk'), ('Asia/Novosibirsk', 'Novosibirsk'), ('Asia/Omsk', 'Omsk'), ('Asia/Oral', 'Oral'), ('Asia/Phnom_Penh', 'Phnom_Penh'), ('Asia/Pontianak', 'Pontianak'), ('Asia/Pyongyang', 'Pyongyang'), ('Asia/Qatar', 'Qatar'), ('Asia/Qostanay', 'Qostanay'), ('Asia/Qyzylorda', 'Qyzylorda'), ('Asia/Rangoon', 'Rangoon'), ('Asia/Riyadh', 'Riyadh'), ('Asia/Saigon', 'Saigon'), ('Asia/Sakhalin', 'Sakhalin'), ('Asia/Samarkand', 'Samarkand'), ('Asia/Seoul', 'Seoul'), ('Asia/Shanghai', 'Shanghai'), ('Asia/Singapore', 'Singapore'), ('Asia/Srednekolymsk', 'Srednekolymsk'), ('Asia/Taipei', 'Taipei'), ('Asia/Tashkent', 'Tashkent'), ('Asia/Tbilisi', 'Tbilisi'), ('Asia/Tehran', 'Tehran'), ('Asia/Tel_Aviv', 'Tel_Aviv'), ('Asia/Thimbu', 'Thimbu'), ('Asia/Thimphu', 'Thimphu'), ('Asia/Tokyo', 'Tokyo'), ('Asia/Tomsk', 'Tomsk'), ('Asia/Ujung_Pandang', 'Ujung_Pandang'), ('Asia/Ulaanbaatar', 'Ulaanbaatar'), ('Asia/Ulan_Bator', 'Ulan_Bator'), ('Asia/Urumqi', 'Urumqi'), ('Asia/Ust-Nera', 'Ust-Nera'), ('Asia/Vientiane', 'Vientiane'), ('Asia/Vladivostok', 'Vladivostok'), ('Asia/Yakutsk', 'Yakutsk'), ('Asia/Yangon', 'Yangon'), ('Asia/Yekaterinburg', 'Yekaterinburg'), ('Asia/Yerevan', 'Yerevan')]), ('Atlantic', [('Atlantic/Azores', 'Azores'), ('Atlantic/Bermuda', 'Bermuda'), ('Atlantic/Canary', 'Canary'), ('Atlantic/Cape_Verde', 'Cape_Verde'), ('Atlantic/Faeroe', 'Faeroe'), ('Atlantic/Faroe', 'Faroe'), ('Atlantic/Jan_Mayen', 'Jan_Mayen'), ('Atlantic/Madeira', 'Madeira'), ('Atlantic/Reykjavik', 'Reykjavik'), ('Atlantic/South_Georgia', 'South_Georgia'), ('Atlantic/St_Helena', 'St_Helena'), ('Atlantic/Stanley', 'Stanley')]), ('Australia', [('Australia/ACT', 'ACT'), ('Australia/Adelaide', 'Adelaide'), ('Australia/Brisbane', 'Brisbane'), ('Australia/Broken_Hill', 'Broken_Hill'), ('Australia/Canberra', 'Canberra'), ('Australia/Currie', 'Currie'), ('Australia/Darwin', 'Darwin'), ('Australia/Eucla', 'Eucla'), ('Australia/Hobart', 'Hobart'), ('Australia/LHI', 'LHI'), ('Australia/Lindeman', 'Lindeman'), ('Australia/Lord_Howe', 'Lord_Howe'), ('Australia/Melbourne', 'Melbourne'), ('Australia/NSW', 'NSW'), ('Australia/North', 'North'), ('Australia/Perth', 'Perth'), ('Australia/Queensland', 'Queensland'), ('Australia/South', 'South'), ('Australia/Sydney', 'Sydney'), ('Australia/Tasmania', 'Tasmania'), ('Australia/Victoria', 'Victoria'), ('Australia/West', 'West'), ('Australia/Yancowinna', 'Yancowinna')]), ('Brazil', [('Brazil/Acre', 'Acre'), ('Brazil/DeNoronha', 'DeNoronha'), ('Brazil/East', 'East'), ('Brazil/West', 'West')]), ('Canada', [('Canada/Atlantic', 'Atlantic'), ('Canada/Central', 'Central'), ('Canada/Eastern', 'Eastern'), ('Canada/Mountain', 'Mountain'), ('Canada/Newfoundland', 'Newfoundland'), ('Canada/Pacific', 'Pacific'), ('Canada/Saskatchewan', 'Saskatchewan'), ('Canada/Yukon', 'Yukon')]), ('Chile', [('Chile/Continental', 'Continental'), ('Chile/EasterIsland', 'EasterIsland')]), ('Etc', [('Etc/Greenwich', 'Greenwich'), ('Etc/UCT', 'UCT'), ('Etc/UTC', 'UTC'), ('Etc/Universal', 'Universal'), ('Etc/Zulu', 'Zulu')]), ('Europe', [('Europe/Amsterdam', 'Amsterdam'), ('Europe/Andorra', 'Andorra'), ('Europe/Astrakhan', 'Astrakhan'), ('Europe/Athens', 'Athens'), ('Europe/Belfast', 'Belfast'), ('Europe/Belgrade', 'Belgrade'), ('Europe/Berlin', 'Berlin'), ('Europe/Bratislava', 'Bratislava'), ('Europe/Brussels', 'Brussels'), ('Europe/Bucharest', 'Bucharest'), ('Europe/Budapest', 'Budapest'), ('Europe/Busingen', 'Busingen'), ('Europe/Chisinau', 'Chisinau'), ('Europe/Copenhagen', 'Copenhagen'), ('Europe/Dublin', 'Dublin'), ('Europe/Gibraltar', 'Gibraltar'), ('Europe/Guernsey', 'Guernsey'), ('Europe/Helsinki', 'Helsinki'), ('Europe/Isle_of_Man', 'Isle_of_Man'), ('Europe/Istanbul', 'Istanbul'), ('Europe/Jersey', 'Jersey'), ('Europe/Kaliningrad', 'Kaliningrad'), ('Europe/Kiev', 'Kiev'), ('Europe/Kirov', 'Kirov'), ('Europe/Lisbon', 'Lisbon'), ('Europe/Ljubljana', 'Ljubljana'), ('Europe/London', 'London'), ('Europe/Luxembourg', 'Luxembourg'), ('Europe/Madrid', 'Madrid'), ('Europe/Malta', 'Malta'), ('Europe/Mariehamn', 'Mariehamn'), ('Europe/Minsk', 'Minsk'), ('Europe/Monaco', 'Monaco'), ('Europe/Moscow', 'Moscow'), ('Europe/Nicosia', 'Nicosia'), ('Europe/Oslo', 'Oslo'), ('Europe/Paris', 'Paris'), ('Europe/Podgorica', 'Podgorica'), ('Europe/Prague', 'Prague'), ('Europe/Riga', 'Riga'), ('Europe/Rome', 'Rome'), ('Europe/Samara', 'Samara'), ('Europe/San_Marino', 'San_Marino'), ('Europe/Sarajevo', 'Sarajevo'), ('Europe/Saratov', 'Saratov'), ('Europe/Simferopol', 'Simferopol'), ('Europe/Skopje', 'Skopje'), ('Europe/Sofia', 'Sofia'), ('Europe/Stockholm', 'Stockholm'), ('Europe/Tallinn', 'Tallinn'), ('Europe/Tirane', 'Tirane'), ('Europe/Tiraspol', 'Tiraspol'), ('Europe/Ulyanovsk', 'Ulyanovsk'), ('Europe/Uzhgorod', 'Uzhgorod'), ('Europe/Vaduz', 'Vaduz'), ('Europe/Vatican', 'Vatican'), ('Europe/Vienna', 'Vienna'), ('Europe/Vilnius', 'Vilnius'), ('Europe/Volgograd', 'Volgograd'), ('Europe/Warsaw', 'Warsaw'), ('Europe/Zagreb', 'Zagreb'), ('Europe/Zaporozhye', 'Zaporozhye'), ('Europe/Zurich', 'Zurich')]), ('Indian', [('Indian/Antananarivo', 'Antananarivo'), ('Indian/Chagos', 'Chagos'), ('Indian/Christmas', 'Christmas'), ('Indian/Cocos', 'Cocos'), ('Indian/Comoro', 'Comoro'), ('Indian/Kerguelen', 'Kerguelen'), ('Indian/Mahe', 'Mahe'), ('Indian/Maldives', 'Maldives'), ('Indian/Mauritius', 'Mauritius'), ('Indian/Mayotte', 'Mayotte'), ('Indian/Reunion', 'Reunion')]), ('Mexico', [('Mexico/BajaNorte', 'BajaNorte'), ('Mexico/BajaSur', 'BajaSur'), ('Mexico/General', 'General')]), ('Other', [('CET', 'CET'), ('CST6CDT', 'CST6CDT'), ('Cuba', 'Cuba'), ('EET', 'EET'), ('EST', 'EST'), ('EST5EDT', 'EST5EDT'), ('Egypt', 'Egypt'), ('Eire', 'Eire'), ('GB', 'GB'), ('GB-Eire', 'GB-Eire'), ('Greenwich', 'Greenwich'), ('HST', 'HST'), ('Hongkong', 'Hongkong'), ('Iceland', 'Iceland'), ('Iran', 'Iran'), ('Israel', 'Israel'), ('Jamaica', 'Jamaica'), ('Japan', 'Japan'), ('Kwajalein', 'Kwajalein'), ('Libya', 'Libya'), ('MET', 'MET'), ('MST', 'MST'), ('MST7MDT', 'MST7MDT'), ('NZ', 'NZ'), ('NZ-CHAT', 'NZ-CHAT'), ('Navajo', 'Navajo'), ('PRC', 'PRC'), ('PST8PDT', 'PST8PDT'), ('Poland', 'Poland'), ('Portugal', 'Portugal'), ('ROC', 'ROC'), ('ROK', 'ROK'), ('Singapore', 'Singapore'), ('Turkey', 'Turkey'), ('UCT', 'UCT'), ('UTC', 'UTC'), ('Universal', 'Universal'), ('W-SU', 'W-SU'), ('WET', 'WET'), ('Zulu', 'Zulu')]), ('Pacific', [('Pacific/Apia', 'Apia'), ('Pacific/Auckland', 'Auckland'), ('Pacific/Bougainville', 'Bougainville'), ('Pacific/Chatham', 'Chatham'), ('Pacific/Chuuk', 'Chuuk'), ('Pacific/Easter', 'Easter'), ('Pacific/Efate', 'Efate'), ('Pacific/Enderbury', 'Enderbury'), ('Pacific/Fakaofo', 'Fakaofo'), ('Pacific/Fiji', 'Fiji'), ('Pacific/Funafuti', 'Funafuti'), ('Pacific/Galapagos', 'Galapagos'), ('Pacific/Gambier', 'Gambier'), ('Pacific/Guadalcanal', 'Guadalcanal'), ('Pacific/Guam', 'Guam'), ('Pacific/Honolulu', 'Honolulu'), ('Pacific/Johnston', 'Johnston'), ('Pacific/Kiritimati', 'Kiritimati'), ('Pacific/Kosrae', 'Kosrae'), ('Pacific/Kwajalein', 'Kwajalein'), ('Pacific/Majuro', 'Majuro'), ('Pacific/Marquesas', 'Marquesas'), ('Pacific/Midway', 'Midway'), ('Pacific/Nauru', 'Nauru'), ('Pacific/Niue', 'Niue'), ('Pacific/Norfolk', 'Norfolk'), ('Pacific/Noumea', 'Noumea'), ('Pacific/Pago_Pago', 'Pago_Pago'), ('Pacific/Palau', 'Palau'), ('Pacific/Pitcairn', 'Pitcairn'), ('Pacific/Pohnpei', 'Pohnpei'), ('Pacific/Ponape', 'Ponape'), ('Pacific/Port_Moresby', 'Port_Moresby'), ('Pacific/Rarotonga', 'Rarotonga'), ('Pacific/Saipan', 'Saipan'), ('Pacific/Samoa', 'Samoa'), ('Pacific/Tahiti', 'Tahiti'), ('Pacific/Tarawa', 'Tarawa'), ('Pacific/Tongatapu', 'Tongatapu'), ('Pacific/Truk', 'Truk'), ('Pacific/Wake', 'Wake'), ('Pacific/Wallis', 'Wallis'), ('Pacific/Yap', 'Yap')]), ('US', [('US/Alaska', 'Alaska'), ('US/Aleutian', 'Aleutian'), ('US/Arizona', 'Arizona'), ('US/Central', 'Central'), ('US/East-Indiana', 'East-Indiana'), ('US/Eastern', 'Eastern'), ('US/Hawaii', 'Hawaii'), ('US/Indiana-Starke', 'Indiana-Starke'), ('US/Michigan', 'Michigan'), ('US/Mountain', 'Mountain'), ('US/Pacific', 'Pacific'), ('US/Samoa', 'Samoa')])], default='America/Mexico_City', max_length=50, verbose_name='location'), + ), + ] diff --git a/judge/migrations/0099_auto_20200123_2228.py b/judge/migrations/0099_auto_20200123_2228.py new file mode 100644 index 0000000..3666752 --- /dev/null +++ b/judge/migrations/0099_auto_20200123_2228.py @@ -0,0 +1,30 @@ +# Generated by Django 2.2.9 on 2020-01-23 22:28 + +from django.db import migrations, models +import judge.models.problem_data +import judge.utils.problem_data + + +class Migration(migrations.Migration): + + dependencies = [ + ('judge', '0098_auto_20200123_2136'), + ] + + operations = [ + migrations.AddField( + model_name='problemdata', + name='custom_checker', + field=models.FileField(blank=True, null=True, storage=judge.utils.problem_data.ProblemDataStorage(), upload_to=judge.models.problem_data.problem_directory_file, verbose_name='custom checker file'), + ), + migrations.AlterField( + model_name='problemdata', + name='checker', + field=models.CharField(blank=True, choices=[('standard', 'Standard'), ('floats', 'Floats'), ('floatsabs', 'Floats (absolute)'), ('floatsrel', 'Floats (relative)'), ('rstripped', 'Non-trailing spaces'), ('sorted', 'Unordered'), ('identical', 'Byte identical'), ('linecount', 'Line-by-line'), ('custom', 'Custom checker')], max_length=10, verbose_name='checker'), + ), + migrations.AlterField( + model_name='problemtestcase', + name='checker', + field=models.CharField(blank=True, choices=[('standard', 'Standard'), ('floats', 'Floats'), ('floatsabs', 'Floats (absolute)'), ('floatsrel', 'Floats (relative)'), ('rstripped', 'Non-trailing spaces'), ('sorted', 'Unordered'), ('identical', 'Byte identical'), ('linecount', 'Line-by-line'), ('custom', 'Custom checker')], max_length=10, verbose_name='checker'), + ), + ] diff --git a/judge/models/problem_data.py b/judge/models/problem_data.py index 8ae25b7..8c46ff3 100644 --- a/judge/models/problem_data.py +++ b/judge/models/problem_data.py @@ -1,6 +1,7 @@ import errno import os +from django.core.validators import FileExtensionValidator from django.db import models from django.utils.translation import gettext_lazy as _ @@ -28,6 +29,7 @@ CHECKERS = ( ('sorted', _('Unordered')), ('identical', _('Byte identical')), ('linecount', _('Line-by-line')), + ('custom', _('Custom checker')), ) @@ -44,7 +46,9 @@ class ProblemData(models.Model): checker = models.CharField(max_length=10, verbose_name=_('checker'), choices=CHECKERS, blank=True) checker_args = models.TextField(verbose_name=_('checker arguments'), blank=True, help_text=_('checker arguments as a JSON object')) - + custom_checker = models.FileField(verbose_name=_('custom checker file'), storage=problem_data_storage, null=True, blank=True, + upload_to=problem_directory_file, + validators=[FileExtensionValidator(allowed_extensions=['py'])]) __original_zipfile = None def __init__(self, *args, **kwargs): @@ -69,6 +73,8 @@ class ProblemData(models.Model): self.zipfile.name = _problem_directory_file(new, self.zipfile.name) if self.generator: self.generator.name = _problem_directory_file(new, self.generator.name) + if self.custom_checker: + self.custom_checker.name = _problem_directory_file(new, self.custom_checker.name) self.save() _update_code.alters_data = True diff --git a/judge/utils/problem_data.py b/judge/utils/problem_data.py index 9655f76..9c185fd 100644 --- a/judge/utils/problem_data.py +++ b/judge/utils/problem_data.py @@ -64,6 +64,11 @@ class ProblemDataCompiler(object): cases.append(batch) def make_checker(case): + if (case.checker == 'custom'): + custom_checker_path = split_path_first(case.custom_checker.name) + if len(custom_checker_path) != 2: + raise ProblemDataError(_('How did you corrupt the custom checker path?')) + return(custom_checker_path[1]) if case.checker_args: return { 'name': case.checker, diff --git a/judge/views/problem_data.py b/judge/views/problem_data.py index 0223170..2c392aa 100644 --- a/judge/views/problem_data.py +++ b/judge/views/problem_data.py @@ -50,7 +50,7 @@ class ProblemDataForm(ModelForm): class Meta: model = ProblemData - fields = ['zipfile', 'generator', 'output_limit', 'output_prefix', 'checker', 'checker_args'] + fields = ['zipfile', 'generator', 'output_limit', 'output_prefix', 'checker', 'checker_args', 'custom_checker'] widgets = { 'checker_args': HiddenInput, } diff --git a/templates/problem/data.html b/templates/problem/data.html index b21a8ed..639dfc0 100644 --- a/templates/problem/data.html +++ b/templates/problem/data.html @@ -95,6 +95,13 @@ }).change(); } + function checker_custom($checker, $custom_checker) { + $tr = $custom_checker.parent().parent(); + $checker.change(function () { + $tr.toggle($checker.val().startsWith('custom')).change(); + }).change(); + } + function swap_row($a, $b) { var $a_order = $a.find('input[id$=order]'), $b_order = $b.find('input[id$=order]'); var order = $a_order.val(); @@ -107,6 +114,7 @@ } checker_precision($('#id_problem-data-checker')); + checker_custom($('#id_problem-data-checker'), $('#id_problem-data-custom_checker')); $table.on('add-row', function (e, $tr) { var $order = $tr.find('input').filter('[id$=order]').attr('type', 'hidden').val(++order);