summaryrefslogtreecommitdiff
path: root/kpov_judge
diff options
context:
space:
mode:
Diffstat (limited to 'kpov_judge')
-rwxr-xr-xkpov_judge/create_disk_images.py2
-rw-r--r--kpov_judge/tasks/basic_network_gcc/task.py12
2 files changed, 8 insertions, 6 deletions
diff --git a/kpov_judge/create_disk_images.py b/kpov_judge/create_disk_images.py
index 3e59ed4..8b357ed 100755
--- a/kpov_judge/create_disk_images.py
+++ b/kpov_judge/create_disk_images.py
@@ -61,7 +61,7 @@ if __name__ == '__main__':
if len(sys.argv) != 1:
print "Usage: {0}"
print "Create the neccessarry disk images"
- db = pymongo.Connection(settings.DB_HOST).kpov
+ db = pymongo.MongoClient(settings.DB_HOST).kpov
try:
db.authenticate(settings.USERNAME, settings.PASSWORD)
except Exception, e:
diff --git a/kpov_judge/tasks/basic_network_gcc/task.py b/kpov_judge/tasks/basic_network_gcc/task.py
index 6aa2144..8311503 100644
--- a/kpov_judge/tasks/basic_network_gcc/task.py
+++ b/kpov_judge/tasks/basic_network_gcc/task.py
@@ -22,9 +22,11 @@ Izvorna koda je namenoma pokvarjena tako, da so vanjo vrinjeni nepotrebni znaki.
Pred prevajanjem jo morate popraviti.
Napišite skripto ali program {P_script} v domačem imeniku uporabnika student, ki:
-- požene {P_executable} z argumentom "{arg_c}" in mu na standardni vhod pripelje vrednost spremenljivke {env_c}
+- požene {P_executable} z argumentom "{arg_c}" in mu na standardni vhod
+ pripelje vrednost spremenljivke {env_c}
- vse, kar {P_executable} izpiše na stderr, spravi v datoteko {out_stderr_c}.
-- vse vrstice, ki jih {P_executable} izpiše na stdout in vsebujejo zaporedje znakov "ma", zapiše v {out_stdout_c}.
+- vse vrstice, ki jih {P_executable} izpiše na stdout in vsebujejo
+ zaporedje znakov "ma", zapiše v {out_stdout_c}.
Lastnik vseh ustvarjenih datotek mora biti uporabnik student.
@@ -176,11 +178,11 @@ def task_check(results, params):
for i in xrange(100):
s_out += chr(32 + ((ord(arg[i % arg_len]) ^ ord(var[i % env_len])) % 64))
r += ord(arg[i % arg_len]) + ord(var[i % env_len]) + i;
- if (i % 20 == 0):
+ if (i % 17 == 0):
s_out += "RAUS\r\n";
- if (i % 31 == 0):
+ if (i % 29 == 0):
s_out += 'ma'
- s_err += chr((r % 32) + ord('A'));
+ s_err += chr((r % 31) + ord('A'));
if (i % 23 == 0):
s_err += "PATACIS\r\n"
retval = r % 16