From 53fea983a90447865c429c2573bfb36cba179054 Mon Sep 17 00:00:00 2001 From: "gasperfele@fri1.uni-lj.si" Date: Wed, 1 Apr 2015 20:32:28 +0000 Subject: added hints to task results git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@296 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414 --- kpov_judge/tasks/custom_rdate/task.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'kpov_judge/tasks/custom_rdate') diff --git a/kpov_judge/tasks/custom_rdate/task.py b/kpov_judge/tasks/custom_rdate/task.py index 3a72b5d..ee1e245 100644 --- a/kpov_judge/tasks/custom_rdate/task.py +++ b/kpov_judge/tasks/custom_rdate/task.py @@ -125,6 +125,7 @@ def task_check(results, params): # print results r = random.Random(params['PROGRAM_FILENAME']) score = 0.0 + hints = [] for i in xrange(10): data = results['in_' + str(i)] if data != struct.pack("!I", r.randint(0, 2**32)): @@ -133,12 +134,14 @@ def task_check(results, params): if str(struct.unpack("!I", data)[0]) == res.strip(): score += 0.5 else: - pass + hints += ["wrong convert"] # print str(struct.unpack("!I", data)[0]), res.strip() if abs(int(results['ldate']) + \ int(params['RDATE_OFFSET']) - int(results['date'])) < 3: score += 5 - return score + else: + hints += ["wrong offset"] + return score, hints def prepare_disks(templates, params): # d = templates['simpleArbiterDhcp'] -- cgit v1.2.1