diff options
Diffstat (limited to 'kpov_judge/web')
-rwxr-xr-x | kpov_judge/web/kpov_judge/kpov_judge.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kpov_judge/web/kpov_judge/kpov_judge.py b/kpov_judge/web/kpov_judge/kpov_judge.py index 5d3e791..b190567 100755 --- a/kpov_judge/web/kpov_judge/kpov_judge.py +++ b/kpov_judge/web/kpov_judge/kpov_judge.py @@ -91,7 +91,7 @@ def results_post(class_id, task_id, results): try: 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'), d) + exec(compile(task_check_source, 'checker.py', 'exec'), globals(), d) # raise Exception(str(params)) res, hints = d['task_check'](results, params) except Exception as e: @@ -188,7 +188,7 @@ def get_params(class_id, task_id, student_id, db): gen_params_source = db.gen_params.find_one({'class_id': class_id, 'task_id': task_id})['source'] gen_params_code = compile(gen_params_source, 'generator.py', 'exec') d = {} - exec(gen_params_code, d) + exec(gen_params_code, globals(), d) params = d['gen_params'](student_id, meta) db.task_params.update({'class_id': class_id, 'task_id': task_id, 'student_id': student_id}, {'$set': {'params': params}}, upsert=True) |