Moodle plugin
The local_ssea plugin is the bridge between your Moodle and SoftSys Edu Analytics. It observes 15 standard Moodle events, queues them, and resiliently sends them to the SSEA backend.
Prerequisites
Section titled “Prerequisites”- Moodle 4.1 or higher (4.5+ recommended).
- PHP 7.4+ (aligned with Moodle 4.x requirements).
- Administrator access in Moodle.
- Tenant credentials provided by SoftSys Solutions:
- Tenant ID (UUID)
- API key (format
ssea_+ 32 hex characters)
- HTTPS egress allowed from your Moodle server to
ingest.softsysanalytics.comandapi.softsysanalytics.com.
Installation
Section titled “Installation”-
Download the latest
local_ssea.zipfrom the release channel agreed with SoftSys Solutions (customers receive access to the package through the support channel). -
In Moodle, go to Site administration → Plugins → Install plugins.
-
Upload the ZIP file.
-
Follow the installation wizard.
-
When finished, complete the initial configuration (next section).
-
Copy the plugin directory inside
<moodle_root>/local/ssea/. -
Adjust permissions to the web-server user (typical on Debian/Ubuntu):
Ventana de terminal sudo chown -R www-data:www-data <moodle_root>/local/ssea -
Visit
https://<your_moodle>/admin/index.php— Moodle detects the plugin and runs the database migration. -
Complete the initial configuration.
Configuration
Section titled “Configuration”After install, go to:
Site administration → Plugins → Local plugins → SSEA Analytics
Or directly: /admin/settings.php?section=local_ssea
Required settings
Section titled “Required settings”| Setting | Description | Example |
|---|---|---|
| Enabled | Plugin master switch | Yes |
| Server URL | SSEA ingest endpoint | https://ingest.softsysanalytics.com |
| API key | Tenant API key | ssea_abc123... |
| Tenant ID | UUID assigned by SoftSys | f47ac10b-58cc-... |
Optional settings
Section titled “Optional settings”| Setting | Default | Description |
|---|---|---|
| Delivery mode | batch | sync (immediate), async (adhoc task), batch (DB queue) |
| Batch size | 50 | Events per batch (1–500) |
| Request timeout | 5 s | HTTP timeout |
| SSL verify | Yes | Only disable on local dev with invalid certificates |
| Debug logging | No | Verbose log to Moodle debug log |
Do not send IP (no_ip) | No | Exclude IP from the payload before sending — useful for strict internal policies |
Delivery modes
Section titled “Delivery modes”The plugin supports three modes for sending events to ingest:
Batch (default, recommended)
Section titled “Batch (default, recommended)”Events are written to the local_ssea_queue table and sent in batches every 5 minutes by the process_queue_task scheduled task. Best performance and resilience: if the ingest is temporarily down, events accumulate safely and are sent once it recovers.
Async (adhoc task)
Section titled “Async (adhoc task)”Each event is queued as a Moodle adhoc task and delivered when Moodle’s task runner (cron.php) processes it. Better UX than sync mode (no per-page latency), but depends on the Moodle cron frequency.
Sync (immediate)
Section titled “Sync (immediate)”Events are sent directly during the Moodle HTTP request. Simple but adds latency to every page that triggers an event. Recommended only for very low-traffic sites or for debugging.
Captured events
Section titled “Captured events”The plugin observes 15 standard Moodle events: session, enrollment, course navigation, resource views, quiz attempts and submissions, assignment submissions, forum posts, grading, and completion.
See the full catalog in Event types.
Plugin capabilities
Section titled “Plugin capabilities”The plugin declares four Moodle capabilities to control access to its views:
| Capability | Description | Typical roles |
|---|---|---|
local/ssea:viewlearnerreport | View the personal learner report | Student, Teacher, Manager |
local/ssea:viewinstructorreport | View instructor reports | Teacher, Manager |
local/ssea:managesettings | Manage plugin configuration | Manager |
local/ssea:viewreports | View aggregated admin reports | Manager |
Scheduled tasks
Section titled “Scheduled tasks”The plugin registers two Moodle scheduled tasks:
| Task | Class | Default frequency |
|---|---|---|
| SSEA: Process event queue | \local_ssea\task\process_queue_task | Every 5 minutes (*/5 * * * *) |
| SSEA: Migrate Moodle data | \local_ssea\task\migrate_data_task | Daily (disabled by default — see below) |
The data migration task syncs the current state of users, courses, enrollments, activities, and grades to the backend. Useful to pre-populate the dashboard with existing history when you install the plugin on a Moodle with content. It is disabled by default — enable it when you want to run the initial sync.
To enable it:
Site administration → Server → Scheduled tasks → SSEA Migrate Data → Edit → Enable
Troubleshooting
Section titled “Troubleshooting”No events reaching SSEA
Section titled “No events reaching SSEA”-
Confirm the plugin is enabled: Site administration → Plugins → SSEA → “Enabled: Yes”.
-
Test the connection: the plugin settings page has a “Test connection” button.
-
Check the queue: run (from the Moodle UI or the DB):
SELECT COUNT(*) FROM mdl_local_ssea_queue WHERE status = 'pending'; -
Verify Moodle cron is running. Without cron, the
process_queue_tasknever runs and events pile up. From the shell:Ventana de terminal php admin/cli/cron.phpOr check your crontab / systemd unit.
-
Check errors: Moodle debug log, and if the plugin has an errors table:
SELECT * FROM mdl_local_ssea_errors ORDER BY created_at DESC LIMIT 20;
401 error (API key rejected)
Section titled “401 error (API key rejected)”- Verify the API key starts with
ssea_and has the correct length. - Verify the Tenant ID matches what SoftSys Solutions provisioned.
- If you suspect the key was revoked, contact the support team to issue a new one.
402 error (plan quota exceeded)
Section titled “402 error (plan quota exceeded)”Your tenant has exceeded its plan’s daily event quota. Options:
- Wait for the UTC midnight reset.
- Upgrade to a higher-quota plan. See Plans & limits.
SSL errors on on-premise Moodle
Section titled “SSL errors on on-premise Moodle”If your Moodle server has an outdated CA bundle, TLS verification may fail against Cloudflare. Update the system CA bundle:
sudo apt-get update && sudo apt-get install --only-upgrade ca-certificatesOnly as a last resort in internal environments can you disable SSL verify in the plugin settings. Never in public production.
Queue grows indefinitely
Section titled “Queue grows indefinitely”- Verify
process_queue_taskis running: Site administration → Scheduled tasks. - Check errors:
SELECT * FROM mdl_local_ssea_errors WHERE error_type = 'delivery_failed' LIMIT 10; - If the ingest is temporarily down, events accumulate safely — they will flush once the ingest recovers.
The plugin doesn’t appear in settings
Section titled “The plugin doesn’t appear in settings”Verify the plugin directory is named exactly ssea (not local_ssea):
<moodle_root>/local/ssea/ ← correct<moodle_root>/local/local_ssea/ ← wrongPlugin upgrade
Section titled “Plugin upgrade”- Download the new ZIP or copy the new files into
<moodle_root>/local/ssea/. - Visit
/admin/index.php— Moodle detects the new version and runs DB upgrades (they are incremental, no data loss). - Existing settings are preserved.
Uninstall
Section titled “Uninstall”Site administration → Plugins → Local plugins → SSEA → Uninstall
Uninstalling:
- Removes the plugin’s local tables (queue, errors, metadata).
- Does not remove the data already sent to SSEA (lives in the tenant’s backend).
- Stops generating events immediately.
If you also want to delete the tenant’s data from the backend, contact the support team — see Data retention.
Privacy
Section titled “Privacy”The plugin implements Moodle’s standard Privacy API provider (classes/privacy/provider.php):
- When Moodle deletes a user, the plugin immediately stops generating events for that
user_id. - Moodle’s standard export / right-to-be-forgotten flows include the plugin’s data.
- The plugin API key is stored in Moodle’s config and is never logged in plaintext.
- Events do not include the content of activities (quiz answers, forum bodies, uploaded files). Only metadata.
See Security & privacy for the full model.