The Dodona project aims to provide a solution for the automatic testing of solutions for programming exercises.
On https://dodona.ugent.be, students can sign in with the credentials of the Smartschool, Office 365, or G Suite account of their school. After signing in, you can subscribe to one of the many courses. Dodona courses consist of several exercise series. Each exercise has a detailed exercise description and an extensive test suite. After submitting a solution to an exercise, a sandboxed background job is started to test the solution, and the result and feedback is displayed within seconds.
The documentation of this project can be found at https://dodona-edu.github.io.
- Install and start
- If using
- Create dodona user (with password 'dodona') with create database permissions.
- Create and seed the database with
rails db:setup. (If something goes wrong with the database, you can use
rails db:resetto drop, rebuild and reseed the database.)
- Start the server. The simplest way is with
- Because CAS authentication does not work in development, you can log in by going to these pages (only works with the seed database form step 4)
Evaluating exercises locally
These steps are not required to run the server, but you need docker to actually evaluate exercises.
- Install and start
- Clone the docker-images repository.
- Build a docker image. The
build.shscripts builds all images. But with the initial data, only
dodona-anaconda3is needed. You can build this image with
docker build --pull --force-rm -t "dodona-anaconda3" -f "dodona-anaconda3.dockerfile" ..
Starting the server
The simplest way to start the server is with the
- To process the submission queue, delayed job needs to be started with the
To run all these processes at the same time, the foreman gem is used. To start the rails server, delayed job and the webpack dev server, simply run
This has one letdown: debugging with
byebug is broken. You can run
bin/server norails to only start webpack and delayed_job in foreman and then run
rails s in a different terminal to be able to use
Tutor Docker network
Your docker network (for the python tutor) should be in
192.168.0.0/16. If this is not the case, you should edit
config/application.rb. Be aware that you should run this application behind a proxy, otherwise users could spoof their IP address via the
X-Forwarder-For header. (If they spoof their ip addres to one within the docker network, they will be able to access media files of private exercises that they would otherwise not have access to.)
Running on Windows
- Dodona itself must be run in WSL. The Ubuntu WSL distribution is known to work.
- The database can be run in either Windows or WSL. If you run the database in Windows, you must change
config/database.yml). Otherwise Ruby will attempt to connect using sockets, which won't work.
Docker runs in Windows, and requires some tweaks to communicate with WSL.
- Enable the TCP daemon in the Docker settings.
- Set the environment variable
DOCKER_URLto the url of the Docker daemon. Otherwise Ruby will again attempt to connect using sockets.
- Dodona uses bind mounts to share a folder with the container. As Dodona runs in WSL and Docker in Windows, this does not work out of the box.
By default, WSL uses paths of the form
/mnt/c/users/blabla. However, Docker uses
/c/users/blabla. You need to change the mount location in WSL. (See also in this blog post and the reference documentation.)
Open or create the config file by running
sudo nano /etc/wsl.confin WSL and insert this:
[automount] root = / options = "metadata,umask=22,fmask=11"
This will also give Windows folders proper permissions in WSL.
There is another problem: Dodona creates a temporary folder in
/tmp(inside WSL), which is not accessible to Docker. A solution is setting the
TMPDIRenvironment variable (in WSL when running Dodona). Set
TMPDIRto a folder on your Windows drive, like
/c/ubuntu-tmp. As Dodona will then pass
/c/ubuntu-tmpto Docker, it will be able to access the folder.
- This is not specific to Dodona, but when you build Docker images in Windows, you need special care to ensure files have the proper permissions (executable) and have the correct line endings.