From 68e25d05abcd7d97057951895f912f36fb505039 Mon Sep 17 00:00:00 2001 From: "gasperfele@fri1.uni-lj.si" Date: Sun, 2 Oct 2016 13:33:54 +0000 Subject: fixed the default task_check in add_task.py git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@356 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414 --- kpov_judge/add_task.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'kpov_judge') diff --git a/kpov_judge/add_task.py b/kpov_judge/add_task.py index 9ba49f3..f95f44d 100755 --- a/kpov_judge/add_task.py +++ b/kpov_judge/add_task.py @@ -18,7 +18,10 @@ def task_check(results, params): }) req = urllib2.Request('{task_url}/{task_name}/results.json'.format(task_url=task_url, task_name=task_name), data) response = urllib2.urlopen(req) - return response.read() + response_dict = json.loads(response.read()) + hints = response_dict.get('hints', []) + hints = [u'status: ' + response_dict.get('status', '')] + hints + return response_dict.get('result', 'No result'), u"\n".join(hints) uploading_task_check_source = inspect.getsource(task_check) -- cgit v1.2.1