This is a fork of maths/moodle-qtype_stack system with support for Dockerized API server.
STACK is an assessment system for mathematics, science and related disciplines. STACK is a question type for the Moodle learning management system, and also the ILIAS learning management system.
STACK was created by Chris Sangwin of the University of Edinburgh, and includes the work of many other contributors. A demonstration server is available at the University of Edinburgh: https://stack.maths.ed.ac.uk/.
STACK is based on continuing research and use at the University of Edinburgh, the Open University, Aalto, Loughborough University, the University of Birmingham and others.
This is a fork tailored to run Stack API server as a Docker container in TIM stack.
Please note the following when trying to use or setup your own container
To build an image, you can use normal docker build
. You can also use the included buildimage.sh
script as follows:
$ ./buildimage.sh prod
This will build the production image and tag it as stack-api:build
.
You can also use dev
target to build development image. Check out the differences between the two targets in the next section.
Currently Dockerfile
contains two targets:
prod
: Sets up PHP 7.4,gnuplot
andstack
server. Runsentrypoint_install_and_run.sh
as its entrypoint.dev
: Same asprod
but in addition startssshd
. Runsentrypoint_install_and_run.sh
as its entrypoint (seedocker-compose
section below for more info).
Use api/config.php.docker
file to edit Stack API config. It currently contains options relevant to TIM.
Currently the fork is pre-configured to run MaximaPool API using goemaxima server. As such, there is no local Maxima installation that you can access within the container.
These examples assume you built the images yourself with buildimage.sh
script.
You can also use automatically built images from timimages/stack-api repository instead of building them yourself.
version: "3.7"
services:
maxima:
image: timimages/goemaxima:2020113000-latest
stack:
image: stack-api:build
depends_on:
- maxima
ports:
- "49992:80"
volumes:
- ./plots:/var/data/api/stack/plots:rw
- ./plots:/var/www/html/plots:rw
- ./api/config.php.docker:/var/www/html/config.php:rw
- ./entrypoint_install_and_run.sh:/var/www/html/entrypoint_install_and_run.sh
This will
- Start MaximaPool server (accessible via
http://maxima:8080/maxima/
endpoint) - Build and start Stack API server in production mode on port 80 and makes it accessible via
localhost:49992
To debug stack, you can use the included Docker Compose file that sets up a local development environment.
-
Run
docker-compose -f docker-compose.debug.yml up
.This will build the latest image of stack API server and set up the following ports:
48882
for stack API2222
for SSH (usernameroot
, passwordtest
)
This wil also start the server in attached mode. Add
-d
flag todocker-compose
to run in detached mode instead if you need to. -
Once the server starts, test that it works by going to
localhost:48882/api/endpoint.html
-
Set up xdebug remote debugging using IDE of your choice.
The image uses port
3009
for xdebug and has automatic breaking enabled for each request. Editentrypoint_install_and_run_debug.sh
to edit breakpoint behaviour if needed.
From time to time, this fork needs to be synced with upstream.
At this moment api4.3
is the fork on upstream that contains up-to-date API.
To pull changes from upstream to this fork, you can merge changes from upstream:
git pull https://github.com/maths/moodle-qtype_stack api4.3
This may require resolving merge conflicts.
The documentation is here, including the installation instructions.
STACK is Licensed under the GNU General Public, License Version 3.