diff options
Diffstat (limited to 'kpov_judge/tasks/basic_network_gcc')
-rw-r--r-- | kpov_judge/tasks/basic_network_gcc/task.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/kpov_judge/tasks/basic_network_gcc/task.py b/kpov_judge/tasks/basic_network_gcc/task.py index 8311503..eeb7d1c 100644 --- a/kpov_judge/tasks/basic_network_gcc/task.py +++ b/kpov_judge/tasks/basic_network_gcc/task.py @@ -118,7 +118,7 @@ params_meta = { def task(student_IP, net_prog_name, P_c, P_executable, arg_c, env_c, out_stderr_c, out_stdout_c, P_script, param_gen_seed): - import pxssh + from pexpect import pxssh import random conn = pxssh.pxssh() conn.login(student_IP, 'student', 'vaje') @@ -232,7 +232,7 @@ def task_check(results, params): score += 1 return score, hints -def prepare_disks(templates, params): +def prepare_disks(templates, task_params, global_params): c_source = '''#include<stdio.h> #include<stdlib.h> #include<string.h> @@ -276,7 +276,7 @@ done; }& """ import random d = templates['student-entrance'] - r = random.Random(params['c_destroy_gen_seed']) + r = random.Random(task_params['c_destroy_gen_seed']) destroyed_c_source = c_source[:110] for c in c_source[110:]: i = r.randint(0, 5) @@ -287,7 +287,7 @@ done; }& if i == 3: destroyed_c_source += 'QX' destroyed_c_source += c - d.write(params['P_c'], destroyed_c_source) + d.write(task_params['P_c'], destroyed_c_source) d.chown(1000, 1000, params['P_c']) sh_path = r.choice(['/usr/share/doc', '/var/lib', '/usr/local/share', '/etc/alternatives']) sh_file = sh_path + '/' + params['net_prog_name'] @@ -298,4 +298,4 @@ export PATH=$PATH:{} {} & exit 0 -""".format(sh_path, params['net_prog_name'])) +""".format(sh_path, task_params['net_prog_name'])) |