Moodle learning analytics and at-risk student predictions

Moodle's analytics models and insights report can flag students who may need support, but predictions only help once the data, model choices and privacy review are settled. This page explains how to plan and roll them out in infrastructure you control.

On this page

How Moodle learning analytics and at-risk predictions work

Teams that want early warning of at-risk learners in Moodle should start by understanding that the platform already ships the pieces for it. Moodle core includes an analytics admin tool, listed as Analytic models, and an insights report. The admin tool is where a site defines models that predict an outcome, such as a learner being unlikely to complete a course, from activity data. The insights report is where teachers see the resulting flags for their own courses. Predictions only work when three things are in place: enough course activity data for the model to learn from, a clearly defined target outcome that the site agrees on, and a configured machine learning backend that does the calculation. Without all three, the model produces weak or misleading output, and the insights report will not show a useful picture.

The machine learning backend is the part that changed most recently. Moodle 5.0 removed the mlbackend_php plugin, so the Python machine learning backend in core is now the supported route. Teams planning a new deployment should confirm with their hosting team that a Python runtime can be installed and kept current on the same infrastructure, and that the security team accepts it as a component to patch and monitor. Sites that ran the older PHP backend need a migration plan rather than a simple setting change. Confirm which release the site runs against the Moodle 5.0 release notes before committing to a design.

Not every team needs predictions. If the question is which courses have low logins or which students have not submitted anything this week, a standard report or the custom report builder usually answers it with less setup, less data review and no model to explain to staff. Predictions earn their cost when a team has enough historical courses to train on, can name the outcome it wants to prevent, and will act on each flag with a documented intervention. Before any prediction reaches teachers, the data and privacy review should confirm which activity data feeds the models, who can see individual flags, how long data is kept, and whether the learners and their institution have been told. That review is the decision point, and it should be finished before the first model is switched on.

Choosing a machine learning backend after the PHP backend was removed

Sites already running Moodle 5.0 or later have no backend choice to make in the sense of picking between two engines. The PHP backend, mlbackend_php, was removed in Moodle 5.0, so the Python machine learning backend in core is the only option. The decision that remains is whether to run that Python service at all, and where it lives. Start by confirming whether analytics models are enabled, which models are in use, and whether anyone has already trained them.

  • Check existing configuration: Review the analytic models and backend settings in the admin interface to see what is currently active.
  • Confirm the service exists: Establish whether a Python service is already reachable from Moodle, or whether analytics has been dormant since the upgrade.
  • Plan the host: Decide which infrastructure runs the service, with its own patching, logging and access control.
  • Restrict network paths: Allow only Moodle to call the service, and keep training data within your environment.
  • Document the model owner: Name the person who approves retraining and who answers questions about a prediction.

Before relying on any existing model, confirm with your own analytics owner how it was trained, on what data, and when it was last validated.

Analytics configuration options and when each fits

This table compares the main ways to configure Moodle analytics, from the insights report alone to prediction models that reach students. Read each row as a step up in data use, governance effort and staff time, and start at the lowest level your learning goals can justify. The main takeaway is that audience and course scope usually carry more risk than the choice of model.

OptionWhen it fitsWhat it requires from governance and staff
Insights report only, without prediction modelsTeams want to review activity-based insights for courses they already teach, without automated predictions being generatedA named owner for the report, a rule that insights are used for teaching support only, and a check that teachers understand what the report does not show
Selected prediction models on a pilot set of coursesA small group of courses with clear, consistent activity data and willing teachers who can test whether the predictions are usefulA documented data review for those courses, an agreed success measure, and a staff member who reviews prediction quality each term
Full set of prediction models across all coursesFew use cases, since broad coverage increases the number of students profiled and the number of teachers who must interpret resultsA completed data protection impact assessment, a lawful basis or policy position signed off by legal, and sustained staff time for moderation and training
Indicators and targets chosen by the institutionPrograms have specific completion or attendance outcomes that the default indicators do not measure wellAcademic sign-off on each target definition, a review of whether indicators proxy protected characteristics, and a record of why each indicator was chosen
Default indicators and targetsThe team needs a fast start and can accept that defaults may not match its course designTesting that default indicators are valid for the course types in scope, plus a plan to revisit them when assessment or course design changes
Course scope limited to specific programs or categoriesAnalytics relate to a defined cohort and the institution wants a bounded, reviewable data setClear category or course selection criteria, a process for adding courses, and a log of which courses are included and why
Predictions visible to teachers onlyStaff should decide what support to offer, and students should not see automated risk labelsTraining on how to use predictions as a prompt for contact, rules against using them in grading, and a route for teachers to record their own judgment
Predictions shared with studentsThe institution wants learners to see their own engagement signals and act on themStudent-facing wording reviewed for accuracy and tone, an appeal or correction route, and staff ready to respond to questions about results

Setting up analytics models and the insights report step by step

This sequence takes a Moodle site from a supported version and a secured Python backend to tested analytics models and an insights report that only authorized staff can open. Each step ends with a check, so the team knows whether to move on before predictions reach anyone who acts on them.

  1. Confirm Moodle version and server prerequisites

    The platform team confirms the Moodle version in production and checks it against the release notes for that version, including PHP, database and web server requirements. From Moodle 5.1, the web server document root must point to the /public directory. Confirm the same for the analytics backend, because Moodle 5.0 removed the PHP backend and the Python backend is now the only option in core. Done when the team has a written checklist, signed off by the platform owner, that matches the running environment.

  2. Provision and secure the Python backend

    The infrastructure team deploys the Python machine learning backend on a host or container inside the same controlled network as Moodle, and confirms its runtime and library requirements with the Moodle backend documentation for the version in use. Restrict network access so only the Moodle application servers can reach it, store any credentials in the organization's secrets tooling, and keep the host on the normal patching cycle. Done when the backend answers a connection test from Moodle and a port scan from outside the permitted network finds nothing open.

  3. Enable the analytics admin tool

    A Moodle administrator enables the analytics admin tool and the insights report from the site administration pages, then selects the machine learning backend. The administrator confirms that the analytics models page loads without errors and that the backend status shows as reachable. Log the change in the change record, including the version and backend host. Done when the admin tool lists its models, the backend connection test passes, and the change record is complete.

  4. Define targets and indicators

    Academic staff and the analytics owner agree on the prediction target, such as a student being at risk of not completing a course, and the indicators the model may use, such as activity logs and grades. Each indicator is reviewed for whether it reflects student behavior fairly, and whether it is personal data that the privacy review has approved. Record the decisions with reasons. Done when the target and indicator list is approved in writing by the academic owner and the data protection contact.

  5. Train and evaluate models on test courses

    The analytics owner creates models on a small set of test courses that have completed in the past, so outcomes are already known. The team trains each model, reviews the evaluation results that Moodle reports, and compares predictions with actual outcomes. Weak models are changed or dropped, and each decision is recorded. Done when the team has a short list of models whose evaluation results have been reviewed and accepted by the academic owner. Do not move to live courses until this sign-off exists.

  6. Grant insights access to a limited role

    The Moodle administrator creates a dedicated role for reviewers, such as student support staff, and grants only the capabilities needed to view the insights report and the relevant courses. Teachers and general staff do not receive the analytics capabilities by default. Assign the role to named people and keep the membership list under review. Confirm the capability names in your Moodle version before creating the role. Done when a test account with only that role can open the report, and an ordinary teacher account cannot.

  7. Verify output against known cases

    The analytics owner and an academic reviewer check the insights report against students whose outcomes are already known, including students who completed and students who withdrew. They look for missed cases, false alarms and any indicator that appears to drive results unfairly. Findings go back into the target and indicator review. Done when the reviewer signs off on the accuracy, the known-case results are filed with the change record, and the report is cleared for a limited pilot.

How log data moves from Moodle to the backend and back to teachers

The flow starts with Moodle's logstore and course data, which the analytics models in the Moodle host turn into training and prediction inputs. Those inputs cross into the Python machine learning backend on a separate host, which returns predictions to Moodle. The insights report then shows them to teachers only through role checks. Confirm which host holds each copy of personal data, and where the trust boundary sits, before any prediction reaches a teacher.

Data crosses the Moodle host to backend boundary, with predictions shown only through role checks.

The data and privacy review before predictions reach teachers

The review has to settle several decisions before any at-risk flag reaches a teacher's screen. The first is the lawful basis and stated purpose for running predictions on students at all, which must be written down in terms the institution can defend. The second is scope: which student data feeds each analytics indicator, such as log activity, submission timing or grades, and whether any field is included only because it is available. Each indicator should be justified against the purpose, and fields that do not support the purpose should be excluded from the model before training starts. Your data protection officer and legal counsel own these decisions, and DeployOpen's role is to document the data flows and configure the controls that enforce them.

The second part of the review covers retention and visibility. Training data, the trained models and the stored predictions are three separate retention questions, and each needs a defined period and a deletion method. Confirm in your environment how the analytics models and their prediction records are stored and purged, and whether old predictions remain visible in the insights report. Access is equally specific: decide which roles can see individual flags, whether a teacher sees only students in their own courses, and whether administrators outside teaching need access at all. Also decide whether learners are told that predictions are made about them and how they can ask questions about a flag.

Finally, the review must confirm that Moodle's privacy tooling can answer data subject requests for analytics records. Check how prediction and training records are covered by the site's privacy API and export and deletion workflows, and test a full request against a non-production copy before go-live. DeployOpen prepares evidence and controls for this review, including data flow records, configuration settings and test results, but DeployOpen does not issue audit reports or attestations. Independent auditors and the institution's own governance bodies make the assessment, so the evidence pack should be built for their review rather than presented as a conclusion.

Security and operational risks of predictions on student data

Predictions about learners combine sensitive personal data, a model that changes over time and a set of teachers who may act on it. The cards below cover where these risks show up in a Moodle site and the control to put in place for each before predictions reach staff.

Over-broad report access

The insights report and analytic model output can show at-risk flags to anyone whose role grants the capability, which is often wider than the teachers of one course. Check which roles hold the report and model-viewing capabilities at system and category level, and remove them from roles that are assigned broadly, such as managers and custom roles copied from defaults. Test the restriction with a teacher account from a course that has no connection to the flagged learners.

Report source code

Backend credentials and network exposure

The Python machine learning backend receives learner activity data and must be reachable from the Moodle server. Give it its own network segment, restrict inbound access to the Moodle application servers, and keep its service credentials out of course content and general configuration exports. Confirm with your platform team how the backend authenticates to Moodle and where its logs are written.

Model drift and retraining schedule

A model trained on last year's cohorts can lose accuracy when assessment design, enrolment mix or course content changes. Set a documented retraining schedule, record the evaluation results of each model version, and compare the flags against outcomes before the next term. Ask the team who signs off a retrain and how a model is rolled back if its results worsen.

Bias and false positives

A flag that is wrong for a learner, or wrong more often for some groups, can lead to unfair intervention or missed support. Review the indicators the model uses for proxies of disability, language background or socioeconomic status, and measure false positive and false negative rates by group. Decide in advance how a teacher can dispute or override a flag and whether learners are told that a prediction exists.

Logging who viewed predictions

Predictions about individuals are personal data, and staff access to them should be traceable. Confirm which log entries Moodle writes when a user opens the insights report or a model's output, and send those entries to a store that your security team can search. Agree how long these logs are kept and who may review them.

Backup of models and training data

Trained models, their training datasets and the evaluation results must be recoverable, but each copy is another store of learner data. Include the model files and the database tables behind the analytics models in the backup plan, encrypt the backups, and set a retention period that matches your data protection policy. Test a restore into a non-production site before you rely on it.

Questions buyers ask about Moodle analytics and at-risk predictions

What drives the cost of a Moodle analytics and at-risk prediction project?

The cost is driven by how many data sources feed the models, how many course types need their own models, and how much of the data review must be done before any prediction reaches a teacher. Work usually splits into four parts: scoping and data mapping, configuring the analytics models and the insights report, setting up and operating the Python machine learning backend, and the privacy and governance review. Ask any quote to show each part separately, which items are one-time and which recur (model retraining, monitoring, and support after upgrades), and which assumptions depend on your data quality. DeployOpen does not publish a price list, and a quote follows from the written scope.

How long does a pilot of Moodle predictions take?

A pilot length depends mainly on how quickly your institution can provide course samples, approve data use, and agree on what a teacher should do with a flagged student. Technical setup of the machine learning backend is usually the smaller part. Before the pilot starts, ask for a written timeline that names the dependencies: data owner sign-off, access to historical course data, the number of courses in the pilot, and the review cycle for results. Treat any duration without a stated basis as an assumption to test, not a commitment.

What must our institution provide before a predictions project starts?

The project needs three things from your side: named data owners who can approve each data field used by the models, representative course samples that cover the course types where predictions will be used, and governance sign-off from the people accountable for student data. Data owners confirm what can be used and for what purpose. Course samples let the team check whether the models behave sensibly across different designs. Governance sign-off covers the purpose statement, retention, who sees predictions, and how students are informed. Without these, the technical work cannot be completed safely.

Can our own staff run Moodle analytics without a partner?

Your staff can run the analytics models and the insights report after setup, provided someone owns the configuration, the Python backend, and the monitoring of model results. The harder part is ongoing governance: deciding which predictions reach teachers, reviewing bias and accuracy, and updating the process when courses change. Ask whether your team has skills in Moodle administration, the Python service, and data protection review. DeployOpen can deliver a fixed-scope build with documentation and handover, or support the system under a retainer.

How does an at-risk prediction project differ from a standard Moodle report?

A standard report shows what has already happened, such as logins, completion or grades, and a person decides what it means. An analytics model estimates a future outcome from patterns across many students and courses, so it needs training data, a defined target, validation, and a review process. That adds data preparation, model configuration, privacy assessment, and ongoing checks that a report does not require. If you only need operational or compliance reporting, the report builder may be the better fit, and the analytics project should start only when a prediction is needed.

What happens to predictions when courses change?

Predictions depend on the activities, grading patterns, and course structure used during training, so a change in course design can make a model less reliable. Changing a quiz, removing an activity type, or moving a course to a new template can shift the data the model sees. Your process should define when models are reviewed, which course changes trigger a review, and who can disable a model for a course. Ask any partner how they will detect drift in results and how they will record which model version produced each prediction.

Does the Python machine learning backend affect our upgrade plan?

Yes. Moodle 5.0 removed the PHP machine learning backend, so the Python backend in core is the supported path for analytics models. Your Moodle upgrade plan must include the Python service, its runtime, and its dependencies, not only the Moodle code. Confirm the supported Python version and hosting model against the Moodle release notes for your target version before you commit to a build. Plan testing of predictions after each Moodle upgrade, because model behavior can change with the platform and the data.

What does a privacy review of Moodle predictions need to cover?

A privacy review should cover the lawful basis or policy basis for processing, the list of data fields used, whether any field is a proxy for protected characteristics, retention periods, who can see predictions, how students are informed, and how decisions based on predictions can be challenged. It should also cover where the Python backend runs and who can access its logs. The review produces documented decisions and evidence, which your data protection officer and governance board approve. DeployOpen prepares the technical evidence for this review, while approval rests with your institution.

How DeployOpen scopes and delivers analytics rollouts

DeployOpen starts every analytics rollout by agreeing the scope in writing before any work begins. For a Moodle learning analytics project, that document should name which analytic models are enabled, which courses and activity types feed them, which teachers and roles see predictions and insights, and what the Python machine learning backend will run on. Because most engagements are fixed-scope, the quote follows from that written scope, so each model, course group and report you add or remove changes the price and timeline in a visible way. Ask any provider to show you the scope document and the list of decisions it still depends on before you sign.

Delivery covers the parts that Moodle does not configure for you. DeployOpen hosts and hardens the machine learning backend in your own infrastructure, sets up the service account and network path between Moodle and that backend, and documents how training data leaves the Moodle database and where it is stored. Alongside the build, DeployOpen prepares the privacy review evidence your data protection and compliance teams need: a data inventory for the analytics inputs, the role design that limits who can view individual risk indicators, and records of the controls that were tested. These outputs are prepared for your reviewers, and the decision to approve predictions for teachers remains with your organization and its independent assessors.

A pilot comes before any wider rollout. In the pilot, a small set of courses runs the models against historical data, and the team compares predictions with what teachers actually observed, then checks the insights report for accuracy, bias across student groups and access leaks. Once the pilot results are signed off, DeployOpen can offer retainers for Moodle upgrades, backend updates and periodic checks of model behavior and permissions, since each new Moodle release changes the surrounding code. Confirm the retainer scope, response expectations and what happens to the backend if a Moodle version change breaks a model before you commit to ongoing support.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.