From e11077772bf32f25613f4f559feee8c963ea5dda Mon Sep 17 00:00:00 2001 From: "gasperfele@fri1.uni-lj.si" Date: Thu, 29 Dec 2016 23:43:31 +0000 Subject: Fixes to multiple tasks git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@377 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414 --- kpov_judge/web/kpov_judge/kpov_judge.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'kpov_judge/web') diff --git a/kpov_judge/web/kpov_judge/kpov_judge.py b/kpov_judge/web/kpov_judge/kpov_judge.py index 21233f4..1bd42c5 100755 --- a/kpov_judge/web/kpov_judge/kpov_judge.py +++ b/kpov_judge/web/kpov_judge/kpov_judge.py @@ -77,7 +77,7 @@ def results_post(task_id, results): except Exception as e: hints = ["Checker died: " + str(e)] res = 0 - if isinstance(res, int) and res > 0: + if (isinstance(res, int) or isinstance(res, float)) and res > 0: res_status = 'OK' else: res_status = 'NOT OK' @@ -101,7 +101,8 @@ def results_dict(task_id): @app.route('/tasks//results.json', methods=['GET', 'POST']) def results_json(task_id): if flask.app.request.method == 'POST': - return json.dumps(results_post(task_id, json.loads(flask.app.request.form['results']))) + return json.dumps(results_post(task_id, + json.loads(flask.app.request.form['results']))) return json.dumps(results_dict(task_id)) @app.route('/tasks///setup.', methods=['GET']) -- cgit v1.2.1