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. --- .../tasks/edit_find_grep_compile_convert/task.py | 65 +++++++++------------- 1 file changed, 27 insertions(+), 38 deletions(-) (limited to 'kpov_judge/tasks/edit_find_grep_compile_convert') diff --git a/kpov_judge/tasks/edit_find_grep_compile_convert/task.py b/kpov_judge/tasks/edit_find_grep_compile_convert/task.py index 7a96a0b..48b713b 100644 --- a/kpov_judge/tasks/edit_find_grep_compile_convert/task.py +++ b/kpov_judge/tasks/edit_find_grep_compile_convert/task.py @@ -5,54 +5,43 @@ # - switch to a real SSH/SFTP client to properly handle filenames instructions = { - 'si':""" -Ustvari dva navidezna računalnika s slikama diskov -- SimpleArbiter s sliko diska simpleArbiterDhcp in -SmallStudent s sliko diska student-entrance2. + 'si': '''\ +

+Ustvari dva navidezna računalnika: SimpleArbiter SmallStudent. -Na SimpleArbiter se lahko prijaviš z uporabniškim imenom tester in geslom tester. -Na SmallStudent se lahko prijaviš kot root z geslom kaboom. +

+Poskrbi, da bo SmallStudent s SimpleArbiter dostopen na naslovu {{testip}}. -Poskrbi, da bo SmallStudent s SimpleArbiter dostopen na naslovu {testip}. +

+Na SmallStudent ustvari uporabnika {{testuser}} z geslom {{passwd}}. -Na SmallStudent ustvari uporabnika {testuser} z geslom {passwd}. +

+Na SmallStudent je nekje v domačem imeniku uporabnika bilbo skrita datoteka, ki vsebuje niz {{magicstr}}. Skopiraj jo v domači imenik uporabnika {{testuser}} in jo poimenuj {{dstfile}}. Poskrbi, da bo lastnik {{testuser}}, skupina pa naj bo enaka kot pri izvorni datoteki. Brati naj jo ima pravico samo lastnik, pisati lastnik in skupina, poganjati nihče. -Na SmallStudent je nekje v domačem imeniku uporabnika "bilbo" skrita datoteka, ki vsebuje niz {magicstr}. -Skopiraj jo v domači imenik {testuser} in poimenuj {dstfile}. -Poskrbi, da bo lastnik {testuser}, skupina pa naj ostane nespremenjena. -Brati naj jo ima pravico samo lastnik, pisati lastnik in skupina, poganjati nihče. -V {dstfile} zamenjaj vse vrstice oblike poXYZlz, kjer so XYZ poljubni znaki, tako, da bo namesto XYZ niz "kaka". +

+V {{dstfile}} zamenjaj vse vrstice oblike poXYZlz, kjer je XYZ poljubno zaporedje znakov, tako, da bo namesto XYZ niz kaka. -Napiši program v poljubnem programskem jeziku, ki kot argument sprejme število B med 0 in 7. -Program naj prebere znak s standardnega vhoda. -Če je B-ti bit v znaku nastavljen na 1, naj izpiše "ta". -Če je B-ti bit nastavljen na 0, naj program izpiše "ti". -Program poimenuj {progname} in ga spravi v domači imenik {testuser}. -""", - 'en': ''' -Create two virtual machines -- SimpleArbiter using simpleArbiterDhcp as the disk image and -SmallStudent using student-entrance2 as its disk. +

+Napiši program v poljubnem programskem jeziku, ki kot argument sprejme število B med 0 in 7. Program naj prebere znak s standardnega vhoda Če je B-ti bit v znaku nastavljen na 1, naj izpiše ta. Če je B-ti bit nastavljen na 0, naj program izpiše ti. Program poimenuj {{progname}} in ga spravi v domači imenik uporabnika {{testuser}}. +''', + 'en': '''\ +

+Create two virtual machines: SimpleArbiter and SmallStudent. -You can log in as tester on SimpleArbiter with the password tester. -You can log in as root on SimpleStudent with the password kaboom. +

+Make sure that SmallStudent is accessible from SimpleArbiter on IP {{testip}}. -Make sure that SmallStudent is accessible from SimpleArbiter on IP {testip}. +

+Create a user {{testuser}} with the password {{passwd}} on SmallStudent. -Create a user {testuser} with the password {passwd} on SmallStudent. +

+There is a file containing {{magicstr}} hidden somewhere in the home directory of user bilbo. Copy it into {{testuser}}’s home directory and name it {{dstfile}}. Change the owner to {{testuser}} and ensure the group is the same as for the original file. Make sure only the owner has the right to read it, only the owner and group members have the right to write to it and nobody has the right to execute it. -There is a file containing {magicstr} hidden somewhere in the home directory of -user "bilbo". -Copy the into the home directory of user {testuser} and name it {dstfile}. -Change the owner to {testuser} and leave the group unchanged. -Make sure only the owner has the right to read it, only the owner and group members have the right to write to it and noone has the right to execute it. -In {dstfile}, replace all lines of the form poXYZlz where XYZ are arbitrary characters so that XYZ is replaced by "kaka". +

+In {{dstfile}}, replace all lines of the form poXYZlz where XYZ are arbitrary characters so that XYZ is replaced by kaka. -Write a program in any programming language. -The program should accept a single argument, B, which is a number between 0 and 7. -It should read a character from standard input and output "ta" if B-th bit in this character is -set to 1. If B-th bit is not set, the program should output "ti". -Name the program {progname} and place it in the home directory of {testuser}. +

+Write a program in any programming language. The program should accept a single argument B, which is a number between 0 and 7. It should read a character from standard input and output ta if B-th bit in this character is set to 1, and ti. If B-th bit is set to 0. Name the program {{progname}} and place it in the home directory of {{testuser}}. ''', } -- cgit v1.2.1