Functional Weave
Code in Rust

education.degree-classification@1.0.0

README.md

2,402 bytes · view raw

# education.degree-classification

The classification of a UK bachelor's degree with honours from module marks:
each counted level's credit-weighted mean mark, combined by the level weights
the caller supplies, rounded as the caller says, and banded:

| class | average |
|---|---|
| First | 70 and above |
| Upper second (2:1) | 60 to 69 |
| Lower second (2:2) | 50 to 59 |
| Third | 40 to 49 |
| Unclassified | below 40 |

## Institutions differ, so the algorithm is arguments

The four bands are the sector's convention, but every university writes its
own degree algorithm: which levels count (level 4, the first year, usually
does not), the weight of each (1:2, 40:60, 25:75 and 0:100 are all in use),
and whether the average is rounded to a whole mark (69.5 becomes a First) or
to one place (69.5 stays a 2:1) before banding. So the level weights, the
places and the rounding mode are all the caller's. Use `mode` `down` to
classify on the unrounded average: truncation never lifts a mark across a
boundary.

Not modelled: borderline and preponderance rules (a 68.5 lifted to a First
because most credits are at First level), discounting the worst 20 credits,
capped resits, compensation, and integrated masters or Scottish four-year
honours schemes. Apply those to the inputs, or to the result, as your
regulations say. The bands are a convention, not dated rules, so the table
ships whole with no `effective` columns.

## Decisions

- **Two stages of weighting.** Marks are averaged by credits within a level,
  then levels by their weight. Averaging every module by credits alone, or
  taking the plain mean of module marks, gives a different answer; a vector
  pins the difference.
- `average` is the exact fraction; `scaled` is it rounded once.
- A level with weight above 0 but no modules is an error: a transcript
  missing its final year should not be classified on its second.

## Sources

- Universities UK and GuildHE, "Principles for effective degree algorithm
  design" (2020), on why algorithms vary and what to publish:
  https://www.universitiesuk.ac.uk/what-we-do/policy-and-research/publications/principles-effective-degree-algorithm
- The 70 / 60 / 50 / 40 bands as the sector convention: see any university's
  academic regulations, e.g. the summary in "British undergraduate degree
  classification", https://en.wikipedia.org/wiki/British_undergraduate_degree_classification