Search by

phil / courses-bundle

phil

Online courses in a Symfony application: modules, enrollments, progress and completion, with SCORM and cmi5 packages and an xAPI record store.

Package info

github.com/parler-haut-interagir-librement/courses-bundle

Homepage

Type:symfony-bundle

pkg:composer/phil/courses-bundle

Statistics

Installs: 0

Dependents: 1

Suggesters: 1

Stars: 0

Open Issues: 0

0.4.0-alpha 2026-11-26 22:00 UTC

This package is auto-updated.

Last update: 2026-11-27 03:44:43 UTC


README

Online courses for Symfony: SCORM, cmi5 and xAPI content run inside the platform, mandatory training, transcripts.

phil/courses-bundle gives an application online courses. A course holds modules in order, and each module holds activities: a page of text, a link, the content of an imported SCORM package, a cmi5 assignable unit, or an activity of an xAPI package. Activity types are a port with a few adapters, so that an application adds its own. A learner enrolls once in a course; each activity records what they did — completed, passed, failed, waived, the best score — and is satisfied by the requirement it carries, the values of cmi5's moveOn. The course is completed when every required activity is satisfied.

A module or an activity opens at once, on a date, or a number of days after the learner enrolled, counted from midnight in the site's time zone. A course may impose the order of its activities. No state is a dead end: a learner who failed every try of an activity asks for a second chance, which a teacher grants, refuses, or answers by waiving the activity, with a note, on an administration page or from the console; with phil/audit-bundle, each step is written to the audit trail.

The bundle imports SCORM 1.2, SCORM 2004 and cmi5 packages, to run them or to migrate courses from another platform, read by phil/elearning-packages. The ZIP archive is read within bounds — its size, its number of entries, the size of each file uncompressed, its compression ratio —, and an entry that would leave the package, a symbolic link or a corrupt entry is refused. The manifest is parsed without any document type or entity. The files are stored apart, and served from a content origin that is not the application's, with a content security policy. SCORM content runs inside the platform: a Stimulus controller frames it under the run-time API of SCORM 1.2 (API) or SCORM 2004 (API_1484_11), which answers each call at once by the data model of phil/elearning-packages and sends the commits to an endpoint that checks them again. Attempts are kept with their tracking data — suspended and resumed, attempted again, reviewed read-only once ended —, and feed the learner's progress, the mastery score of the manifest included; the time allowed, the manifest's or the activity's own, is enforced by the server's clock. The tree of the blocks of a cmi5 course structure is kept: nested blocks, their order and their identifiers. cmi5 units are launched with the parameters of cmi5, fetch their token once, and send their statements to an xAPI endpoint of the bundle, which checks them against the rules of cmi5 before a learning record store keeps them. The platform issues the satisfied statement of each block once its required units are satisfied, then of the course, once for each enrollment. The store inside the bundle keeps the statements through DBAL; the bundle also sends them to a remote xAPI learning record store through the guarded client of phil/safe-http, the state documents of the units staying in the application's database, and an application's own store plugs into the same port.

An xAPI package runs as an activity of its own: launched with the parameters xAPI packages read and a token of its session, it talks to the same xAPI endpoint, its statements checked — the learner of the session, the registration of the enrollment, no voiding — and its completed, passed and failed statements, or the completion and success the result of another verb reports, move the learner's progress, with a mastery score when it has one. Its package is imported through the reader of tincan.xml of phil/elearning-packages, which an application may replace.

A course can be mandatory: assigned to a learner, to the members of a group or of a unit, by a due moment, each member enrolled and reminded through phil/notifications-bundle before, on and after the due moment, the person who assigned it told once it is overdue; the learner and the managers see the overdue state on their pages. A recertification renews a completion after a number of months, read by phil/recurrence, and the learner takes the course again. A course grants credits — continuing education units or hours — on its completion, and each completion enters the learner's transcript, a page, JSON and CSV. Symfony Scheduler runs the reminders every day.

A learning path is an ordered sequence of courses, each waiting for courses placed before it. A learner enrolls in the path once, and is enrolled in each course as its prerequisites are completed; the path is completed once its required courses are, with the PathCompleted event.

The same training given in several languages is a group of equivalent courses, one course per language. The outline shows the other languages, and an address leads to the course of the learner's language. Completing one course of the group completes them all: for the paths, the mandatory training, the credits — granted once — and the certificates.

Catalogues list the courses a learner may take: a public catalogue shown to everyone, visitors signed out included, and private catalogues, each shown to the members of one unit of an organization and of the units below it — with phil/organizations-bundle, read from its tree of units. A catalogue places its courses in an order, filters them by words, tag and price, sorts them by title, by date or by price, a page at a time, and lists a group of equivalent courses once, in the learner's language, with where the learner stands in each — enrolled, completed, mandatory for them. A learner enrolls themselves in a free course the catalogue opens to it; a course with a price is sold through phil/commerce-bundle, and its buyer is enrolled once the order is paid.

Another part of the application — certificates, badges, a report — asks Completions whether a learner completed a course, and keeps its own model; with phil/certificates-bundle, the bundle answers its CourseCompletions port, for the courses and for the learning paths.

The services keep no state between requests and are safe in a long-running worker. The stores use DBAL, and are tested on SQLite, MySQL 8.4 and PostgreSQL 17.

Status

Part State
Courses, modules and activities through DBAL; activity types as a port with the page, link, SCORM, cmi5 and xAPI adapters Implemented and tested
Enrollment, progress by activity, the requirement of each activity, completion by course, events of PSR-14 Implemented and tested
Completions, and the adapter of the CourseCompletions port of phil/certificates-bundle 0.2 Implemented and tested
Release on a date or days after the enrollment in the site's time zone; imposed order Implemented and tested
Second chances asked for, granted, refused or answered by a waiver with a note, the trail of phil/audit-bundle Implemented and tested
The administration page of the second chances, behind a configurable role, with the recipes of the kit, English and French Implemented and tested
The import of SCORM 1.2 and 2004 packages through phil/elearning-packages, sequencing kept for information, results imported from a CSV export Implemented and tested
The SCORM run time: the API of SCORM 1.2 and 2004 in the browser, every element of their data models checked in the browser and on the server, attempts suspended, resumed and attempted again, tracking data kept, progress recorded, navigation requests followed Implemented, tested on SQLite, MySQL and PostgreSQL, and fuzzed
The review of an ended SCORM attempt, read-only, and the time limits of the manifest and of the activity, enforced on the server Implemented, tested on SQLite, MySQL and PostgreSQL
The tracking data of the SCORM attempts and the cmi5 records of a learner — launch sessions, statements, state documents — in the access and erasure requests of phil/privacy-bundle; what a remote learning record store keeps said in the export Implemented and tested
The sequencing and navigation of SCORM 2004 beyond the flow and the choice of the outline: rules, rollup, shared objectives Not yet: see SCORM run time
The import of cmi5 packages and course structures, through phil/elearning-packages, the tree of the blocks kept, a unit whose moveOn is NotApplicable not required Implemented and tested
cmi5 launches, the fetch URL, the xAPI endpoint with the rules of cmi5, the learning record store as a port Implemented and tested
The satisfied statements of the blocks, innermost first, and of the course, once for each enrollment, named by the course structure, with the BlockSatisfied event Implemented and tested
The remote xAPI learning record store through phil/safe-http, for the statements Implemented and tested; its integration test runs against a store the environment names
xAPI activities: the launch parameters of xAPI packages, the token of the session, the statements checked and kept, completion, success and score from completed, passed and failed and from the result of any other verb, a mastery score, state documents put whole or merged, their records in the privacy module of cmi5 Implemented and tested
The import of xAPI packages, through the XapiPackageReader port and its adapter on the reader of phil/elearning-packages Implemented and tested
Learning paths: ordered courses with prerequisites, the enrollment in the path, its completion with PathCompleted and through the CourseCompletions port of phil/certificates-bundle, its privacy module Implemented, tested on SQLite, MySQL and PostgreSQL
Groups of equivalent courses: one course per language, the course of the learner's language, the completion recognised across the group for the paths, the mandatory training and the credits Implemented, tested on SQLite, MySQL and PostgreSQL
The pages of the learning paths and of the groups of equivalent courses Not yet: the application draws them on LearningPaths and Equivalences
Catalogues: a public one and one per unit of an organization, the units of phil/organizations-bundle, courses placed in order, filters, sorts and pages, a group of equivalent courses listed once, where the learner stands, self-enrollment, and their pages with the recipes of the kit, English and French Implemented, tested on SQLite, MySQL and PostgreSQL, and fuzzed
Courses sold from a catalogue through phil/commerce-bundle: the sellables of type course, the buyer enrolled once the order is paid, the CourseCheckout port to the application's cart Implemented and tested
Mandatory training: courses assigned to a learner, a group or a unit by a due moment, reminders before, on and after it through phil/notifications-bundle and Symfony Scheduler, the overdue state on the learner's and the managers' pages Implemented and tested
Recertification through phil/recurrence: a completion renewed after a number of months, the enrollment starting again Implemented and tested
Credits in continuing education units or hours, the transcript as a page, JSON and CSV, its privacy module Implemented and tested
The state documents of the units with a remote store Kept in the store inside the bundle, never sent: the port names no agent, which the State resource of xAPI asks for
A remote store on a private network Refused by phil/safe-http: an application's own adapter of the port reaches it
The upgrade of the tables of an earlier schema, on SQLite, MySQL and PostgreSQL Implemented and tested
The content served from its own origin, with its content security policy Implemented and tested
phil:courses:import, phil:courses:import-results, phil:courses:retries Implemented and tested
The pages — outline, activity, enrollment, second chance — with the recipes of the kit, English and French Implemented and tested
The Flex recipe: the bundle, its configuration and its routes Written in recipe/0.2, for the recipes repository of PHIL; recipe/0.1 serves the versions 0.1
Branching lessons through phil/story-graph, quizzes through phil/assessment, access through phil/content-access Planned, as activity types and an access port, once those libraries are written
LTI 1.3 activities, hosted video with consented watch tracking Planned, as activity types the LTI and video bundles add
Cohorts with live meetings, multilingual courses of translated content Planned

Documentation

Document What it covers
Installation Requirements, the tables and their upgrade, the routes, the content origin, the recipes of the kit, the recipe.
Configuration Every option, with an example.
The course model Courses, modules, blocks, activities, enrollments, progress, releases, order and second chances, with their administration page.
SCORM import What a SCORM package becomes, what is kept for information, what is left out, and imported results.
SCORM run time How a SCO runs: the API in the browser, the commit endpoint, attempts, progress, packages of several SCOs, what is supported and what is not yet, privacy.
cmi5 The import of cmi5 packages and their blocks, the launch, the fetch URL, the xAPI endpoint, the satisfied statements and the learning record stores, inside the bundle or remote.
xAPI activities xAPI packages as activities: the launch, the statements, the outcome they record, their import, privacy.
Mandatory training Courses assigned by a due moment, groups and units, the states, the reminders, the run and its schedule, recertification.
Credits and transcripts The credits of the courses, the transcript as a page, JSON and CSV, and its privacy.
Training reports The completions as the training source of phil/reporting-bundle: hours and costs by organisational unit and period, the 1 % of payroll template, the costs and units the application gives.
Learning paths Ordered courses with prerequisites, the enrollment in a path, its progress and its completion, certificates and badges, privacy.
Equivalent courses One training in several languages: the groups, the course of the learner's language, the completion recognised across the group.
Catalogues The public catalogue and those of the units, the order of the courses, filters, sorts and pages, self-enrollment, the courses sold through phil/commerce-bundle, the pages.
Security The bounds of the archive and the manifest, the content origin and its headers, the SCORM run time, the remote store, the administration page, the catalogues.
Extension points The ports, the events, the services to replace, and when they are stable.
Testing The bundle's tests, the servers and the learning record store its integration tests read, and the fuzz target.
Reference Every class and file of the bundle.

Quick start

composer require phil/courses-bundle
php bin/console ux:install button badge input native-select progress textarea --kit=github.com/parler-haut-interagir-librement/ux-kit
# config/packages/phil_courses.yaml
phil_courses:
    timezone: America/Toronto
    content:
        base_url: 'https://content.example.org'
        application_origin: 'https://www.example.org'
    cmi5:
        actor_home_page: 'https://www.example.org'
php bin/console phil:courses:import var/import/safety-course.zip

Requirements

PHP 8.5 or later with the mbstring and sodium extensions, and those phil/elearning-packages reads packages with — dom, libxml and zip —, Symfony 8.2 or later, and Doctrine DBAL 4.5. The remote learning record store needs phil/safe-http, the administration pages Symfony Security, the SCORM run time symfony/stimulus-bundle with AssetMapper, the reminders of the mandatory training phil/notifications-bundle, and their schedule symfony/scheduler with symfony/messenger.

Contributing

Contributions are welcome on the PHIL monorepo: read the contribution guide and the code of conduct. Report a vulnerability privately, as the security policy explains, never in a public issue.

License

MIT, © Philippe Gamache, doing business as Le Gnome Archiviste; a Parler Haut Interagir Librement project. See LICENSE.