Learning Analytics in Moodle: Building a Plugin That Shows Teachers Who Needs Support

How to design a Moodle learning-analytics plugin: which log and forum data to use, how social network analysis turns replies into an engagement map, privacy and performance considerations, and what teachers actually find useful.

Gigantic WorkEngineering team • Nov 17, 2026

Moodle collects a great deal of data about how students learn: every login, page view, forum post and submission. Out of the box, most of it is hard for a teacher to use. A focused learning-analytics plugin can turn that data into a few views that answer practical questions: Who has gone quiet? Is the discussion forum a conversation or a set of monologues? Which groups are working together?

This guide describes how our team approaches such a plugin, based on building one for a medical faculty’s teaching team.

Start with the teacher’s question

Before writing code, agree with teachers on two or three questions the plugin must answer. Typical ones:

  1. Which students have not logged in or participated recently?
  2. How much do students interact with each other, not just with the tutor?
  3. Are some groups or individuals isolated from the course community?

Everything else — charts, exports, filters — follows from those questions. A dashboard with twenty widgets usually goes unused.

Try it: a forum interaction network

The demo below uses fictional data. Each dot is a student; each line means they replied to each other in the forum. Students with few connections or few recent logins are flagged in red. Drag the week slider to see the network form over a semester.

Forum interaction network Sample course · 24 fictional students · Moodle-style analytics
TutorDanielFionaNathanQueenieVincent

The data you already have

Question Moodle data Notes
Login frequency and recency Standard log store (logstore_standard_log), user last-access fields Aggregate per week; raw logs grow quickly
Time spent Derived from sequences of log events Treat as an estimate; define “session” clearly
Participation Forum posts, assignment submissions, quiz attempts Count per student per week
Interaction network Forum posts and their parent post A reply from A to B creates an edge A–B

Use Moodle’s APIs and data definitions rather than ad-hoc SQL against tables that may change between versions, and keep heavy queries out of page loads.

Social network analysis, simply

Social network analysis (SNA) treats students as nodes and replies as links. A few measures go a long way:

  • Degree — how many different peers a student has interacted with. Very low degree is an early warning sign.
  • Density — the share of possible connections that exist. Low density suggests the forum is mostly tutor-led.
  • Groups and bridges — clusters show tutorial groups working together; a few students who connect clusters are often the course’s informal leaders.

Present these in plain language. Teachers need “these five students have replied to almost no one”, not “degree centrality < 2”.

Plugin architecture

A maintainable design for a Moodle plugin:

  1. A report or block plugin that teachers reach from the course, respecting Moodle capabilities so only teaching staff see it.
  2. A scheduled task that aggregates logs and forum data nightly into small summary tables, so the report loads instantly even for large courses.
  3. A clear data model — per student, per course, per week — that is easy to export for teaching research.
  4. Visualisations rendered in the browser from the summary data, with accessible tables as an alternative view.

Following Moodle’s plugin conventions (capabilities, scheduled tasks, language strings, privacy API) keeps the plugin upgradeable when the site moves to a new Moodle version.

Privacy and ethics

Analytics is about support, not surveillance

Tell students what is collected and why, limit access to the teaching team, and implement Moodle’s privacy API so data can be exported or deleted on request. If the data is used for teaching research, align with your ethics approval and anonymise exports.

  • Show flags as prompts for a friendly check-in, never as grades or judgements.
  • Keep retention short for detailed activity data; keep aggregated trends longer.
  • Avoid comparing named students in front of others.

What teachers found useful

From working with teaching teams, the most-used features are rarely the most sophisticated:

  • A weekly list of students who have gone quiet, with one-click messaging.
  • The forum network at mid-semester, to rebalance groups or prompt quieter students.
  • A simple export for course reviews and teaching-grant reports.

Getting started

A good first step is a two-week discovery: agree the questions, check your Moodle version and logging settings, and prototype one view on a past course’s data. Our learning platforms page describes how we work with Moodle and Open edX, and the Grant IT Budget Planner can estimate a plugin project for a teaching grant proposal.

WORK WITH US

Planning a project like this?

Gigantic Work builds web platforms, research portals, AI tools, Unity/VR experiences and cloud infrastructure for Hong Kong universities, grant-funded projects, NGOs and SMEs — and hands over everything at the end.