This project consists of two main components:
- JobeInABox: A Dockerized version of the Jobe server, which is used for running student code in a sandboxed environment.
- Modified CodeRunner: A customized version of the CodeRunner question type for Moodle, where the SQL question type uses PostgreSQL instead of the default SQLite.
Before you begin, ensure you have the following:
- Docker: Installed and running on your system.
- Moodle: Installed and configured on your server.
- PostgreSQL: Installed and running, as the modified CodeRunner uses PostgreSQL for SQL questions.
-
Pull this repository from GitHub:
git clone https://github.com/niklvdanya/coderunner-psql.git cd coderunner-psql/jobeinabox
-
Build the Docker image:
sudo docker build . -t my/jobeinabox --build-arg TZ="Europe/Amsterdam"
-
Run the Docker container:
sudo docker run -d -p 4000:80 --name jobe my/jobeinabox
This will start the Jobe server on port 4000.
-
Move the coderunner folder to your Moodle's question type directory:
cp -r coderunner /path/to/moodle/question/type
Typically, the path is:
/var/www/html/moodle/question/type
-
Set the correct permissions:
sudo chown -R www-data:www-data /path/to/moodle/question/type/coderunner sudo chmod -R 755 /path/to/moodle/question/type/coderunner
-
Install the plugin:
Log in to your Moodle server as an administrator.
Go to Site Administration → Notifications.
Moodle will detect the new plugin and prompt you to install it. Click Upgrade.
-
Configure CodeRunner:
Go to Site Administration → Plugins → Question Types → CodeRunner.
Set the Jobe server URL to http://localhost:4000 (or the appropriate address if Jobe is running elsewhere).
The jobeinabox directory contains an init.sql file, which is used to initialize the PostgreSQL database for the Jobe server. This file creates tables and grants necessary privileges to the jobe_user