summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgasperfele@fri1.uni-lj.si <gasperfele@fri1.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414>2014-11-21 08:33:49 +0000
committergasperfele@fri1.uni-lj.si <gasperfele@fri1.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414>2014-11-21 08:33:49 +0000
commit4ce9fe9a726b148c13fb98e8ac00715d438516a0 (patch)
tree6baea6fde65fe90a1ad240e1a9e66a98689518cb
parent694bbfde8a947560beec9549e9068e64024e2d7a (diff)
Updated the instructions on how to use the system
git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@8 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414
-rw-r--r--kpov_judge/README.txt120
l---------kpov_judge/courses/fri_kpov/01/evaluation (renamed from kpov_judge/lectures/fri_kpov/01/evaluation)0
-rw-r--r--kpov_judge/courses/fri_kpov/01/lecture/idea.txt (renamed from kpov_judge/lectures/fri_kpov/01/lecture/idea.txt)0
l---------kpov_judge/courses/fri_kpov/01/preparation (renamed from kpov_judge/lectures/fri_kpov/01/preparation)0
l---------kpov_judge/courses/fri_kpov/02/evaluation (renamed from kpov_judge/lectures/fri_kpov/02/evaluation)0
-rw-r--r--kpov_judge/courses/fri_kpov/02/lecture/idea.txt (renamed from kpov_judge/lectures/fri_kpov/02/lecture/idea.txt)0
l---------kpov_judge/courses/fri_kpov/02/preparation (renamed from kpov_judge/lectures/fri_kpov/02/preparation)0
l---------kpov_judge/courses/fri_kpov/03/evaluation (renamed from kpov_judge/lectures/fri_kpov/03/evaluation)0
-rw-r--r--kpov_judge/courses/fri_kpov/03/lecture/idea.txt (renamed from kpov_judge/lectures/fri_kpov/03/lecture/idea.txt)0
l---------kpov_judge/courses/fri_kpov/03/preparation (renamed from kpov_judge/lectures/fri_kpov/03/preparation)0
l---------kpov_judge/courses/fri_kpov/04/evaluation (renamed from kpov_judge/lectures/fri_kpov/04/evaluation)0
-rw-r--r--kpov_judge/courses/fri_kpov/04/lecture/idea.txt (renamed from kpov_judge/lectures/fri_kpov/04/lecture/idea.txt)0
l---------kpov_judge/courses/fri_kpov/04/preparation (renamed from kpov_judge/lectures/fri_kpov/04/preparation)0
l---------kpov_judge/courses/fri_kpov/05/evaluation (renamed from kpov_judge/lectures/fri_kpov/05/evaluation)0
-rw-r--r--kpov_judge/courses/fri_kpov/05/lecture/idea.txt (renamed from kpov_judge/lectures/fri_kpov/05/lecture/idea.txt)0
l---------kpov_judge/courses/fri_kpov/05/preparation (renamed from kpov_judge/lectures/fri_kpov/05/preparation)0
l---------kpov_judge/courses/fri_kpov/06/evaluation (renamed from kpov_judge/lectures/fri_kpov/06/evaluation)0
-rw-r--r--kpov_judge/courses/fri_kpov/06/lecture/idea.txt (renamed from kpov_judge/lectures/fri_kpov/06/lecture/idea.txt)0
l---------kpov_judge/courses/fri_kpov/06/preparation (renamed from kpov_judge/lectures/fri_kpov/06/preparation)0
l---------kpov_judge/courses/fri_kpov/07/evaluation (renamed from kpov_judge/lectures/fri_kpov/07/evaluation)0
-rw-r--r--kpov_judge/courses/fri_kpov/07/lecture/idea.txt (renamed from kpov_judge/lectures/fri_kpov/07/lecture/idea.txt)0
l---------kpov_judge/courses/fri_kpov/07/preparation (renamed from kpov_judge/lectures/fri_kpov/07/preparation)0
l---------kpov_judge/courses/fri_kpov/08/evaluation (renamed from kpov_judge/lectures/fri_kpov/08/evaluation)0
-rw-r--r--kpov_judge/courses/fri_kpov/08/lecture/idea.txt (renamed from kpov_judge/lectures/fri_kpov/08/lecture/idea.txt)0
l---------kpov_judge/courses/fri_kpov/08/preparation (renamed from kpov_judge/lectures/fri_kpov/08/preparation)0
l---------kpov_judge/courses/fri_kpov/09/evaluation (renamed from kpov_judge/lectures/fri_kpov/09/evaluation)0
-rw-r--r--kpov_judge/courses/fri_kpov/09/lecture/idea.txt (renamed from kpov_judge/lectures/fri_kpov/09/lecture/idea.txt)0
l---------kpov_judge/courses/fri_kpov/09/preparation (renamed from kpov_judge/lectures/fri_kpov/09/preparation)0
l---------kpov_judge/courses/fri_kpov/10/evaluation (renamed from kpov_judge/lectures/fri_kpov/10/evaluation)0
-rw-r--r--kpov_judge/courses/fri_kpov/10/lecture/idea.txt (renamed from kpov_judge/lectures/fri_kpov/10/lecture/idea.txt)0
l---------kpov_judge/courses/fri_kpov/10/preparation (renamed from kpov_judge/lectures/fri_kpov/10/preparation)0
l---------kpov_judge/courses/fri_kpov/11/evaluation (renamed from kpov_judge/lectures/fri_kpov/11/evaluation)0
-rw-r--r--kpov_judge/courses/fri_kpov/11/lecture/idea.txt (renamed from kpov_judge/lectures/fri_kpov/11/lecture/idea.txt)0
l---------kpov_judge/courses/fri_kpov/11/preparation (renamed from kpov_judge/lectures/fri_kpov/11/preparation)0
l---------kpov_judge/courses/fri_kpov/12/evaluation (renamed from kpov_judge/lectures/fri_kpov/12/evaluation)0
-rw-r--r--kpov_judge/courses/fri_kpov/12/lecture/idea.txt (renamed from kpov_judge/lectures/fri_kpov/12/lecture/idea.txt)0
l---------kpov_judge/courses/fri_kpov/12/preparation (renamed from kpov_judge/lectures/fri_kpov/12/preparation)0
l---------kpov_judge/courses/fri_kpov/13/evaluation (renamed from kpov_judge/lectures/fri_kpov/13/evaluation)0
-rw-r--r--kpov_judge/courses/fri_kpov/13/lecture/idea.txt (renamed from kpov_judge/lectures/fri_kpov/13/lecture/idea.txt)0
l---------kpov_judge/courses/fri_kpov/13/preparation (renamed from kpov_judge/lectures/fri_kpov/13/preparation)0
l---------kpov_judge/courses/fri_kpov/14/evaluation (renamed from kpov_judge/lectures/fri_kpov/14/evaluation)0
-rw-r--r--kpov_judge/courses/fri_kpov/14/lecture/idea.txt (renamed from kpov_judge/lectures/fri_kpov/14/lecture/idea.txt)0
l---------kpov_judge/courses/fri_kpov/14/preparation (renamed from kpov_judge/lectures/fri_kpov/14/preparation)0
-rw-r--r--kpov_judge/instructions_extractor.py43
-rwxr-xr-xkpov_judge/run_test.py4
-rw-r--r--kpov_judge/tasks/copy_rename_100_files/task.py8
-rw-r--r--kpov_judge/tasks/copy_rename_20_files_tail_env/evaluation/task.py120
-rw-r--r--kpov_judge/tasks/copy_rename_20_files_tail_env/lecture/ideja.txt1
-rw-r--r--kpov_judge/tasks/copy_rename_20_files_tail_env/task.py2
-rw-r--r--kpov_judge/tasks/custom_rdate/lecture/ideja.txt2
-rw-r--r--kpov_judge/tasks/custom_rdate/task.py8
-rw-r--r--kpov_judge/tasks/dhcp_dns_predefined_ip/task.py8
-rw-r--r--kpov_judge/tasks/isc_dhcp_live_boot/lecture/ideja.txt1
-rw-r--r--kpov_judge/tasks/isc_dhcp_live_boot/task.py10
-rw-r--r--kpov_judge/tasks/ldap_import/task.py8
-rw-r--r--kpov_judge/tasks/ldap_search/lecture/ideja.txt2
-rw-r--r--kpov_judge/tasks/ldap_search/task.py8
-rw-r--r--kpov_judge/tasks/nat_port_forward/task.py8
-rw-r--r--kpov_judge/tasks/nat_vlc/lecture/ideja.txt2
-rw-r--r--kpov_judge/tasks/nat_vlc/task.py8
-rw-r--r--kpov_judge/tasks/network_boot_custom_program/task.py8
-rw-r--r--kpov_judge/tasks/openvpn_multiple_hops/task.py8
-rw-r--r--kpov_judge/tasks/openvpn_simple_smb/lecture/ideja.txt2
-rw-r--r--kpov_judge/tasks/openvpn_simple_smb/task.py8
-rw-r--r--kpov_judge/tasks/openwrt/task.py8
-rw-r--r--kpov_judge/tasks/public_ip_ssh/lecture/ideja.txt2
-rw-r--r--kpov_judge/tasks/public_ip_ssh/task.py6
-rw-r--r--kpov_judge/tasks/public_ssh_motd_http/lecture/ideja.txt1
-rw-r--r--kpov_judge/tasks/public_ssh_motd_http/task.py8
-rw-r--r--kpov_judge/tasks/radius_multiple_realms/task.py8
-rw-r--r--kpov_judge/tasks/radius_mysql_pam/lecture/ideja.txt1
-rw-r--r--kpov_judge/tasks/radius_mysql_pam/task.py14
-rw-r--r--kpov_judge/tasks/rdate_64bit/task.py8
-rw-r--r--kpov_judge/tasks/set_ip_dhcp_hostname/task.py8
-rw-r--r--kpov_judge/tasks/set_ip_static_dhcp/evaluation/task.py100
-rw-r--r--kpov_judge/tasks/set_ip_static_dhcp/lecture/ideja.txt2
-rw-r--r--kpov_judge/tasks/set_ip_static_dhcp/task.py8
-rw-r--r--kpov_judge/tasks/set_motd/lecture/ideja.txt2
-rw-r--r--kpov_judge/tasks/set_motd/task.py6
-rw-r--r--kpov_judge/tasks/smb_nfs/lecture/ideja.txt1
-rw-r--r--kpov_judge/tasks/smb_nfs/task.py10
-rw-r--r--kpov_judge/tasks/snmp_agent_uptime/lecture/ideja.txt2
-rw-r--r--kpov_judge/tasks/snmp_agent_uptime/task.py6
-rw-r--r--kpov_judge/tasks/snmp_alarms_interfaces/task.py8
-rw-r--r--kpov_judge/tasks/vlc_stream_rtp/lecture/ideja.txt2
-rw-r--r--kpov_judge/tasks/vlc_stream_rtp/task.py8
-rwxr-xr-xkpov_judge/test_task.py161
87 files changed, 342 insertions, 427 deletions
diff --git a/kpov_judge/README.txt b/kpov_judge/README.txt
new file mode 100644
index 0000000..82d5cbd
--- /dev/null
+++ b/kpov_judge/README.txt
@@ -0,0 +1,120 @@
+What is kpov_judge
+
+ kpov_judge is a system for the automated grading of assignments for
+ networking and system administration courses.
+
+ Each assignment is represented by a task which a student should perform.
+ Tasks are customised for each student by setting a number of parameters
+ for each task.
+
+ Typically, each task involves a number of interconnected computers, one
+ of which contains the kpov_judge testing program (test_task.py). After
+ solving the task, a student runs the test_task.py to check their solution.
+ The testing results are uploaded to a server for grading and feedback can
+ be provided immediately.
+
+Using kpov_judge as a student
+
+ For each task, the student is supposed to set up some services or resources
+ on one or multiple computers. The services or resources are then checked to
+ see if the task has been performed successfully. The result of the test is
+ reported back to the student.
+
+ The instructions for each task are included in the task itself. The
+ parameters for each task are either prepared for each student in advance or
+ generated the moment a student tries to check whether they have performed
+ the task successfully.
+
+ The computers for each task are typically set up by downloading a set of
+ virtual disk images, creating a number of virtual machines using these
+ disks and connecting these virtual machines using virtual or physical
+ networks. After the computers are set up, a student can set up the services
+ required by the instructions.
+
+ The checking is done by the program test_task.py. This program can run in
+ both an on-line mode where some of the testing is done by a remote server
+ or an off-line mode where all the testing is done locally. Since kpov_judge
+ is expected to be mostly used by schools, usually the on-line mode will be
+ used by students for handing in graded assignments and for immediate
+ feedback during practice.
+
+Using kpov_judge as a teacher
+
+ TBD
+
+Preparing tasks
+
+ Within the kpov_judge repository, tasks are stored under kpov_judge/tasks.
+ New tasks should be added as sub-directories of tasks.
+
+ Each task is defined by a python file named task.py . The file task.py
+ contains:
+ - instructions - the task instructions in multiple languages,
+ - computers - a dictionary describing the computers used for this task,
+ - networks - a dictionary describing the network links for this task,
+ - params_meta - a dictionary with a description and other metadata for
+ each parameter for this task
+ - task(...) - a function for testing the student's solution of this task.
+ All the arguments for this function should be described in
+ params_meta and should be public. This function is run by
+ the student to test their task solution. The output of
+ task(...) should be relatively hard to fake - for example,
+ if the student had to set up the default route on one of
+ the computers, this function could return a string
+ containing the output of the 'netstat -r' command. The
+ idea is to make it harder for the student to fake the
+ correct output of task(...) than it would be to just
+ solve the task.
+ - task_check(results, params) - check the output of task(...).
+ The parameter results contains the return value of task(...).
+ The parameter params contains a dictionary of values for each
+ parameter used for this task
+ This function is used for grading the task and should return
+ a value between 0 and 10 with 0 representing the lowest and 10
+ representing the highest number of points attainable for solving
+ the task.
+ - gen_params(user_id, params_meta) - prepare all the parameters for
+ this task. For most tasks, most of the parameters will be randomly
+ generated according to the metadata in params_meta. A number of
+ helper functions for generating the parameters are available in
+ kpov_random_helpers.py
+ - prepare_disks(templates, params) - prepare the disk images for this
+ task. For some tasks it might be neccessarry to create or edit
+ some files on the virtual disk images used by each student to set
+ up the computers needed for this task. The parameter templates
+ contains a dictionary of guestfs objects. Refer to the libguestfs
+ documentation for more information.
+
+ Typically, a new task is created by the following steps:
+ - prepare a (virtual) testing computer
+ - checkout the kpov_judge repository on the testing computer
+ - create a copy of an existing task to use as reference
+ - change the instructions in task.py
+ - create the other computers and networks involved in this task
+ - change the dictionaries computers and networks in task.py
+ - change the params_meta to correspond to the new instructions.
+ - write a task(...) function which returns a simple string
+ - write a task_check function which simply prints out the parameter
+ results
+ - debug everything you have created so far by performing the task
+ and running test_task.py as many times as needed
+ - write the task_check and gen_params functions
+ - write the prepare_disks function
+ - commit the new task to the repository
+ - checkout the task on the web-based evaluation system
+ - upload the clean virtual disk images, add the task to the web-based
+ system
+ - log in as a student, download the images, solve task, run task_check
+ - debug the task if needed
+
+ For each course taught using kpov_judge, a directory should be created
+ under kpov_judge/courses. Each course's directory can be arranged in any
+ way the lecturer sees fit. For fri_kpov, the directory contains one
+ sub-directory for each lesson. Each lesson consists of a task the student
+ should perform before attending class (preparation), the instructions
+ for that week's class (lecture) and a task the student will be graded on
+ after the class (evaluation).
+
+
+
+
diff --git a/kpov_judge/lectures/fri_kpov/01/evaluation b/kpov_judge/courses/fri_kpov/01/evaluation
index bc7800d..bc7800d 120000
--- a/kpov_judge/lectures/fri_kpov/01/evaluation
+++ b/kpov_judge/courses/fri_kpov/01/evaluation
diff --git a/kpov_judge/lectures/fri_kpov/01/lecture/idea.txt b/kpov_judge/courses/fri_kpov/01/lecture/idea.txt
index e05a775..e05a775 100644
--- a/kpov_judge/lectures/fri_kpov/01/lecture/idea.txt
+++ b/kpov_judge/courses/fri_kpov/01/lecture/idea.txt
diff --git a/kpov_judge/lectures/fri_kpov/01/preparation b/kpov_judge/courses/fri_kpov/01/preparation
index bc7800d..bc7800d 120000
--- a/kpov_judge/lectures/fri_kpov/01/preparation
+++ b/kpov_judge/courses/fri_kpov/01/preparation
diff --git a/kpov_judge/lectures/fri_kpov/02/evaluation b/kpov_judge/courses/fri_kpov/02/evaluation
index aa80e13..aa80e13 120000
--- a/kpov_judge/lectures/fri_kpov/02/evaluation
+++ b/kpov_judge/courses/fri_kpov/02/evaluation
diff --git a/kpov_judge/lectures/fri_kpov/02/lecture/idea.txt b/kpov_judge/courses/fri_kpov/02/lecture/idea.txt
index 23f5dcc..23f5dcc 100644
--- a/kpov_judge/lectures/fri_kpov/02/lecture/idea.txt
+++ b/kpov_judge/courses/fri_kpov/02/lecture/idea.txt
diff --git a/kpov_judge/lectures/fri_kpov/02/preparation b/kpov_judge/courses/fri_kpov/02/preparation
index 92a2558..92a2558 120000
--- a/kpov_judge/lectures/fri_kpov/02/preparation
+++ b/kpov_judge/courses/fri_kpov/02/preparation
diff --git a/kpov_judge/lectures/fri_kpov/03/evaluation b/kpov_judge/courses/fri_kpov/03/evaluation
index 83669c5..83669c5 120000
--- a/kpov_judge/lectures/fri_kpov/03/evaluation
+++ b/kpov_judge/courses/fri_kpov/03/evaluation
diff --git a/kpov_judge/lectures/fri_kpov/03/lecture/idea.txt b/kpov_judge/courses/fri_kpov/03/lecture/idea.txt
index 92d984c..92d984c 100644
--- a/kpov_judge/lectures/fri_kpov/03/lecture/idea.txt
+++ b/kpov_judge/courses/fri_kpov/03/lecture/idea.txt
diff --git a/kpov_judge/lectures/fri_kpov/03/preparation b/kpov_judge/courses/fri_kpov/03/preparation
index ecf9a02..ecf9a02 120000
--- a/kpov_judge/lectures/fri_kpov/03/preparation
+++ b/kpov_judge/courses/fri_kpov/03/preparation
diff --git a/kpov_judge/lectures/fri_kpov/04/evaluation b/kpov_judge/courses/fri_kpov/04/evaluation
index 8c03708..8c03708 120000
--- a/kpov_judge/lectures/fri_kpov/04/evaluation
+++ b/kpov_judge/courses/fri_kpov/04/evaluation
diff --git a/kpov_judge/lectures/fri_kpov/04/lecture/idea.txt b/kpov_judge/courses/fri_kpov/04/lecture/idea.txt
index 1a29e34..1a29e34 100644
--- a/kpov_judge/lectures/fri_kpov/04/lecture/idea.txt
+++ b/kpov_judge/courses/fri_kpov/04/lecture/idea.txt
diff --git a/kpov_judge/lectures/fri_kpov/04/preparation b/kpov_judge/courses/fri_kpov/04/preparation
index bf8f78f..bf8f78f 120000
--- a/kpov_judge/lectures/fri_kpov/04/preparation
+++ b/kpov_judge/courses/fri_kpov/04/preparation
diff --git a/kpov_judge/lectures/fri_kpov/05/evaluation b/kpov_judge/courses/fri_kpov/05/evaluation
index bfe5840..bfe5840 120000
--- a/kpov_judge/lectures/fri_kpov/05/evaluation
+++ b/kpov_judge/courses/fri_kpov/05/evaluation
diff --git a/kpov_judge/lectures/fri_kpov/05/lecture/idea.txt b/kpov_judge/courses/fri_kpov/05/lecture/idea.txt
index 91c85c2..91c85c2 100644
--- a/kpov_judge/lectures/fri_kpov/05/lecture/idea.txt
+++ b/kpov_judge/courses/fri_kpov/05/lecture/idea.txt
diff --git a/kpov_judge/lectures/fri_kpov/05/preparation b/kpov_judge/courses/fri_kpov/05/preparation
index 214ed3a..214ed3a 120000
--- a/kpov_judge/lectures/fri_kpov/05/preparation
+++ b/kpov_judge/courses/fri_kpov/05/preparation
diff --git a/kpov_judge/lectures/fri_kpov/06/evaluation b/kpov_judge/courses/fri_kpov/06/evaluation
index 13f05ef..13f05ef 120000
--- a/kpov_judge/lectures/fri_kpov/06/evaluation
+++ b/kpov_judge/courses/fri_kpov/06/evaluation
diff --git a/kpov_judge/lectures/fri_kpov/06/lecture/idea.txt b/kpov_judge/courses/fri_kpov/06/lecture/idea.txt
index 89f3a3a..89f3a3a 100644
--- a/kpov_judge/lectures/fri_kpov/06/lecture/idea.txt
+++ b/kpov_judge/courses/fri_kpov/06/lecture/idea.txt
diff --git a/kpov_judge/lectures/fri_kpov/06/preparation b/kpov_judge/courses/fri_kpov/06/preparation
index aaee75c..aaee75c 120000
--- a/kpov_judge/lectures/fri_kpov/06/preparation
+++ b/kpov_judge/courses/fri_kpov/06/preparation
diff --git a/kpov_judge/lectures/fri_kpov/07/evaluation b/kpov_judge/courses/fri_kpov/07/evaluation
index a033e6b..a033e6b 120000
--- a/kpov_judge/lectures/fri_kpov/07/evaluation
+++ b/kpov_judge/courses/fri_kpov/07/evaluation
diff --git a/kpov_judge/lectures/fri_kpov/07/lecture/idea.txt b/kpov_judge/courses/fri_kpov/07/lecture/idea.txt
index a380311..a380311 100644
--- a/kpov_judge/lectures/fri_kpov/07/lecture/idea.txt
+++ b/kpov_judge/courses/fri_kpov/07/lecture/idea.txt
diff --git a/kpov_judge/lectures/fri_kpov/07/preparation b/kpov_judge/courses/fri_kpov/07/preparation
index 338e3c4..338e3c4 120000
--- a/kpov_judge/lectures/fri_kpov/07/preparation
+++ b/kpov_judge/courses/fri_kpov/07/preparation
diff --git a/kpov_judge/lectures/fri_kpov/08/evaluation b/kpov_judge/courses/fri_kpov/08/evaluation
index 9f38dbd..9f38dbd 120000
--- a/kpov_judge/lectures/fri_kpov/08/evaluation
+++ b/kpov_judge/courses/fri_kpov/08/evaluation
diff --git a/kpov_judge/lectures/fri_kpov/08/lecture/idea.txt b/kpov_judge/courses/fri_kpov/08/lecture/idea.txt
index 0832279..0832279 100644
--- a/kpov_judge/lectures/fri_kpov/08/lecture/idea.txt
+++ b/kpov_judge/courses/fri_kpov/08/lecture/idea.txt
diff --git a/kpov_judge/lectures/fri_kpov/08/preparation b/kpov_judge/courses/fri_kpov/08/preparation
index 43d41d1..43d41d1 120000
--- a/kpov_judge/lectures/fri_kpov/08/preparation
+++ b/kpov_judge/courses/fri_kpov/08/preparation
diff --git a/kpov_judge/lectures/fri_kpov/09/evaluation b/kpov_judge/courses/fri_kpov/09/evaluation
index 4cf01e0..4cf01e0 120000
--- a/kpov_judge/lectures/fri_kpov/09/evaluation
+++ b/kpov_judge/courses/fri_kpov/09/evaluation
diff --git a/kpov_judge/lectures/fri_kpov/09/lecture/idea.txt b/kpov_judge/courses/fri_kpov/09/lecture/idea.txt
index 0fb111a..0fb111a 100644
--- a/kpov_judge/lectures/fri_kpov/09/lecture/idea.txt
+++ b/kpov_judge/courses/fri_kpov/09/lecture/idea.txt
diff --git a/kpov_judge/lectures/fri_kpov/09/preparation b/kpov_judge/courses/fri_kpov/09/preparation
index 93958cb..93958cb 120000
--- a/kpov_judge/lectures/fri_kpov/09/preparation
+++ b/kpov_judge/courses/fri_kpov/09/preparation
diff --git a/kpov_judge/lectures/fri_kpov/10/evaluation b/kpov_judge/courses/fri_kpov/10/evaluation
index 7dad5da..7dad5da 120000
--- a/kpov_judge/lectures/fri_kpov/10/evaluation
+++ b/kpov_judge/courses/fri_kpov/10/evaluation
diff --git a/kpov_judge/lectures/fri_kpov/10/lecture/idea.txt b/kpov_judge/courses/fri_kpov/10/lecture/idea.txt
index 3ae0c92..3ae0c92 100644
--- a/kpov_judge/lectures/fri_kpov/10/lecture/idea.txt
+++ b/kpov_judge/courses/fri_kpov/10/lecture/idea.txt
diff --git a/kpov_judge/lectures/fri_kpov/10/preparation b/kpov_judge/courses/fri_kpov/10/preparation
index 88dd369..88dd369 120000
--- a/kpov_judge/lectures/fri_kpov/10/preparation
+++ b/kpov_judge/courses/fri_kpov/10/preparation
diff --git a/kpov_judge/lectures/fri_kpov/11/evaluation b/kpov_judge/courses/fri_kpov/11/evaluation
index 632bdfe..632bdfe 120000
--- a/kpov_judge/lectures/fri_kpov/11/evaluation
+++ b/kpov_judge/courses/fri_kpov/11/evaluation
diff --git a/kpov_judge/lectures/fri_kpov/11/lecture/idea.txt b/kpov_judge/courses/fri_kpov/11/lecture/idea.txt
index fd9d1a9..fd9d1a9 100644
--- a/kpov_judge/lectures/fri_kpov/11/lecture/idea.txt
+++ b/kpov_judge/courses/fri_kpov/11/lecture/idea.txt
diff --git a/kpov_judge/lectures/fri_kpov/11/preparation b/kpov_judge/courses/fri_kpov/11/preparation
index 193fb07..193fb07 120000
--- a/kpov_judge/lectures/fri_kpov/11/preparation
+++ b/kpov_judge/courses/fri_kpov/11/preparation
diff --git a/kpov_judge/lectures/fri_kpov/12/evaluation b/kpov_judge/courses/fri_kpov/12/evaluation
index 63a7017..63a7017 120000
--- a/kpov_judge/lectures/fri_kpov/12/evaluation
+++ b/kpov_judge/courses/fri_kpov/12/evaluation
diff --git a/kpov_judge/lectures/fri_kpov/12/lecture/idea.txt b/kpov_judge/courses/fri_kpov/12/lecture/idea.txt
index 852ee43..852ee43 100644
--- a/kpov_judge/lectures/fri_kpov/12/lecture/idea.txt
+++ b/kpov_judge/courses/fri_kpov/12/lecture/idea.txt
diff --git a/kpov_judge/lectures/fri_kpov/12/preparation b/kpov_judge/courses/fri_kpov/12/preparation
index 28b7694..28b7694 120000
--- a/kpov_judge/lectures/fri_kpov/12/preparation
+++ b/kpov_judge/courses/fri_kpov/12/preparation
diff --git a/kpov_judge/lectures/fri_kpov/13/evaluation b/kpov_judge/courses/fri_kpov/13/evaluation
index 350e3c0..350e3c0 120000
--- a/kpov_judge/lectures/fri_kpov/13/evaluation
+++ b/kpov_judge/courses/fri_kpov/13/evaluation
diff --git a/kpov_judge/lectures/fri_kpov/13/lecture/idea.txt b/kpov_judge/courses/fri_kpov/13/lecture/idea.txt
index 7e12372..7e12372 100644
--- a/kpov_judge/lectures/fri_kpov/13/lecture/idea.txt
+++ b/kpov_judge/courses/fri_kpov/13/lecture/idea.txt
diff --git a/kpov_judge/lectures/fri_kpov/13/preparation b/kpov_judge/courses/fri_kpov/13/preparation
index 3fa7bd2..3fa7bd2 120000
--- a/kpov_judge/lectures/fri_kpov/13/preparation
+++ b/kpov_judge/courses/fri_kpov/13/preparation
diff --git a/kpov_judge/lectures/fri_kpov/14/evaluation b/kpov_judge/courses/fri_kpov/14/evaluation
index e6e31f2..e6e31f2 120000
--- a/kpov_judge/lectures/fri_kpov/14/evaluation
+++ b/kpov_judge/courses/fri_kpov/14/evaluation
diff --git a/kpov_judge/lectures/fri_kpov/14/lecture/idea.txt b/kpov_judge/courses/fri_kpov/14/lecture/idea.txt
index e9647ce..e9647ce 100644
--- a/kpov_judge/lectures/fri_kpov/14/lecture/idea.txt
+++ b/kpov_judge/courses/fri_kpov/14/lecture/idea.txt
diff --git a/kpov_judge/lectures/fri_kpov/14/preparation b/kpov_judge/courses/fri_kpov/14/preparation
index 51c2854..51c2854 120000
--- a/kpov_judge/lectures/fri_kpov/14/preparation
+++ b/kpov_judge/courses/fri_kpov/14/preparation
diff --git a/kpov_judge/instructions_extractor.py b/kpov_judge/instructions_extractor.py
index 5574389..4e00dc5 100644
--- a/kpov_judge/instructions_extractor.py
+++ b/kpov_judge/instructions_extractor.py
@@ -2,23 +2,40 @@
import glob
import os.path
+import os
from bson.son import SON
import sys
+def print_instructions(p, fname):
+ try:
+ print "---------------"
+ l = p.split(os.sep)
+ l1 = []
+ for i in xrange(len(l)):
+ f = os.path.join(*l[:i+1])
+ if os.path.islink(f):
+ s = "{0} ({1})".format(l[i], os.path.split(os.readlink(f))[1])
+ else:
+ s = l[i]
+ l1.append(s)
+ print p
+ print " - ".join(l1)
+ with open(os.path.join(p, fname)) as f:
+ task_code = compile(f.read(), fname, 'exec')
+ exec(task_code)
+ for lang, text in instructions.iteritems():
+ print("Language: {0}".format(lang))
+ print(text.encode('utf-8'))
+ print("")
+ except Exception, e:
+ print e
+ pass
if __name__ == '__main__':
l = glob.glob(sys.argv[1])
l.sort()
- for week in l:
- print "---------------"
- for part in ['preparation', 'evaluation']:
- try:
- print week.split('/')[2], '-' , part, ':'
- with open(os.path.join(week, part, 'task.py')) as f:
- task_code = compile(f.read(), 'task.py', 'exec')
- exec(task_code)
- print instructions['si'].encode('utf-8')
- except Exception, e:
- print e
- pass
-
+ for d in l:
+ for root, dirs, files in os.walk(d, followlinks=True):
+ for fname in files:
+ if fname == 'task.py':
+ print_instructions(root, fname)
diff --git a/kpov_judge/run_test.py b/kpov_judge/run_test.py
index 894bfe6..2a2155b 100755
--- a/kpov_judge/run_test.py
+++ b/kpov_judge/run_test.py
@@ -49,7 +49,7 @@ def load_checker(request):
t = compile(source, 'task.py', 'exec')
exec(t)
args_list = inspect.getargs(task.func_code)[0]
- return task, args_list, param_meta
+ return task, None, args_list, param_meta
if __name__ == '__main__':
try:
@@ -83,7 +83,7 @@ if __name__ == '__main__':
req = urllib2.Request(TASK_URL.format(**saved_params))
response = urllib2.urlopen(req)
# load task_check over the net
- task, args_list, meta = load_checker(response)
+ task, task_check, args_list, meta = load_checker(response)
# get missing parameters from user
task_params = get_params(task_params, args_list, meta, d)
# save
diff --git a/kpov_judge/tasks/copy_rename_100_files/task.py b/kpov_judge/tasks/copy_rename_100_files/task.py
index 834cb2a..614afd5 100644
--- a/kpov_judge/tasks/copy_rename_100_files/task.py
+++ b/kpov_judge/tasks/copy_rename_100_files/task.py
@@ -61,10 +61,10 @@ computers = {
networks = { 'net1': {'public': False}, 'test-net': {'public': True} }
params_meta = {
- 'IP_NM': {'opis': 'Naslov maliNetworkManager', 'w': False, 'public':True, 'type': 'IP', 'generated': True},
- 'DNS_NM': {'opis': 'DNS za maliNetworkManager', 'w': False, 'public':True, 'type': 'IP', 'generated': True},
- 'IP_static': {'opis': 'Naslov maliBrezNetworkManager', 'w': False, 'public': True, 'type': 'IP', 'generated': True},
- 'DNS_static': {'opis': 'DNS za maliBrezNetworkManager', 'w': False, 'public': True, 'type': 'IP', 'generated': True},
+ 'IP_NM': {'descriptions': {'si': 'Naslov maliNetworkManager'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
+ 'DNS_NM': {'descriptions': {'si': 'DNS za maliNetworkManager'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
+ 'IP_static': {'descriptions': {'si': 'Naslov maliBrezNetworkManager'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True},
+ 'DNS_static': {'descriptions': {'si': 'DNS za maliBrezNetworkManager'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True},
}
def task(IP_NM, DNS_NM, IP_static, DNS_static):
diff --git a/kpov_judge/tasks/copy_rename_20_files_tail_env/evaluation/task.py b/kpov_judge/tasks/copy_rename_20_files_tail_env/evaluation/task.py
deleted file mode 100644
index 834cb2a..0000000
--- a/kpov_judge/tasks/copy_rename_20_files_tail_env/evaluation/task.py
+++ /dev/null
@@ -1,120 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-# kpovRandomHelpers should be imported by add_assignment.py
-
-instructions = {
- 'si':u"""
-Ustvari dva navidezna računalnika. Za prvega uporabi sliko diska simpleArbiterDhcp. Na drugem računalniku
-ustvari uporabnika test z geslom test.
-Na sliki diska simpleArbiterDhcp najdeš imenik s 100 datotekami. Prekopiraj vse datoteke na drugi računalnik, v domači imenik uporabnika test.
-Spremeni vsebino datotek tako, da vse male črke spremeniš v velike. Poskrbi, da se bo s prvega računalnika (simpleArbiterDhcp) mogoče prek
-ssh prijaviti na drugi računalnik in prebrati predelane datoteke.
-"""
-}
-
-computers = {
- 'maliNetworkManager': {
- 'disks': [
- { 'name': 'maliNetworkManager',
- },
- #{ 'name': 'CDROM',
- # 'options':{'readonly': True},
- # 'parts': [],# no parts, no mounting.
- #}
- ],
- 'network_interfaces': [{'network': 'net1'}],
- 'flavor': 'm1.tiny',
- 'config_drive': False
-
- },
- 'maliBrezNetworkManager': {
- 'disks': [
- { 'name': 'maliBrezNetworkManager',
- },
- #{ 'name': 'CDROM',
- # 'options':{'readonly': True},
- # 'parts': [],# no parts, no mounting.
- #}
- ],
- 'network_interfaces': [{'network': 'net1'}],
- 'flavor': 'm1.tiny',
- 'config_drive': False
-
- },
- 'SimpleArbiter': {
- 'disks': [
- { 'name': 'simpleArbiterDhcp',
- # attempt automount
- },
- #{ 'name': 'CDROM',
- # 'options': {'readonly': True},
- # 'parts': [{'dev': 'b1', 'path': '/cdrom'}],
- #},
- ],
- 'network_interfaces': [{'network': 'net1'}, {'network': 'test-net'}],
- 'flavor': 'm1.tiny',
- 'config_drive': False
- }
-}
-
-networks = { 'net1': {'public': False}, 'test-net': {'public': True} }
-
-params_meta = {
- 'IP_NM': {'opis': 'Naslov maliNetworkManager', 'w': False, 'public':True, 'type': 'IP', 'generated': True},
- 'DNS_NM': {'opis': 'DNS za maliNetworkManager', 'w': False, 'public':True, 'type': 'IP', 'generated': True},
- 'IP_static': {'opis': 'Naslov maliBrezNetworkManager', 'w': False, 'public': True, 'type': 'IP', 'generated': True},
- 'DNS_static': {'opis': 'DNS za maliBrezNetworkManager', 'w': False, 'public': True, 'type': 'IP', 'generated': True},
-}
-
-def task(IP_NM, DNS_NM, IP_static, DNS_static):
- import pxssh
- import pexpect
- results = dict()
- peer_user = 'student'
- peer_passwd = 'vaje'
- sA = pxssh.pxssh()
- sB = pxssh.pxssh()
- sA.login(IP_NM, peer_user, peer_passwd)
- sB.login(IP_static, peer_user, peer_passwd)
- # sA
- # make sure NM is not handling eth0
- results['NM_nmcli'] = sA.run('nmcli d')
- results['NM_nslookup'] = sA.run('nslookup www.arnes.si')
- # sB
- # check whether NM is handling eth0
- results['static_nmcli'] = sB.run('nmcli d')
- results['static_nslookup'] = sB.run('nslookup www.arnes.si')
- sA.logout()
- sB.logout()
- return results
-
-def gen_params(user_id, params_meta):
- params = dict()
- r = random.Random(user_id)
- # IP_NM, DNS_NM, IP_static, DNS_static)
- dns_servers = ['193.2.1.66', '193.2.1.72', '8.8.8.8', '8.8.4.4', '208.67.222.222', '208.67.220.220']
- net = kpovRandomHelpers.IPv4_subnet_gen(r, '172.23.128.0/18', 24)
- params['DNS_NM'] = r.choice(dns_servers)
- params['IP_NM'], params['IP_static'] = kpovRandomHelpers.IPv4_addr_gen(r, net, 2)
- params['DNS_static'] = r.choice(dns_servers)
- return params
-
-def task_check(results, params):
- import re
- score = -9
- if results['NM_nslookup'].find('Server:\t\t{0}\r'.format(params['DNS_NM'])) > -1:
- score += 3
- if results['static_nslookup'].find('Server:\t\t{0}\r'.format(params['DNS_static'])) > -1:
- score += 3
- if re.search(r'eth0 +802-.*connected', results['NM_nmcli']):
- score += 2
- if not re.search(r'eth0 +802-.*connected', results['static_nmcli']):
- score += 2
- score = 0
- return score
-
-def prepare_disks(templates, params):
-# d = templates['simpleArbiterDhcp']
- pass
-
diff --git a/kpov_judge/tasks/copy_rename_20_files_tail_env/lecture/ideja.txt b/kpov_judge/tasks/copy_rename_20_files_tail_env/lecture/ideja.txt
deleted file mode 100644
index 1a29e34..0000000
--- a/kpov_judge/tasks/copy_rename_20_files_tail_env/lecture/ideja.txt
+++ /dev/null
@@ -1 +0,0 @@
-Vprašanja/odgovori glede pristopnega kolokvija. Bashizmi. Morda window managerji.
diff --git a/kpov_judge/tasks/copy_rename_20_files_tail_env/task.py b/kpov_judge/tasks/copy_rename_20_files_tail_env/task.py
index 05bfd2c..309a902 100644
--- a/kpov_judge/tasks/copy_rename_20_files_tail_env/task.py
+++ b/kpov_judge/tasks/copy_rename_20_files_tail_env/task.py
@@ -50,7 +50,7 @@ computers = {
networks = { 'net1': {'public': False}, 'test-net': {'public': True} }
params_meta = {
- 'IP_NM': {'opis': 'Naslov maliNetworkManager', 'w': False, 'public':True, 'type': 'IP', 'generated': True},
+ 'IP_NM': {'descriptions': {'si': 'Naslov maliNetworkManager'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
}
def task(IP_NM, DNS_NM, IP_static, DNS_static):
diff --git a/kpov_judge/tasks/custom_rdate/lecture/ideja.txt b/kpov_judge/tasks/custom_rdate/lecture/ideja.txt
deleted file mode 100644
index 0fb111a..0000000
--- a/kpov_judge/tasks/custom_rdate/lecture/ideja.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Napiši svoj rdate klient. Nastavi računalnik, da bo uro sinhroniziral z NTP strežnika.
-
diff --git a/kpov_judge/tasks/custom_rdate/task.py b/kpov_judge/tasks/custom_rdate/task.py
index caf6298..ea2c098 100644
--- a/kpov_judge/tasks/custom_rdate/task.py
+++ b/kpov_judge/tasks/custom_rdate/task.py
@@ -48,10 +48,10 @@ computers = {
networks = { 'net1': {'public': False}, 'test-net': {'public': True} }
params_meta = {
- 'IP_NM': {'opis': 'Naslov maliNetworkManager', 'w': False, 'public':True, 'type': 'IP', 'generated': True},
- 'DNS_NM': {'opis': 'DNS za maliNetworkManager', 'w': False, 'public':True, 'type': 'IP', 'generated': True},
- 'IP_static': {'opis': 'Naslov maliBrezNetworkManager', 'w': False, 'public': True, 'type': 'IP', 'generated': True},
- 'DNS_static': {'opis': 'DNS za maliBrezNetworkManager', 'w': False, 'public': True, 'type': 'IP', 'generated': True},
+ 'IP_NM': {'descriptions': {'si': 'Naslov maliNetworkManager'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
+ 'DNS_NM': {'descriptions': {'si': 'DNS za maliNetworkManager'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
+ 'IP_static': {'descriptions': {'si': 'Naslov maliBrezNetworkManager'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True},
+ 'DNS_static': {'descriptions': {'si': 'DNS za maliBrezNetworkManager'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True},
}
def task(IP_NM, DNS_NM, IP_static, DNS_static):
diff --git a/kpov_judge/tasks/dhcp_dns_predefined_ip/task.py b/kpov_judge/tasks/dhcp_dns_predefined_ip/task.py
index 5e443ce..9f6c591 100644
--- a/kpov_judge/tasks/dhcp_dns_predefined_ip/task.py
+++ b/kpov_judge/tasks/dhcp_dns_predefined_ip/task.py
@@ -59,10 +59,10 @@ computers = {
networks = { 'net1': {'public': False}, 'test-net': {'public': True} }
params_meta = {
- 'IP_NM': {'opis': 'Naslov maliNetworkManager', 'w': False, 'public':True, 'type': 'IP', 'generated': True},
- 'DNS_NM': {'opis': 'DNS za maliNetworkManager', 'w': False, 'public':True, 'type': 'IP', 'generated': True},
- 'IP_static': {'opis': 'Naslov maliBrezNetworkManager', 'w': False, 'public': True, 'type': 'IP', 'generated': True},
- 'DNS_static': {'opis': 'DNS za maliBrezNetworkManager', 'w': False, 'public': True, 'type': 'IP', 'generated': True},
+ 'IP_NM': {'descriptions': {'si': 'Naslov maliNetworkManager'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
+ 'DNS_NM': {'descriptions': {'si': 'DNS za maliNetworkManager'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
+ 'IP_static': {'descriptions': {'si': 'Naslov maliBrezNetworkManager'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True},
+ 'DNS_static': {'descriptions': {'si': 'DNS za maliBrezNetworkManager'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True},
}
def task(IP_NM, DNS_NM, IP_static, DNS_static):
diff --git a/kpov_judge/tasks/isc_dhcp_live_boot/lecture/ideja.txt b/kpov_judge/tasks/isc_dhcp_live_boot/lecture/ideja.txt
deleted file mode 100644
index 89f3a3a..0000000
--- a/kpov_judge/tasks/isc_dhcp_live_boot/lecture/ideja.txt
+++ /dev/null
@@ -1 +0,0 @@
-Nastavi strežnik dhcp tako, da bodo računalniki v različnih skupinah dobili različna imena zagonskih datotek. Nastavi syslinux tako, da se bo ob zagonu syslinux pokazala slika.
diff --git a/kpov_judge/tasks/isc_dhcp_live_boot/task.py b/kpov_judge/tasks/isc_dhcp_live_boot/task.py
index c060db6..0a6c33c 100644
--- a/kpov_judge/tasks/isc_dhcp_live_boot/task.py
+++ b/kpov_judge/tasks/isc_dhcp_live_boot/task.py
@@ -68,11 +68,11 @@ computers = {
networks = { 'net1': {'public': False}, 'test-net': {'public': True} }
params_meta = {
- 'IP_DHCP': {'opis': 'IP DHCP streznika', 'w': False, 'public': True, 'type':'IP', 'generated': True},
- 'IP_GW': {'opis': 'IP SimpleArbiterja', 'w': False, 'public': True, 'type':'IP', 'generated': True},
- 'MAC_BOOT': {'opis': 'MAC racunalnika, ki se zazene z ISO', 'w': True, 'public': True, 'type':'MAC', 'generated': False},
- 'IP_BOOT': {'opis': 'IP racunalnika, ki se zazene z ISO', 'w': True, 'public': True, 'type':'IP', 'generated': False},
- 'BOOT_FNAME': {'opis': 'Ime datoteke', 'w': False, 'public': True, 'type': 'filename', 'generated': True},
+ 'IP_DHCP': {'descriptions': {'si': 'IP DHCP streznika'}, 'w': False, 'public': True, 'type':'IP', 'generated': True},
+ 'IP_GW': {'descriptions': {'si': 'IP SimpleArbiterja'}, 'w': False, 'public': True, 'type':'IP', 'generated': True},
+ 'MAC_BOOT': {'descriptions': {'si': 'MAC racunalnika, ki se zazene z ISO'}, 'w': True, 'public': True, 'type':'MAC', 'generated': False},
+ 'IP_BOOT': {'descriptions': {'si': 'IP racunalnika, ki se zazene z ISO'}, 'w': True, 'public': True, 'type':'IP', 'generated': False},
+ 'BOOT_FNAME': {'descriptions': {'si': 'Ime datoteke'}, 'w': False, 'public': True, 'type': 'filename', 'generated': True},
}
def task(IP_DHCP, IP_GW, MAC_BOOT, BOOT_FNAME):
diff --git a/kpov_judge/tasks/ldap_import/task.py b/kpov_judge/tasks/ldap_import/task.py
index fee168a..e03387a 100644
--- a/kpov_judge/tasks/ldap_import/task.py
+++ b/kpov_judge/tasks/ldap_import/task.py
@@ -64,10 +64,10 @@ computers = {
networks = { 'net1': {'public': False}, 'test-net': {'public': True} }
params_meta = {
- 'IP_NM': {'opis': 'Naslov maliNetworkManager', 'w': False, 'public':True, 'type': 'IP', 'generated': True},
- 'DNS_NM': {'opis': 'DNS za maliNetworkManager', 'w': False, 'public':True, 'type': 'IP', 'generated': True},
- 'IP_static': {'opis': 'Naslov maliBrezNetworkManager', 'w': False, 'public': True, 'type': 'IP', 'generated': True},
- 'DNS_static': {'opis': 'DNS za maliBrezNetworkManager', 'w': False, 'public': True, 'type': 'IP', 'generated': True},
+ 'IP_NM': {'descriptions': {'si': 'Naslov maliNetworkManager'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
+ 'DNS_NM': {'descriptions': {'si': 'DNS za maliNetworkManager'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
+ 'IP_static': {'descriptions': {'si': 'Naslov maliBrezNetworkManager'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True},
+ 'DNS_static': {'descriptions': {'si': 'DNS za maliBrezNetworkManager'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True},
}
def task(IP_NM, DNS_NM, IP_static, DNS_static):
diff --git a/kpov_judge/tasks/ldap_search/lecture/ideja.txt b/kpov_judge/tasks/ldap_search/lecture/ideja.txt
deleted file mode 100644
index e9647ce..0000000
--- a/kpov_judge/tasks/ldap_search/lecture/ideja.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Postavi strežnik OpenLDAP. Ustvari shemo. Ustvari uporabnika. Uporabi LDAP kot backend za RADIUS.
-
diff --git a/kpov_judge/tasks/ldap_search/task.py b/kpov_judge/tasks/ldap_search/task.py
index c123c92..7a27591 100644
--- a/kpov_judge/tasks/ldap_search/task.py
+++ b/kpov_judge/tasks/ldap_search/task.py
@@ -52,10 +52,10 @@ computers = {
networks = { 'net1': {'public': False}, 'test-net': {'public': True} }
params_meta = {
- 'LDAP_USERNAME': {'opis': 'Uporabnisko ime v LDAP', 'w': False, 'public':True, 'type': 'username', 'generated': True},
- 'LDAP_PASSWORD': {'opis': 'Geslo v LDAP', 'w': False, 'public':True, 'type': 'password', 'generated': True},
- 'BIND_USERNAME': {'opis': 'Uporabnisko ime za dostop do LDAP', 'w': False, 'public':True, 'type': 'username', 'generated': True},
- 'BIND_PASSWORD': {'opis': 'Geslo za dostop do LDAP', 'w': False, 'public':True, 'type': 'password', 'generated': True},
+ 'LDAP_USERNAME': {'descriptions': {'si': 'Uporabnisko ime v LDAP'}, 'w': False, 'public':True, 'type': 'username', 'generated': True},
+ 'LDAP_PASSWORD': {'descriptions': {'si': 'Geslo v LDAP'}, 'w': False, 'public':True, 'type': 'password', 'generated': True},
+ 'BIND_USERNAME': {'descriptions': {'si': 'Uporabnisko ime za dostop do LDAP'}, 'w': False, 'public':True, 'type': 'username', 'generated': True},
+ 'BIND_PASSWORD': {'descriptions': {'si': 'Geslo za dostop do LDAP'}, 'w': False, 'public':True, 'type': 'password', 'generated': True},
}
def task(LDAP_USERNAME, LDAP_PASSWORD, IP_static, DNS_static):
diff --git a/kpov_judge/tasks/nat_port_forward/task.py b/kpov_judge/tasks/nat_port_forward/task.py
index 763dee4..97182bc 100644
--- a/kpov_judge/tasks/nat_port_forward/task.py
+++ b/kpov_judge/tasks/nat_port_forward/task.py
@@ -63,10 +63,10 @@ computers = {
networks = { 'net1': {'public': False}, 'test-net': {'public': True} }
params_meta = {
- 'IP_NM': {'opis': 'Naslov maliNetworkManager', 'w': False, 'public':True, 'type': 'IP', 'generated': True},
- 'DNS_NM': {'opis': 'DNS za maliNetworkManager', 'w': False, 'public':True, 'type': 'IP', 'generated': True},
- 'IP_static': {'opis': 'Naslov maliBrezNetworkManager', 'w': False, 'public': True, 'type': 'IP', 'generated': True},
- 'DNS_static': {'opis': 'DNS za maliBrezNetworkManager', 'w': False, 'public': True, 'type': 'IP', 'generated': True},
+ 'IP_NM': {'descriptions': {'si': 'Naslov maliNetworkManager'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
+ 'DNS_NM': {'descriptions': {'si': 'DNS za maliNetworkManager'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
+ 'IP_static': {'descriptions': {'si': 'Naslov maliBrezNetworkManager'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True},
+ 'DNS_static': {'descriptions': {'si': 'DNS za maliBrezNetworkManager'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True},
}
def task(IP_NM, DNS_NM, IP_static, DNS_static):
diff --git a/kpov_judge/tasks/nat_vlc/lecture/ideja.txt b/kpov_judge/tasks/nat_vlc/lecture/ideja.txt
deleted file mode 100644
index 852ee43..0000000
--- a/kpov_judge/tasks/nat_vlc/lecture/ideja.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Nastavi računalnik tako, da bo vse pakete za določene naslove prepošiljal na drug računalnik.
-Vzpostavi NAT.
diff --git a/kpov_judge/tasks/nat_vlc/task.py b/kpov_judge/tasks/nat_vlc/task.py
index 6fb5700..144d86d 100644
--- a/kpov_judge/tasks/nat_vlc/task.py
+++ b/kpov_judge/tasks/nat_vlc/task.py
@@ -66,10 +66,10 @@ computers = {
networks = { 'net1': {'public': False}, 'test-net': {'public': True} }
params_meta = {
- 'IP_NM': {'opis': 'Naslov maliNetworkManager', 'w': False, 'public':True, 'type': 'IP', 'generated': True},
- 'DNS_NM': {'opis': 'DNS za maliNetworkManager', 'w': False, 'public':True, 'type': 'IP', 'generated': True},
- 'IP_static': {'opis': 'Naslov maliBrezNetworkManager', 'w': False, 'public': True, 'type': 'IP', 'generated': True},
- 'DNS_static': {'opis': 'DNS za maliBrezNetworkManager', 'w': False, 'public': True, 'type': 'IP', 'generated': True},
+ 'IP_NM': {'descriptions': {'si': 'Naslov maliNetworkManager'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
+ 'DNS_NM': {'descriptions': {'si': 'DNS za maliNetworkManager'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
+ 'IP_static': {'descriptions': {'si': 'Naslov maliBrezNetworkManager'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True},
+ 'DNS_static': {'descriptions': {'si': 'DNS za maliBrezNetworkManager'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True},
}
def task(IP_NM, DNS_NM, IP_static, DNS_static):
diff --git a/kpov_judge/tasks/network_boot_custom_program/task.py b/kpov_judge/tasks/network_boot_custom_program/task.py
index 8d1c308..3af7a7b 100644
--- a/kpov_judge/tasks/network_boot_custom_program/task.py
+++ b/kpov_judge/tasks/network_boot_custom_program/task.py
@@ -62,10 +62,10 @@ computers = {
networks = { 'net1': {'public': False}, 'test-net': {'public': True} }
params_meta = {
- 'IP_NM': {'opis': 'Naslov maliNetworkManager', 'w': False, 'public':True, 'type': 'IP', 'generated': True},
- 'DNS_NM': {'opis': 'DNS za maliNetworkManager', 'w': False, 'public':True, 'type': 'IP', 'generated': True},
- 'IP_static': {'opis': 'Naslov maliBrezNetworkManager', 'w': False, 'public': True, 'type': 'IP', 'generated': True},
- 'DNS_static': {'opis': 'DNS za maliBrezNetworkManager', 'w': False, 'public': True, 'type': 'IP', 'generated': True},
+ 'IP_NM': {'descriptions': {'si': 'Naslov maliNetworkManager'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
+ 'DNS_NM': {'descriptions': {'si': 'DNS za maliNetworkManager'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
+ 'IP_static': {'descriptions': {'si': 'Naslov maliBrezNetworkManager'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True},
+ 'DNS_static': {'descriptions': {'si': 'DNS za maliBrezNetworkManager'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True},
}
def task(IP_NM, DNS_NM, IP_static, DNS_static):
diff --git a/kpov_judge/tasks/openvpn_multiple_hops/task.py b/kpov_judge/tasks/openvpn_multiple_hops/task.py
index 679d136..850abd3 100644
--- a/kpov_judge/tasks/openvpn_multiple_hops/task.py
+++ b/kpov_judge/tasks/openvpn_multiple_hops/task.py
@@ -63,10 +63,10 @@ computers = {
networks = { 'net1': {'public': False}, 'test-net': {'public': True} }
params_meta = {
- 'IP_NM': {'opis': 'Naslov maliNetworkManager', 'w': False, 'public':True, 'type': 'IP', 'generated': True},
- 'DNS_NM': {'opis': 'DNS za maliNetworkManager', 'w': False, 'public':True, 'type': 'IP', 'generated': True},
- 'IP_static': {'opis': 'Naslov maliBrezNetworkManager', 'w': False, 'public': True, 'type': 'IP', 'generated': True},
- 'DNS_static': {'opis': 'DNS za maliBrezNetworkManager', 'w': False, 'public': True, 'type': 'IP', 'generated': True},
+ 'IP_NM': {'descriptions': {'si': 'Naslov maliNetworkManager'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
+ 'DNS_NM': {'descriptions': {'si': 'DNS za maliNetworkManager'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
+ 'IP_static': {'descriptions': {'si': 'Naslov maliBrezNetworkManager'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True},
+ 'DNS_static': {'descriptions': {'si': 'DNS za maliBrezNetworkManager'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True},
}
def task(IP_NM, DNS_NM, IP_static, DNS_static):
diff --git a/kpov_judge/tasks/openvpn_simple_smb/lecture/ideja.txt b/kpov_judge/tasks/openvpn_simple_smb/lecture/ideja.txt
deleted file mode 100644
index 3ae0c92..0000000
--- a/kpov_judge/tasks/openvpn_simple_smb/lecture/ideja.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Namesti OpenVPN. Ustvari OpenVPN strežnik. Omogoči sosedu, da se nanj poveže.
-Ustvari javni in zasebni ključ. Omogoči več sosedom, da se povežejo na tvoj strežnik.
diff --git a/kpov_judge/tasks/openvpn_simple_smb/task.py b/kpov_judge/tasks/openvpn_simple_smb/task.py
index 2ca15fc..eb65d06 100644
--- a/kpov_judge/tasks/openvpn_simple_smb/task.py
+++ b/kpov_judge/tasks/openvpn_simple_smb/task.py
@@ -62,10 +62,10 @@ computers = {
networks = { 'net1': {'public': False}, 'test-net': {'public': True} }
params_meta = {
- 'IP_NM': {'opis': 'Naslov maliNetworkManager', 'w': False, 'public':True, 'type': 'IP', 'generated': True},
- 'DNS_NM': {'opis': 'DNS za maliNetworkManager', 'w': False, 'public':True, 'type': 'IP', 'generated': True},
- 'IP_static': {'opis': 'Naslov maliBrezNetworkManager', 'w': False, 'public': True, 'type': 'IP', 'generated': True},
- 'DNS_static': {'opis': 'DNS za maliBrezNetworkManager', 'w': False, 'public': True, 'type': 'IP', 'generated': True},
+ 'IP_NM': {'descriptions': {'si': 'Naslov maliNetworkManager'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
+ 'DNS_NM': {'descriptions': {'si': 'DNS za maliNetworkManager'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
+ 'IP_static': {'descriptions': {'si': 'Naslov maliBrezNetworkManager'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True},
+ 'DNS_static': {'descriptions': {'si': 'DNS za maliBrezNetworkManager'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True},
}
def task(IP_NM, DNS_NM, IP_static, DNS_static):
diff --git a/kpov_judge/tasks/openwrt/task.py b/kpov_judge/tasks/openwrt/task.py
index 3326065..af46573 100644
--- a/kpov_judge/tasks/openwrt/task.py
+++ b/kpov_judge/tasks/openwrt/task.py
@@ -61,10 +61,10 @@ computers = {
networks = { 'net1': {'public': False}, 'test-net': {'public': True} }
params_meta = {
- 'IP_NM': {'opis': 'Naslov maliNetworkManager', 'w': False, 'public':True, 'type': 'IP', 'generated': True},
- 'DNS_NM': {'opis': 'DNS za maliNetworkManager', 'w': False, 'public':True, 'type': 'IP', 'generated': True},
- 'IP_static': {'opis': 'Naslov maliBrezNetworkManager', 'w': False, 'public': True, 'type': 'IP', 'generated': True},
- 'DNS_static': {'opis': 'DNS za maliBrezNetworkManager', 'w': False, 'public': True, 'type': 'IP', 'generated': True},
+ 'IP_NM': {'descriptions': {'si': 'Naslov maliNetworkManager'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
+ 'DNS_NM': {'descriptions': {'si': 'DNS za maliNetworkManager'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
+ 'IP_static': {'descriptions': {'si': 'Naslov maliBrezNetworkManager'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True},
+ 'DNS_static': {'descriptions': {'si': 'DNS za maliBrezNetworkManager'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True},
}
def task(IP_NM, DNS_NM, IP_static, DNS_static):
diff --git a/kpov_judge/tasks/public_ip_ssh/lecture/ideja.txt b/kpov_judge/tasks/public_ip_ssh/lecture/ideja.txt
deleted file mode 100644
index 23f5dcc..0000000
--- a/kpov_judge/tasks/public_ip_ssh/lecture/ideja.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Primer pristopnega kolokvija. Odgovori na vprašanja. Pogoste težave v Virtualbox.
-X11, desktopi, nastavitve.
diff --git a/kpov_judge/tasks/public_ip_ssh/task.py b/kpov_judge/tasks/public_ip_ssh/task.py
index 0468b7d..dbb832f 100644
--- a/kpov_judge/tasks/public_ip_ssh/task.py
+++ b/kpov_judge/tasks/public_ip_ssh/task.py
@@ -22,9 +22,9 @@ computers = {
}
params_meta = {
- 'peer_ip': {'opis': 'Naslov ssh strežnika', 'w': True, 'public':True, 'type': 'IP', 'generated': False},
- 'peer_user': {'opis': 'ime uporabnika', 'w': False, 'public': True, 'type': 'username', 'generated': True},
- 'peer_passwd': {'opis': 'geslo uporabnika', 'w': False, 'public': True, 'type': 'password', 'generated': True},
+ 'peer_ip': {'descriptions': {'si': 'Naslov ssh strežnika'}, 'w': True, 'public':True, 'type': 'IP', 'generated': False},
+ 'peer_user': {'descriptions': {'si': 'ime uporabnika'}, 'w': False, 'public': True, 'type': 'username', 'generated': True},
+ 'peer_passwd': {'descriptions': {'si': 'geslo uporabnika'}, 'w': False, 'public': True, 'type': 'password', 'generated': True},
}
def task(peer_ip, peer_user, peer_passwd):
diff --git a/kpov_judge/tasks/public_ssh_motd_http/lecture/ideja.txt b/kpov_judge/tasks/public_ssh_motd_http/lecture/ideja.txt
deleted file mode 100644
index 91c85c2..0000000
--- a/kpov_judge/tasks/public_ssh_motd_http/lecture/ideja.txt
+++ /dev/null
@@ -1 +0,0 @@
-Reši pristopni kolokvij z visoko oceno.
diff --git a/kpov_judge/tasks/public_ssh_motd_http/task.py b/kpov_judge/tasks/public_ssh_motd_http/task.py
index cd3d970..8966770 100644
--- a/kpov_judge/tasks/public_ssh_motd_http/task.py
+++ b/kpov_judge/tasks/public_ssh_motd_http/task.py
@@ -61,10 +61,10 @@ computers = {
networks = { 'net1': {'public': False}, 'test-net': {'public': True} }
params_meta = {
- 'IP_NM': {'opis': 'Naslov maliNetworkManager', 'w': False, 'public':True, 'type': 'IP', 'generated': True},
- 'DNS_NM': {'opis': 'DNS za maliNetworkManager', 'w': False, 'public':True, 'type': 'IP', 'generated': True},
- 'IP_static': {'opis': 'Naslov maliBrezNetworkManager', 'w': False, 'public': True, 'type': 'IP', 'generated': True},
- 'DNS_static': {'opis': 'DNS za maliBrezNetworkManager', 'w': False, 'public': True, 'type': 'IP', 'generated': True},
+ 'IP_NM': {'descriptions': {'si': 'Naslov maliNetworkManager'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
+ 'DNS_NM': {'descriptions': {'si': 'DNS za maliNetworkManager'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
+ 'IP_static': {'descriptions': {'si': 'Naslov maliBrezNetworkManager'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True},
+ 'DNS_static': {'descriptions': {'si': 'DNS za maliBrezNetworkManager'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True},
}
def task(IP_NM, DNS_NM, IP_static, DNS_static):
diff --git a/kpov_judge/tasks/radius_multiple_realms/task.py b/kpov_judge/tasks/radius_multiple_realms/task.py
index 5472d10..c48ad02 100644
--- a/kpov_judge/tasks/radius_multiple_realms/task.py
+++ b/kpov_judge/tasks/radius_multiple_realms/task.py
@@ -67,10 +67,10 @@ computers = {
networks = { 'net1': {'public': False}, 'test-net': {'public': True} }
params_meta = {
- 'IP_NM': {'opis': 'Naslov maliNetworkManager', 'w': False, 'public':True, 'type': 'IP', 'generated': True},
- 'DNS_NM': {'opis': 'DNS za maliNetworkManager', 'w': False, 'public':True, 'type': 'IP', 'generated': True},
- 'IP_static': {'opis': 'Naslov maliBrezNetworkManager', 'w': False, 'public': True, 'type': 'IP', 'generated': True},
- 'DNS_static': {'opis': 'DNS za maliBrezNetworkManager', 'w': False, 'public': True, 'type': 'IP', 'generated': True},
+ 'IP_NM': {'descriptions': {'si': 'Naslov maliNetworkManager'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
+ 'DNS_NM': {'descriptions': {'si': 'DNS za maliNetworkManager'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
+ 'IP_static': {'descriptions': {'si': 'Naslov maliBrezNetworkManager'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True},
+ 'DNS_static': {'descriptions': {'si': 'DNS za maliBrezNetworkManager'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True},
}
def task(IP_NM, DNS_NM, IP_static, DNS_static):
diff --git a/kpov_judge/tasks/radius_mysql_pam/lecture/ideja.txt b/kpov_judge/tasks/radius_mysql_pam/lecture/ideja.txt
deleted file mode 100644
index fd9d1a9..0000000
--- a/kpov_judge/tasks/radius_mysql_pam/lecture/ideja.txt
+++ /dev/null
@@ -1 +0,0 @@
-Nastavi apache tako, da se boš nanj prijavila s pomočjo avtentikacije pri sosedu.
diff --git a/kpov_judge/tasks/radius_mysql_pam/task.py b/kpov_judge/tasks/radius_mysql_pam/task.py
index c160464..f331fd5 100644
--- a/kpov_judge/tasks/radius_mysql_pam/task.py
+++ b/kpov_judge/tasks/radius_mysql_pam/task.py
@@ -53,13 +53,13 @@ computers = {
networks = { 'net1': {'public': False}, 'test-net': {'public': True} }
params_meta = {
- 'RADIUS_SECRET':{'opis': 'Skrivnost RADIUS', 'w': False, 'public':True, 'type': 'passwd', 'generated': True},
- 'RADIUS_USERNAME': {'opis': 'Username v RADIUS', 'w': True, 'public':True, 'type': 'username', 'generated': False},
- 'RADIUS_PASSWORD': {'opis': 'Geslo v RADIUS', 'w': False, 'public':True, 'type': '', 'generated': True},
- 'MYSQL_ADMIN_USER':{'opis': 'Username za dostop do MySQL', 'w': True, 'public':True, 'type': 'username', 'generated': False},
- 'MYSQL_ADMIN_PASSWORD': {'opis': 'Geslo za dostop do MySQL', 'w': True, 'public':True, 'type': 'passwd', 'generated': True},
- 'MYSQL_PAM_USERNAME': {'opis': 'Username v MySQL', 'w': True, 'public': True, 'type': 'IP', 'generated': False},
- 'MYSQL_PAM_PASSWORD': {'opis': 'Geslo za uporabnika v MySQL', 'w': True, 'public': True, 'type': 'passwd', 'generated': False},
+ 'RADIUS_SECRET':{'descriptions': {'si': 'Skrivnost RADIUS'}, 'w': False, 'public':True, 'type': 'passwd', 'generated': True},
+ 'RADIUS_USERNAME': {'descriptions': {'si': 'Username v RADIUS'}, 'w': True, 'public':True, 'type': 'username', 'generated': False},
+ 'RADIUS_PASSWORD': {'descriptions': {'si': 'Geslo v RADIUS'}, 'w': False, 'public':True, 'type': '', 'generated': True},
+ 'MYSQL_ADMIN_USER':{'descriptions': {'si': 'Username za dostop do MySQL'}, 'w': True, 'public':True, 'type': 'username', 'generated': False},
+ 'MYSQL_ADMIN_PASSWORD': {'descriptions': {'si': 'Geslo za dostop do MySQL'}, 'w': True, 'public':True, 'type': 'passwd', 'generated': True},
+ 'MYSQL_PAM_USERNAME': {'descriptions': {'si': 'Username v MySQL'}, 'w': True, 'public': True, 'type': 'IP', 'generated': False},
+ 'MYSQL_PAM_PASSWORD': {'descriptions': {'si': 'Geslo za uporabnika v MySQL'}, 'w': True, 'public': True, 'type': 'passwd', 'generated': False},
}
def task(RADIUS_SECRET, RADIUS_USERNAME, RADIUS_PASSWORD, MYSQL_ADMIN_USER, MYSQL_ADMIN_PASSWORD, MYSQL_PAM_USERNAME, MYSQL_PAM_PASSWORD):
diff --git a/kpov_judge/tasks/rdate_64bit/task.py b/kpov_judge/tasks/rdate_64bit/task.py
index bd77c13..c518d47 100644
--- a/kpov_judge/tasks/rdate_64bit/task.py
+++ b/kpov_judge/tasks/rdate_64bit/task.py
@@ -62,10 +62,10 @@ computers = {
networks = { 'net1': {'public': False}, 'test-net': {'public': True} }
params_meta = {
- 'IP_NM': {'opis': 'Naslov maliNetworkManager', 'w': False, 'public':True, 'type': 'IP', 'generated': True},
- 'DNS_NM': {'opis': 'DNS za maliNetworkManager', 'w': False, 'public':True, 'type': 'IP', 'generated': True},
- 'IP_static': {'opis': 'Naslov maliBrezNetworkManager', 'w': False, 'public': True, 'type': 'IP', 'generated': True},
- 'DNS_static': {'opis': 'DNS za maliBrezNetworkManager', 'w': False, 'public': True, 'type': 'IP', 'generated': True},
+ 'IP_NM': {'descriptions':{'si':'Naslov maliNetworkManager'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
+ 'DNS_NM': {'descriptions':{'si':'DNS za maliNetworkManager'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
+ 'IP_static': {'descriptions':{'si':'Naslov maliBrezNetworkManager'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True},
+ 'DNS_static': {'descriptions':{'si':'DNS za maliBrezNetworkManager'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True},
}
def task(IP_NM, DNS_NM, IP_static, DNS_static):
diff --git a/kpov_judge/tasks/set_ip_dhcp_hostname/task.py b/kpov_judge/tasks/set_ip_dhcp_hostname/task.py
index 2defe2a..db7ca35 100644
--- a/kpov_judge/tasks/set_ip_dhcp_hostname/task.py
+++ b/kpov_judge/tasks/set_ip_dhcp_hostname/task.py
@@ -65,10 +65,10 @@ computers = {
networks = { 'net1': {'public': False}, 'test-net': {'public': True} }
params_meta = {
- 'IP_DHCP': {'opis': 'Naslov za DHCP', 'w': False, 'public': False, 'type': 'IP', 'generated': True},
- 'Hostname_DHCP': {'opis': 'Ime DHCP', 'w': False, 'public': True, 'type': 'hostname', 'generated': True},
- 'IP_static': {'opis': 'Naslov BREZ_DHCP', 'w': False, 'public': True, 'type': 'IP', 'generated': True},
- 'IP_dhcp_static': {'opis': 'Dodeljen IP brez DHCP', 'w': False, 'public': False, 'type': 'IP', 'generated': True},
+ 'IP_DHCP': {'descriptions': {'si': 'Naslov za DHCP'}, 'w': False, 'public': False, 'type': 'IP', 'generated': True},
+ 'Hostname_DHCP': {'descriptions': {'si': 'Ime DHCP'}, 'w': False, 'public': True, 'type': 'hostname', 'generated': True},
+ 'IP_static': {'descriptions': {'si': 'Naslov BREZ_DHCP'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True},
+ 'IP_dhcp_static': {'descriptions': {'si': 'Dodeljen IP brez DHCP'}, 'w': False, 'public': False, 'type': 'IP', 'generated': True},
}
def task(IP_DHCP, Hostname_DHCP, IP_static, MAC_static, IP_dhcp_static):
diff --git a/kpov_judge/tasks/set_ip_static_dhcp/evaluation/task.py b/kpov_judge/tasks/set_ip_static_dhcp/evaluation/task.py
deleted file mode 100644
index 0fad134..0000000
--- a/kpov_judge/tasks/set_ip_static_dhcp/evaluation/task.py
+++ /dev/null
@@ -1,100 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-# TODO: finish thi
-# kpovRandomHelpers should be imported by add_assignment.py
-
-instructions = {
- 'si':u"""
-Ustvari tri navidezne računalnike. Za disk prvega uporabi sliko diska simpleArbiterDhcp.
-Za enega od ostalih dveh (Z_DHCP) poskrbi, da bo dobil IP prek DHCP, pri čemer
-naj kot hostname strežniku pošlje ime, ki ga dobiš na simpleArbiterDhcp.
-Za drugega poskrbi, da bo imel statično nastavljen IP.
-"""
-}
-
-computers = {
- 'Z_DHCP': {
- 'disks': [
- { 'name': 'Z_DHCP',
- },
- #{ 'name': 'CDROM',
- # 'options':{'readonly': True},
- # 'parts': [],# no parts, no mounting.
- #}
- ],
- 'network_interfaces': [{'network': 'net1'}],
- 'flavor': 'm1.tiny',
- 'config_drive': False
-
- },
- 'BREZ_DHCP': {
- 'disks': [
- { 'name': 'BREZ_DHCP',
- },
- #{ 'name': 'CDROM',
- # 'options':{'readonly': True},
- # 'parts': [],# no parts, no mounting.
- #}
- ],
- 'network_interfaces': [{'network': 'net1'}],
- 'flavor': 'm1.tiny',
- 'config_drive': False
-
- },
- 'SimpleArbiter': {
- 'disks': [
- { 'name': 'simpleArbiterDhcp',
- # attempt automount
- },
- #{ 'name': 'CDROM',
- # 'options': {'readonly': True},
- # 'parts': [{'dev': 'b1', 'path': '/cdrom'}],
- #},
- ],
- 'network_interfaces': [{'network': 'net1'}, {'network': 'test-net'}],
- 'flavor': 'm1.tiny',
- 'config_drive': False
- }
-}
-
-networks = { 'net1': {'public': False}, 'test-net': {'public': True} }
-
-params_meta = {
- 'IP_DHCP': {'opis': 'Naslov za DHCP', 'w': False, 'public': False, 'type': 'IP', 'generated': True},
- 'Hostname_DHCP': {'opis': 'Ime DHCP', 'w': False, 'public': True, 'type': 'hostname', 'generated': True},
- 'IP_static': {'opis': 'Naslov BREZ_DHCP', 'w': False, 'public': True, 'type': 'IP', 'generated': True},
- 'IP_dhcp_static': {'opis': 'Dodeljen IP brez DHCP', 'w': False, 'public': False, 'type': 'IP', 'generated': True},
-}
-
-def task(IP_DHCP, Hostname_DHCP, IP_static, MAC_static, IP_dhcp_static):
- import pxssh
- import pexpect
- results = dict()
- # check hostname of DHCP
- # check the hostname in the response of IP_DHCP
- # check availability of IP_static
- # check non-availability of IP_dhcp_static
- return results
-
-def gen_params(user_id, params_meta):
- r = random.Random(user_id)
- # IP_NM, DNS_NM, IP_static, DNS_static)
- net = kpovRandomHelpers.IPv4_subnet_gen(r, '172.23.128.0/18', 24)
- params['IP_DHCP'], params['IP_static'], params['IP_dhcp_static'] = kpovRandomHelpers.IPv4_addr_gen(r, net, 3)
- params['Hostname_DHCP'] = kpovRandomHelpers.hostname_gen(r)
- return params
-
-def task_check(results, params):
- import re
- score = -9
- if results['bla']:
- score += 3
- return score
-
-def prepare_disks(templates, params):
-# d = templates['simpleArbiterDhcp']
-# create config for static_DHCP
-# set static_DHCP hostname
- pass
-
diff --git a/kpov_judge/tasks/set_ip_static_dhcp/lecture/ideja.txt b/kpov_judge/tasks/set_ip_static_dhcp/lecture/ideja.txt
deleted file mode 100644
index 92d984c..0000000
--- a/kpov_judge/tasks/set_ip_static_dhcp/lecture/ideja.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Mrežne nastavitve pod Linuxom. Ukazi za delo z mrežo. tcpdump. NetworkManager.
-dbus.
diff --git a/kpov_judge/tasks/set_ip_static_dhcp/task.py b/kpov_judge/tasks/set_ip_static_dhcp/task.py
index 1d79a61..50d6fa1 100644
--- a/kpov_judge/tasks/set_ip_static_dhcp/task.py
+++ b/kpov_judge/tasks/set_ip_static_dhcp/task.py
@@ -63,10 +63,10 @@ computers = {
networks = { 'net1': {'public': False}, 'test-net': {'public': True} }
params_meta = {
- 'IP_NM': {'opis': 'Naslov maliNetworkManager', 'w': False, 'public':True, 'type': 'IP', 'generated': True},
- 'DNS_NM': {'opis': 'DNS za maliNetworkManager', 'w': False, 'public':True, 'type': 'IP', 'generated': True},
- 'IP_static': {'opis': 'Naslov maliBrezNetworkManager', 'w': False, 'public': True, 'type': 'IP', 'generated': True},
- 'DNS_static': {'opis': 'DNS za maliBrezNetworkManager', 'w': False, 'public': True, 'type': 'IP', 'generated': True},
+ 'IP_NM': {'descriptions': {'si': 'Naslov maliNetworkManager'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
+ 'DNS_NM': {'descriptions': {'si': 'DNS za maliNetworkManager'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
+ 'IP_static': {'descriptions': {'si': 'Naslov maliBrezNetworkManager'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True},
+ 'DNS_static': {'descriptions': {'si': 'DNS za maliBrezNetworkManager'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True},
}
def task(IP_NM, DNS_NM, IP_static, DNS_static):
diff --git a/kpov_judge/tasks/set_motd/lecture/ideja.txt b/kpov_judge/tasks/set_motd/lecture/ideja.txt
deleted file mode 100644
index e05a775..0000000
--- a/kpov_judge/tasks/set_motd/lecture/ideja.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Sistem dela pri vajah. Kako izgleda pristopni kolokvij. Kako se ocenjuje.
-Pogosti problemi pri VirtualBox. Dodajanje diskov. Problemi z mrežo.
diff --git a/kpov_judge/tasks/set_motd/task.py b/kpov_judge/tasks/set_motd/task.py
index 0f3bcf8..5367577 100644
--- a/kpov_judge/tasks/set_motd/task.py
+++ b/kpov_judge/tasks/set_motd/task.py
@@ -50,9 +50,9 @@ computers = {
networks = { 'net1': {'public': False}, 'test-net': {'public': True} }
params_meta = {
- 'peer_ip': {'opis': 'IP računalnika', 'w': True, 'public':True, 'type': 'IP', 'generated': False},
- 'peer_user': {'opis': 'ime uporabnika', 'w': False, 'public': True, 'type': 'username', 'generated': True},
- 'peer_passwd': {'opis': 'geslo uporabnika', 'w': True, 'public': True, 'type': 'alnumstr', 'generated': False},
+ 'peer_ip': {'descriptions': {'si': 'IP računalnika'}, 'w': True, 'public':True, 'type': 'IP', 'generated': False},
+ 'peer_user': {'descriptions': {'si': 'ime uporabnika'}, 'w': False, 'public': True, 'type': 'username', 'generated': True},
+ 'peer_passwd': {'descriptions': {'si': 'geslo uporabnika'}, 'w': True, 'public': True, 'type': 'alnumstr', 'generated': False},
'niz': {'w': False, 'public': True, 'type': 'short_text', 'generated': True},
}
diff --git a/kpov_judge/tasks/smb_nfs/lecture/ideja.txt b/kpov_judge/tasks/smb_nfs/lecture/ideja.txt
deleted file mode 100644
index a380311..0000000
--- a/kpov_judge/tasks/smb_nfs/lecture/ideja.txt
+++ /dev/null
@@ -1 +0,0 @@
-Zaženi računalnik. Spremeni initrd. Zaženi sistem prek NFS. Spremeni podatke v squashfs.
diff --git a/kpov_judge/tasks/smb_nfs/task.py b/kpov_judge/tasks/smb_nfs/task.py
index 8c54bf6..b8aa836 100644
--- a/kpov_judge/tasks/smb_nfs/task.py
+++ b/kpov_judge/tasks/smb_nfs/task.py
@@ -46,11 +46,11 @@ computers = {
networks = { 'net1': {'public': False}, 'test-net': {'public': True} }
params_meta = {
- 'SMB_NAME': {'opis': 'SMB ime streznika', 'w': False, 'public':True, 'type': 'hostname', 'generated': True},
- 'SMB_SHARENAME': {'opis': 'Imenik v skupni rabi', 'w': False, 'public':True, 'type': 'filename', 'generated': True},
- 'NFS_MOUNT': {'opis': 'Imenik, dostopen prek NFS', 'w': False, 'public': True, 'type': 'filename', 'generated': True},
- 'SHARED_FILENAME': {'opis': 'Ime datoteke, ki je deljena', 'w': False, 'public': True, 'type': 'filename', 'generated': True},
- 'SHARED_FILENAME_CONTENT': {'opis': 'Vsebina datoteke', 'w': False, 'public': True, 'type': 'filename', 'generated': True},
+ 'SMB_NAME': {'descriptions': {'si': 'SMB ime streznika'}, 'w': False, 'public':True, 'type': 'hostname', 'generated': True},
+ 'SMB_SHARENAME': {'descriptions': {'si': 'Imenik v skupni rabi'}, 'w': False, 'public':True, 'type': 'filename', 'generated': True},
+ 'NFS_MOUNT': {'descriptions': {'si': 'Imenik, dostopen prek NFS'}, 'w': False, 'public': True, 'type': 'filename', 'generated': True},
+ 'SHARED_FILENAME': {'descriptions': {'si': 'Ime datoteke, ki je deljena'}, 'w': False, 'public': True, 'type': 'filename', 'generated': True},
+ 'SHARED_FILENAME_CONTENT': {'descriptions': {'si': 'Vsebina datoteke'}, 'w': False, 'public': True, 'type': 'filename', 'generated': True},
}
def task(SMB_NAME, NFS_MOUNT, SHARED_FILENAME, SHARED_FILENAME_CONTENT):
diff --git a/kpov_judge/tasks/snmp_agent_uptime/lecture/ideja.txt b/kpov_judge/tasks/snmp_agent_uptime/lecture/ideja.txt
deleted file mode 100644
index 0832279..0000000
--- a/kpov_judge/tasks/snmp_agent_uptime/lecture/ideja.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Postavi SNMP strežnik. Preberi podatke z njega. Dodaj agenta za temp. procesorja. Namesti CACTI. Nastavi CACTI, da bo bral podatke s strežnika.
-
diff --git a/kpov_judge/tasks/snmp_agent_uptime/task.py b/kpov_judge/tasks/snmp_agent_uptime/task.py
index 7bd6069..b1bf54c 100644
--- a/kpov_judge/tasks/snmp_agent_uptime/task.py
+++ b/kpov_judge/tasks/snmp_agent_uptime/task.py
@@ -67,9 +67,9 @@ computers = {
networks = { 'net1': {'public': False}, 'test-net': {'public': True} }
params_meta = {
- 'SNMP_VALUE': {'opis': 'Vrednost, dostopna prek SNMP', 'w': False, 'public':True, 'type': 'number', 'generated': True},
- 'SNMP_OID_ON_SERVER': {'opis': 'OID, na katerem je vrednost dostopna', 'w': False, 'public':True, 'type': 'OID', 'generated': True},
- 'SNMP_OID_ON_CLIENT': {'opis': 'OID, ki naj ga klient bere', 'w': False, 'public':True, 'type': 'OID', 'generated': True},
+ 'SNMP_VALUE': {'descriptions': {'si': 'Vrednost, dostopna prek SNMP'}, 'w': False, 'public':True, 'type': 'number', 'generated': True},
+ 'SNMP_OID_ON_SERVER': {'descriptions': {'si': 'OID, na katerem je vrednost dostopna'}, 'w': False, 'public':True, 'type': 'OID', 'generated': True},
+ 'SNMP_OID_ON_CLIENT': {'descriptions': {'si': 'OID, ki naj ga klient bere'}, 'w': False, 'public':True, 'type': 'OID', 'generated': True},
}
def task(SNMP_VALUE, SNMP_OID_ON_SERVER, SNMP_OID_ON_CLIENT):
diff --git a/kpov_judge/tasks/snmp_alarms_interfaces/task.py b/kpov_judge/tasks/snmp_alarms_interfaces/task.py
index e8fb908..4e19ef4 100644
--- a/kpov_judge/tasks/snmp_alarms_interfaces/task.py
+++ b/kpov_judge/tasks/snmp_alarms_interfaces/task.py
@@ -65,10 +65,10 @@ computers = {
networks = { 'net1': {'public': False}, 'test-net': {'public': True} }
params_meta = {
- 'IP_NM': {'opis': 'Naslov maliNetworkManager', 'w': False, 'public':True, 'type': 'IP', 'generated': True},
- 'DNS_NM': {'opis': 'DNS za maliNetworkManager', 'w': False, 'public':True, 'type': 'IP', 'generated': True},
- 'IP_static': {'opis': 'Naslov maliBrezNetworkManager', 'w': False, 'public': True, 'type': 'IP', 'generated': True},
- 'DNS_static': {'opis': 'DNS za maliBrezNetworkManager', 'w': False, 'public': True, 'type': 'IP', 'generated': True},
+ 'IP_NM': {'descriptions': {'si': 'Naslov maliNetworkManager'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
+ 'DNS_NM': {'descriptions': {'si': 'DNS za maliNetworkManager'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
+ 'IP_static': {'descriptions': {'si': 'Naslov maliBrezNetworkManager'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True},
+ 'DNS_static': {'descriptions': {'si': 'DNS za maliBrezNetworkManager'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True},
}
def task(IP_NM, DNS_NM, IP_static, DNS_static):
diff --git a/kpov_judge/tasks/vlc_stream_rtp/lecture/ideja.txt b/kpov_judge/tasks/vlc_stream_rtp/lecture/ideja.txt
deleted file mode 100644
index 7e12372..0000000
--- a/kpov_judge/tasks/vlc_stream_rtp/lecture/ideja.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Postavi OpenWRT na router. Usposobi predvajanje filmov na Raspberry PI.
-
diff --git a/kpov_judge/tasks/vlc_stream_rtp/task.py b/kpov_judge/tasks/vlc_stream_rtp/task.py
index 934dfe6..cb9243c 100644
--- a/kpov_judge/tasks/vlc_stream_rtp/task.py
+++ b/kpov_judge/tasks/vlc_stream_rtp/task.py
@@ -63,10 +63,10 @@ computers = {
networks = { 'net1': {'public': False}, 'test-net': {'public': True} }
params_meta = {
- 'IP_NM': {'opis': 'Naslov maliNetworkManager', 'w': False, 'public':True, 'type': 'IP', 'generated': True},
- 'DNS_NM': {'opis': 'DNS za maliNetworkManager', 'w': False, 'public':True, 'type': 'IP', 'generated': True},
- 'IP_static': {'opis': 'Naslov maliBrezNetworkManager', 'w': False, 'public': True, 'type': 'IP', 'generated': True},
- 'DNS_static': {'opis': 'DNS za maliBrezNetworkManager', 'w': False, 'public': True, 'type': 'IP', 'generated': True},
+ 'IP_NM': {'descriptions': {'si': 'Naslov maliNetworkManager'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
+ 'DNS_NM': {'descriptions': {'si': 'DNS za maliNetworkManager'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
+ 'IP_static': {'descriptions': {'si': 'Naslov maliBrezNetworkManager'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True},
+ 'DNS_static': {'descriptions': {'si': 'DNS za maliBrezNetworkManager'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True},
}
def task(IP_NM, DNS_NM, IP_static, DNS_static):
diff --git a/kpov_judge/test_task.py b/kpov_judge/test_task.py
index 894bfe6..449be35 100755
--- a/kpov_judge/test_task.py
+++ b/kpov_judge/test_task.py
@@ -9,27 +9,49 @@ import dialog
import os
import inspect
import sys
+from bson.son import SON
+import kpov_random_helpers
# SERVER_URL = "http://localhost/kpov_judge/"
-SERVER_URL = "http://kpov.fri.uni-lj.si/kpov_judge/"
-TASK_URL = SERVER_URL + '{task_id}/task.py'
-PARAMS_URL = SERVER_URL + '{task_id}/params.json'
-SUBMIT_URL = SERVER_URL + '{task_id}/results.json'
+#SERVER_URL = "http://kpov.fri.uni-lj.si/kpov_judge/"
+#TASK_URL = SERVER_URL + '{task_id}/task.py'
+#PARAMS_URL = SERVER_URL + '{task_id}/params.json'
+#SUBMIT_URL = SERVER_URL + '{task_id}/results.json'
+TASK_URL = "file://./"
+PARAMS_URL = None
PARAMS_FILE = os.path.expanduser("~/.kpov_params.yaml")
+DEFAULT_LANGUAGE = 'si'
-def get_params(params, param_names, meta, d):
- for name in param_names:
- m = meta.get(name, {})
- if d is not None:
- ret, s = d.inputbox(m.get('opis', name), init=params.get(name, ''))
+"""get the parameters for a task either from the user
+or from a file."""
+def get_params_dialog(params, param_name_list, meta):
+ lang = params['language']
+ for name in param_name_list:
+ if name not in meta:
+ pass
+ got_param = False
+ while not got_param:
+ m = meta.get(name, {})
+ try:
+ description = m['descriptions'][lang]
+ except KeyError:
+ description = ''
+ ret, s = dialog.inputbox(m.get('descriptions', name), init=params.get(name, ''))
if ret == 0 and m.get('w', False):
params[name] = s
- else:
- if name not in params:
- raise "Missing param: {0}".format(name)
+ got_param = (ret == 0) and name in params
+ return params
+
+def get_params_web(params, param_name_list, meta, url=PARAMS_URL):
+ req = urllib2.Request(url.format(**saved_params))
+ response = urllib2.urlopen(req)
+ params = json.load(response)
return params
+def get_params_args(params, param_names_list, meta):
+ pass
+
def auth_open(url, username, password):
password_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm()
# Add the username and password.
@@ -44,66 +66,65 @@ def auth_open(url, username, password):
# Now all calls to urllib2.urlopen use our opener.
urllib2.install_opener(opener)
-def load_checker(request):
- source = response.read()
+def load_task(stream):
+ # the stream should compile into at least the function
+ # task(...) and a dictionary "params_meta".
+ source = stream.read()
t = compile(source, 'task.py', 'exec')
exec(t)
- args_list = inspect.getargs(task.func_code)[0]
- return task, args_list, param_meta
-
+ # get a list of arguments for task(...)
+ # args_list = inspect.getargs(task.func_code)[0]
+ return task, task_check, params_meta
+
+
if __name__ == '__main__':
+ # get default parameters
try:
- try:
- saved_params = yaml.load(open(PARAMS_FILE))
- except:
- print "Missing - creating anew.", PARAMS_FILE
- saved_params = dict()
- if len(sys.argv) > 1 and sys.argv[1] == '-q':
- d = None
+ with open(PARAMS_FILE) as f:
+ saved_params = yaml.load(f)
+ except:
+ saved_params = dict()
+ # get the parameters needed to get to the task, such as the URLs, the name of the task and optionally an ID from the student
+ import argparse
+ task_argparser = argparse.ArgumentParser(description='Get the task parameters', conflict_handler='resolve', add_help=False)
+ task_argparser.add_argument('-h', '--help', action='store_true')
+ task_argparser.add_argument('-q', '--quiet', action='store_true', help='disable dialog')
+ task_argparser.add_argument('-pf','--params_file', nargs='?',
+ help='a local file containing saved param values', default=PARAMS_FILE)
+ basic_args = task_argparser.parse_args()
+ print basic_args
+ task_argparser.add_argument('-pu', '--params_url', nargs=1,
+ help='the URL for task parameters', default=PARAMS_URL)
+ task_argparser.add_argument('-tu', '--task_url', nargs='?',
+ help='the root URL for all tasks', default=TASK_URL)
+ task_argparser.add_argument('-l', '--language', nargs=1,
+ help='the language used', default=DEFAULT_LANGUAGE)
+ task_argparser.add_argument('task_name', help='task name')
+ args = task_argparser.parse_args()
+ print args
+ lang = args.language
+ print args.task_dir, args.task_name
+ task_fname = os.path.join(args.task_dir, args.task_name, 'task.py')
+ # get task source
+ try:
+ with open(task_fname) as source:
+ task, task_check, params_meta = load_task(source)
+ except:
+ if args.help:
+ task_argparser.print_help()
else:
- d = dialog.Dialog(dialog="dialog")
- basic_params = {
- # 'param_name': ('prompt', editable)
- "student_id": {'opis':"Upor. ime:", 'w': True},
- "student_password": {'opis':"Geslo:", 'w': True},
- "task_id": {'opis': "Naloga:", 'w': True}}
- saved_params = get_params(saved_params, ['student_id', 'student_password', 'task_id'], basic_params, d)
- task_id = saved_params['task_id']
- yaml.dump(saved_params, open(PARAMS_FILE, 'w'))
- auth_open(SERVER_URL, saved_params['student_id'], saved_params['student_password'])
- # get parameters
- req = urllib2.Request(PARAMS_URL.format(**saved_params))
- response = urllib2.urlopen(req)
- web_params = json.load(response)
- task_params_dict = saved_params.get('tasks', {})
- task_params = task_params_dict.get(task_id, {})
- saved_params['tasks'] = task_params_dict
- task_params.update(web_params)
- # get task source
- req = urllib2.Request(TASK_URL.format(**saved_params))
- response = urllib2.urlopen(req)
- # load task_check over the net
- task, args_list, meta = load_checker(response)
- # get missing parameters from user
- task_params = get_params(task_params, args_list, meta, d)
- # save
- # run checker
- valid_task_params = dict()
- for i in args_list:
- valid_task_params[i] = task_params[i]
- saved_params['tasks'][task_id] = valid_task_params
- results = task(**valid_task_params)
- data = urllib.urlencode({
- 'results': json.dumps(results),
- 'params': json.dumps(valid_task_params)
- })
- req = urllib2.Request(SUBMIT_URL.format(**saved_params), data)
- response = urllib2.urlopen(req)
- if d is not None:
- d.msgbox(response.read())
- yaml.dump(saved_params, open(PARAMS_FILE, 'w'))
- # d.add_persistent_args([('background_title', 'KPOVv')])
- except Exception, e:
- yaml.dump(saved_params, open(PARAMS_FILE, 'w'))
- print "problem!"
- print e
+ task_argparser.print_usage()
+ exit(1)
+ # get task parameters
+ params_argparser = argparse.ArgumentParser(parents=[task_argparser], conflict_handler='resolve', add_help=True)
+ for pm_name, pm in params_meta.iteritems():
+ params_argparser.add_argument('--' + pm_name, nargs = 1, help=pm['descriptions'][lang])
+ if args.help:
+ params_argparser.print_help()
+ args = params_argparser.parse_args()
+ # run task.task()
+ s = task(**public_params)
+ # run task.task_check()
+ result = task_check(s, params)
+ # print results
+