Activity module for Moodle that enables you to use already existing Moodle structures like questions and courses to create quizzes in MI-Quiz.
- Download ZIP of master branch: https://github.com/PW-Solutions/miquiz-moodle/archive/master.zip (for Moodle v4+)
- Use v3 for Moodle < v4
- Open Moodle Plugin installer: /admin/tool/installaddon/index.php
- Select downloaded ZIP files as ZIP package
- Select "Activity Module (mod)" as Plugin type
- Enter
miquiz
in the "Rename the root directory" field - Follow the installation process.
Make sure to enable web services and the external service moodle_mobile_app
,
so that MI-Quiz can authenticate users with Moodle credentials. See:
/admin/webservice/service.php?id=1
, /admin/search.php?query=enablewebservices
, and /admin/settings.php?section=mobilesettings
.
This repository comes with a ready to use docker configuration to test the plugin (without the connection to MI Quiz).
- Clone repository
- Create
.env
file:cp .env.example .env
- Update
SERVER
variable in.env
file - Start containers with
docker-compose up -d
- Login under
SERVER
and use default admin account:admin
:Admin123.
Important: To perform the initial moodle installation with this plugin already imported, we
have to temporary comment out the lines in lang\{en|de}\miquiz.php
where get_config
is called,
as Moodle tries to get the config value from the database before any tables are created.
- admin:Admin123. = Admin
- alice:Alice123. = Student (Course A), Teacher (Course B)
- bob:Bob1234. = Teacher (Course A), Student (Course B)
- carol:Carol123. = User with 'mod/miquiz:overview' capability (via system role "MI-Quiz Manager")
docker-compose down -v
docker-compose build --no-cache
docker exec -it moodle_db_1 mysqldump -u moodle -pmoodle moodle -r startup_db.sql
docker cp moodle_db_1:startup_db.sql ./
See https://stackoverflow.com/a/20086949/5816097 on why we cannot use ... > startup_db.sql
.
There is no cron-job configured in the docker image (yet). To perform the Moodle cron job, execute
docker exec -it moodle_moodle_1 php admin/cli/cron.php
. This is necessary to sync users
of activities with miquiz.
Default host: http://host.docker.internal:8000 (Moodle plugin settings)
If you use another port for MI-Quiz in your docker port, change it in the moodle plugin settings.
Important: If you use Docker on Linux, you need to add the host ip in the /etc/hosts
file yourself (see
open issue).