Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Prevent Error 500 and Update README.md mentioning new dependencies and pitfalls after merge of "feature boxplot-taskstatistic" #352

Open
wants to merge 146 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 142 commits
Commits
Show all changes
146 commits
Select commit Hold shift + click to select a range
b7e2663
HBRS 2013 before Wintersemester, test VM
Jan 28, 2016
069e174
HBRS 2013 Wintersemester, production
Jan 28, 2016
b96a019
HBRS 2014 Sommersemester, production
Jan 28, 2016
71b7f90
HBRS 2014 Wintersemester, production
Jan 28, 2016
afc27bf
HBRS 2015 , admin-tutor-test
Jan 28, 2016
ded98f9
HBRS 2015 Sommersemester, production
Jan 28, 2016
521ef00
HBRS 2015 Wintersemester, BCS, production
Jan 28, 2016
ba6d04d
HBRS 2015 Wintersemester, BCS-pract, production
Jan 28, 2016
068dcb5
HBRS 2015 Wintersemester, BIS, production
Jan 28, 2016
b94507a
HBRS 2016 Sommersemester, test
Jan 28, 2016
e801904
make shure submodules can be recieved via http_proxy ...
Jan 28, 2016
0600c9b
Merge remote-tracking branch 'HBRS_2013w/master' into HBRS_Merge_Local
Feb 19, 2016
8b25e47
Merge remote-tracking branch 'HBRS_2013w/HBRS_2013w_production' into …
Feb 19, 2016
7489312
Merge remote-tracking branch 'HBRS_2014s/HBRS_2014s' into HBRS_Merge_…
Feb 19, 2016
5cb8006
Merge remote-tracking branch 'HBRS_2014w/HBRS_2014w' into HBRS_Merge_…
Feb 19, 2016
2af20e3
Merge remote-tracking branch 'HBRS_2014_15_test/HBRS_2014_15_test' in…
Feb 19, 2016
2c2cd67
Merge remote-tracking branch 'HBRS_2015s/HBRS_2015s' into HBRS_Merge_…
Feb 19, 2016
861095e
Merge remote-tracking branch 'HBRS_2015w-bcs/HBRS_2015w-bcs' into HBR…
Feb 19, 2016
acaa08c
Merge remote-tracking branch 'HBRS_2015w-bcs-practice/HBRS_2014w' int…
Feb 19, 2016
80b1fbd
Merge remote-tracking branch 'HBRS_2015w-bis/HBRS_2015w-bis' into HBR…
Feb 19, 2016
23c5ea5
Merge remote-tracking branch 'HBRS_2016s/HBRS' into HBRS_Merge_Local
Feb 23, 2016
7782042
Merge remote-tracking branch 'HBRS_2016s/HBRS_s2016' into HBRS_Merge_…
Feb 23, 2016
82d7f58
reinsert LDAP-users and handling with a quixfix (is it a fix?)
Mar 7, 2016
d00a663
solving "runtime merge conflicts..."
Mar 7, 2016
6496f1f
solving "runtime merge conflicts... remove old SOUTH-Migration files …
Mar 14, 2016
37745d5
configuration in src/settings/defaults.py, src/settings/devel.py, sr…
Mar 14, 2016
ef92f27
Attestation_view-Template : Allow Tutor+Trainer to watch solutionfile…
Mar 29, 2016
ea72bff
Resubmit Solution => Java Compiler failed <=
May 6, 2016
3aa3397
Merge of current HBRS-settings from old Praktomat versions ...
Jul 11, 2016
4dba611
move and rename old hbrs praktomat settings file
Jul 11, 2016
e2edd73
Attestation_view-Template : Allow Tutor+Trainer to watch solutionfile…
Jul 19, 2016
81afb71
AutoAttest-Checker: made Praktomat2016 compatible, changed default va…
Jul 19, 2016
6263d25
AutoAttest-Checker: repair setting final solutions and repair saving …
Jul 19, 2016
8d2c1cb
Task-Admin: to prevend "repair functions" doing from dbshell and file…
Jul 19, 2016
f9ba7f0
Tasks: Modell + Solution: View // implement requirements for limiting…
Jul 19, 2016
af714ac
Task-Admin: missing html-template used in function run_all_uploadtime…
Jul 19, 2016
06ac78f
individualised Settings (devel.py + local.py) , remove old backup set…
Jul 20, 2016
2ffc43d
AutoAttestChecker: migration py
Jul 20, 2016
35ab8e9
settings/default.py : bug in class D, could not save values as attrib…
Jul 20, 2016
28be9f4
remove 404 Http-Error for favico.ico
Jul 21, 2016
ba04138
Autoattest-Checker: Add ValidationError
Jul 21, 2016
10d4313
settings/devel.py add comment for not using PRAKTOMAT_ID with runserv…
Jul 21, 2016
2f2e2ee
Merge branch 'master' of https://github.com/KITPraktomatTeam/Praktoma…
Jul 21, 2016
f931bfc
Migration files merge HBRS
Jul 21, 2016
9fc7a4b
Fix: django-debug-toolbar + sqlparse
Jul 21, 2016
50a3b53
hbrs: make compatible diffchecker
Jul 22, 2016
0d20601
JPLAGJAR in /opt/praktomat-addons/jplag.jar
Jul 22, 2016
eef8891
Dockerfile: Insert line "RUN pip3 install --upgrade pip setuptools wh…
Jul 22, 2016
ce59b1d
Dockerfile: comment out lines for Isabelle support
Jul 22, 2016
7f63091
Small code layout modifications ...
Jul 27, 2016
ff0b474
src/settings/local.py correct for HBRS deployment needs ...
Jul 27, 2016
5fa2fcb
Merge branch 'master' of https://github.com/KITPraktomatTeam/Praktoma…
Jul 27, 2016
c639623
Update AutoAttestChecker.py
ifrh Jul 27, 2016
de9944d
Update 0003_merge-hbrs.py
ifrh Dec 7, 2016
f4f86ff
This fixes
Feb 20, 2017
6c2238c
JUNIT-Policy cleanup but
Feb 20, 2017
e163bc7
Tasks: students upload waitingtime changed from linear time-function …
Feb 20, 2017
52e802d
some HBRS-specific cleanups for src/settings/local.py
Feb 20, 2017
01f9dc4
correct some wording in template file:
Feb 20, 2017
0e6569d
change file mode for src/urls.py
Feb 20, 2017
de5ab7f
Revert like merge branch 'master' into 'HBRS_Merge_Local'
Feb 21, 2017
b2b4f2c
Merge branch 'feature_gitmodules_https-proxy_compatible' into 'hbrs_p…
Feb 24, 2017
1be9ade
Merge branch 'bugfix_safeexec' into 'hbrs_public'
Mar 6, 2017
cbd441d
Merge branch 'feature_diffchecker' into 'hbrs_public'
Mar 6, 2017
45f1a7b
Merge branch 'feature_autoattestchecker' into 'hbrs_public'
Mar 6, 2017
8197fb3
Merge branch 'feature_admin-additional-actions_avoid_working_via_dbsh…
Mar 6, 2017
b15380e
Merge branch 'bugfix_solution_resubmit' into 'hbrs_public'
Mar 6, 2017
6549f2c
Merge branch 'feature_TrainerTutor_Watch_SolutionFiles' into 'hbrs_pu…
Mar 6, 2017
8919131
Merge branch 'bugfix_small_typos' into 'hbrs_public'
Mar 6, 2017
e858a4c
Merge branch 'feature_dynamic_upload_waiting_time' into 'hbrs_public'
Mar 6, 2017
56aea06
Merge branch 'feature_sort_tasklist_via_names' into 'hbrs_public'
Mar 6, 2017
8274277
Merge branch 'feature_TaskAdmin_Button_Modell_Solution' into 'hbrs_pu…
Mar 6, 2017
dbe314b
Merge branch 'feature_LDAP_bindings' into hbrs_public
Mar 6, 2017
ae4ca3c
Merge branch 'feature_download_solutiondetails' into 'hbrs_public'
Mar 6, 2017
5a9ac40
Merge branch 'feature_disable_contactlink' into hbrs_public
Mar 6, 2017
802ec6a
Merge branch 'feature_LDAP_bindings' into 'hbrs_public'
Feb 5, 2018
6ca3633
Isabelle checker : Add created Migrationfile missing in KITPraktomatT…
Nov 21, 2018
2cf55c2
Merge branches 'master', 'fix_readme_pip_problem', 'fix_requirement_D…
Nov 22, 2018
9a52b2f
Merge branch 'feature_LDAP_bindings' into hbrsNov2018
Nov 22, 2018
66316be
Merge branch 'feature_CUnitCppUnit_Checker' into hbrsNov2018
Nov 22, 2018
ff7082f
Merge branch 'feature_autoattestchecker' into hbrsNov2018
Nov 22, 2018
dd52159
Merge branch 'feature_checkstyleChecker_updVersion_8.14' into hbrsNov…
Nov 22, 2018
1e0a659
Merge branch 'feature_diffchecker' into hbrsNov2018
Nov 22, 2018
9b1c932
create migrationfile for merging HBRS migration-leafs
Nov 22, 2018
9ee8791
Merge branch 'hbrsNov2018' into hbrs_public
Nov 23, 2018
643f28a
repair Checker migration files after completing merging
Nov 23, 2018
dd0817c
Merge branch 'master' into fix_IsabelleChecker_Migrationfile
Dec 13, 2018
f7684ca
Merge branch 'master' into hbrs_public
Dec 13, 2018
bf9bd5d
Update src/checker/checker/AnonymityChecker.py, src/checker/checker/C…
Jun 30, 2019
f9c3e19
Update .gitlab-ci.yml
Oct 6, 2019
5e25624
Update .gitlab-ci.yml
Oct 6, 2019
8ce5b29
Merge branch 'master32' into java-checker
Mar 6, 2020
7e3c1aa
fix Django migration-file for javaChecker: on_delete at ForeignKey fo…
Mar 10, 2020
2c8324a
remove gitlab-ci.yml from branch
Mar 10, 2020
4d7c5bd
Merge branches 'bugfix_safeexec', 'bugfix_small_typos' and 'bugfix_so…
Mar 16, 2020
c6574aa
Merge remote-tracking branches 'origin/feature_gitmodules_https-proxy…
Mar 16, 2020
65ecbf9
Merge remote-tracking branches 'origin/feature_CUnitCppUnit_Checker' …
Mar 16, 2020
4799bd6
Merge remote-tracking branch 'origin/feature_autoattestchecker' into …
Mar 16, 2020
d0ad868
Merge remote-tracking branch 'origin/feature_checkstyleChecker_updVer…
Mar 16, 2020
80830cb
Merge remote-tracking branch 'origin/feature_diffchecker' into octupu…
Mar 16, 2020
ad2b4e8
Merge remote-tracking branch 'origin/fix_IsabelleChecker_Migrationfil…
Mar 16, 2020
ba77c99
Merge branch 'feature_LDAP_bindings' into octupus_merge_2020
Mar 16, 2020
f713878
add Django migrationfiles for HBRS octopus branch merges. Python2 and…
Mar 16, 2020
173a3a2
Merge branch 'octupus_merge_2020' into hbrs_public
Mar 16, 2020
57f2c4a
add Django migration mergefile
Mar 16, 2020
d3bf84c
Merge branch 'feature_LDAP_bindings' into hbrs_public
Mar 16, 2020
8486212
Merge branch 'feature_LDAP_bindings' into hbrs_public
Mar 21, 2020
b784bdc
Merge branch 'master32' updated from 'master' into java-checker
May 28, 2020
0d255b9
Merge branch 'master32' into hbrs_public
Jul 19, 2020
8bc45f7
Merge branches 'feature_gitmodules_https-proxy_compatible', 'fix_read…
Jul 19, 2020
07d5e6f
Merge branch 'feature_LDAP_bindings' into hbrs_public
Jul 19, 2020
58fc743
Merge branch 'feature_checkstyleChecker_updVersion_8.14' into hbrs_pu…
Jul 19, 2020
14369f2
Merge branch 'feature_TaskAdmin_Button_Modell_Solution' into hbrs_public
Jul 19, 2020
896fd69
Merge branch 'feature_disable_contactlink' into hbrs_public
Jul 19, 2020
fab5d94
Merge branch 'feature_download_solutiondetails' into hbrs_public
Jul 19, 2020
0ac9291
Merge branch 'bugfix_safeexec' into hbrs_public
Jul 19, 2020
163e018
Merge branch 'master32' updated from master into hbrs_public
Oct 29, 2020
7b8c6a7
Merge branch 'master32' updated from 'master' into java-checker
Oct 29, 2020
9a7f655
Merge branch 'master32' updated from 'master' into hbrs_public
Oct 29, 2020
3bcc01c
Merge H-BRS feature und bugfix branches 'feature_gitmodules_https-pro…
Oct 29, 2020
f99dc44
[py2py3] fix importing Tasks
ifrh Oct 30, 2020
1fdd3c5
[py2py3 bugfix] Merge branch 'master32' into java-checker
Oct 31, 2020
0f8f93e
[py2py3 bugfix] Merge all HBRS feature und bugfix branches 'feature_g…
Oct 31, 2020
4baaeb5
Merge branch 'master32' after updating from KIT-master into hbrs_public
Feb 26, 2021
89094e6
remove trailing whitespaces
Feb 26, 2021
e6b312b
Merge branch 'hbrs_changes_dont_merge_just_for_reference' into 'hbrs_…
Apr 15, 2021
c6b5bbd
Move logic to check "latest only failed" solutions to models
hannesbraun Jun 20, 2022
28b8989
GitHub Actions: also run taskstatistics tests
hannesbraun Jul 29, 2022
3d04381
GitHub Actions: remove gcj-jdk comment
hannesbraun Jul 29, 2022
4feed7e
Fix solution upload permissions for trainers
hannesbraun Jul 29, 2022
3dd4e8e
Add runallcheckers command
hannesbraun Aug 10, 2022
3600767
Document automated execution of checkers in README
hannesbraun Aug 11, 2022
957db49
Merge branch 'master'from repository KITPraktomatTeam into hbrs_publi…
Aug 15, 2022
a5cecea
Merge remote-tracking branches 'hannesbraun/checker-automation', 'han…
Aug 15, 2022
df8f7b2
README update: Mentione system dependencies introduced via merged fea…
Aug 18, 2022
13f2d44
Update README.md: Insert information about new dependencies introduce…
Aug 19, 2022
84d720d
Update README.md
ifrh Aug 19, 2022
3ca297e
Update README.md - hannesbraun found some orthography errors.
ifrh Aug 31, 2022
94f7b0d
Update README.md - hannesbraun found some more orthography errors.
ifrh Aug 31, 2022
a5747e4
Update README.md - again hannesbraun found orthography errors.
ifrh Aug 31, 2022
17ae0dc
Update README.md - fix "to old" => "too old"
ifrh Aug 31, 2022
5b0d3ef
Update src/checker/tests.py : remove some TODO comments, which were o…
ifrh Aug 31, 2022
7312795
Update local.py
ifrh Sep 1, 2022
6ffb725
Update README.md : mention that policy files could be changed
ifrh Sep 1, 2022
af7cff1
Bugfix in src/tasks/admin.py : prevent Error 500
ifrh Sep 6, 2022
67453af
Update apache_praktomat_wsgi.conf
ifrh Sep 8, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install swig libsasl2-dev libssl-dev libpq-dev
sudo apt-get install openjdk-8-jdk dejagnu checkstyle # gcj-jdk is not available anymore
sudo apt-get install openjdk-8-jdk dejagnu checkstyle
sudo apt-get install r-base wget
sudo apt-get install libcunit1-dev libcppunit-dev
sudo apt-get install apache2-dev # needed for unit test of praktomat.wsgi , praktomat.wsgi used mod_wsgi, installing mod_wsgi via requirementsfile via pip needs apache2-dev
Expand Down Expand Up @@ -59,9 +59,9 @@ jobs:
ls -la --time-style=long-iso ..
- name: Run tests
run: |
./src/manage-test.py test accounts attestation checker configuration solutions tasks hbrs_tests
./src/manage-test.py test accounts attestation checker configuration solutions tasks taskstatistics hbrs_tests
- name: Run test with code coverage
run: |
coverage run --branch --omit='*/node_modules/*,*/migrations/*' --source='./src' ./src/manage-test.py test accounts attestation checker configuration solutions tasks hbrs_tests
coverage run --branch --omit='*/node_modules/*,*/migrations/*' --source='./src' ./src/manage-test.py test accounts attestation checker configuration solutions tasks taskstatistics hbrs_tests
- name: Coverage report
run: coverage report
145 changes: 134 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ In case of bugs or feature requests, please use the [Bug tracker]. There is
also a moderated [mailing list] for Praktomat administrators:
[email protected].


A note about Python 2
=============
Since `pip` will drop support for Python 2 in January 2020,
Expand All @@ -25,11 +24,12 @@ Python 3.5
python-psycopg2
python-virtualenv


General setup
=============

You need the latest version that is compatible with the Python version used.
We also highly recommend to use virtualenv so your system Python installation remains clean.
You need the latest version of `pip`that is compatible with the Python version used.
We also highly recommend to use `virtualenv` so your system Python installation remains clean.

If you are having trouble with

Expand Down Expand Up @@ -64,6 +64,7 @@ Prerequisites: Database and Webserver
libapache2-mod-xsendfile (version 0.12; or install version 1.0 manually)
apache2-dev (used by pip while installing mod_wsgi)


Pitfalls while Systemupgrades
============
In Ubuntu 16 the package `apache2-mpm-worker` has been merged into `apache2`.
Expand All @@ -83,13 +84,86 @@ Pitfalls while Systemupgrades

If you don't change that value, apache2 package becomes deleted while upgrading Ubuntu.

Pitfalls after Praktomat-Update (Summer 2022)
=================

A note about `prlimit`
----------
To make Praktomat compatible with newer Python versions, we introduce a dependency to binary executable program `prlimit`.

util-linux (containing prlimit)

If you have installed `util-linux` but the command `prlimit` remain unknown, your linux system may be too old.
On some circumstances you can build `prlimit` from scources ( more about this cf. https://github.com/KITPraktomatTeam/Praktomat/pull/342#issuecomment-1219445202 )


A note about SQLite3 and Praktomat's unit tests
----------

Unit tests which are testing Praktomat code are using `SQLite3` as database backend, depending on settings in `Praktomat/src/settings/test.py`.

Since merge of feature boxplot-taskstatistic (cf https://github.com/KITPraktomatTeam/Praktomat/pull/345 ) at 2022-07-27
your Python environment is using an too old `SQLite3` version, if tests fails with message:


django.db.utils.OperationalError: near "(": syntax error while migrating migrationfile taskstatistics.0001_initial_TaskStatisticsDBview


In example, `SQLite3` version 3.16.2 dated to 2017-01-06 is much too old to handle the handwritten migration file `Praktomat/src/taskstatistics/migrations/0001_initial_TaskStatisticsDBview.py` correctly.

That migration file uses *SQL window functions*, which were standardized in `SQL:2003` and covered by `SQLite3` with version 3.25.0 dated to 2018-09-15. But, because of some bugs inside `SQLite3`, you cannot use that first version supporting *SQL window functions*, too.

Please use `SQLite3` Version 3.38.5 from 2022-05-06, which works for our needs.

Check your Python - SQLite dependency on command line via:

```bash
$ python -c "import sqlite3; print(\"... uses pysqlite \" + sqlite3.version +\" with SQLite \" + sqlite3.sqlite_version);"

... uses pysqlite 2.6.0 with SQLite 3.38.5
```


A note about Python and dependencies to Tcl/Tk
----------

Since merge of feature boxplot-taskstatistic (cf https://github.com/KITPraktomatTeam/Praktomat/pull/345 )
users can have a look onto whisker-boxplot diagrams.
These diagrams where generated via `matplotlib`, which can be installed via `pip` and is listed in our `requirements` file.
`matplotlib` loads transitive `_tkinter` module, which you cannot install via `pip`, and which have dependencies to system libraries for Tcl/Tk. (There exists a package installable via `pip` named `tk` but that package has nothing to do with what you need...)

You can check, if your Python version and your system fullfill that dependencies in a shell:

python -c "import lzma" && python -c "import _tkinter" && python -c "import -c"matplotlib.pyplot as plt"

That commands should not produce any error messages.

If `lzma` couldn't be imported, then you need to install the system library and dev package:

apt-get install liblzma-dev lzma -y -q

If `_tkinter` failed to load, then perhaps on your system the `_tkinter` module can be installed for your Python on a separate way.
In example, on Debian you install the tkinter-support via system package manager:

apt install python-tk -y -q (that is for Python 2)
apt install python3-tk -y -q (that is for Python 3)

And of course you need tcl/tk on the system:

apt install tk tk-dev

**Hint:** Praktomat's DejaGnuChecker uses `dejagnu`, which is written in `expect`. And `expect` is using `Tcl`.



Prerequisites: 3rd-Party libraries and programms
============

Praktomat requires some 3rd-Party libraries programs to run.
On a Ubuntu/Debian System, these can be installed by installing the following packages:

util-linux
util-linux (containing prlimit)

libpq-dev
zlib1g-dev
libmysqlclient-dev (or: default-libmysqlclient-dev)
Expand All @@ -110,8 +184,7 @@ Prerequisites: 3rd-Party libraries and programms

r-base


If youre going to use Praktomat to check Haskell submissions, you will also require the packages:
If you're going to use Praktomat to check Haskell submissions, you will also require the packages:

ghc libghc-test-framework-dev libghc-test-framework-hunit-dev libghc-test-framework-quickcheck2-dev

Expand Down Expand Up @@ -174,7 +247,7 @@ Praktomat/src/checker/scripts/junit.policy
```

You can deactivate checkers and compilers in your local Praktomat instance,
just comment them out in ``` src/checker/checker/__init__.py ``` and ``` src/checker/checker/__init__.py ```.
just comment them out in ``` src/checker/checker/__init__.py ``` and ``` src/checker/compiler/__init__.py ```.
Do not forget to create and run a django migration in that case.

If you exchange Praktomat-Tasks (export and import) than the instance, which is used to import the task,
Expand Down Expand Up @@ -229,11 +302,11 @@ to run django unit tests
```bash
cd Praktomat
mkdir ../test-data/
./src/manage-test.py test accounts attestation checker configuration solutions tasks hbrs_tests
./src/manage-test.py test accounts attestation checker configuration solutions tasks taskstatistics hbrs_tests
```


Deployment installation
Deployment installation (using Apache and PostgreSQL)
=======================

Like for the development version, clone the Praktomat and install its dependencies:
Expand All @@ -250,7 +323,17 @@ Now create a database. Using postgres on Ubuntu, this might work for creating
a database "praktomat_<PRAKTOMAT_ID>". Also edit `pg_hba.conf` to allow the access.
Your database-system should be configured to UTF-8.

To find your `pg_hba.conf` run on server commandline

```bash
cd / && cat $( sudo -u postgres psql -c 'SHOW config_file' | grep '\.conf') | grep 'pg_hba.conf' && cd ~
```
Edit that file to your needs. (Per default only connections to localhost are configured.)

```bash
sudo systemctl enable postgresql
sudo systemctl start postgresql
sudo systemctl status postgresql
sudo -u postgres createuser -DRS praktomat
sudo -u postgres createdb --encoding UTF8 -O praktomat praktomat_<PRAKTOMAT_ID>
```
Expand All @@ -264,8 +347,8 @@ Create the upload directory, populate the database:
```bash
cd Praktomat
mkdir ../work-data/
./Praktomat/src/manage-local.py collectstatic --noinput --link
./Praktomat/src/manage-local.py migrate --noinput
./src/manage-local.py collectstatic --noinput --link
./src/manage-local.py migrate --noinput
```

It should now be possible to start the deployment server with:
Expand All @@ -275,6 +358,29 @@ It should now be possible to start the deployment server with:

If you want to deploy the project using mod_wsgi in apache you could use `documentation/apache_praktomat_wsgi.conf` as a starting point. Don't forget to install `mod_xsendfile` to serve uploaded files.

```bash
sudo systemctl enable apache2
sudo a2enmod macro
sudo a2enmod xsendfile
sudo a2enmod ssl
sudo a2ensite default-ssl
```
Change /etc/apache2/sites-enabled/default-ssl.conf by inserting information `ServerAdmin` and `ServerName` after line `<VirtualHost _default_:443>`

```
ServerAdmin fill in valid e-mail-adress to reach servers admin.
ServerName fill in FQDN of server (matching to HTTPS-Certificate.)
```
And copy the complete Apache-Macro `Praktomat` from `documentation/apache_praktomat_wsgi.conf`, with modification for your needs, just before
the `<VirtualHost _default_:443>`-Entries. Use the `Praktomat` Apache-Macro inside the `<VirtualHost _default_:443>`-Entries like you can see in
usage example `<VirtualHost *:80>` in `documentation/apache_praktomat_wsgi.conf`.

Start `Apache`.
```bash
sudo systemctl start apache2
sudo systemctl status apache2
```

And if your Praktomat running on apache should handle non-ASCII filenames correctly, than the easyest way is activating UTF-8 support inside apache.
Debian runs Apache with the LANG=C locale by default, which breaks uploading files with special characters in their names at least when running with mod_wsgi.
Activating a UTF-8 locale in /etc/apache2/envvars should resolve the issue. ( see https://code.djangoproject.com/ticket/6009#comment:18 )
Expand Down Expand Up @@ -326,6 +432,11 @@ submissions from the system:
prefixed with `sudo -u tester --`. For this to work you need to add a user
`tester` which is also a member of the default group of the user that runs
the praktomat (usually `praktomat`).
```bash
sudo adduser tester --disabled-password
sudo usermod tester -a -G praktomat
sudo usermod www-data -a -G praktomat
```
* With `USESAFEDOCKER = True`, external commands are prefixed with
`safe-docker`, which you need to have installed. You can fetch it from
http://github.com/nomeata/safe-docker
Expand Down Expand Up @@ -360,6 +471,18 @@ detection program [jPlag](https://jplag.ipd.kit.edu/). Do enable this support, y
* Copy the resulting `.jar` file somewhere on the Praktomat server.
* In the settings, set `JPLAGJAR = /full/path/to/jplag.jar`

Automating the execution of checkers
=================

To automatically run all checkers for expired tasks where not all checkers are finished yet,
there is a command called `runallcheckers`:
```bash
./Praktomat/src/manage-local.py runallcheckers
```

Use Cron (or something similar) to automate the execution of this command.
Tutors can then automatically start attesting solutions without the need of
an admin or trainer to manually run all checkers after a task expired.

PhpBB integration
=================
Expand Down
28 changes: 14 additions & 14 deletions documentation/ExampleChecker.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,40 @@

class ExampleChecker(Checker):
""" This class is an minimalistic example on how to implement a new checker. """

# Add fields to configure checker instances. You can use any of the Django fields. (See online documentation)
# The fields created, task, public, required and always will be inherited from the abstract base class Checker
configuration_field = models.CharField(max_length=100, blank=True, default="I'm a test.", help_text=_("This text will be displayed under Charfield in the admin."))

def title(self):
""" Return the name of this instance of the checker. This will be shown to the user if the checker is public. """
return "Exampe Checker"
return "Example Checker"

@classmethod
def description():
""" Returns a description for this Checker which will be displayed in the admin interface. """
return "This class is an minimalistic example on how to implement a new checker."

#def requires(self):
#""" Returns the list of passed Checkers required by this checker. If the returned checker have not been passed this checker will fail automaticly """
#""" Returns the list of passed Checkers required by this checker. If the returned checker have not been passed this checker will fail automatically """
#from checker.compiler.Builder import Builder
#return [ Builder ]
#return [ Builder ]



def run(self, env):
""" Do whatever this checker is suposed to do. """
""" Do whatever this checker is supposed to do. """

# use env.tmpdir() to get the sandbox folder
# env.sources() contains the uploades files ala [(unicode_name, unicode_content)...] - all these files will exist in the sandbox folder
# env.sources() contains the uploaded files ala [(unicode_name, unicode_content)...] - all these files will exist in the sandbox folder
# env.user() returns the author of the solution

# to pass information to a checker which runs at a later time save it in env, but make sure the checkers will be executet in the right order.
# to pass information to a checker which runs at a later time save it in env, but make sure the checkers will be executed in the right order.

# if you need to to create or copy files use the methods from utilities.file_operations - these will alter the owner and rights of the files apropriately
# if you need to run external programs/scripts use execute(...) - this will enshure that it will be executed with a user with restricted rights - if so configured
# if you need to to create or copy files use the methods from utilities.file_operations - these will alter the owner and rights of the files appropriately
# if you need to run external programs/scripts use execute(...) - this will ensure that it will be executed with a user with restricted rights - if so configured

# Create a result
result = CheckerResult(checker=self)
result = CheckerResult(checker=self)
# Set the massage for the user and if this checker has passed then return it.
result.set_log(self.configuration_field)
result.set_passed(True)
Expand All @@ -54,7 +54,7 @@ class ExampleCheckerInline(CheckerInline):
model = ExampleChecker


# A more advanced example: By overwriting the form of the checkerinline the initial values of the inherited atributes can be overritten.
# A more advanced example: By overwriting the form of the checkerinline the initial values of the inherited attributes can be overwritten.
# An other example would be to validate the inputfields in the form. (See Django documentation)
#class ExampleForm(AlwaysChangedModelForm):
#def __init__(self, **args):
Expand Down
6 changes: 4 additions & 2 deletions src/checker/basemodels.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def is_critical(self):
def set_log(self, log,timed_out=False,truncated=False,oom_ed=False):
""" Sets the log of the Checker run. timed_out and truncated indicated if appropriate error messages shall be appended """
if timed_out:
log = '<div class="error">Timeout occured!</div>' + log
log = '<div class="error">Timeout occurred!</div>' + log
if truncated:
log = '<div class="error">Output too long, truncated</div>' + log
if oom_ed:
Expand Down Expand Up @@ -420,8 +420,10 @@ def run_checks(solution, env, run_all):
else:
# make non passed result
# this as well as the dependency check should propably go into checker class
# TODO: Move code to checker class ?
result = checker.create_result(env)
result.set_log("Checker konnte nicht ausgeführt werden, da benötigte Checker nicht bestanden wurden.")
#result.set_log("Checker konnte nicht ausgeführt werden, da benötigte Checker nicht bestanden wurden.")
result.set_log("Checker failed to run because required checkers failed.")
result.set_passed(False)

elapsed_time = time.time() - start_time
Expand Down
Loading