diff options
author | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2018-10-13 23:06:27 +0200 |
---|---|---|
committer | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2018-10-13 23:06:27 +0200 |
commit | 97e13d167e5ccdc02e2c1ac34b9179cbe316db14 (patch) | |
tree | 6c514f41984a741dbc4105d8dd6f14180d880dcb /kpov_judge/tasks/copy_rename_20_files_tail_env | |
parent | e4e109c16ef27012157cb38cf6375c1ae4d2ef69 (diff) |
Fix two tasks
Diffstat (limited to 'kpov_judge/tasks/copy_rename_20_files_tail_env')
-rw-r--r-- | kpov_judge/tasks/copy_rename_20_files_tail_env/task.py | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/kpov_judge/tasks/copy_rename_20_files_tail_env/task.py b/kpov_judge/tasks/copy_rename_20_files_tail_env/task.py index 6a4b18a..ce51c9c 100644 --- a/kpov_judge/tasks/copy_rename_20_files_tail_env/task.py +++ b/kpov_judge/tasks/copy_rename_20_files_tail_env/task.py @@ -182,11 +182,7 @@ def task_check(results, params): #TO FINISH SCORING WE REQUIRE DICT KEYS AND FUNCTIONS gen_params AND task TO BE FINISHED # preimenuj 1 - lines = results['preimenuj'].split("\n") - task1_ok = len(lines) == len(fnames) + 4 - task1_ok = task1_ok and lines[0].find(params['file_rename_dirname']) >= 0 - task1_ok = task1_ok and lines[1].strip() == "." - task1_ok = task1_ok and lines[2].strip() == ".." + task1_ok = True for fname in fnames: task1_ok = task1_ok and results['preimenuj'].find(fname) > 0 if task1_ok: @@ -212,14 +208,16 @@ def task_check(results, params): hints += ["wrong mv_command size or owner"] # rename files - pre_src = set([i.strip() for i in results['pre_mv_src'].split('\n')[3:-1]]) - pre_dst = set([i.strip() for i in results['pre_mv_dst'].split('\n')[3:-1]]) + pre_src = set([i.strip() for i in results['pre_mv_src'].splitlines()[2:]]) + pre_dst = set([i.strip() for i in results['pre_mv_dst'].splitlines()[2:]]) + print(set(fnames)) + print(pre_src) task2_ok = task2_ok and pre_src == set(fnames) - task2_ok = task2_ok and len(pre_dst) < 2 - post_src = set([i.strip() for i in results['post_mv_src'].split('\n')[3:-1]]) - post_dst = set([i.strip() for i in results['post_mv_dst'].split('\n')[3:-1]]) + task2_ok = task2_ok and len(pre_dst) < 3 + post_src = set([i.strip() for i in results['post_mv_src'].splitlines()[2:]]) + post_dst = set([i.strip() for i in results['post_mv_dst'].splitlines()[2:]]) task2_ok = task2_ok and post_dst == set(fnames) - task2_ok = task2_ok and len(post_src) < 2 + task2_ok = task2_ok and len(post_src) < 3 if task2_ok: score += 1 else: |