Domain Model
This chapter summarizes principal entities; authoritative behavioral details live in the referenced chapters.
Registration
| Component | Type | Description |
|---|---|---|
| Registration::Campaign | ActiveRecord | Time‑bounded process (modes: FCFS, preference_based) |
| Registration::Item | ActiveRecord | Wrapper exposing a registerable option under a campaign |
| Registration::UserRegistration | ActiveRecord | (user, item) intent + status (pending/confirmed/rejected) + optional preference_rank |
| Registration::Policy | ActiveRecord | Ordered eligibility rule (student_performance, institutional_email, prerequisite_campaign, custom_script) |
| Registration::Campaignable | Concern | Enables a model to host registration campaigns |
| Registration::Registerable | Concern | Enables a model to be an option within a campaign |
| Registration::PolicyEngine | Service | Executes ordered active policies; short‑circuits on first failure |
| Registration::AllocationMaterializer | Service | Applies confirmed allocations → registerable.materialize_allocation! |
Rosters
| Component | Type | Description |
|---|---|---|
| Roster::Rosterable | Concern | Unified roster API (roster_user_ids, replace_roster!, etc.) |
| Roster::MaintenanceService | Service | Post-allocation admin (move/add/remove) with capacity enforcement |
Assessments & Grading
| Component | Type | Description |
|---|---|---|
| Assessment::Assessment | ActiveRecord | Gradebook container for graded work (assignment, exam, talk, achievement) |
| Assessment::Participation | ActiveRecord | Per-user totals, grade, status, submission timestamps |
| Assessment::Task | ActiveRecord | Per-assessment graded component (only if requires_points) |
| Assessment::TaskPoint | ActiveRecord | Per (participation, task) points + grader + submission link |
| Assessment::Assessable | Concern | Enables a model to be linked to an Assessment::Assessment |
| Assessment::Pointable | Concern | Extends Assessable to enable per-task point tracking |
| Assessment::Gradable | Concern | Extends Assessable to enable final grade recording |
| Assessment::SubmissionGrader | Service | Submission-centered fan-out to TaskPoints for team grading |
| Submission | ActiveRecord | Team-capable artifact optionally linked to a task |
Student Performance & Certification
| Component | Type | Description |
|---|---|---|
| StudentPerformance::Record | ActiveRecord | Materialized factual performance data per (lecture, user): points_total, achievements_met |
| StudentPerformance::Rule | ActiveRecord | Configuration for eligibility criteria (min_points, required_achievements, assessment_types) |
| StudentPerformance::Certification | ActiveRecord | Teacher's eligibility decision per (lecture, user) with status (passed/failed/pending) |
| Achievement | ActiveRecord | Assessable type for qualitative accomplishments (e.g., blackboard presentations) with Assessment infrastructure |
| StudentPerformance::Service | Service | Computes and upserts Records from coursework points and achievements |
| StudentPerformance::Evaluator | Service | Generates eligibility proposals by evaluating Records against Rules |
| Registration::Policy (kind: student_performance) | Integration | Checks Certification.status during exam registration (no runtime recomputation) |
Grading Schemes
| Component | Type | Description |
|---|---|---|
| GradeScheme::Scheme | ActiveRecord | Versioned configuration for converting assessment points to final grades |
| GradeScheme::Applier | Service | Applies scheme to compute and persist final grades for all participations |
Allocation Algorithm
| Component | Type | Description |
|---|---|---|
| Registration::AllocationService | Service | Strategy dispatcher using pluggable solvers (Min-Cost Flow, future CP-SAT) |
| Registration::Solvers::MinCostFlow | Service | OR-Tools SimpleMinCostFlow implementation for bipartite preference allocation |
| Registration::Solvers::CpSat | Service | Future CP-SAT solver for advanced constraints (fairness, mutual exclusion, quotas) |
Linking Concepts
These are the "glue" entities that connect the core domain models (User, Lecture, Tutorial, etc.) to the systems above. They enable domain models to participate in registration, assessment, and eligibility tracking.
Core Domain Models:
User- Students, teachers, tutors who participate in the systemLecture- A course offering (e.g., "Linear Algebra WS 2024/25")Tutorial- A tutorial group within a lectureTalk- A student presentation or seminar talkAssignment- A homework assignmentExam- An exam assessment
How they link to the systems:
| Domain Model | Links To | Via | Purpose |
|---|---|---|---|
| Lecture | Registration | Registration::Campaignable concern | Host exam registration campaigns |
| Tutorial | Registration | Registration::Registerable concern | Become a registerable option in tutorial allocation |
| Exam | Registration | Registration::Campaignable concern | Host exam registration campaigns |
| Assignment | Assessment | Assessment::Pointable concern | Track per-task points for homework |
| Exam | Assessment | Assessment::Gradable concern | Record final exam grades |
| Talk | Assessment | Assessment::Gradable concern | Grade student presentations |
| User | All Systems | Direct associations | Student participates in registrations, assessments, eligibility |
| Lecture | Exam Eligibility | Direct association | Scope eligibility records to specific lecture |
Example Flows:
-
Tutorial Registration:
Lecture(campaignable) → createsRegistration::Campaign→ containsRegistration::ItemwrappingTutorial(registerable) → students submitRegistration::UserRegistration -
Exam Registration:
Lecture(campaignable) → createsRegistration::Campaign→ containsRegistration::ItemwrappingExam(registerable) → students submitRegistration::UserRegistration→ policies check eligibility -
Homework Grading:
Assignment(pointable) → linked toAssessment::Assessment→ containsAssessment::Task→ tutors recordAssessment::TaskPoint→ aggregated intoAssessment::Participation -
Exam Eligibility:
Lecture→ students completeAssignmentassessments →StudentPerformance::Serviceaggregates points intoStudentPerformance::Record→StudentPerformance::Evaluatorgenerates proposals → teacher createsStudentPerformance::Certification→Registration::Policy(kind: student_performance) checksCertification.statuswhen student attemptsExamregistration via the lecture's exam campaign
High-Level ERD (Simplified)
erDiagram
USER ||--o{ REGISTRATION_USER_REGISTRATION : submits
REGISTRATION_CAMPAIGN ||--o{ REGISTRATION_ITEM : has
REGISTRATION_ITEM ||--o{ REGISTRATION_USER_REGISTRATION : options
REGISTRATION_CAMPAIGN ||--o{ REGISTRATION_POLICY : guards
REGISTRATION_ITEM }o--|| REGISTERABLE : polymorphic
ASSESSMENT ||--o{ ASSESSMENT_PARTICIPATION : has
ASSESSMENT ||--o{ TASK : has
TASK ||--o{ TASK_POINT : points
ASSESSMENT_PARTICIPATION ||--o{ TASK_POINT : aggregates
SUBMISSION ||--o{ TASK_POINT : optional
USER ||--o{ ASSESSMENT_PARTICIPATION : participates
LECTURE_PERFORMANCE_RECORD }o--|| USER : "factual data"
LECTURE_PERFORMANCE_RECORD }o--|| LECTURE : "scoped to"
LECTURE_PERFORMANCE_CERTIFICATION }o--|| USER : "decision for"
LECTURE_PERFORMANCE_CERTIFICATION }o--|| LECTURE : "scoped to"
LECTURE_PERFORMANCE_CERTIFICATION }o--|| LECTURE_PERFORMANCE_RECORD : "based on (optional)"
ACHIEVEMENT }o--|| USER : "accomplished by"
ACHIEVEMENT }o--|| LECTURE : "belongs to"
GRADE_SCHEME_SCHEME ||--|| ASSESSMENT : "applies to"
See details: