Capstone 10 — Learning Management System¶
Scope: a term's work · Prerequisites: Modules 1–15
1. Problem statement¶
A small online course platform hosts courses made of lessons, with learners who enrol, submit work, are assessed, and progress through a course at their own pace.
Assessment is the hard part. Marks come from several sources — quizzes marked automatically, assignments marked by hand, a final project — and they combine with weights that differ per course. Learners may be graded on a pass/fail or a banded scale, some assessments can be retaken with a documented policy on which attempt counts, late submissions incur penalties that vary by assessment, and a learner may be granted an extension that overrides the deadline for that one learner, that one time.
The platform must show each learner their progress accurately, and it must be able to answer "what did this learner's grade consist of?" long after the course rules changed.
2. Actors¶
| Actor | What they do | What the system owes them |
|---|---|---|
| Learner | Enrols, completes lessons, submits work, sees progress and grades | An accurate progress figure, and a grade they can see the composition of |
| Instructor | Creates courses and assessments, marks submissions, grants extensions | Marking that is efficient, and a rule change that does not rewrite past grades |
| Assessor | Marks by hand against a rubric | A queue of unmarked submissions, and a mark that is recorded with its rubric |
| Administrator | Sets grade scales and weighting rules | Configuration without recompiling |
3. Use cases¶
- Create a course with lessons and an ordered structure.
- Add assessments with kinds (quiz, assignment, project), weights and due dates.
- Enrol a learner, and record lesson completion.
- Submit work, with a submission time; refuse a submission after the deadline unless an extension exists.
- Mark automatically (a quiz) and by hand (an assignment), with a rubric score.
- Apply a late penalty according to the assessment's policy.
- Compute a grade: weighted components, the scale, and the resulting band.
- Show progress: lessons completed, assessments submitted, marks so far.
- Explain a grade: the components, their weights, the penalties, and the resulting total.
- Save and load everything; refuse a corrupted file with a line number and no partial state.
4. Suggested classes¶
| Class | Responsibility, in one sentence | Notes |
|---|---|---|
Lesson |
One unit of content in a course's ordered sequence | Owns nothing but its identity and position |
Assessment |
What is being marked: kind, weight, due date, rubric | Owns its marking policy |
Rubric |
The criteria and their maximum scores | A value type |
Mark |
One learner's score on one assessment, with its components | Immutable once recorded |
Submission |
A learner's work for an assessment, with a timestamp | Immutable after submission, except for an extension |
LatePenaltyPolicy |
Turns a lateness and a policy into a penalty | Injected; the thing that varies |
GradingPolicy |
Turns a set of marks into a final grade on a scale | Injected; the other thing that varies |
GradeScale |
The bands, boundaries and whether the scale is pass/fail | Composition inside the grading policy |
Extension |
A per-learner, per-assessment deadline override | The requirement that makes deadlines a policy, not a date |
Progress |
A learner's completion state for a course, derived | A projection: recomputed, never stored loosely |
Enrolment |
One learner in one course, with their submissions and marks | Aggregates without owning the course |
Course |
Lessons and assessments, in order | Owns its assessments |
Platform |
Coordinates operations and owns courses and enrolments | Where a marking operation is a transaction |
The class worth the most marks is the pair LatePenaltyPolicy and GradingPolicy. Two independent
variations — how lateness is penalised, and how marks become a grade — that compose, and that a real
platform must be able to change without rewriting history. The requirement that past grades keep their
composition is what forces you to record what the grade was made of, not just its value.
5. Relationships¶
Platform ◆── vector<Course> composition
Course ◆── vector<Lesson> composition, in order
Course ◆── vector<Assessment> composition
Assessment ◆── Rubric composition
Enrolment ◆── vector<Submission> composition
Submission ◆── Mark composition: a marked submission owns its mark
Enrolment ────> Course association: referred to, never owned
Assessment ┈┈> LatePenaltyPolicy dependency, injected
Course ┈┈> GradingPolicy dependency, injected
Extension ────> Assessment association, and to a learner
Progress ┈┈> Enrolment dependency: derived on request
6. Design constraints¶
- Grades record their composition. A past grade must be explainable after a policy changes, which means the components, their weights and the penalties are stored with it, not recomputed later.
- Deadlines are per learner once an extension exists. The due date is the default, not the truth — say where the effective deadline is computed, and test it.
- Late penalties and grading are separate injected policies. Both vary independently, and the report should show each policy failing to notice the other's change.
- A submission is immutable after submission, apart from an extension recorded against it; the document should say what "resubmission" means in your design.
- Marks come from two sources — automatic and hand-marking — behind one interface, so a third kind of
assessment is a class rather than an
if. - Progress is derived. No stored percentage that can drift; it is computed, and the report states the cost of computing it.
- A learner can see why. One command prints a grade's composition, and that output is a test.
- Format: documented text format with a version marker and an escape rule; enrolments, submissions and marks preserved exactly; a later-version file refused, not misread.
7. Milestones¶
| # | Milestone | Done when |
|---|---|---|
| 1 | Design | Diagram; the two policy axes identified; where a grade's composition is recorded decided |
| 2 | Courses and lessons | Courses with ordered lessons; assessments with kinds, weights and deadlines; enrolments |
| 3 | Submission and marking | Submit with a deadline rule; automatic and hand marking behind one interface; marks recorded |
| 4 | Policies | Late penalties and grading from injected policies; a grade explained component by component |
| 5 | Persistence | Documented format; round trip preserving submissions, marks and grade compositions; three hand-edited corruptions rejected with line numbers |
| 6 | Tests and report | Boundaries and failures asserted; a deliberate bug caught; the policy composition evaluated; the reversal named with its cost |
8. Minimum requirements¶
- [ ] Courses with ordered lessons, and assessments of at least two kinds with weights and due dates
- [ ] Enrolment and lesson completion, with progress derived rather than stored
- [ ] Submissions with timestamps; a late submission refused or penalised according to the policy
- [ ] Automatic and hand marking behind one interface, with a rubric for hand marking
- [ ] A late penalty from an injected policy, with two implementations
- [ ] A grading policy turning weighted marks into a band, with a pass/fail and a banded scale
- [ ] A grade's composition recorded and printable, unchanged by a later policy change — demonstrated
- [ ] Per-learner extensions that override a deadline for one assessment only
- [ ] Persistence with a version marker and escape rule; a round trip preserving marks and compositions, including a course with no enrolments
- [ ] Three hand-edited corruptions rejected with line numbers, leaving the loaded state untouched
- [ ] At least two patterns, each justified by a named requirement; one declined, with the reason
- [ ] Tests with assertions covering invariants, boundaries and failure paths
- [ ] No warnings with
-Wall -Wextra -Werror
9. Advanced requirements¶
- [ ] Retakes: the best-of rule, or last-attempt rule, from a policy — with a measurement of the change cost if the rule changes
- [ ] An extension for one learner only, with the boundary test that another learner's deadline is unaffected
- [ ] A third assessment kind added with no edits to existing marking code — the file count in the report
- [ ] A progress report per learner, exported to CSV behind the same interface as the console output
- [ ] Course versioning: a course whose rules changed mid-term keeps old grades explainable
- [ ] Cohort statistics: the distribution of final grades, and the complexity of computing it
- [ ] A marking queue for instructors, ordered by due date and submission time
10. Testing requirements¶
- Invariants: a grade's components sum to its total; progress never decreases as more work is done in the same course; a submission is never silently replaced; a learner's deadline with an extension differs from another learner's
- Boundaries: a submission exactly at the deadline and one minute after; a mark at the pass boundary and one mark below; an assessment weight of zero; no submissions; a perfectly complete course
- Failure paths: submitting to an unenrolled course; marking an unsubmitted assessment; a rubric score above the maximum; loading a truncated file; a negative weight
- Round trip: enrolments, submissions, marks and grade compositions preserved exactly, including an empty course
- One deliberate bug (for example, recomputing a grade from current policies instead of the recorded composition), caught by the "explain this grade" test, with the failing assertion kept
11. Extension ideas¶
- Peer assessment, with several marks per submission and a policy for combining them.
- Discussion forums attached to lessons, with notifications — and the observer's lifetime question.
- Prerequisite lessons that must be completed before an assessment unlocks.
- Certificates at a passing grade, generated as a separate document with the same data.
- Time-on-task statistics per lesson, and the design question about where such data lives.
- Weighted cohort curves (a normalised scale), used carefully, and the report's judgement about whether it belongs in the system at all.
12. Evaluation checklist¶
- [ ] The diagram matches the declarations, including multiplicities
- [ ] A past grade is explainable after a policy change — demonstrated by running the explanation
- [ ] A grade's components sum to its total, checked by a test rather than by arithmetic on paper
- [ ] Late penalties and grading are separate injected policies, and two implementations of each exist
- [ ] An extension for one learner does not affect another — demonstrated
- [ ] Progress is derived, and there is no stored percentage that can drift
- [ ] Adding an assessment kind required no edits to the marking operation, and the file count is in the report
- [ ] The round trip preserves marks and their compositions, including an empty course — output pasted
- [ ] Three corruptions rejected with line numbers, leaving the loaded state untouched
- [ ] The suite fails when a deliberate bug is introduced
- [ ] One pattern considered and declined, in writing
- [ ] The report names the decision I would reverse and the cost of reversing it
Related: Capstone options · Projects and the rubric · Module 16 — Capstone · Module 13 — Exception Handling