# Features — doh_moodle

Evidence date: 2026-10-16.

Source: `main` at `b9db23cf` (2026-06-24).

**Current** means the code is in this tree. **Installed** on a server is a database flag and was not observed. Stock Moodle 4.5 activities, blocks, and themes are present and are not listed one by one.

## Platform

| Feature | Status | Evidence |
|---|---|---|
| Moodle 4.5.7+ (build 20251009), branch 405 | Current | `version.php` |
| Themes `boost` and `classic` only | Current | `theme/` directories |
| Stock block set (no extra block plugin directory) | Current | `blocks/` directory names match a standard Moodle tree |
| GPL-3.0-or-later | Current | `composer.json`, `COPYING.txt` |

## Overdrive features (current)

### Gibbon Cohort Sync — release 1.2.0

Path: `local/gibbon_cohort/`. Plugin version `2026031903`. Maturity alpha. Requires Moodle 4.1+.

| Feature | Status | Evidence |
|---|---|---|
| One scheduled task, every 5 minutes, runs the steps in order | Current | `db/tasks.php`, `classes/task/sync_all.php` |
| Separate task classes for cohorts, members, enrolments, group modes | Current as classes. Not registered as their own cron tasks | `classes/task/sync_*.php`. README still documents the old schedule |
| Read Gibbon views with configurable names and field names | Current | `settings.php` |
| Create and update cohorts with `component = local_gibbon_cohort` | Current | `classes/task/sync_cohorts.php` |
| Delete orphan cohorts only when that component is set | Current | same file, README |
| Add cohort members by username | Current | `sync_cohort_members.php` |
| Remove absent members only when auth_db remove-user is full delete; never remove suspended users | Current | `sync_cohort_members.php` lines 62–73 and 313–315. README section matches. An earlier README sentence does not |
| Cohort enrolment instances from `moodleCohortCourse` | Current | `sync_cohort_enrolments.php` |
| Role map, default `Teacher\|editingteacher`, `Lecturer\|editingteacher`, `Student\|student`, `Assistant\|teacher` | Current | `settings.php` default; `parse_role_mapping()` |
| Remove this cohort's enrol roles and empty-component manual roles; keep other enrol components | Current | `assign_user_roles()` |
| Optional course groups, default off, with backfill | Current | setting `creategroups` default 0; commit `69251cfb` |
| Force separate groups and force group mode on courses from the enrol_database new-course table, and on their modules | Current | `course_group_mode_sync.php` |
| Sync per-cohort credits, pass mark, core flag | Current | `credits_sync.php`, table `local_gibbon_cohort_credits` |
| Sync year-group minimum credits; delete rows no longer in the view | Current | `credits_sync.php` `delete_records` on `local_gibbon_cohort_yeargroup` |
| Sync course to year-group list; delete rows no longer in the view | Current | table `local_gibbon_cohort_course_yeargroup` |
| Award user credits from the course total versus pass mark; recalculate when pass mark or credit values change | Current | `event/observer.php`, `recalc_user_credits_for_cohort` |
| My credits in primary nav and user menu | Current | `db/hooks.php`, `hook_callbacks.php`, `my_credits.php` |
| Capability `local/gibbon_cohort:manage` for manager | Current as a definition. No screen was found that requires it | `db/access.php` |
| Batch sizes default 1000 (cohorts/enrolments) and 500 (members) | Current | `settings.php` |
| Statistics written to the PHP error log with prefix `local_gibbon_cohort` | Current | README and `error_log` calls |
| `GRADES_AND_CREDITS.md`, `GRADES_SYSTEM.md` | Current documentation | plugin directory |
| `TESTING.md` linked from the README | Not in the tree | README link; file absent |

### Gibbon Sync web services — release 1.0

Path: `local/gibbon_sync/`. Plugin version `2025112000`. Maturity alpha. Requires Moodle 4.0+.

| Feature | Status | Evidence |
|---|---|---|
| External service "Gibbon Sync Service" (`gibbon_sync`), declared enabled | Current | `db/services.php` |
| `local_gibbon_sync_get_students` | Current | `classes/api/grades.php` |
| `local_gibbon_sync_get_grades` including credits and pass mark | Current | same file. Commit `cf578896` "Add credites to grade response" |
| `local_gibbon_sync_get_courses` and `get_course` | Current | `classes/external/`. Commit `e97c78ce` |
| `local_gibbon_sync_sync_grades` feedback update | Current | `grades.php`. README calls this bidirectional grade sync |
| API key required on every function | Current | key check throws if empty or mismatched |
| Admin fields for Gibbon URL and Gibbon DB credentials | Current as settings. No caller | `settings.php`. Language string says future webhook support |
| Table `gibbon_sync_course_mapping` | Schema only. No PHP uses the table name | `db/install.xml` |
| One-off scripts `fix_webservice.php`, `diagnose_webservice.php`, `list_courses.php`, and similar | Current files under the plugin. Not product screens | plugin root |

### Course start date — release 1.0.0

Path: `local/course_startdate/`. Plugin version `2026051802`. Maturity stable. Copyright 2026.

| Feature | Status | Evidence |
|---|---|---|
| Hide not-yet-started courses from students in course lists | Current | `lib.php` filter callback |
| Redirect students who open the course to `/my/courses.php` | Current | `local_course_startdate_after_require_login` |
| Bypass for site admin and course update / manage activities / view hidden courses | Current | `course_access.php` |
| Grace period toggle, default on, using Moodle's future-course grace | Current | `settings.php` |
| Enabled by default | Current | setting default 1 |
| PHPUnit tests | Current | `tests/course_access_test.php` |
| Does not unenrol | Current | class comment and the methods, which do not touch `user_enrolments` |

Commit: `765c21c0` (2026-05-22, "Hide courses from students before course start date").

### Azure AI plagiarism detection — release 1.0.0

Path: `plagiarism/azureai/`. Plugin version `2025101501`. Maturity stable. Requires Moodle 4.1+.

| Feature | Status | Evidence |
|---|---|---|
| Global enable, endpoint, key, timeout (default 60 seconds), provider | Current | `settings.php`, language strings |
| Providers referenced in settings: `azure` (default), GPTZero, check-plagiarism.com | Current | `settings.php` default URLs |
| Per-assignment enable, student-visible report, threshold | Current on assignment forms only | `lib.php` `coursemodule_standard_elements` returns unless modulename is `assign` |
| Queue on assignment online text and file submit/update | Current | `db/events.php`, observer |
| Queue on quiz attempt submitted, if that module's `use` flag is 1 | Current observer. The form does not set that flag for quizzes | `quiz_submitted` |
| Adhoc task sends submission text and stores processing/failed/parsed result | Current | `classes/task/process_queue.php`, table `plagiarism_azureai_results` |
| Legacy `$plugin->cron = 300` while `db/tasks.php` registers nothing | Current. The comment says cron picks up adhoc tasks | `version.php`, `db/tasks.php` |
| Diagnostic scripts and markdown checklists in the plugin directory | Current files | `verify_production.php`, `INSTALLATION_CHECKLIST.md`, curl samples |

### Moodle Adminer — 4.8.2

Path: `local/adminer/`. Author Andreas Grabs. Maturity stable.

| Feature | Status | Evidence |
|---|---|---|
| Database UI under Site administration → Server → Moodle Adminer | Current | `README.md` |
| Not an Overdrive feature | Current | `version.php` copyright |

### Gibbon client checked into this repo

Path: `gibbon_module/MoodleSync/`. This is Gibbon PHP, not a Moodle plugin.

| Feature | Status | Evidence |
|---|---|---|
| Settings, manual sync, student sync, grade sync | Current as files | `gibbon_module/README.md` |
| Calls `local_gibbon_sync_get_students` and `get_grades` | Current | README |
| Standalone script `GIBBON_STANDALONE_SYNC.php` | Current | README |
| Install instructions that say copy the folder into a Gibbon tree | Current | `INSTALL_IN_GIBBON.md` |

`doh_sims` documents a different module, LMS Sync, as the client of the same web services. Two clients exist across the two repositories. Which one a server runs is **Unknown**.

## Root scripts that are not Moodle core

These PHP files sit in the repository root next to `index.php`. They are diagnostic or maintenance scripts (names such as `check_plugin_status.php`, `check_gibbon_module_registration.php`, `assign_admin_role.php`, `run_plagiarism_cron.php`, `manual_update.php`, `debug_check.php`). They are **current files**. They are not registered Moodle pages in `lib/db`. Whether a web server executes them is **Requires confirmation**. They should be treated as operational leftovers until someone confirms they are meant to be deployed.

`config.php` is not in the tree. `configx.php` is committed and is a local Moodle config (wwwroot `http://localhost/moodle_stable`, database `moodle_stable`). It contains credentials. Values are not recorded in Silicon Ark.

`NewKnowledgeBase.md` says config files should be gitignored. The `.gitignore` "Config files" section is empty. Commit `57ac79f2` (2025-12-11) is "removed *Config from gitignore".

## Recently changed (git, newest first)

| Date | Change | Commit |
|---|---|---|
| 2026-06-24 | Azure Pipelines YAML updated | `b9db23cf` |
| 2026-06-15 | Cohort sync backfills group creation | `69251cfb` |
| 2026-06-03 | Azure Pipelines added | `c2e19b96` |
| 2026-05-22 | Hide courses before start date | `765c21c0` |
| 2026-03-20 | Cohort member removal follows auth_db remove-user | `3d9c9f40` |
| 2026-03-05 | My credits page | `2bdeb758` |
| 2026-02-20 | Credit integration and recalculation when pass mark or credits change | `60b6c31a`, `f6ad0db8` |
| 2026-02-05 | Group settings on synced modules | `1a5c746b` |
| 2026-01-13 | Separate tasks consolidated into `sync_all` | `0ca23e7a` |

## Planned

| Item | Evidence | Status |
|---|---|---|
| Gibbon URL on `local_gibbon_sync` "for future webhook support" | language string `gibbon_url_desc` | **Planned** in that string. No webhook code |
| Direct Gibbon database access from `local_gibbon_sync` | settings heading "Optional". No reader | **Not implemented** |
| QA and production Azure deploy | comments in `azure-pipelines.yml` naming `-qa` and `-prod` groups | **Named only** |
| README `TESTING.md` for cohort sync | link in README | **Missing file** |

## Deprecated or removed

No plugin in this tree is marked deprecated. The three standalone cohort cron tasks were replaced as the schedule by `sync_all` (commit `0ca23e7a`). The classes remain.

`local_gibbon_cohort_credits` rows are inserted and updated. Deletion of a credits row when the Gibbon view loses that cohort was not found. Year-group and course-year-group rows are deleted when absent from the view.

## Not in this repository

- Gibbon itself, including the SQL that defines the views. Expected view names are documented here. The view bodies live in Gibbon (`doh_sims` documents several `moodle*` views; `moodleCourse` is read by this plugin and is not named in the `doh_sims` Silicon Ark set).
- A custom authentication plugin. User creation is left to Moodle, with the README pointing at `auth_db`.
- A production `config.php`.
