From c5a8b2c72841ad0b58fb36870624737634778056 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Sat, 13 Oct 2018 03:10:03 +0200 Subject: HTMLize instructions and use jinja2 to render them Only fixed tasks for the kpov_2018 class for now. --- kpov_judge/tasks/mock_entrance_exam/task.py | 67 ++++++++++++++++------------- 1 file changed, 36 insertions(+), 31 deletions(-) (limited to 'kpov_judge/tasks/mock_entrance_exam') diff --git a/kpov_judge/tasks/mock_entrance_exam/task.py b/kpov_judge/tasks/mock_entrance_exam/task.py index 906df97..84dff82 100644 --- a/kpov_judge/tasks/mock_entrance_exam/task.py +++ b/kpov_judge/tasks/mock_entrance_exam/task.py @@ -5,45 +5,50 @@ # - switch to a real SSH/SFTP client to properly handle filenames instructions = { - 'si': ''' -Postavite dva navidezna računalnika - SimpleArbiter in Student. -Oba naj bosta povezana na internet. Poleg tega mora biti -Student na naslovu {student_IP} dostopen s SimpleArbiter. + 'si': '''\ +

+Postavite dva navidezna računalnika - SimpleArbiter in Student. Oba naj bosta povezana na internet. Poleg tega mora biti Student na naslovu {{student_IP}} dostopen s SimpleArbiter. -Računajte, da se na Student ob zagonu zažene program {net_prog_name}, -ki vam spreminja nastavitve mrežne kartice. +

+Računajte, da se na Student ob zagonu zažene program {{net_prog_name}}, ki vam spreminja nastavitve mrežne kartice. -V domačem imeniku uporabnika student obstaja program {P_c} v programskem jeziku C. -Prevedite ga v program z imenom {P_executable}. -Izvorna koda je namenoma pokvarjena tako, da so vanjo vrinjeni nepotrebni znaki. -Pred prevajanjem jo morate popraviti. +

+V domačem imeniku uporabnika student obstaja program {{P_c}} v programskem jeziku C. +Prevedite ga v program z imenom {{P_executable}}. 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} -- 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}. +

+Napišite skripto ali program {{P_script}} v domačem imeniku uporabnika student, ki: -Lastnik vseh ustvarjenih datotek mora biti uporabnik student. -Gesla uporabnika student (vaje) ne smete spreminjati.''', - 'en': '''Set up two virtual machines - SimpleArbiter and Student. -Both should be connected to the Internet. Student should also be accessible -from SimpleArbiter at the address {student_IP}. +

-Keep in mind that a program called {net_prog_name} starts on Student -whenever Student boots. This program may change your network settings. +

+Lastnik vseh ustvarjenih datotek mora biti uporabnik student. Gesla uporabnika student (vaje) ne smete spreminjati. +''', + 'en': '''\ +

+Set up two virtual machines - SimpleArbiter and Student. Both should be connected to the internet. Student should also be accessible from SimpleArbiter at the address {{student_IP}}. + +

+Keep in mind that a program called {{net_prog_name}} starts on Student on each boot. This program may change your network settings. + +

+There is a program called {{P_c}} in student’s home directory. Compile it into a program called {{P_executable}}. The source code is intentionally broken so that unneccessarry characters are inserted into the file. You have to fix the file before compiling. -There is a program called {P_c} in the home directory of student. Compile it -into a program called {P_executable}. The source code is intentionally broken -so that unneccessarry characters are inserted into the file. You have to fix -the file before compiling. +

+Also, write a script or program called {{P_script}} in student’s home directory. The script should: -Also, write a script or program called {P_script} in the home directory of student. -The script should: -- run {P_executable} with the argument {arg_c} and pipe the value of the environment variable {env_c} into {P_executable}'s standard input. -- redirect stderr of {P_executable} into a file called {out_stderr_c}. -- save each line which {P_executable} outputs and which contains the character sequence "ma" into {out_stdout_c}. +

-The owner of all created files should be student. You are not allowed to change student's password (vaje). +

+The owner of all created files should be student. You are not allowed to change student’s password (vaje). ''', } -- cgit v1.2.1 From 481fd30e6cc6fc242e9471ce08f676f4883a3e69 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Sat, 13 Oct 2018 19:16:45 +0200 Subject: Call write_default_config for arbiter in all KPOV 2018 tasks --- kpov_judge/tasks/mock_entrance_exam/task.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'kpov_judge/tasks/mock_entrance_exam') diff --git a/kpov_judge/tasks/mock_entrance_exam/task.py b/kpov_judge/tasks/mock_entrance_exam/task.py index 84dff82..01d4fa5 100644 --- a/kpov_judge/tasks/mock_entrance_exam/task.py +++ b/kpov_judge/tasks/mock_entrance_exam/task.py @@ -309,3 +309,6 @@ nohup {} & exit 0 """.format(sh_path, task_params['net_prog_name'])) + +def prepare_disks(templates, task_params, global_params): + write_default_config(templates['simpleArbiter'], global_params) -- cgit v1.2.1 From fe23a3348098bc62b91c866771bd6585e01e4929 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Sat, 13 Oct 2018 20:17:56 +0200 Subject: =?UTF-8?q?Oops,=20don=E2=80=99t=20redefine=20prepare=5Fdisks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kpov_judge/tasks/mock_entrance_exam/task.py | 1 - 1 file changed, 1 deletion(-) (limited to 'kpov_judge/tasks/mock_entrance_exam') diff --git a/kpov_judge/tasks/mock_entrance_exam/task.py b/kpov_judge/tasks/mock_entrance_exam/task.py index 01d4fa5..ad51c2a 100644 --- a/kpov_judge/tasks/mock_entrance_exam/task.py +++ b/kpov_judge/tasks/mock_entrance_exam/task.py @@ -310,5 +310,4 @@ nohup {} & exit 0 """.format(sh_path, task_params['net_prog_name'])) -def prepare_disks(templates, task_params, global_params): write_default_config(templates['simpleArbiter'], global_params) -- cgit v1.2.1