# gabrielkaos/auto-gradesheet-plugin-moodle architecture

> Architecture diagram of the GitHub repository gabrielkaos/auto-gradesheet-plugin-moodle, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gabrielkaos/auto-gradesheet-plugin-moodle
- Repository: https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle

## Overview

This Moodle plugin turns course grade data and course settings into student/faculty grade views and official report sheets. The principal workflow runs from course navigation to the dashboard, through grade computation, and into preview or PDF/Excel export; faculty can also configure course and section details. The README documents these product capabilities and the service’s use by report pages. Some implementation links are not shown in the excerpts, so those are marked unverified rather than asserted as direct calls.

Main entry points: [`index.php`](https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/index.php) (Grade dashboard), [`classes/gradesheet_service.php`](https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/classes/gradesheet_service.php) (Batch grade service), [`db/install.xml`](https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/db/install.xml) (Plugin data tables), [`export.php`](https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/export.php) (PDF export)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Navigation and views"]
  node_navigation["Course navigation<br/>[lib.php]"]
  node_dashboard["Grade dashboard<br/>[index.php]"]
end

subgraph group_grading["Grade processing"]
  node_helper["Grade/config helpers<br/>[helper.php]"]
  node_formula["Grade formula<br/>[formula.php]"]
  node_service["Batch grade service"]
  node_status["Student status<br/>[helper.php]"]
end

subgraph group_reports["Report output"]
  node_preview["HTML preview<br/>[preview.php]"]
  node_pdfexport["PDF export<br/>[export.php]"]
  node_pdfbuilder["PDF document builder<br/>[pdf_builder.php]"]
  node_pdfadapter["PDF adapter<br/>[gradesheet_pdf.php]"]
  node_excel["Excel export<br/>[export_excel.php]"]
  node_sectionzip["Section PDF bundle<br/>[export_all.php]"]
end

subgraph group_configuration["Configuration"]
  node_settings["Course settings"]
  node_formhooks["Course form hooks<br/>[hooks.php]"]
  node_store[("Plugin data tables<br/>[install.xml]")]
end

subgraph group_lifecycle["Course lifecycle"]
  node_observer["Course creation observer<br/>[observer.php]"]
  node_eventregistration["Course event registration<br/>[events.php]"]
  node_privacy["Privacy provider<br/>[provider.php]"]
end

node_faculty(("Faculty/admin"))
node_student(("Student"))

node_faculty -->|"opens course"| node_navigation
node_student -->|"opens course"| node_navigation
node_navigation -->|"links to"| node_dashboard
node_faculty -->|"configures"| node_settings
node_settings -.->|"saves settings"| node_store
node_formhooks -.->|"loads settings"| node_store
node_dashboard -->|"computes grades"| node_helper
node_dashboard -.->|"sets status"| node_status
node_helper -.->|"applies formula"| node_formula
node_preview -->|"requests rows"| node_service
node_pdfexport -->|"requests rows"| node_service
node_excel -->|"requests rows"| node_service
node_service -->|"computes student grades"| node_helper
node_pdfexport -.->|"builds PDF"| node_pdfbuilder
node_pdfbuilder -.->|"uses adapter"| node_pdfadapter
node_dashboard -->|"opens preview"| node_preview
node_dashboard -->|"exports PDF"| node_pdfexport
node_dashboard -->|"exports Excel"| node_excel
node_dashboard -->|"downloads sections"| node_sectionzip
node_eventregistration -->|"registers observer"| node_observer
node_observer -.->|"initializes defaults"| node_store
node_privacy -->|"exports/deletes data"| node_store

click node_navigation "https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/lib.php"
click node_dashboard "https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/index.php"
click node_settings "https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/course_settings.php"
click node_formhooks "https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/classes/hooks.php"
click node_helper "https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/classes/helper.php"
click node_formula "https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/classes/formula.php"
click node_service "https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/classes/gradesheet_service.php"
click node_status "https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/classes/helper.php"
click node_preview "https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/preview.php"
click node_pdfexport "https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/export.php"
click node_pdfbuilder "https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/classes/pdf_builder.php"
click node_pdfadapter "https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/classes/gradesheet_pdf.php"
click node_excel "https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/export_excel.php"
click node_sectionzip "https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/export_all.php"
click node_store "https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/db/install.xml"
click node_observer "https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/classes/observer.php"
click node_eventregistration "https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/db/events.php"
click node_privacy "https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/classes/privacy/provider.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_navigation,node_dashboard toneBlue
class node_helper,node_formula,node_service,node_status toneAmber
class node_preview,node_pdfexport,node_pdfbuilder,node_pdfadapter,node_excel,node_sectionzip toneMint
class node_settings,node_formhooks,node_store toneRose
class node_observer,node_eventregistration,node_privacy,node_faculty,node_student toneIndigo
```

## Components

### Navigation and views

- [Course navigation](https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/lib.php): `lib.php`
- [Grade dashboard](https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/index.php): `index.php`

### Grade processing

- [Grade/config helpers](https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/classes/helper.php): `classes/helper.php`
- [Grade formula](https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/classes/formula.php): `classes/formula.php`
- [Batch grade service](https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/classes/gradesheet_service.php): `classes/gradesheet_service.php`
- [Student status](https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/classes/helper.php): `classes/helper.php`

### Report output

- [HTML preview](https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/preview.php): `preview.php`
- [PDF export](https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/export.php): `export.php`
- [PDF document builder](https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/classes/pdf_builder.php): `classes/pdf_builder.php`
- [PDF adapter](https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/classes/gradesheet_pdf.php): `classes/gradesheet_pdf.php`
- [Excel export](https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/export_excel.php): `export_excel.php`
- [Section PDF bundle](https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/export_all.php): `export_all.php`

### Configuration

- [Course settings](https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/course_settings.php): `course_settings.php`
- [Course form hooks](https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/classes/hooks.php): `classes/hooks.php`
- [Plugin data tables](https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/db/install.xml): `db/install.xml`

### Course lifecycle

- [Course creation observer](https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/classes/observer.php): `classes/observer.php`
- [Course event registration](https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/db/events.php): `db/events.php`
- [Privacy provider](https://github.com/gabrielkaos/auto-gradesheet-plugin-moodle/blob/main/classes/privacy/provider.php): `classes/privacy/provider.php`

### Other components

- **Faculty/admin**
- **Student**

## Connections

- Faculty/admin → Course navigation: opens course (evidence: `README.md`)
- Student → Course navigation: opens course (evidence: `README.md`)
- Course navigation → Grade dashboard: links to (evidence: `lib.php`)
- Faculty/admin → Course settings: configures (evidence: `README.md`)
- Course settings → Plugin data tables: saves settings
- Course form hooks → Plugin data tables: loads settings
- Grade dashboard → Grade/config helpers: computes grades (evidence: `index.php`)
- Grade dashboard → Student status: sets status
- Grade/config helpers → Grade formula: applies formula
- HTML preview → Batch grade service: requests rows (evidence: `README.md`)
- PDF export → Batch grade service: requests rows (evidence: `README.md`)
- Excel export → Batch grade service: requests rows (evidence: `README.md`)
- Batch grade service → Grade/config helpers: computes student grades (evidence: `classes/gradesheet_service.php`)
- PDF export → PDF document builder: builds PDF
- PDF document builder → PDF adapter: uses adapter
- Grade dashboard → HTML preview: opens preview (evidence: `README.md`)
- Grade dashboard → PDF export: exports PDF (evidence: `README.md`)
- Grade dashboard → Excel export: exports Excel (evidence: `README.md`)
- Grade dashboard → Section PDF bundle: downloads sections (evidence: `README.md`)
- Course event registration → Course creation observer: registers observer (evidence: `db/events.php`)
- Course creation observer → Plugin data tables: initializes defaults
- Privacy provider → Plugin data tables: exports/deletes data (evidence: `classes/privacy/provider.php`)
