From 64885ef1675f32cc3ce9d59aa0f6c31064338eec Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Sat, 13 Oct 2018 03:30:56 +0200 Subject: web.results_post: call task_check with defaultdict(str) Many tasks barf on missing keys. --- kpov_judge/web/kpov_judge/kpov_judge.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'kpov_judge') diff --git a/kpov_judge/web/kpov_judge/kpov_judge.py b/kpov_judge/web/kpov_judge/kpov_judge.py index db2359d..2febf9a 100755 --- a/kpov_judge/web/kpov_judge/kpov_judge.py +++ b/kpov_judge/web/kpov_judge/kpov_judge.py @@ -92,8 +92,7 @@ def results_post(class_id, task_id, results): task_check_source = db.task_checkers.find_one({'class_id': class_id, 'task_id': task_id})['source'] d = {} exec(compile(task_check_source, 'checker.py', 'exec'), globals(), d) - # raise Exception(str(params)) - res, hints = d['task_check'](results, params) + res, hints = d['task_check'](collections.defaultdict(str, results), params) except Exception as e: hints = ["Checker died: " + str(e)] res = 0 -- cgit v1.2.1