summaryrefslogtreecommitdiff
path: root/kpov_judge/tasks/basic_network_gcc
diff options
context:
space:
mode:
authorgasperfele@fri1.uni-lj.si <gasperfele@fri1.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414>2016-10-01 21:46:34 +0000
committergasperfele@fri1.uni-lj.si <gasperfele@fri1.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414>2016-10-01 21:46:34 +0000
commitfa8934667ad8eae30c81081bbaa868b227c119ed (patch)
treed2a69178cfb693c0da0ffbefaff2da70a64f52f5 /kpov_judge/tasks/basic_network_gcc
parent7210b74d6241a4264532aaaa2e1d771eaca4e073 (diff)
added a global_params parameter to prepare_disks so that the task_name, username and task_url are pre-entered on the arbiters
git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@351 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414
Diffstat (limited to 'kpov_judge/tasks/basic_network_gcc')
-rw-r--r--kpov_judge/tasks/basic_network_gcc/task.py10
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']))