# lsweatman/mmpi_2_grader architecture

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

- Interactive diagram: https://gitdiagram.com/lsweatman/mmpi_2_grader
- Repository: https://github.com/lsweatman/mmpi_2_grader

## Overview

MMPI_2_Grader is a Windows UI for entering test-taker details and answers, scoring a selected CSV, and producing a PDF with scale charts. The documented workflow also supports viewing the CSV, printing the current user’s PDF, and resetting the graphs. The graph separates answer capture, score calculation, visualization, and output. Source excerpts show the UI-to-grader relationship and the grader’s raw-scale and PDF-generation calls; links through the unsampled calculation and chart stages are marked unverified.

Main entry points: [`PrimaryUI.cs`](https://github.com/lsweatman/mmpi_2_grader/blob/master/PrimaryUI.cs) (Grading UI), [`Grading/Grader.cs`](https://github.com/lsweatman/mmpi_2_grader/blob/master/Grading/Grader.cs) (Grader), [`Generation/PDFGeneration.cs`](https://github.com/lsweatman/mmpi_2_grader/blob/master/Generation/PDFGeneration.cs) (PDF Generation), [`Static/RawScales.cs`](https://github.com/lsweatman/mmpi_2_grader/blob/master/Static/RawScales.cs) (Raw Scales)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["User Input"]
  node_ui["Grading UI<br/>[PrimaryUI.cs]"]
  node_answer["Answer Capture<br/>[PrimaryUI.cs]"]
  node_reset["Graph Reset<br/>[PrimaryUI.cs]"]
end

subgraph group_scoring["Scoring"]
  node_grader["Grader<br/>[Grader.cs]"]
  node_raw["Raw Scales<br/>[RawScales.cs]"]
  node_rawsub["Raw Subscales<br/>[RawToSubscales.cs]"]
  node_final["Final Scores"]
  node_adjusted["Adjusted Scales<br/>[AdjustedScales.cs]"]
end

subgraph group_report["Reporting"]
  node_charts["Chart Generation<br/>[ChartGenerator.cs]"]
  node_pdfgen["PDF Generation<br/>[PDFGeneration.cs]"]
end

subgraph group_output["File Output"]
  node_csv["User CSV"]
  node_pdf["Score PDF"]
  node_print["Print Current User"]
end

node_person(("Test Taker"))
node_operator(("Operator"))

node_operator -->|"uses"| node_ui
node_person -->|"provides answers"| node_answer
node_ui -->|"captures"| node_answer
node_ui -->|"scores CSV"| node_grader
node_ui -->|"creates"| node_csv
node_grader -.->|"reads answers"| node_csv
node_grader -->|"loads raw scales"| node_raw
node_raw -.->|"feeds"| node_rawsub
node_rawsub -.->|"feeds"| node_final
node_final -.->|"uses"| node_adjusted
node_grader -.->|"requests charts"| node_charts
node_grader -->|"generates report"| node_pdfgen
node_charts -.->|"supplies charts"| node_pdfgen
node_pdfgen -->|"writes"| node_pdf
node_ui -->|"opens print prompt"| node_print
node_print -->|"prints"| node_pdf
node_operator -->|"resets graphs"| node_reset

click node_ui "https://github.com/lsweatman/mmpi_2_grader/blob/master/PrimaryUI.cs"
click node_answer "https://github.com/lsweatman/mmpi_2_grader/blob/master/PrimaryUI.cs"
click node_grader "https://github.com/lsweatman/mmpi_2_grader/blob/master/Grading/Grader.cs"
click node_raw "https://github.com/lsweatman/mmpi_2_grader/blob/master/Static/RawScales.cs"
click node_rawsub "https://github.com/lsweatman/mmpi_2_grader/blob/master/Grading/RawToSubscales.cs"
click node_final "https://github.com/lsweatman/mmpi_2_grader/blob/master/Grading/SubscalesToFinalCalc.cs"
click node_adjusted "https://github.com/lsweatman/mmpi_2_grader/blob/master/Static/AdjustedScales.cs"
click node_charts "https://github.com/lsweatman/mmpi_2_grader/blob/master/Generation/ChartGenerator.cs"
click node_pdfgen "https://github.com/lsweatman/mmpi_2_grader/blob/master/Generation/PDFGeneration.cs"
click node_reset "https://github.com/lsweatman/mmpi_2_grader/blob/master/PrimaryUI.cs"

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_ui,node_answer,node_reset toneBlue
class node_grader,node_raw,node_rawsub,node_final,node_adjusted toneAmber
class node_charts,node_pdfgen toneMint
class node_csv,node_pdf,node_print toneRose
class node_person,node_operator toneIndigo
```

## Components

### User Input

- [Grading UI](https://github.com/lsweatman/mmpi_2_grader/blob/master/PrimaryUI.cs): `PrimaryUI.cs`
- [Answer Capture](https://github.com/lsweatman/mmpi_2_grader/blob/master/PrimaryUI.cs): `PrimaryUI.cs`
- [Graph Reset](https://github.com/lsweatman/mmpi_2_grader/blob/master/PrimaryUI.cs): `PrimaryUI.cs`

### Scoring

- [Grader](https://github.com/lsweatman/mmpi_2_grader/blob/master/Grading/Grader.cs): `Grading/Grader.cs`
- [Raw Scales](https://github.com/lsweatman/mmpi_2_grader/blob/master/Static/RawScales.cs): `Static/RawScales.cs`
- [Raw Subscales](https://github.com/lsweatman/mmpi_2_grader/blob/master/Grading/RawToSubscales.cs): `Grading/RawToSubscales.cs`
- [Final Scores](https://github.com/lsweatman/mmpi_2_grader/blob/master/Grading/SubscalesToFinalCalc.cs): `Grading/SubscalesToFinalCalc.cs`
- [Adjusted Scales](https://github.com/lsweatman/mmpi_2_grader/blob/master/Static/AdjustedScales.cs): `Static/AdjustedScales.cs`

### Reporting

- [Chart Generation](https://github.com/lsweatman/mmpi_2_grader/blob/master/Generation/ChartGenerator.cs): `Generation/ChartGenerator.cs`
- [PDF Generation](https://github.com/lsweatman/mmpi_2_grader/blob/master/Generation/PDFGeneration.cs): `Generation/PDFGeneration.cs`

### File Output

- **User CSV**
- **Score PDF**
- **Print Current User**

### Other components

- **Test Taker**
- **Operator**

## Connections

- Operator → Grading UI: uses
- Test Taker → Answer Capture: provides answers
- Grading UI → Answer Capture: captures (evidence: `PrimaryUI.cs`)
- Grading UI → Grader: scores CSV (evidence: `PrimaryUI.cs`)
- Grading UI → User CSV: creates
- Grader → User CSV: reads answers
- Grader → Raw Scales: loads raw scales (evidence: `Grading/Grader.cs`)
- Raw Scales → Raw Subscales: feeds
- Raw Subscales → Final Scores: feeds
- Final Scores → Adjusted Scales: uses
- Grader → Chart Generation: requests charts (evidence: `Grading/Grader.cs`)
- Grader → PDF Generation: generates report (evidence: `Grading/Grader.cs`)
- Chart Generation → PDF Generation: supplies charts
- PDF Generation → Score PDF: writes
- Grading UI → Print Current User: opens print prompt
- Print Current User → Score PDF: prints
- Operator → Graph Reset: resets graphs
