Moodle LMS — Complete Course

Master Moodle LMS · Beginner to Advanced

The complete Moodle LMS course from zero to expert — 18 core sections covering installation, administration, course design, SCORM/xAPI, grading, plugins, custom API development, security, GDPR compliance, automation scripts, and real project portfolios.

30
Core Sections
120+
Topics
50+
Practical Labs
100%
Hands-On

Course Overview — Moodle LMS Mastery

This end-to-end curriculum covers Moodle from zero to production. You will install Moodle, manage users and courses, design interactive learning, configure exams, integrate APIs, secure deployments, and automate with scripts. Each section contains real-world scenarios, worked examples, practical activities, and production-ready code.

SectionsFocus AreaSkill Level
1 – 2Foundations — What is LMS, History, Installation🟢 Beginner
3 – 5Administration, Course Design, E-Learning Standards🟡 Intermediate
6 – 9Exams, Grading, User Roles, Communication🟡 Intermediate
10 – 12Reports, Plugins, Custom API Development🔴 Advanced
13 – 16GDPR, Performance, Security, Moodle Networks🔴 Advanced
17 – 18Automation, Real Projects & Portfolio🔴 Expert
19 – 22All Activity Types, Assignment, Workshop, Lesson, Database, Wiki🟡 Intermediate
23 – 24Badges, Open Badges 2.0, Competency Frameworks, Learning Plans🔴 Advanced
25 – 26All Enrolment Methods, Calendar, Notifications, Messaging🟡 Intermediate
27 – 28Moodle Mobile App, Theme Customization, Boost Configuration🟡 Intermediate
29 – 30Plagiarism Detection, Blocks, Complete CLI Reference🔴 Advanced

Key Operational Workflows

Step-by-step visual pipelines for the most common Moodle administrative operations.

Pipeline A · Course Upload & Publishing
Step 1 Enable Edit Mode

Toggle "Edit Mode" switch in the top-right of your course page.

Step 2 Add Activity

Click "+ Add Activity". Choose File, SCORM, H5P, or Quiz.

Step 3 Configure & Save

Upload binary, set completion tracking, save & return.

Pipeline B · Backup & Disaster Recovery
Phase 1 Trigger CLI Backup

php admin/cli/backup.php --courseid=5

Phase 2 Push to S3 / Cloud

Send .mbz snapshot to off-site storage bucket.

Phase 3 CLI Restore

php admin/cli/restore_backup.php --file=backup.mbz

Pipeline C · Live Server Migration
Step 1 Database Dump

mysqldump -u root -p moodle > moodle.sql

Step 2 rsync Files

rsync -avz /var/moodledata/ newserver:/var/moodledata/

Step 3 Replace URLs

Update config.php + run DB replace CLI tool.

Pipeline D · Course Cloning
Step 1 Manage Courses

Site Admin → Courses → Manage Courses & Categories.

Step 2 Copy Course

Click copy icon next to the template course.

Step 3 Configure Copy

Set shortname, start date, exclude enrolments & logs.

Section 1

Introduction to LMS & Moodle

Understand the foundations of Learning Management Systems and why Moodle is the world's most popular open-source LMS.

Topic 1.1 — What is LMS?

Core Concepts

  • LMS = Learning Management System — software to deliver, track and manage education
  • Key functions: content hosting, assessment, progress tracking, communication
  • Used in: K-12 schools, universities, corporate training, government institutions
  • Benefits: scalability, 24/7 access, analytics, certification management
📌 Scenario 1 — School

Teacher uploads homework, attendance sheets and lecture videos online. Students complete quizzes, download resources and submit assignments from home.

📌 Scenario 2 — Corporate HR

HR department assigns mandatory cybersecurity awareness training to all 500 employees. Completion certificates are auto-emailed after 80% pass mark.

📌 Scenario 3 — Coaching Institute

Students watch recorded classes, download PDF notes and take timed mock tests. Results are sent automatically to parents via email integration.

Practical Activity
  • Compare offline classroom training vs online LMS training — draw a Venn diagram
  • Create an LMS workflow diagram: Student → Course → Activity → Grade → Certificate
Topic 1.2 — Introduction to Moodle

History, Architecture & Features

  • Founded in 2002 by Martin Dougiamas in Perth, Australia
  • Open-source (GPL v3), 250M+ users across 240+ countries
  • Architecture: PHP + MySQL/MariaDB/PostgreSQL, plugin-based modular system
  • Core modules: Courses, Activities, Users, Grades, Reports, Plugins
PlatformIndustryLicenseKey Advantage vs Moodle
MoodleEducation, CorporateFree, Open-SourceInfinite flexibility, plugin ecosystem
CanvasK-12, Higher EdPaid / FreemiumSleeker default UI, native provisioning
BlackboardHigher EducationCommercial PremiumEnterprise hosting, assessment engines
TalentLMSCorporate TrainingSaaS SubscriptionFast setup, built-in gamification
TeachableSolopreneursSaaS SubscriptionBuilt-in payment processing, simple UX
Practical Activity
  • Explore demo.moodle.net — identify all dashboard components
  • List all default plugins visible in a fresh Moodle installation
Section 2

Moodle Installation & Server Setup

Full server requirements and installation methods — from local XAMPP to production VPS and Bitnami stacks.

Topic 2.1 — Server Requirements
ComponentMinimumRecommended (Production)
PHP8.18.2+ with OPcache enabled
DatabaseMySQL 8.0 / MariaDB 10.6MariaDB 10.10+ with InnoDB
Web ServerApache 2.4Nginx with FastCGI-PHP
RAM512 MB4 GB+
Disk5 GB50 GB+ SSD with moodledata mount
Topic 2.2 — XAMPP / MAMP Local Install
bash — Local Installation (Mac / Linux)
# 1. Download Moodle from moodle.org/downloads
# 2. Extract to your web root:
cp -r moodle /Applications/MAMP/htdocs/

# 3. Create moodledata directory OUTSIDE web root:
mkdir /Applications/MAMP/moodledata
chmod 777 /Applications/MAMP/moodledata

# 4. Create MySQL database:
mysql -u root -p
CREATE DATABASE moodle DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'moodleuser'@'localhost' IDENTIFIED BY 'SecurePass123!';
GRANT ALL PRIVILEGES ON moodle.* TO 'moodleuser'@'localhost';
FLUSH PRIVILEGES;

# 5. Visit http://localhost/moodle in browser to run web installer
Topic 2.3 — CLI Installation (Production)
bash — CLI Install (Ubuntu VPS)
sudo php admin/cli/install.php \
  --wwwroot=https://your-moodle.com \
  --dataroot=/var/moodledata \
  --dbtype=mariadb \
  --dbhost=localhost \
  --dbname=moodle \
  --dbuser=moodleuser \
  --dbpass=SecurePass123! \
  --fullname="My Moodle LMS" \
  --shortname="MoodleLMS" \
  --adminuser=admin \
  --adminpass=Admin@1234! \
  --adminemail=admin@yourdomain.com \
  --non-interactive \
  --agree-license
⚠️ After Install
Run php admin/cli/upgrade.php every time you update Moodle core or install new plugins. Always set chmod 0777 on moodledata and chmod 0755 on the Moodle code directory.
Section 3

Moodle Administration

Master the Site Administration panel — manage categories, users, appearance, language packs, notifications and cron.

Topic 3.1 — config.php Key Settings
php — config.php Production Essentials
<?php  // config.php
unset($CFG);
global $CFG;
$CFG = new stdClass();

$CFG->dbtype    = 'mariadb';
$CFG->dblibrary = 'native';
$CFG->dbhost    = 'localhost';
$CFG->dbname    = 'moodle';
$CFG->dbuser    = 'moodleuser';
$CFG->dbpass    = 'SecurePass123!';
$CFG->prefix    = 'mdl_';

$CFG->wwwroot   = 'https://your-moodle.com';
$CFG->dataroot  = '/var/moodledata';
$CFG->admin     = 'admin';

// Performance
$CFG->cachetype = 'memcached';
$CFG->session_handler_class = '\core\session\database';

// Security
$CFG->cookiesecure = true;
$CFG->loginhttps   = true;
$CFG->passwordpolicy = true;

require_once(__DIR__ . '/lib/setup.php');
Topic 3.2 — Cron Configuration
bash — crontab Setup
# Open crontab for www-data
crontab -u www-data -e

# Run Moodle cron every 1 minute
* * * * * /usr/bin/php /var/www/html/moodle/admin/cli/cron.php >/dev/null 2>&1

# Or using systemd timer — create file:
# /etc/systemd/system/moodle-cron.service
# /etc/systemd/system/moodle-cron.timer
Why Cron Matters
Cron drives: automated course backups, email notifications, badge awards, activity completion marking, scheduled report generation, and plugin background tasks.
Topic 3.3 — Bulk User Upload via CSV
csv — users.csv format for bulk upload
username,firstname,lastname,email,password,course1,role1
john_doe,John,Doe,john@example.com,Temp@1234,CS101,student
jane_smith,Jane,Smith,jane@example.com,Temp@1234,CS101,teacher
admin_bob,Bob,Admin,bob@example.com,Temp@1234,CS101,editingteacher

Upload via: Site Admin → Users → Accounts → Upload Users. Supports auto-enrolment, custom profile fields and password policy enforcement.

Section 4

Course Management & Design

Create, design, and manage courses — categories, sections, activities, completion tracking, and conditional access.

Topic 4.1 — Course Formats
FormatLayoutBest For
TopicsNumbered topics sectionsSubject-organized content
WeeklyDates-based weekly sectionsFixed-schedule semester courses
SocialSingle discussion forumCommunity discussion boards
Single ActivityOne activity (quiz/SCORM)Standalone assessment portals
Grid (Plugin)Icon grid layoutVisual learner dashboards
Topic 4.2 — Completion Tracking & Conditions
  • Activity Completion: Mark done when viewed / passed / submitted
  • Course Completion: Requires all sections complete + minimum grade
  • Conditional Access: Lock activities behind prerequisites (grade > 70%, date, group membership)
  • Restrict by: Activity completion, grade range, user profile field, group, date, user role
✅ Best Practice
Enable completion tracking in Course Settings first, then configure per-activity. Use "Expected completion date" for deadline reminders via automated notifications.
Topic 4.3 — CLI Course Backup & Restore
bash — Backup & Restore via CLI
# Backup a specific course (courseid=5)
php admin/cli/backup.php \
  --courseid=5 \
  --destination=/var/backups/moodle/

# List available backup files
ls -lh /var/backups/moodle/

# Restore backup to category (categoryid=1)
php admin/cli/restore_backup.php \
  --file=/var/backups/moodle/backup-moodle2-course-5-CS101.mbz \
  --categoryid=1 \
  --userid=2
Section 5

E-Learning Content & Standards

SCORM, xAPI (Tin Can), H5P, IMS Content Packages — standards for interoperable, trackable learning content.

Topic 5.1 — Standards Comparison
StandardOfflineMobileDetailed TrackingComplexity
SCORM 1.2NoNoBasic pass/failLow — drag & drop
SCORM 2004NoNoDetailed sequencingMedium
xAPI (Tin Can)YesYesAny verb/objectRequires LRS setup
H5PNoYesBuilt-in reportsVery Low — browser editor
IMS CPNoNoBasic navigationLow
Topic 5.2 — H5P Interactive Content
  • Types: Interactive Video, Course Presentation, Drag & Drop, Fill in the Blanks, Quiz (Question Set)
  • Create directly in Moodle browser editor — no software required
  • Stores xAPI statements locally in Moodle DB
  • Reuse across multiple courses using the H5P Content Bank
✅ Lab Task
Create an H5P Interactive Video for a 5-minute recorded lesson. Add 3 quiz questions embedded at the 1-min, 3-min, and 5-min mark. Publish to a course.
Section 6

Advanced Examinations & Question Bank

Build quiz activities, question banks, GIFT format imports, timed exams, safe exam browser, and randomised question pools.

Topic 6.1 — Question Types
TypeAuto-GradeUse Case
Multiple Choice✅ YesTheory knowledge checks
True / False✅ YesQuick concept verification
Short Answer⚠️ PartialKeyword-based text answers
Numerical✅ YesMath/formula answers
Essay❌ ManualLong-form written responses
Drag & Drop✅ YesOrdering, matching diagrams
Calculated✅ YesVariables-based formulas
Topic 6.2 — GIFT Format Bulk Import

GIFT (General Import Format Technology) lets you write questions in a plain text file and import hundreds at once.

GIFT Format — questions.txt
// Multiple Choice — correct answer marked with =
What is Moodle? {
   ~An operating system
   ~A database engine
   =An open-source Learning Management System
   ~A cloud hosting provider
}

// True/False
Moodle supports REST web service protocols. {TRUE}

// Short Answer (case-insensitive)
The default Moodle database prefix is: {=mdl_}

// Numerical with tolerance
What is 15% of 200? {#30:2}

// Matching
Match the protocol to its purpose: {
   =REST -> Stateless HTTP API calls
   =SOAP -> XML-based structured messaging
   =WebSocket -> Real-time bidirectional streams
}

// Essay (no auto-grade)
Describe the Moodle plugin installation process. {}
Import Steps
Question Bank → Import → Select format "GIFT" → Upload .txt file → Choose destination category → Import.
Topic 6.3 — Safe Exam Browser (SEB)
  • Lock-down browser that prevents copy-paste, tab switching, and screen sharing
  • Configure: Quiz Settings → Extra Restrictions → Require SEB
  • Upload SEB config file (.seb) to the quiz
  • Students must install SEB client before attempting the exam
Section 7

Grading & Gradebook Mastery

Configure grade categories, weighted averages, letter grades, outcomes, rubrics, marking guides and grade exports.

Topic 7.1 — Gradebook Structure
  • Grade Items: Each quiz, assignment, or manual grade entry
  • Grade Categories: Group items with their own aggregation (mean, max, sum)
  • Course Total: Final aggregated score for the whole course
  • Aggregation Strategies: Mean of Grades, Weighted Mean, Natural (raw scores), Highest Grade, Mode
Topic 7.2 — Rubrics & Marking Guides
MethodStructureBest For
RubricCriteria × Level grid with descriptorsEssays, presentations, projects
Marking GuideCriteria with max points + commentsOpen-ended submissions
Simple DirectSingle score entryQuick manual grading
Topic 7.3 — Grade Export
SQL — Export Grade Data Directly
SELECT
    u.username,
    u.firstname,
    u.lastname,
    u.email,
    c.shortname AS course,
    gi.itemname AS grade_item,
    gg.finalgrade,
    gg.timemodified
FROM mdl_grade_grades gg
JOIN mdl_grade_items gi ON gi.id = gg.itemid
JOIN mdl_user u ON u.id = gg.userid
JOIN mdl_course c ON c.id = gi.courseid
WHERE c.shortname = 'CS101'
  AND gi.itemtype = 'mod'
ORDER BY u.lastname, gi.sortorder;
Section 8

User Management & Role Architecture

Built-in roles, custom role creation, capabilities, context levels, cohort sync, and authentication methods.

Topic 8.1 — Default Roles
RoleDefault ContextKey Capabilities
AdministratorSiteEverything — full site control
Course CreatorCourse CategoryCreate, delete, restore courses
Editing TeacherCourseAdd/edit content, grade, manage enrolments
TeacherCourseGrade and communicate, cannot edit content
StudentCourseView and complete activities
GuestCourseView-only (no submissions)
Topic 8.2 — Custom Role Creation
  1. Navigate: Site Admin → Users → Permissions → Define Roles
  2. Click "Add a new role" — choose archetype (e.g., based on Student)
  3. Set role name, description, and short name
  4. Search and configure capabilities (allow/prevent/prohibit)
  5. Assign context levels (System, Category, Course, Module, Block, User)
  6. Save — then assign via course enrolment or user profile
Topic 8.3 — Authentication Methods
MethodUse CaseSetup Complexity
Manual AccountsSmall teams, testingNone
Email-based self-registrationOpen enrollment portalsLow
LDAP / Active DirectoryCorporate internal SSOMedium-High
OAuth 2.0 (Google, MS)Modern social loginMedium
SAML 2.0Enterprise federated identityHigh
CAS (Central Auth Service)University SSO portalsMedium
Section 9

Communication & Collaboration

Forums, messaging, Announcements, Groups, Groupings, BigBlueButton virtual classrooms, and email notifications.

Topic 9.1 — Forum Types
Forum TypeStructureBest For
Standard ForumAnyone can start topicsOpen discussion
News ForumTeacher announcements onlyCourse-wide notifications
Q&A ForumMust answer before seeing othersIndependent thinking exercises
Single Simple DiscussionOne shared threadWeekly discussion topic
Each Person Posts OneOne topic per userPeer review introductions
Topic 9.2 — Groups vs Groupings
  • Groups: Sub-divisions of students within one course (e.g., Group A, B, C)
  • Groupings: A collection of groups used to restrict activity access
  • Use Separate Groups Mode so students only see their own group's forum posts
  • Use Visible Groups Mode so all groups can see each other but submit separately
Section 10

Reports & Learning Analytics

Built-in reports, live logs, course participation, Moodle Analytics API, custom SQL reports and scheduled exports.

Topic 10.1 — Built-In Reports
  • Live Logs: Site Admin → Reports → Live Logs (real-time user activity stream)
  • Course Participation: Teacher view of which students opened each activity
  • Activity Completion Report: Grid view of all students × all activities
  • Statistics: Site-wide weekly/monthly login and activity graphs
  • Security Report: Failed login attempts, password resets, suspicious activity
Topic 10.2 — Custom SQL Reports (Configurable Reports Plugin)
SQL — Last Login per User per Course
SELECT
    u.username,
    u.firstname,
    u.lastname,
    c.fullname AS course,
    FROM_UNIXTIME(MAX(l.timecreated)) AS last_access
FROM mdl_logstore_standard_log l
JOIN mdl_user u    ON u.id = l.userid
JOIN mdl_course c  ON c.id = l.courseid
WHERE l.action = 'viewed'
  AND l.component = 'core'
  AND c.id != 1
GROUP BY u.id, c.id
ORDER BY c.fullname, u.lastname;
Topic 10.3 — Moodle Analytics Models
  • Built-in ML models: "Students at risk of dropping out", "No recent accesses"
  • Access: Site Admin → Analytics → Analytics Models
  • Train models using historical data — runs automatically via cron
  • Teachers see predictions on Student Dashboard and Course Insights panel
Section 11

Plugins & Extensions

Explore the Moodle plugin directory — theme plugins, activity modules, authentication, enrollment, admin tools and blocks.

Topic 11.1 — Plugin Installation Methods
  1. Download .zip from moodle.org/plugins
  2. Admin → Site Admin → Plugins → Install Plugins → Upload ZIP
  3. Or: extract to correct /mod/, /blocks/, /theme/ directory via FTP/SCP
  4. Run php admin/cli/upgrade.php to trigger DB schema migration
  5. Configure the plugin via its settings page
Topic 11.2 — Essential Plugin Recommendations
PluginTypeFunction
AttendanceActivity ModuleRecord student attendance per session
Configurable ReportsBlockCustom SQL report builder
Level Up!BlockGamification — XP points and levels
BigBlueButtonActivity ModuleIntegrated virtual classroom
Boost UnionThemeEnterprise-grade Boost child theme
ChecklistActivity ModuleStudent self-checklist for tasks
Group ChoiceActivity ModuleSelf-enroll into groups with capacity limits
Section 12

Custom API Development

Build, register, and deploy custom Moodle web service functions inside local plugins — complete workflow from db/services.php to external class.

Topic 12.1 — Plugin Folder Structure
bash — Local Plugin Directory Layout
/moodle/local/courseprogress/
├── version.php                    # Plugin version metadata
├── lib.php                        # Plugin library hooks
├── db/
│   ├── services.php               # Register web service functions
│   └── access.php                 # Define capabilities
├── classes/
│   └── external/
│       └── progress.php           # External function class
└── lang/
    └── en/
        └── local_courseprogress.php  # Language strings
Topic 12.2 — version.php
php — version.php
<?php
defined('MOODLE_INTERNAL') || die();

$plugin->component = 'local_courseprogress';
$plugin->version   = 2024010100;   // YYYYMMDDXX
$plugin->requires  = 2022041900;   // Minimum Moodle version
$plugin->maturity  = MATURITY_STABLE;
$plugin->release   = '1.0.0';
Topic 12.3 — db/services.php
php — db/services.php (Complete)
<?php
defined('MOODLE_INTERNAL') || die();

$functions = [
    'local_courseprogress_get_user_course_progress' => [
        'classname'   => 'local_courseprogress\external\progress',
        'methodname'  => 'get_user_course_progress',
        'description' => 'Get user course progress details',
        'type'        => 'read',
        'ajax'        => true,
        'capabilities'=> 'moodle/user:viewdetails',
        'services'    => [MOODLE_OFFICIAL_MOBILE_SERVICE],
    ],
    'local_courseprogress_get_all_courses' => [
        'classname'   => 'local_courseprogress\external\progress',
        'methodname'  => 'get_user_all_courses_progress',
        'description' => 'Get all enrolled course progress for a user',
        'type'        => 'read',
        'ajax'        => true,
        'capabilities'=> 'moodle/user:viewdetails',
    ],
    'local_courseprogress_get_course_details' => [
        'classname'   => 'local_courseprogress\external\progress',
        'methodname'  => 'get_course_progress_details',
        'description' => 'Get detailed progress breakdown per course activity',
        'type'        => 'read',
        'ajax'        => true,
        'capabilities'=> 'moodle/course:view',
    ],
];

$services = [
    'Course Progress API Service' => [
        'functions'       => [
            'local_courseprogress_get_user_course_progress',
            'local_courseprogress_get_all_courses',
            'local_courseprogress_get_course_details',
        ],
        'restrictedusers' => 0,
        'enabled'         => 1,
        'shortname'       => 'courseprogress_api',
    ],
];
Topic 12.4 — classes/external/progress.php
php — External Function Class
<?php
namespace local_courseprogress\external;

defined('MOODLE_INTERNAL') || die();
require_once($CFG->libdir . '/externallib.php');

class progress extends \external_api {

    // ─── get_user_course_progress ────────────────────────────
    public static function get_user_course_progress_parameters() {
        return new \external_function_parameters([
            'userid'   => new \external_value(PARAM_INT, 'User ID'),
            'courseid' => new \external_value(PARAM_INT, 'Course ID'),
        ]);
    }

    public static function get_user_course_progress($userid, $courseid) {
        global $DB;
        $params = self::validate_parameters(
            self::get_user_course_progress_parameters(),
            ['userid' => $userid, 'courseid' => $courseid]
        );

        $completion = new \completion_info($DB->get_record('course', ['id' => $params['courseid']], '*', MUST_EXIST));
        $activities = $completion->get_activities();

        $completed = 0;
        foreach ($activities as $activity) {
            $data = $completion->get_data($activity, false, $params['userid']);
            if ($data->completionstate == COMPLETION_COMPLETE || $data->completionstate == COMPLETION_COMPLETE_PASS) {
                $completed++;
            }
        }

        $total = count($activities);
        $percent = $total > 0 ? round(($completed / $total) * 100, 2) : 0;

        return [
            'userid'    => $params['userid'],
            'courseid'  => $params['courseid'],
            'completed' => $completed,
            'total'     => $total,
            'percent'   => $percent,
        ];
    }

    public static function get_user_course_progress_returns() {
        return new \external_single_structure([
            'userid'    => new \external_value(PARAM_INT,   'User ID'),
            'courseid'  => new \external_value(PARAM_INT,   'Course ID'),
            'completed' => new \external_value(PARAM_INT,   'Completed activities'),
            'total'     => new \external_value(PARAM_INT,   'Total activities'),
            'percent'   => new \external_value(PARAM_FLOAT, 'Completion percentage'),
        ]);
    }
}
Topic 12.5 — API Deployment Steps
  1. Place plugin folder in /moodle/local/courseprogress/
  2. Run upgrade: php admin/cli/upgrade.php --non-interactive
  3. Enable web services: Site Admin → Advanced Features → Enable web services → ✅
  4. Enable REST protocol: Site Admin → Plugins → Web Services → Manage Protocols → REST
  5. Create/assign token: Site Admin → Web Services → Manage Tokens → Add
  6. Test API endpoint:
bash — cURL Test
curl -X POST "https://your-moodle.com/webservice/rest/server.php" \
  -d "wstoken=YOUR_TOKEN_HERE" \
  -d "wsfunction=local_courseprogress_get_user_course_progress" \
  -d "moodlewsrestformat=json" \
  -d "userid=5" \
  -d "courseid=3"

# Expected Response:
# {
#   "userid": 5,
#   "courseid": 3,
#   "completed": 7,
#   "total": 10,
#   "percent": 70.0
# }
Section 13

Privacy & GDPR Compliance

Configure cookie policy banners, data retention, user data export, account deletion, and Moodle's Privacy API.

Topic 13.1 — GDPR Configuration Checklist
  • Enable Privacy Policy: Site Admin → Users → Privacy and Policies → Policy Settings
  • Set Data Retention: Site Admin → Privacy → Data Retention Summary
  • Configure Cookie Consent Banner: Site Admin → Appearance → Cookies
  • User Data Export: Site Admin → Privacy → Privacy and Policies → Data Requests
  • Enable "Right to be forgotten": Site Admin → Privacy → Enable deletion of requests
⚠️ GDPR Requirement
Under GDPR, users have the right to request a complete export of their personal data AND request permanent deletion. Both must be processed within 30 days. Moodle has built-in tools for both.
Topic 13.2 — Data Purge SQL (Emergency GDPR)
SQL — Find all personal data for a user
-- Find all log entries for a specific user
SELECT l.timecreated, l.action, l.component, l.target, l.contextlevel
FROM mdl_logstore_standard_log l
WHERE l.userid = :userid
ORDER BY l.timecreated DESC
LIMIT 100;

-- Check profile data
SELECT * FROM mdl_user WHERE id = :userid;

-- Check messages sent
SELECT * FROM mdl_messages WHERE useridfrom = :userid;

-- Proper deletion should be done via Privacy API, not raw SQL
Section 14

Performance Optimization & Scalability

OPcache, Memcached, Redis session store, MUC (Moodle Universal Cache), CDN integration, load balancing, and database tuning.

Topic 14.1 — Caching Architecture (MUC)
Cache StoreTypeRecommended For
FileDisk-basedDefault — single server setups
MemcachedIn-memory distributedMulti-server clusters
RedisIn-memory + persistenceSession storage, high-traffic
APCuPHP shared memoryApplication-level caching per server
Topic 14.2 — Performance config.php Settings
php — Performance Tuning (config.php)
// Redis for sessions
$CFG->session_handler_class = '\core\session\redis';
$CFG->session_redis_host     = '127.0.0.1';
$CFG->session_redis_port     = 6379;

// Enable Memcached caching
$CFG->cachetype = 'memcached';

// Disable theme designer mode in production
$CFG->themedesignermode = false;

// Enable JavaScript combination & compression
$CFG->yuicomboloading = true;

// Boost performance on load
$CFG->debug = 0; // Disable debug in production
$CFG->debugdisplay = 0;
Topic 14.3 — Caching & Request Routing Pipeline

A high-performance Moodle cluster relies on multi-tier caching. If Level 1 or 2 hits, database access is skipped entirely.

Pipeline E · Moodle Universal Cache (MUC) Data Access Flow
Level 1 APCu Cache Store

PHP local shared memory. Sub-millisecond reads, local to worker node.

Level 2 Redis Store

Shared distributed memory cache. Shared across all autoscaling web servers.

Level 3 MariaDB / Disk

Relational DB storage and physical disk files. Loaded only on cache miss.

Section 15

Security Hardening in Depth

SSL/TLS enforcement, password policies, failed login lockout, brute-force protection, file upload restrictions, and security report auditing.

Topic 15.1 — Production Security Checklist
  • Force HTTPS: $CFG->loginhttps = true; + redirect in Apache/Nginx
  • Set strong password policy: min 12 chars, mixed case, numbers, symbols
  • Configure account lockout: Site Admin → Security → Site Policies → Account lockout threshold
  • Restrict file upload types: Site Admin → Security → Site Policies → Allowed file types
  • Disable guest access in production environments
  • Run Security Report: Site Admin → Reports → Security Overview
  • Hide Moodle version from error messages: $CFG->showcampaigncontent = false;
Topic 15.2 — Nginx Hardened Config
nginx — Security Headers
server {
    listen 443 ssl http2;
    server_name your-moodle.com;

    # Force HTTPS
    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
    add_header X-Frame-Options "SAMEORIGIN" always;
    add_header X-Content-Type-Options "nosniff" always;
    add_header Referrer-Policy "strict-origin-when-cross-origin" always;
    add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval';" always;

    # Block direct access to sensitive dirs
    location ~ ^/moodle/(config\.php|lib|classes|db|admin/cli)/ {
        deny all;
        return 404;
    }
}
Section 16

Moodle Networks (MNet) & SSO

Connect multiple Moodle instances — share enrollments, enable cross-site SSO, and configure Moodle Network Host trust relationships.

Topic 16.1 — MNet Configuration Steps
  1. Enable MNet: Site Admin → Advanced Features → Enable Moodle Network → ✅
  2. Share your public key with remote host admin
  3. Add remote host: Site Admin → Network → Hosts → Add Host → paste their URL + public key
  4. Configure trusted services on both sides (e.g., authentication, course enrolment)
  5. Test SSO: login to Host A and click "Jump to" Host B without re-authentication
Topic 16.2 — MNet Use Cases
ScenarioBenefit
University + Library portalStudents log in once to access both systems
Parent company + subsidiariesShare compliance training across all entities
School district networkCentral reporting with per-school Moodle instances
Section 17

Automation & Scripting

Python, cURL, PHP, and Bash scripts to automate user provisioning, grade exports, course enrollment, and bulk operations via the Moodle REST API.

Topic 17.1 — Python — Bulk User Creation
python — bulk_create_users.py
import requests
import csv

TOKEN  = "your_moodle_token_here"
DOMAIN = "https://your-moodle.com"
URL    = f"{DOMAIN}/webservice/rest/server.php"

def create_user(i, username, firstname, lastname, email, password):
    payload = {
        "wstoken": TOKEN,
        "wsfunction": "core_user_create_users",
        "moodlewsrestformat": "json",
        f"users[{i}][username]":  username,
        f"users[{i}][password]":  password,
        f"users[{i}][firstname]": firstname,
        f"users[{i}][lastname]":  lastname,
        f"users[{i}][email]":     email,
    }
    res = requests.post(URL, data=payload)
    return res.json()

# Read from CSV and create
with open("users.csv") as f:
    reader = csv.DictReader(f)
    for i, row in enumerate(reader):
        result = create_user(i, row['username'], row['firstname'],
                             row['lastname'], row['email'], row['password'])
        print(f"Created: {row['username']} → {result}")
Topic 17.2 — Python — Bulk Enrolment
python — bulk_enrol_course.py
import requests

TOKEN    = "your_moodle_token_here"
DOMAIN   = "https://your-moodle.com"
URL      = f"{DOMAIN}/webservice/rest/server.php"
ROLE_ID  = 5      # 5 = Student
COURSE_ID = 3     # Target course

def enrol_user(user_id):
    payload = {
        "wstoken": TOKEN,
        "wsfunction": "enrol_manual_enrol_users",
        "moodlewsrestformat": "json",
        "enrolments[0][roleid]":   ROLE_ID,
        "enrolments[0][userid]":   user_id,
        "enrolments[0][courseid]": COURSE_ID,
    }
    res = requests.post(URL, data=payload)
    return res.json()

# Enrol a list of user IDs
user_ids = [12, 13, 14, 15, 16]
for uid in user_ids:
    result = enrol_user(uid)
    print(f"Enrolled user {uid}: {result}")
Topic 17.3 — Bash — Automated Nightly Backup
bash — nightly_backup.sh
#!/bin/bash
# Nightly Moodle Backup Script
set -e

DATE=$(date +%Y%m%d_%H%M)
BACKUP_DIR="/var/backups/moodle"
MOODLE_DIR="/var/www/html/moodle"
DB_NAME="moodle"
DB_USER="moodleuser"
DB_PASS="SecurePass123!"

mkdir -p "$BACKUP_DIR/$DATE"

# 1. Database dump
echo "[$(date)] Dumping database..."
mysqldump -u"$DB_USER" -p"$DB_PASS" "$DB_NAME" | gzip > "$BACKUP_DIR/$DATE/moodle_db.sql.gz"

# 2. Course file backups
echo "[$(date)] Backing up courses..."
php "$MOODLE_DIR/admin/cli/backup.php" \
  --courseid=all \
  --destination="$BACKUP_DIR/$DATE/courses/"

# 3. Compress moodledata
echo "[$(date)] Compressing moodledata..."
tar -czf "$BACKUP_DIR/$DATE/moodledata.tar.gz" /var/moodledata/

# 4. Push to S3
aws s3 sync "$BACKUP_DIR/$DATE" "s3://your-bucket/moodle-backups/$DATE/"

# 5. Clean up local backups older than 7 days
find "$BACKUP_DIR" -maxdepth 1 -type d -mtime +7 -exec rm -rf {} \;

echo "[$(date)] Backup complete: $BACKUP_DIR/$DATE"
Add to crontab
0 2 * * * /bin/bash /opt/scripts/nightly_backup.sh >> /var/log/moodle_backup.log 2>&1
Topic 17.4 — PHP — Grade Export Script
php — export_grades.php (CLI)
<?php
// Run: php export_grades.php --courseid=3
define('CLI_SCRIPT', true);
require('/var/www/html/moodle/config.php');
require_once($CFG->libdir . '/gradelib.php');
require_once($CFG->libdir . '/grade/grade_item.php');

$courseid = (int)($argv[1] ?? 3);
$course   = $DB->get_record('course', ['id' => $courseid], '*', MUST_EXIST);

$items = grade_item::fetch_all(['courseid' => $courseid]);
$users = get_enrolled_users(context_course::instance($courseid));

echo "username,firstname,lastname,email,grade\n";
foreach ($users as $user) {
    $gi = grade_item::fetch(['courseid' => $courseid, 'itemtype' => 'course']);
    $grade = new grade_grade(['itemid' => $gi->id, 'userid' => $user->id]);
    echo implode(',', [
        $user->username, $user->firstname, $user->lastname,
        $user->email, round($grade->finalgrade ?? 0, 2)
    ]) . "\n";
}
Section 18

Real Projects & Portfolio

End-to-end guided projects to demonstrate mastery of Moodle LMS to employers and clients.

Project 1

University Exam Portal

Build a complete exam portal with 3 courses, 100 GIFT questions, randomised quizzes, SEB lockdown, automated grade export, and custom certificates.

Quiz GIFT SEB Certificates
Project 2

Corporate LMS Deployment

Deploy Moodle on Ubuntu VPS with Nginx + Redis + Memcached. Integrate LDAP for Active Directory SSO. Create Department Auditor custom role. Configure automated nightly backups to S3.

VPS LDAP Redis S3 Backup
Project 3

Custom API + Mobile App Integration

Build a local_courseprogress Moodle plugin with 5 custom web service functions. Integrate with a React Native mobile app. Display live progress bars, completion status, and badges.

Plugin Dev REST API React Native
Project 4

Fully Automated Moodle DevOps Pipeline

Write an Ansible playbook that: installs Moodle from scratch on a fresh Ubuntu server, configures Nginx + MariaDB, creates admin user, installs plugins, enables web services, and runs smoke-tests.

Ansible CI/CD DevOps
Section 19

All Moodle Activity Types — Complete Reference

Every activity and resource type available in Moodle core — what each does, when to use it, and key configuration options.

Resources (Non-graded Content)
ResourcePurposeKey Option
FileUpload single file (PDF, DOCX, MP4)Force download vs display in browser
FolderGroup multiple files in one placeDisplay inline or as expandable folder
URLLink to any external websiteOpen in new window / same window
PageRich text HTML page within MoodleEmbeds images, video, formatted text
BookMulti-chapter content with table of contentsChapter numbering, print entire book
LabelInline text/image inside course sectionNo click needed — always visible
IMS Content PackageImport SCORM-like zipped contentStandardized eLearning package
Graded Activities
ActivityTypeAuto-GradeKey Feature
QuizAssessment✅ YesRandomised questions, timed, SEB lockdown
AssignmentSubmission❌ ManualFile upload, text, PDF annotation, team submission
WorkshopPeer Review⚠️ Partial5-phase peer assessment with calibration
LessonBranching✅ YesConditional content pages based on answers
SCORMPackage✅ YesExternal eLearning packages (SCORM 1.2/2004)
H5PInteractive✅ Yes50+ content types, no software needed
DatabaseData collection⚠️ OptionalCustom fields, templates, peer approval
GlossaryDictionary⚠️ OptionalAuto-link terms across course, peer entries
WikiCollaborative⚠️ OptionalIndividual or group wiki pages
ForumDiscussion⚠️ Optional5 types, peer ratings, digest emails
ChatReal-time❌ NoSynchronous text chat with session logs
ChoicePoll/Vote❌ NoSingle question, group sign-up
FeedbackAnonymous survey❌ NoCourse evaluation, non-graded feedback
SurveyResearch survey❌ NoCOLLES, ATTLS, Critical Incidents instruments
BigBlueButtonVirtual class❌ NoBreakout rooms, recordings, whiteboard
LTI (External Tool)Integration✅ YesConnect any LTI 1.3 tool (Turnitin, Kahoot, etc.)
Topic 19.1 — Book Activity (Multi-Chapter Content)
  • Create a multi-chapter reference guide with auto-generated Table of Contents
  • Add sub-chapters (max 2 levels of nesting)
  • Embed images, audio, and video directly into pages
  • Print entire book to PDF for offline access
  • Import chapters from .zip of HTML files
Topic 19.2 — Choice Activity (Voting & Group Sign-Up)
  • One question with multiple options — students choose one or many
  • Limit seats per option (perfect for project group self-selection)
  • Show results: always / after answer / after close / never
  • Allow students to change their choice (configurable)
Topic 19.3 — Feedback Activity (Anonymous Surveys)
  • Build custom survey forms: multiple choice, text boxes, rating scales, page breaks
  • Anonymous mode — responses not linked to student identity
  • Export responses to Excel
  • Trigger course completion when feedback is submitted
  • Template reuse — copy a feedback form across courses
Topic 19.4 — LTI External Tool
  • Connect third-party tools using LTI 1.1 or 1.3 standard
  • Common integrations: Turnitin, Kahoot!, Padlet, Zoom, Google Meet, Flipgrid
  • Grades automatically pass back to Moodle Gradebook
  • Configure at: Site Admin → Plugins → Activity Modules → External Tool
Section 20

Assignment Activity — Complete Deep Dive

The Assignment module is Moodle's most powerful grading tool. Master all submission types, marking workflows, PDF annotation, team submissions, and plagiarism integration.

Topic 20.1 — Submission Types
TypeWhat Students SubmitNotes
File SubmissionsUpload files (PDF, DOCX, ZIP, images)Set max files (1–20), max size, allowed types
Online TextRich text editor in browserWord count limits, paste from Word
Online Audio RecordingRecord audio in browserRequires microphone, saves as .ogg
Online Video RecordingRecord video via webcamRequires camera, saves as .webm
Topic 20.2 — Marking Workflow & Allocation
  • Marking Workflow: Grades hidden until teacher marks as "Released" — prevents premature student access
  • Workflow States: Not marked → In marking → Marking complete → In review → Ready for release → Released
  • Marking Allocation: Admin assigns each submission to a specific grader (useful for large classes)
  • Blind Marking: Graders see submissions without student names (prevents bias)
  • Anonymous Marking: Student identity hidden until grading is complete then revealed
Topic 20.3 — PDF Annotation
  • Annotate directly on student-submitted PDFs inside Moodle — no external software needed
  • Tools: stamps, comments, highlight, inline text, draw (freehand), rectangle, oval
  • Add inline comments that students see on their returned submission
  • Generate annotated PDF report that students download from their gradebook
  • Requires Ghostscript installed on server for PDF conversion
Topic 20.4 — Team Submissions (Group Assignment)
  • Enable "Students submit in groups" — one submission per group
  • Require all group members to confirm before submission locks
  • Grade applies to entire group automatically
  • Override individual grades for specific group members when needed
Topic 20.5 — Offline Bulk Grading Spreadsheet
Offline Grading Workflow
# Step 1: In Assignment grader → Download grading worksheet (.csv)
# It contains: Identifier, Full name, Email, Status, Grade, Maximum Grade, Feedback

# Step 2: Fill in Grade and Feedback columns in Excel/LibreOffice
Identifier, Full name, Grade, Feedback
"Participant 1", John Doe, 85, "Good analysis but missing citations"
"Participant 2", Jane Smith, 92, "Excellent work — well structured"

# Step 3: Upload CSV back → Grades and feedback applied automatically
# Assignment → View All Submissions → Upload grading worksheet
Section 21

Workshop — Peer Assessment Activity

The Workshop module enables powerful peer-review assessments in 5 distinct phases. Students submit work, review peers, and receive an aggregated grade.

Topic 21.1 — 5 Workshop Phases
Phase 1 Setup

Teacher defines submission instructions, assessment form, and grading strategy.

Phase 2 Submission

Students upload their work within the submission deadline.

Phase 3 Assessment

Each student reviews N peers' submissions using the assessment form.

Phase 4 Grading

Teacher grades student assessments for accuracy vs their own marking.

Phase 5 Closed

Final grades published. Students see received reviews and their grades.

Topic 21.2 — Grading Strategies
StrategyHow It WorksBest For
AccumulativeCriteria with points, weighted averageMost assignments
Comments OnlyText comments, no numeric gradeFormative feedback only
Number of ErrorsYes/No checklist — points deducted per errorTechnical tasks with clear requirements
RubricFull rubric with criteria × levelsEssays, projects, presentations
Section 22

Lesson, Database, Wiki & Glossary

Advanced activity types for branching content, collaborative data collection, group wikis, and auto-linking terminology.

Topic 22.1 — Lesson (Branching Scenarios)
  • Page Types: Content pages (read-only) and Question pages (branching based on answer)
  • Branching: Wrong answer → remedial content page. Correct answer → next topic
  • Use Case: Compliance training, language learning, scenario-based medical education
  • Timed Lessons: Set maximum time — grade decreases for slow completion
  • Progress Bar: Display lesson progress to students as percentage
  • Allow Review: Let students retake questions before final submission
Lesson Structure Example
Lesson: "Fire Safety Compliance" (Branching)
├── [Content] Introduction to Fire Safety
├── [Question] Where is the nearest fire exit? (MCQ)
│   ├── ✅ Correct → [Content] Emergency Evacuation Procedures
│   └── ❌ Wrong   → [Content] Study the Floor Map Again → Loop back
├── [Question] Who do you call first in a fire?
│   ├── ✅ Correct → [Content] Final Summary
│   └── ❌ Wrong   → [Content] Emergency Contact Procedures → Loop back
└── [End of Lesson] Grade = % questions correct
Topic 22.2 — Database Activity (Custom Data Forms)
  • Purpose: Students submit structured records — like a shared class database
  • Field Types: Text, Number, URL, Image, File upload, Date, Latitude/Longitude, Checkbox, Radio buttons
  • Templates: Customise how records are displayed (List, Single, Add, Search, RSS)
  • Approval: Teacher must approve entries before they appear publicly
  • Peer Rating: Students can rate each other's database entries (1–5 stars)
  • Use Cases: Student portfolios, case study libraries, resource sharing boards, research data collection
Topic 22.3 — Wiki Activity
ModeWho EditsUse Case
CollaborativeAll students share one wikiGroup knowledge base, class glossary
IndividualEach student has their own wikiPersonal learning journal, portfolio
  • Full version history — see every edit with diff comparison
  • Rollback any page to a previous version
  • Cross-link wiki pages with [[PageName]] syntax
  • Export entire wiki to HTML
Topic 22.4 — Glossary Activity
  • Auto-linking: Glossary terms are automatically hyperlinked wherever they appear in the course
  • Student entries: Enable peer contribution — teacher approves before publishing
  • Display formats: Dictionary, Encyclopedia, Entry list, FAQ, Full with Author, Simple Dictionary
  • Main Glossary: One per course — can be site-wide. Secondary glossaries are course-specific
  • Export/Import: Export glossary as XML, import into another course
Section 23

Badges, Open Badges 2.0 & Certificates

Motivate learners with digital achievement badges and issue verifiable completion certificates that are portable across the web.

Topic 23.1 — Open Badges 2.0
  • Moodle implements Mozilla Open Badges 2.0 — internationally portable credentials
  • Badges are digitally signed JSON-LD files containing: issuer, criteria, evidence, expiry date
  • Students share badges to LinkedIn, Credly, Open Badge Passport, Mozilla Backpack
  • Create at: Course → Badges → Add New Badge or Site Admin → Badges → Add New Site Badge
Topic 23.2 — Badge Criteria Types
CriterionTrigger
Manual AwardTeacher manually awards badge to specific students
Course CompletionStudent completes the course (meets all completion requirements)
Activity CompletionStudent completes specific activity (quiz passed, assignment submitted)
GradeStudent achieves minimum grade in grade item
Badge AwardStudent already has another badge (badge chains)
Profile CompletionStudent fills all required profile fields
Cohort MembershipStudent belongs to specific cohort
Topic 23.3 — Certificate Plugin (moodle.org/plugins)
  • Install mod_certificate or mod_customcert from Plugin Directory
  • Custom Certificate Plugin: Drag-and-drop PDF certificate designer in browser
  • Elements: Student name, course name, grade, completion date, teacher signature image, QR code verification
  • Auto-issue when course completed — student downloads from their course page
  • QR code links to a verification page where employers can verify authenticity
bash — Install Custom Certificate Plugin
# Download from moodle.org/plugins/mod_customcert
unzip mod_customcert.zip -d /var/www/html/moodle/mod/

# Set permissions
chown -R www-data:www-data /var/www/html/moodle/mod/customcert/

# Run upgrade
php admin/cli/upgrade.php --non-interactive

# Verify it appears in: Course → Add Activity → Custom Certificate
Section 24

Competency Frameworks & Learning Plans

Moodle's built-in Competency-Based Education (CBE) system — define skills frameworks, map activities to competencies, and create personalised learning plans.

Topic 24.1 — Competency Framework Setup
  1. Enable Competencies: Site Admin → Advanced Features → Enable Competencies ✅
  2. Create Framework: Site Admin → Competencies → Competency Frameworks → Add
  3. Add competencies (hierarchical — parent/child structure allowed)
  4. Set proficiency scale (e.g., Not yet competent → Competent → Proficient)
  5. Link competencies to courses: Course Settings → Competencies → Link
  6. Link competencies to activities: Activity → Edit → Competencies tab
Topic 24.2 — Learning Plans
  • Create personal development roadmaps for individual students
  • Add competencies to a plan with target completion dates
  • Template plans — apply the same plan to many students at once
  • Students see their own learning plan on their dashboard
  • Mentor/Manager can view and comment on student progress
  • Competency evidence: link activities, upload files, write comments as evidence
Topic 24.3 — Evidence of Prior Learning (RPL)
  • Teachers can manually mark a competency as achieved without course completion
  • Upload evidence files (certificates, CVs, portfolios) as proof
  • Override proficiency level with written justification
  • Full audit trail stored — who changed what and when
Section 25

Enrolment Methods — Complete Guide

Moodle supports 10+ enrolment plugins. Understand every method, when to use it, and how to configure it for your institution.

Topic 25.1 — All Enrolment Methods
MethodHow Students JoinBest For
Manual EnrolmentTeacher/admin manually adds usersSmall controlled groups
Self EnrolmentStudent clicks "Enrol Me" buttonOpen access courses
Self Enrolment + KeyEnrol with secret key (password)Restricted access with shared key
Guest AccessView only — no submission allowedPublic preview / demo courses
Cohort SyncAuto-enrol all members of a cohortYear-group or department courses
Meta EnrolmentStudents in Course A auto-join Course BCombined/linked courses
LDAP EnrolmentSync enrolments from Active DirectoryCorporate HRMS integration
Payment (PayPal/Stripe)Pay course fee to auto-enrolCommercial course sales
Flat FileCSV import runs via cronBatch enrolment from SIS
IMS EnterpriseXML-based enterprise data syncUniversity SIS integration
Database EnrolmentDirect DB query to external systemCustom ERP/HRMS sync
LTI ProviderRemote platform auto-enrols via LTIBeing enrolled from another LMS
Topic 25.2 — Cohort Management
  • System Cohorts: Site Admin → Users → Cohorts → Add Cohort (available site-wide)
  • Category Cohorts: Available only within a specific category and its sub-categories
  • Add users manually, via CSV upload, or via LDAP/Active Directory sync
  • Cohort Sync enrolment plugin auto-enrols cohort members into courses
  • Useful for year group management: "2024-Intake", "Dept-HR", "Region-North"
bash — Flat File Enrolment CSV
# format: action, role, username, course_shortname
add, student, john_doe, CS101
add, student, jane_smith, CS101
add, editingteacher, prof_williams, CS101
del, student, old_student, CS101

# Upload via: Site Admin → Plugins → Enrolments → Flat file
# Set the path to this file — cron processes it automatically
Topic 25.3 — Payment Enrolment (Moodle Payments)
  • Enable: Site Admin → Plugins → Enrolments → PayPal or Payment Gateway
  • Moodle 3.11+ has a built-in Payment API supporting multiple gateways
  • Gateways available: PayPal (core), Stripe (plugin), Mollie (plugin)
  • Configure course cost, currency, and free trial period
  • Students see a cost notice and "Enrol" button that redirects to payment
  • Auto-enrols upon payment confirmation + sends confirmation email
Topic 25.4 — SAML2 / OAuth2 SSO Authentication & Provisioning Flow

Enterprise single sign-on (SSO) automates account creation, security group mappings, and instant course enrollments upon secure login.

Pipeline F · Single Sign-On (SSO) User Provisioning Flow
Step 1 SSO Trigger

Student clicks SSO button. Moodle redirects browser to identity provider (IdP).

Step 2 Identity Assertion

IdP validates user and sends secure SAML Assertion / ID Token to Moodle endpoint.

Step 3 Provision & Login

Moodle matches attributes, auto-creates user record, logs them in, and triggers cohort sync.

Section 26

Calendar, Scheduling & Messaging

Manage course events, set automated reminders, configure email notifications, and control messaging preferences across the platform.

Topic 26.1 — Calendar Event Types
Event TypeVisible ToCreated By
Site EventAll users on the siteSite administrators
Category EventUsers in the categoryCategory managers
Course EventAll enrolled studentsCourse teachers/admins
Group EventMembers of specific groupTeachers (group mode enabled)
User EventOnly the creatorAny user (personal calendar)
Activity DeadlineEnrolled studentsAuto-created when activity has due date
Topic 26.2 — iCal Export & Subscription
  • Export all Moodle calendar events to .ics file for Google Calendar / Outlook / Apple Calendar
  • Subscribe via URL: Calendar → Export → Get Calendar URL → paste in Google Calendar
  • Events update automatically — syncs assignment deadlines, quiz opens/closes in real time
Topic 26.3 — Notification & Messaging Configuration
  • Message Providers: Each activity/event type has a message provider (e.g., "Assignment submission" → notify teacher)
  • Configure: Site Admin → Messaging → Notification Settings (admin-level defaults)
  • Users can override defaults per notification type in: User Menu → Preferences → Notifications
  • Channels: Web popup, Email, Mobile push (if Moodle app configured)
  • Email Digest: Users choose daily digest (complete/subjects only) or individual emails
  • Do Not Disturb: Users set quiet hours during which no notifications are sent
Key Automated Email Notifications
  • • Assignment: new submission received (teacher), grade released (student)
  • • Quiz: attempt completed, manual grade needed
  • • Forum: new post in subscribed forum, forum digest
  • • Completion: course completed, badge awarded, certificate ready
  • • Enrolment: welcome email on enrolment, unenrolment confirmation
Topic 26.4 — Custom Profile Fields
  • Add extra data fields to user profiles beyond the default Moodle fields
  • Configure: Site Admin → Users → Accounts → User Profile Fields
  • Field Types: Text, Textarea, Checkbox, Menu (dropdown), Date/Time, Social (URLs)
  • Make fields required, unique, or locked (only admin can change)
  • Use in Conditional Access rules to restrict activities by profile field value
  • Include in bulk CSV user upload to populate automatically
Section 27

Moodle Mobile App — Setup & Configuration

Configure your Moodle site to work with the official Moodle mobile app — enable push notifications, offline access, and QR code login.

Topic 27.1 — Enabling Mobile Access
  1. Enable mobile services: Site Admin → Advanced Features → Enable mobile web services ✅
  2. Enable REST protocol: Site Admin → Plugins → Web Services → Manage Protocols → REST ✅
  3. Configure push notifications: Site Admin → Mobile App → Push notifications → FCM/APN credentials
  4. Set App site policy URL (optional): Site Admin → Mobile App → Mobile app settings
  5. Test: download official Moodle app (iOS/Android) → enter your site URL → login
Topic 27.2 — App Features Overview
FeatureApp SupportNotes
Course dashboard✅ FullAll enrolled courses visible
Quiz✅ FullTimed, with offline attempt sync
Assignment submission✅ FullFile upload, online text, audio/video recording
Forum participation✅ FullReply, rate, attach files
SCORM⚠️ LimitedBasic playback — no adaptive navigation
H5P✅ FullMost content types supported
Offline mode✅ YesDownload course sections for offline viewing
Push notifications✅ YesRequires FCM (Android) / APNs (iOS) setup
QR code login✅ YesScan from User Profile → QR login code
Messaging✅ FullReal-time chat with sound notifications
BigBlueButton✅ YesJoin sessions from mobile (BBB app opens)
Topic 27.3 — Push Notification Setup (Firebase)
Firebase Cloud Messaging (Android) Setup
# Step 1: Create Firebase project at console.firebase.google.com
# Step 2: Add Android App → download google-services.json
# Step 3: Get Server Key:
#   Firebase Console → Project Settings → Cloud Messaging → Server Key

# Step 4: Add to Moodle:
# Site Admin → Mobile App → Push Notifications
# Android → Server API Key: [your FCM server key]
# iOS     → Certificate file (.p12) + password

# Step 5: Test
# Send test push notification from Moodle to your app
Section 28

Theme Customization & Appearance

Customize the look and feel of your Moodle site — configure Boost theme, brand colors, custom CSS, logos, layouts, and create child themes.

Topic 28.1 — Boost Theme Configuration
  • Select Theme: Site Admin → Appearance → Theme → Theme Selector → Boost
  • Brand Color: Site Admin → Appearance → Theme → Boost Settings → Brand Color (hex code)
  • Preset: Choose from Default, Plain — or upload custom SCSS preset file
  • Custom SCSS: Paste raw SCSS in "Raw SCSS" field — compiled and cached automatically
  • Background Image: Upload full-width login page background image
  • Navigation: Configure drawer (left sidebar) show/hide per context
Topic 28.2 — Boost Union Plugin (Enterprise Theme)
  • Most popular Boost child theme — adds 100+ customisation settings without custom code
  • Custom logo, favicon, login page background, footer content
  • Course overview page: grid layout, timeline layout, favorites bar
  • Smart menus: add custom navigation items in the header or footer
  • Course index: collapsible sidebar table of contents
  • Accessibility improvements: high contrast mode, keyboard navigation
Custom SCSS — Boost Theme Branding
/* Add in: Site Admin → Appearance → Boost Settings → Raw SCSS */

/* Brand colors */
$brand-color: #1a56db;
$body-bg: #f8fafc;
$navbar-bg: #0f172a;

/* Typography */
body { font-family: 'Inter', system-ui, sans-serif; }
.h1, .h2, .h3 { font-weight: 800; }

/* Course cards */
.card { border-radius: 1rem; box-shadow: 0 4px 20px rgba(0,0,0,0.06); }
.card:hover { transform: translateY(-2px); transition: all 0.3s ease; }

/* Login page */
#page-login-index .card { backdrop-filter: blur(10px); background: rgba(255,255,255,0.9); }
Topic 28.3 — Language Pack Management
  • Install language packs: Site Admin → Language → Language Packs → Available
  • Set default site language: Site Admin → Language → Language Settings → Default Language
  • Force language per course: Course Settings → Force Language
  • Users choose their own language: User Preferences → Preferred Language
  • Customise strings: Site Admin → Language → Language Customisation → choose language → modify any string
Topic 28.4 — Mustache Template Render & SCSS Compilation Workflow

Moodle theme rendering is divided between template processing and real-time SCSS compilation pipelines.

Pipeline G · Theme Engine Rendering Pipeline
Step 1 Output Registration

PHP script declares output context, registering assets and layout targets via $PAGE.

Step 2 Mustache Rendering

Mustache engine reads layout files, merges contextual variables, and outputs static HTML blocks.

Step 3 SCSS Compilation

SCSS compiler processes Boost brand presets, custom SCSS variables, and outputs fully cached CSS files.

Section 29

Plagiarism Detection, Blocks & Advanced Grading

Integrate Turnitin for plagiarism checking, master all core Moodle blocks, and configure advanced grading scales, outcomes and grade letters.

Topic 29.1 — Plagiarism Detection (Turnitin / Urkund)
  • Turnitin integrates via LTI 1.3 (recommended) or the plagiarism_turnitin plugin
  • Configure at: Site Admin → Plugins → Plagiarism Prevention → Turnitin
  • Enable per assignment: Assignment Settings → Turnitin Plagiarism Plugin → Enable ✅
  • Students see originality report after submission (configurable delay)
  • Teachers see similarity score (0–100%) in grading interface
  • Urkund (Ouriginal): Alternative — configure via plagiarism_urkund plugin
  • Compilatio: European alternative — configure via plagiarism_compilatio
Topic 29.2 — All Core Moodle Blocks
BlockFunctionWhere Used
CalendarShow upcoming eventsDashboard, course page
Upcoming EventsList of next N eventsDashboard, course page
Course OverviewEnrolled courses summaryDashboard (default)
Recently AccessedLast-viewed itemsDashboard
TimelineAssignment deadlines timelineDashboard
Activity CompletionProgress trackerCourse page
Completion StatusGreen/red criteria checklistCourse page (student view)
Latest AnnouncementsRecent forum news postsCourse page
Online UsersWho's online in past N minutesCourse page
Search ForumsFull-text search in forumsCourse page
Random Glossary EntryDisplay random term from GlossaryCourse page
Remote RSS FeedsPull external RSS into MoodleDashboard, course
HTML BlockCustom HTML/CSS widgetAnywhere
NavigationFull site navigation treeAnywhere
AdministrationQuick admin linksSite admin pages
Topic 29.3 — Grade Scales, Outcomes & Letters
  • Custom Scales: Create non-numeric scales like "Not Yet / Developing / Competent / Exemplary"
  • Configure: Site Admin → Grades → Scales → Add new scale
  • Outcomes: Attach measurable learning outcomes to activities — graded separately from main grade
  • Grade Letters: Map numeric ranges to letters (A+, A, B, etc.)
  • Configure: Site Admin → Grades → Letter Grades → Edit site-level letters
  • Course-level override: Course → Grades → Setup → Grade Letters → Override site defaults
SQL — Custom Grade Letter Boundaries Check
SELECT
    gl.courseid,
    c.shortname,
    gl.lowerboundary,
    gl.letter
FROM mdl_grade_letters gl
JOIN mdl_course c ON c.id = gl.courseid
WHERE gl.courseid = 5
ORDER BY gl.lowerboundary DESC;

-- Example output:
-- 90.0 → A+
-- 80.0 → A
-- 70.0 → B
-- 60.0 → C
-- 50.0 → D
-- 0.0  → F
Topic 29.4 — Grade Calculations (Formulas)
Gradebook — Calculated Grade Formula
-- In Gradebook Setup, a Calculated Grade Item uses formula syntax:
-- Reference grade items by their idnumber set in edit screen

-- Example: Final Grade = (Quiz 40%) + (Assignment 40%) + (Attendance 20%)
= ([[quiz_grade]] * 0.4) + ([[assignment_grade]] * 0.4) + ([[attendance_grade]] * 0.2)

-- Minimum grade enforcement
= max([[final]], 0)

-- Round to 2 decimals
= round(([[quiz_grade]] * 0.6) + ([[assignment_grade]] * 0.4), 2)

-- Conditional pass/fail (pass if quiz >= 50 AND assignment >= 50)
= if(and([[quiz_grade]]>=50, [[assignment_grade]]>=50), 100, 0)
Section 30

Complete Moodle CLI Scripts Reference

Every official CLI script in Moodle — what it does, when to use it, and working command examples with flags.

Core Admin CLI Scripts
bash — Complete CLI Script Reference
# ── INSTALLATION & UPGRADE ────────────────────────────────────
php admin/cli/install.php --help           # Fresh install wizard
php admin/cli/upgrade.php --non-interactive # Upgrade Moodle core/plugins
php admin/cli/install_database.php         # Install DB schema only

# ── MAINTENANCE & CACHE ───────────────────────────────────────
php admin/cli/purge_caches.php             # Clear all Moodle caches
php admin/cli/maintenance.php --enable     # Enable maintenance mode
php admin/cli/maintenance.php --disable    # Disable maintenance mode
php admin/cli/cron.php                     # Run cron manually (all tasks)

# ── USERS ─────────────────────────────────────────────────────
php admin/cli/create_user.php              # Create a single user
php admin/cli/reset_password.php          # Reset user password
# --username=admin --password=NewPass123!
php admin/cli/delete_user.php              # Permanently delete user
php admin/cli/suspend_user.php             # Suspend/unsuspend user

# ── COURSES & BACKUP ──────────────────────────────────────────
php admin/cli/backup.php \
  --courseid=5 \
  --destination=/var/backups/             # Backup single course

php admin/cli/restore_backup.php \
  --file=/backups/course.mbz \
  --categoryid=1 \
  --userid=2                              # Restore course

php admin/cli/delete_course.php \
  --courseid=5                            # Delete course permanently

# ── DATABASE ──────────────────────────────────────────────────
php admin/tool/replace/cli/replace.php \
  --search=http://old.com \
  --replace=https://new.com              # URL search-replace in DB

# ── PLUGINS ───────────────────────────────────────────────────
php admin/cli/uninstall_plugins.php \
  --plugins=mod_quiz \
  --run                                  # Uninstall a plugin

# ── WEB SERVICES ──────────────────────────────────────────────
php admin/cli/generate_ws_token.php \
  --userid=2 \
  --service=moodle_mobile_app            # Generate API token

# ── TESTING ───────────────────────────────────────────────────
php admin/tool/behat/cli/init.php        # Init Behat acceptance tests
php admin/tool/phpunit/cli/init.php      # Init PHPUnit unit tests
vendor/bin/phpunit --testsuite=core      # Run PHPUnit suite

# ── PERFORMANCE TESTING ───────────────────────────────────────
php admin/tool/generator/cli/maketestcourse.php \
  --shortname=BIGTEST \
  --size=XL                              # Generate large test course
Moosh — Moodle Shell Tool

Moosh is an unofficial but widely used CLI toolkit that adds 200+ commands for rapid Moodle management.

bash — Moosh Common Commands
# Install Moosh
composer global require moosh/moosh

# User management
moosh user-create --password=Pass123! --email=john@ex.com john_doe
moosh user-list --search=john
moosh user-delete john_doe
moosh user-getidbyname john_doe

# Course management
moosh course-create --fullname="PHP Masterclass" --shortname=PHP101 --category=1
moosh course-list
moosh course-enrol -r student 5 12   # enrol userid=12 in courseid=5 as student
moosh course-unenrol 5 12

# Grades
moosh grade-get --userid=12 --courseid=5
moosh grade-set --userid=12 --courseid=5 --idnumber=quiz1 --grade=85

# Cache & maintenance
moosh cache-clear
moosh config-set maintenance_enabled 1
moosh config-set maintenance_message "Upgrading — back at 3pm"

# Plugin management
moosh plugin-list
moosh plugin-install-fromzip /path/to/plugin.zip
Moodle REST API — All Core Web Service Functions
FunctionActionType
core_user_create_usersCreate one or more userswrite
core_user_get_usersSearch/retrieve usersread
core_user_update_usersUpdate user profile fieldswrite
core_user_delete_usersPermanently delete userswrite
enrol_manual_enrol_usersEnrol users in a coursewrite
enrol_manual_unenrol_usersUnenrol userswrite
core_course_get_coursesGet list of all coursesread
core_course_create_coursesCreate courses programmaticallywrite
core_course_delete_coursesDelete courseswrite
core_course_get_contentsGet course sections & activitiesread
gradereport_user_get_grade_itemsGet all grade items for a userread
mod_assign_get_assignmentsGet assignment dataread
mod_assign_get_submissionsGet student submissionsread
mod_quiz_get_quizzes_by_coursesGet quizzes in a courseread
mod_forum_get_forums_by_coursesGet forums in a courseread
core_group_create_groupsCreate course groupswrite
core_group_add_group_membersAdd users to groupswrite
message_send_instant_messagesSend a message to a userwrite
core_badges_get_user_badgesGet all badges for a userread
core_completion_get_activities_completionGet activity completion statusread

50+ Practical Lab Activities

Complete these hands-on exercises in your local MAMP/XAMPP Moodle sandbox.

Beginner Labs
1

Install Moodle locally using MAMP and create the moodledata directory outside the web root.

2

Create 3 course categories (Engineering, Business, Healthcare) with subcategories.

3

Upload 20 users via CSV — including teachers and students.

4

Build a Topics-format course with 5 sections, each containing a File and a URL resource.

5

Create a Forum activity and post 3 discussion threads.

6

Enable completion tracking on all activities and configure Course Completion.

7

Generate an Activity Completion Report and export it to CSV.

8

Explore the Site Administration panel — document every top-level menu item.

Intermediate Labs
9

Import 15 GIFT-format quiz questions including MCQ, True/False, Matching and Short Answer types.

10

Create a timed 10-question randomised quiz drawing from a question bank of 30 questions.

11

Configure a Rubric grading method for an Essay assignment — 4 criteria, 4 levels each.

12

Create an H5P Interactive Video with embedded quiz questions at 3 timestamps.

13

Create a SCORM package using Articulate Rise (free trial) and deploy it to a Moodle course.

14

Configure Separate Groups in a Forum activity — test isolation between Group A and Group B.

15

Set up an OAuth 2.0 Google login integration for your local Moodle instance.

16

Configure and run the Automated Course Backup for 2 courses and verify .mbz files.

17

Restore a course backup from .mbz to a different category.

18

Write a custom SQL report using the Configurable Reports plugin to show students' last login.

Advanced Labs
19

Create a full local plugin: local_attendance with 2 web service functions registered in db/services.php.

20

Test your API via cURL — get_course_attendance and get_user_sessions.

21

Write a Python script that bulk-enrols 50 users to 3 courses via the REST API.

22

Write a Python script that exports grades for all courses and saves results to a CSV file.

23

Configure Redis as the session store and Memcached as the MUC cache on your local setup.

24

Configure Nginx security headers (CSP, HSTS, X-Frame-Options) for your Moodle instance.

25

Activate the Privacy Data Request workflow — request export and deletion for a test user.

26

Configure Moodle Analytics → train the "Students at risk" model and view predictions.

Expert Labs
27

Write an Ansible playbook to deploy Moodle on a fresh Ubuntu 22.04 droplet end-to-end.

28

Build a nightly backup bash script that exports DB + moodledata + course backups to AWS S3.

29

Integrate BigBlueButton virtual classroom — host a live lecture with 5 test students.

30

Implement 2 Moodle Network (MNet) connections between two local Moodle instances.

CLI Quick Reference

Upgrade Moodle
php admin/cli/upgrade.php
Purge All Caches
php admin/cli/purge_caches.php
Backup Single Course
php admin/cli/backup.php \
  --courseid=5 \
  --destination=/backups/
URL Search-Replace
php admin/tool/replace/cli/\
replace.php \
  --search=http://old.com \
  --replace=https://new.com
Fix File Permissions
chown -R www-data:www-data /moodle
chmod -R 755 /moodle
chmod -R 777 /moodledata

Key DB Tables

  • mdl_user — All user accounts
  • mdl_course — Course definitions
  • mdl_course_modules — Activities per course
  • mdl_grade_grades — Final grades
  • mdl_quiz_attempts — Quiz session data
  • mdl_logstore_standard_log — Activity log
  • mdl_enrol — Enrollment plugins
  • mdl_user_enrolments — Who is in what course
  • mdl_course_completions — Completion status
  • mdl_external_tokens — API tokens

Target Outcomes

  • Install production-grade Moodle from scratch
  • Design and manage complete course curricula
  • Build question banks with GIFT bulk imports
  • Configure advanced grading with rubrics
  • Develop custom REST API plugins (local plugins)
  • Automate operations with Python and Bash
  • Harden Moodle for production security
  • Configure LDAP, OAuth2, SAML SSO
  • Enable GDPR compliance and audit trails
  • Set up MNet for multi-site SSO federation
  • Implement Redis + Memcached caching
  • Deploy nightly backup pipeline to S3