Cohort Membership
Add, remove, and sync Moodle cohort memberships via CSV, with dry-run and an HTML/CSV report — fills the gap left by MDL-61007.
Download and compatibility
verification ledger
Source tagged by maintainer
github.com/tkorner/moodle-local_cohortmembership @ v1.0.4 · commit b3ec27a5f0f0
Rebuilt deterministically from that tag
canonical ZIP, byte-identical on every rebuild
Artifact hash recorded in the public index
sha256 8f5a7682442cad70ee15b56dab38a574cae18d5df7c2534a3eb4cbab9b6761f6
Release signed · trusted publishing
planned — TUF signing (RFC §4.3)
Recorded in public transparency log
planned — Sigstore/Rekor (RFC §4.3)
composer require tkorner/moodle-local_cohortmembership
All versions
About
Manages cohort memberships via CSV: add users to cohorts, remove them, or sync a user's cohort memberships to a desired state. UI-based (CSV upload) with dry-run, HTML report and CSV download; two CLI entry points are also provided.
Why this plugin exists
Moodle core has no built-in way to remove users from cohorts via CSV or
the UI — this is an open tracker request,
MDL-61007, open since 2017.
Core's tool_uploaduser already covers add via cohort1,cohort2,...
columns, and the core_cohort_delete_cohort_members web service covers
remove programmatically, but neither has a UI, a dry-run, or a report.
This plugin fills that gap and extends it to cover add, del and sync — one CSV format, one report, one dry-run, for all three operations.
Guardrails
- Never auto-creates cohorts — an unknown cohort is an error row in the report, never a new cohort.
- Dry-run is the default.
- All membership changes go exclusively through Moodle's
cohort_add_member()/cohort_remove_member(). - A single bad CSV row never aborts the whole run.
- Every removal is flagged if the cohort is used by an active Cohort sync enrolment method, since removal there also unenrols the user from the course.