{{ message }}
Add once-per-attempt tracking lifecycle events (attempt_started/attempt_completed)#68
Merged
Conversation
…pt_completed) Emit two LEVEL_PARTICIPATING events from the shared track::ingest() pipeline so the web (track.php) and mobile (save_track) paths both surface learner activity in the logstore: attempt_started on attempt creation and attempt_completed on the first transition to a terminal status (passed/failed/completed), carrying the server-side overall score and status. Deliberately once-per-attempt, not per-commit, respecting the anti-flood limit set by DEC-0041 (the ~500ms autocommit). Records the design as DEC-0051 (extends DEC-0041) with risk RIE-016, docs in TRACKING.md, and extends events_test.php.
8205789 to
f67aeab
Compare
# Conflicts: # research/docs/indices/adrs.yaml # research/status.yaml
erseco
added a commit
that referenced
this pull request
Jun 29, 2026
Add a Claude Code project skill at .agents/skills/changelog/SKILL.md that drafts a CHANGELOG entry from merged GitHub PRs since the last release, keeping mod_exelearning in parallel with mod_exeweb. Document it in AGENTS.md. The skill is development-only tooling, excluded from release packages by the existing '.*' rule in .distignore (no .distignore change needed).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What
Adds learner-facing observability to the tracking pipeline.
\mod_exelearning\local\track::ingest()— the single pipeline shared by the webtrack.phpendpoint and thesave_trackweb service (DEC-0040) — previously persisted the attempt and updated the gradebook/completion without emitting any event. This closes part of the observability axis flagged by the comparative audit (mod_exescorm exposes 11 events vs our 4).How
Two
LEVEL_PARTICIPATINGevents, emitted once the attempt is persisted (preview / no-op status-only / over-cap commits return earlier and emit nothing):\mod_exelearning\event\attempt_started— on the commit that first creates the attempt.\mod_exelearning\event\attempt_completed— on the commit that first moves the attempt into a terminal status (passed/failed/completed); carries the server-recomputed overallscoreand thestatusinother.Both fire from the shared pipeline, so web and mobile produce the same signal.
Why once-per-attempt, not per-commit
DEC-0041 deliberately rejected "one event per tracking commit" because the shim autocommits roughly every 500 ms and would flood the logstore. A per-commit
score_submittedwould reintroduce exactly that. These two events are bounded to O(attempts):attempt_startedfires on creation only;attempt_completedfires on the first terminal transition only (the prior overall status is checked, so a later commit that stays terminal does not re-fire). This extends DEC-0041 rather than contradicting it.Files
classes/event/attempt_started.php,classes/event/attempt_completed.phpclasses/local/track.php— new-attempt + prior-status detection and theemit_tracking_events()helperlang/en/exelearning.php—eventattemptstarted,eventattemptcompleted(log-facing, en-only per the repo convention)tests/events_test.php— 6 new tests (fires on ingest; once-per-attempt; terminal transitionincomplete→passed; no event on preview / status-only;validate_data)docs/TRACKING.md— "Observability events" sectionresearch/decisiones/adr/DEC-0051-eventos-ciclo-de-vida-intento.md(extends DEC-0041) +research/status.yaml(RIE-016)Verification
phpcs --standard=moodle0/0 on all changed files.attempt_started+attempt_completedappear in the log; a status-only commit produces neither.Moodle Playground Preview
The changes in this pull request can be previewed and tested using a Moodle Playground instance.
ℹ️ The eXeLearning editor is fetched from the shared release and unpacked into the plugin when the playground boots, so the first load may take a few extra seconds. ELPX upload, viewer and preview work normally.