The VMChecker API is built on Django. The project is made up of two parts, the API that exposes the URLs for Moodle, and a second process, that submits assignments to Gitlab, polls for the result or retrieves the output/assignment archive. It uses the Postgres database as a task queue.
python3 >= 3.10
pipenv
(pip3 install pipenv --user
. See docs)docker
(See official docker docs)- Create a test assignment on Gitlab.com by following the TA handbook. You will only require the private git repository. You can directly fork the following template assignment.
- After cloning the repository install the python packages using
pipenv install
. - Clone the Vmchecker Moodle plugin from: VMChecker Next and change the compose-dev moodle service's path to point to it
- Start the environment using
./bin/dev.sh up --watch
Note: The first time you run dev.sh
the moodle service might fail. Comment out the vmchecker volume bind and do dev.sh down && dev.sh up --watch
.
If this is the first time starting up the development environment you'll have to set up a Moodle assignment and configure the Moodle plugin.
To configure the Moodle block plugin:
- Go to
Site Administration > Plugins > Blocks > VMChecker block
- Change
vmck backend
tohttp://backend:8000/api/v1/
To set up the Moodle assignment create a course and some users and add them to the course. Then you can follow the TA handbook on how to prepare the assignment.
Useful notes:
- Moodle is avaialbe at
http://localhost/
- User:
admin
, Password:Parola-123
- If you are also developing the Moodle plugin check out the Moodle debugging notes
- User:
- VMChecker service port
8000
The backend service exposes port 5678
for debugging. A VS Code configuration example:
{
"name": "Python Debugger: Remote Attach",
"type": "debugpy",
"request": "attach",
"connect": {
"host": "localhost",
"port": 5678
},
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "/opt/api"
}
]
}
pipenv run pytest test/