Skip to content

Ways to connect Moodle

LearnBoard reports on a Moodle site, so the first job in a new workspace is to connect one. There are three ways to do it, all from Admin console, Data sources: through the LearnBoard Moodle plugin, with a read-only account on the Moodle database, or by uploading a copy of the database. Whichever you choose, LearnBoard only ever reads.

At a glance

  • Who can do this: the Admin role, with the Manage tenant data sources permission (manage.data-sources).
  • The Moodle plugin is the quickest way and keeps your database closed to the outside.
  • A database connection suits a team that can create a read-only database account and allow LearnBoard to reach it.
  • An uploaded copy is a snapshot, for an audit or last year’s data. It does not update.
  • LearnBoard reads Moodle sites that run on MySQL or MariaDB.
The Data sources screen with the Moodle plugin, Database and SQL dump tabs
Moodle plugin Database account Database copy (SQL dump)
Tab on Data sources Moodle plugin Database SQL dump
What you need A Moodle administrator to install the free plugin A database account that can only read, and network access from LearnBoard to the database An SQL export of the Moodle database, up to 2 GB
What LearnBoard connects to Your Moodle site’s own https address The Moodle database server, usually on port 3306 A private database of its own, loaded from your file
Database port opened to LearnBoard No Yes No
Database password leaves your server No Yes, encrypted when stored No
Figures stay current Yes Yes No, it is a snapshot
Also puts LearnBoard charts in Moodle Yes, the same plugin No No

Pick the plugin when

You run Moodle over https, a Moodle administrator can install a plugin, and you would rather not open the database to anyone. This is the method the setup walkthrough offers first. Connect with the Moodle plugin

Pick a database account when

Your IT team or host can create a read-only database account and let LearnBoard’s server through the firewall, or a plugin cannot be installed. Connect with a database account

Pick a database copy when

There is no live access at all, or you want to look at a fixed point in time. Upload a database copy

  • A Moodle database on MySQL or MariaDB. A plugin connection to a Moodle on another database type fails with “That Moodle runs on a database LearnBoard cannot read yet.”
  • The table prefix. Moodle puts the same short prefix in front of every table name. Almost every site uses mdl_, which is filled in for you. With the plugin, LearnBoard learns the prefix from Moodle.
  • Reporting data. User profiles, enrolments, course activity, grades, completions, certificates and logs. The plugin never sends tables holding site secrets, or password, token and key columns.
  • For the plugin: a public https address for your Moodle. Private and internal network addresses are refused.
  • For a database account: the host, port, database name, and a username and password for an account granted SELECT only.

Can a workspace have more than one source?

Section titled “Can a workspace have more than one source?”

Yes. A workspace can hold several data sources, for example the live Moodle and a copy of last year’s, and reads whichever one is Active. Only one is active at a time: activating a source switches the others off. Your plan sets how many sources a workspace can hold, counting every configured source, active or not. Deleting a source frees its place. See Data sources.

LearnBoard cannot change, delete or add anything on your learning platform, even by accident. Several separate layers make sure of it.

Every query is checked

Before any query runs, LearnBoard checks it. Only reading statements are allowed. Anything that could write, lock tables, reach the file system or change a setting is refused, and anything ambiguous is refused too.

The session itself is read-only

Every database session LearnBoard opens is set to read-only on the database server, reconnections included. A write that somehow got past the check would still be refused by the database.

The plugin checks again in Moodle

With the plugin, every query is signed by LearnBoard and checked again inside Moodle before it runs. The plugin locks its database session to read-only, refuses tables that hold site secrets, and can run on a separate read-only database user.

Your own account limits

With a database account, create one granted SELECT only. LearnBoard only ever reads, so SELECT is enough, and it then could not write even if every other layer failed.