This document guides into different development tasks without installing and running the complete production system on a personal workstation.
The core of the system is written in Python 3 and installing that is the minimum requirement. Then, clone the project and get started!
Following terminal commands create an environment and install required packages.
Linux & OS X:
python3 -m virtualenv -p python3 py_venv
source py_venv/bin/activate
pip install -r requirements.txt
Windows:
C:\Python35\python -m venv py_venv
py_venv\Scripts\activate.bat
pip install -r requirements.txt
When starting a new terminal for development, access the same virtual enviroment by entering the activate command alone (2nd line).
The repository contains a Django web framework project where directory radar
is the main module. Django offers a command line interface for controlling the system and this project further extends it with custom commands. Executing python manage.py
lists all commands.
Useful maintenance actions:
python manage.py migrate
Creates/updates changed database models (default settings store data in filesystemdb.sqlite3
).python manage.py createsuperuser
Creates a user that can login to the web UI.
Useful testing actions:
python manage.py runserver
Runs the web UI in http://localhost:8000/ as well as Django database admin in http://localhost:8000/admin/python manage.py loadsubmissions testcourse/exercise1 user1/sub1 user1/sub2 user2/sub1 ...
Loads file submissions into analysis queue from the given directories (wildcards should work too, e.g. data/rainfall/9*/*). Each submission is a single directory - even if there is only one submitted file per submission.python manage.py matchsubmissions testcourse/exercise1
Processes file submissions from the analysis queue. Beware, time requirement is exponential so better start with ten rather than hundred submissions. Once submissions have been inserted the button at top "Recompare all..." needs to be clicked to feed new submissions for matching.
Tip: create empty file radar/local_settings.py
in order to get rid of extra warnings.
Note: The root folder contains the script "run_loadsubmission.sh" which correctly distributes submission files in a manner which Radar is happy with. To use the script for testing do the following:
- Download submission zip file from A+ for example and unzip it.
./run_loadsubmissions.sh ${directory_with_submissions} {course}/{exercise} 1
This goes through the directory, places each submission into it's own folder and creates a subfolder inside there to put the submission in. After this folder distribution is done, it runs the manage.py loadsubmissions command for each submission. The last variable is the delay, which determines how long we should wait between sending submissions to the service- Wait until the script finishes
- Run
python manage.py matchsubmissions {course}/exercise
and the submissions should be matched.