dodona-edu / Dodona
Programming Languages
Labels
Projects that are alternatives of or similar to Dodona
Dodona
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.
Development Setup
- Install and start
mysql
ormariadb
. - If using
mysql
, change thesql-mode
in themysqld
configuration block:sql-mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'
- Create a
dodona
user with access to thedodona
anddodona_test-N
databases. You will need as much test databases as hou have CPU threads.CREATE USER 'dodona'@'localhost' IDENTIFIED BY 'dodona'; GRANT ALL ON dodona.* TO 'dodona'; GRANT ALL ON dodona_test.* TO 'dodona'; GRANT ALL ON dodona_test-0.* TO 'dodona'; ... GRANT ALL ON dodona_test-3.* TO 'dodona';
- Create and seed the database with
rails db:setup
. (If something goes wrong with the database, you can userails db:reset
to drop, rebuild and reseed the database.) -
Start the server. The simplest way is with
rails s
. Dodona will be available on a subdomain of localhost: http://dodona.localhost:3000. - 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)
http://dodona.localhost:3000/nl/users/1/token/zeus
http://dodona.localhost:3000/nl/users/2/token/staff
http://dodona.localhost:3000/nl/users/3/token/student
Evaluating exercises locally
These steps are not required to run the server, but you need docker to actually evaluate exercises.
- Install and start
docker
. - Clone the docker-images repository.
- Build a docker image. The
build.sh
scripts builds all images. But with the initial data, onlydodona-python
is needed. You can build this image withdocker build --pull --force-rm -t "dodona-python" -f "dodona-python.dockerfile" .
.
Loading visualisations locally
These steps are not required to run the server, but are needed to let the visualisations load.
- Install and start
memcached
. - Create the following file
tmp/caching-dev.txt
.
Starting the server
The simplest way to start the server is with the rails s
command. But this will not process the submission queue, and javascript will be compiled by webpack in the background (without output when something goes wrong).
- To process the submission queue, delayed job needs to be started with the
bin/delayed_job start
command. - With
bin/webpack-dev-server
your javascript is reloaded live and you can see development output.
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 bin/server
.
The foreman gem is not bundled with Dodona. Install it globally with gem install foreman
.
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 byebug
again.
Localhost subdomain
Dodona use subdomains in order to sandbox exercise descriptions (which are arbitrary HTML pages and could be used for malicious purposes if not properly sandboxed. We serve the main application in development from http://dodona.localhost:3000 and exercise descriptions from http://sandbox.localhost:3000.
If this does not work out of the box you can add the following lines to your /etc/hosts
file:
127.0.0.1 dodona.localhost
127.0.0.1 sandbox.localhost
Running on Windows
Some gems (such as therubyracer) and dependencies (such as memcached) do not work on Windows. You should use WSL 2 instead, and run everything inside WSL. This means you use WSL for the database, memcached, git, Docker, etc.