Moodle activity plugin to enable integration between Moodle and Matrix
  • PHP 98.8%
  • Makefile 0.8%
  • Dockerfile 0.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
dependabot[bot] 0f8ebfa756 Build(deps-dev): Bump moodle/moodle from 4.0.4 to 4.0.6
Bumps [moodle/moodle](https://github.com/moodle/moodle) from 4.0.4 to 4.0.6.
- [Release notes](https://github.com/moodle/moodle/releases)
- [Commits](https://github.com/moodle/moodle/compare/v4.0.4...v4.0.6)

---
updated-dependencies:
- dependency-name: moodle/moodle
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-03 16:25:45 +00:00
.docker Update moodle/moodle to >=4.0.1 2022-11-04 14:31:42 +00:00
.github Fix: Enable required extensions 2022-06-07 10:37:32 +02:00
backup/moodle2 Update header licence to SPDX ID Apache-2.0 2022-11-03 23:46:54 +00:00
classes Update header licence to SPDX ID Apache-2.0 2022-11-03 23:46:54 +00:00
db Update header licence to SPDX ID Apache-2.0 2022-11-03 23:46:54 +00:00
lang/en Update header licence to SPDX ID Apache-2.0 2022-11-03 23:46:54 +00:00
pix Initial proof of concept for the moodle plugin 2020-12-28 13:25:18 -07:00
src Fix the valid matrix username scope regex 2023-01-31 13:20:36 +00:00
test Update header licence to SPDX ID Apache-2.0 2022-11-03 23:46:54 +00:00
.editorconfig Enhancement: Use Docker to set up moodle locally 2021-07-01 14:41:54 +02:00
.gitignore add vim swap files to .gitignore 2022-11-03 17:54:56 +00:00
.gitlab-ci.yml Enhancement: Run coding standards job on GitHub Actions 2022-05-24 10:23:09 +02:00
.php-cs-fixer.php Fix: Run 'make coding-standards' 2022-05-24 10:31:28 +02:00
CHANGELOG.md Enhancement: Prepare release 2022-03-22 16:14:04 +01:00
composer.json Update moodle/moodle to >=4.0.1 2022-11-04 14:31:42 +00:00
composer.lock Build(deps-dev): Bump moodle/moodle from 4.0.4 to 4.0.6 2023-03-03 16:25:45 +00:00
lib.php Update header licence to SPDX ID Apache-2.0 2022-11-03 23:46:54 +00:00
LICENSE Re-license project under Apache 2.0 2022-05-23 17:45:23 +01:00
Makefile Fix: Rename target 2022-02-02 09:13:29 +01:00
mod_form.php Update header licence to SPDX ID Apache-2.0 2022-11-03 23:46:54 +00:00
psalm-baseline.xml Fix: Run 'make static-code-analysis-baseline' 2022-05-24 10:29:13 +02:00
psalm.xml Fix: Remove unused file 2022-02-22 08:46:50 +01:00
README.md Update moodle/moodle to >=4.0.1 2022-11-04 14:31:42 +00:00
settings.php Update header licence to SPDX ID Apache-2.0 2022-11-03 23:46:54 +00:00
version.php Remove old CONTRIBUTING file, update version.php 2022-11-21 15:31:55 +00:00
view.php Update header licence to SPDX ID Apache-2.0 2022-11-03 23:46:54 +00:00

matrix-moodle-plugin

Integrate

This plugin provides a Moodle activity to enable integration between Moodle and Matrix. It adds:

  • a new field for mxid for Moodle uers
  • the ability to create a new Matrix room for a course, then invite all students of that course (or group within the course) to the room

Release

Update the plugin version in version.php:

-$plugin->version = 2020122800;
+$plugin->version = 2021070100;

Run

make archive

Share the compressed file mod_matrix.zip.

Setting up a local development environment

Install the pre-requisite tools:

  • cmake (or make)
  • composer (you'll need a version > 2, be warned the version in the Ubuntu repositories is much older)
  • docker
  • docker-compose-plugin to provide the docker compose command. See https://docs.docker.com/compose/install/
  • php extensions:
    • php-curl
    • php-gd
    • php-intl
    • php-simplexml
    • php-zip

Rather than just make, you may want to directly install your operating system's development tools, for instance on Debian: apt install build-essential

On Fedora: dnf groupinstall "Development Tools"

Docker

Run

make docker-up

to start a local development environment.

💡 This command requires docker compose.

Moodle Command Line Installer

Run

docker ps

to obtain a list of the currently running containers. There should be a container with the name docker-moodle_php-1.

Run

docker exec -it docker-moodle_php-1 bash

to enter the container.

Run

cd /var/www/html

to change into the root of the Moodle installation (working directory is set to the root of the Moodle plugin).

Run

php admin/cli/install.php

to run the command line installer.

Basics

Configuration Value
Language en (default)
Data Directory Permissions 2777 (default)
Web Address your local host, e.g., http://moodle.com.local
Data Directory /var/www/moodledata (default)

Database

Configuration Value
Database driver mariadb
Database host moodle_mariadb
Database name moodle (default)
Tables prefix mdl_ (default)
Database port 3306
Database user root
Database password root

Other

Configuration Value
Full site name Moodle Matrix Plugin Development
Short name mmpd
Admin account user name admin (default)
New admin user password password
New admin user email address your email address
Upgrade key (default)

Moodle Administration

Navigate to http://127.0.0.1 to finish setting up the installation.

Log in with the credentials for the administrator account created created when running the command line installer.

Install the mod_matrix plugin

Navigate to http://127.0.0.1/admin/settings.php?section=modsettingmatrix and provide configuration values to finish the configuration of the plugin:

Configuration Value
Homeserver URL
Access Token
Element Web URL
No-Reply Address

Add course

Navigate to Site Administration. Select the Courses tab. In the Courses section, select Add a new course.

Fill in some data for a course.

Configuration Value
Course full name Example Course
Course short name Example

Click Save and Display.

In the Participants section, click Enrol users.

In the Enrol users overlay, select the previously created administrator and assign the Teacher role.

Click Enrol users.

Click Proceed to course content.

Edit course

In the course view, click Turn editing on. In the Announcements section, click on Add an activity or resource.

In the Add an activity or resource overlay, click on Matrix to add a new matrix.

Click Save and Display.

Disable Recycle Bin during Development

Navigate to Site Administration. Select the Plugins tab. Select Category: Admin Tools.

In the Recycle Bin section, deselect Enable course recycle bin and Enable category recycle bin.

Click Save changes.

Stop and clean up development environment

To stop the local development environment, run

make docker-down

To clean up, remove the .data and vendor directories

rm -rf .data/ vendor/

Changelog

Please have a look at CHANGELOG.md.

Contributing

Please have a look at CONTRIBUTING.md.