summaryrefslogtreecommitdiff
path: root/kpov_judge/tasks/edit_find_grep_compile_convert
diff options
context:
space:
mode:
authorgasperfele@fri1.uni-lj.si <gasperfele@fri1.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414>2017-03-23 08:00:31 +0000
committergasperfele@fri1.uni-lj.si <gasperfele@fri1.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414>2017-03-23 08:00:31 +0000
commit68dc29c6f621b86489cd1f26213489032e42b486 (patch)
tree17cde3df1481e7ff951ac1c5bb51e569610dacab /kpov_judge/tasks/edit_find_grep_compile_convert
parentb1b0d75831b3d81c41549358dde122b9fba0c054 (diff)
improve hints for edit_find_grep_compile_convert
git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@408 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414
Diffstat (limited to 'kpov_judge/tasks/edit_find_grep_compile_convert')
-rw-r--r--kpov_judge/tasks/edit_find_grep_compile_convert/task.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/kpov_judge/tasks/edit_find_grep_compile_convert/task.py b/kpov_judge/tasks/edit_find_grep_compile_convert/task.py
index 705ddf6..8b8ecb8 100644
--- a/kpov_judge/tasks/edit_find_grep_compile_convert/task.py
+++ b/kpov_judge/tasks/edit_find_grep_compile_convert/task.py
@@ -266,20 +266,20 @@ def task_check(results, params):
if results["dst_file_contents"] == expected_contents:
score += 3
else:
- #diff_pos = None
- #for i, c in enumerate(results["dst_file_contents"]):
- # if len(expected_contents) < i or c != expected_contents[i]:
- # start = max(0, i-20)
- # end = min(len(expected_contents), len(results["dst_file_contents"]), i+200)
- # diff_pos = (i, expected_contents[start:end], results["dst_file_contents"][start:end])
- # break
- #hints += ["wrong file contents\n" + str(diff_pos)]
- hints += ["wrong file contents"]
+ diff_pos = ""
+ for i, c in enumerate(results["dst_file_contents"]):
+ if len(expected_contents) < i or c != expected_contents[i]:
+ start = max(0, i-10)
+ end = min(len(expected_contents), len(results["dst_file_contents"]), i+20)
+ diff_pos = (i, results["dst_file_contents"][start:end])
+ break
+ hints += ["wrong file contents\n" + str(diff_pos[1])]
+ #hints += ["wrong file contents"]
expected_ls = u"ls -l ~/{dstfile}\r\n-rw--w---- 1 {testuser} bilbo .*{dstfile}\r\n".format(**params)
if re.match(expected_ls, results["dst_ls"]):
score += 3
else:
- hints += ["missing file or wrong user/permissions\n" + str((results["dst_ls"], expected_ls))]
+ hints += [u"missing file or wrong user/permissions\n" + results["dst_ls"]]
if results["home_ls"].find(params['progname']) > -1:
score += 2
else:
@@ -298,7 +298,7 @@ def task_check(results, params):
if results["tita_return"] == expected_tita:
score += 2
else:
- hints += ["program output incorrect\n" + str((results["tita_return"],)) + "\n" + str((expected_tita,))]
+ hints += [u"program output incorrect\n" + results["tita_return"]]
return score, hints