Skip to content

Commit 512bde8

Browse files
docs: represent mastery status enumeration as new table
1 parent 53fa5c4 commit 512bde8

2 files changed

Lines changed: 19 additions & 6 deletions

File tree

docs/decisions/0022-competency-criteria-model.rst

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ Decision
157157
7. `student_competencycriteriagroupstatus(user_id, competency_criteria_group_id)`
158158
8. `student_competencystatus(user_id, oel_tagging_tag_id)`
159159
9. `oel_competency_rule_profile(competency_taxonomy_id, course_id, organization_id)`
160+
10. `oel_competency_mastery_statuses(status)` (unique)
160161

161162
6. Learner progress status concepts (`student_competency*status`)
162163

@@ -167,6 +168,7 @@ Decision
167168
- `student_competencycriteriastatus` tracks status at `CompetencyCriterion` leaf level.
168169
- `student_competencycriteriagroupstatus` tracks status at `CompetencyCriteriaGroup` node level.
169170
- `student_competencystatus` tracks top-level competency demonstration state.
171+
- All learner status rows use a shared lookup table (`oel_competency_mastery_statuses`) so status semantics live in one place and student status tables stay structurally consistent.
170172

171173
Intended update flow (bottom-up materialization):
172174

@@ -175,26 +177,37 @@ Decision
175177
- At each group, evaluate children in `ordering` sequence and short-circuit when the group's result is already determined by its `logic_operator`.
176178
- Persist only rows whose status changed.
177179

178-
1. Add new database table for `student_competencycriteriastatus` with these columns:
180+
1. Add new database table for `oel_competency_mastery_statuses` with these columns:
181+
182+
1. `id`: unique primary key
183+
2. `status`: unique status value (seeded values: “Demonstrated”, “AttemptedNotDemonstrated”, and “PartiallyAttempted”)
184+
185+
Notes:
186+
187+
- This table is system-owned lookup data and should be treated as immutable configuration, not user-authored rows.
188+
189+
2. Add new database table for `student_competencycriteriastatus` with these columns:
179190

180191
1. `id`: unique primary key
181192
2. `competency_criteria_id`: Foreign key to `CompetencyCriterion.id`
182193
3. `user_id`: Foreign key pointing to user_id (presumably the learner's id, although it appears that it is possible for staff to get grades as well) in `auth_user` table
183-
4. `status`: Enumeration of “Demonstrated”, “AttemptedNotDemonstrated”, and “PartiallyAttempted”. This field should be very small and not varchar(100) as it will be part of an index.
194+
4. `status_id`: Foreign key to `oel_competency_mastery_statuses.id`
184195
5. `created`: The timestamp at which the student's criterion status was set.
185-
2. Add a new database table for `student_competencycriteriagroupstatus` with these columns:
196+
197+
3. Add a new database table for `student_competencycriteriagroupstatus` with these columns:
186198

187199
1. `id`: unique primary key
188200
2. `competency_criteria_group_id`: Foreign key to `CompetencyCriteriaGroup.id`
189201
3. `user_id`: Foreign key pointing to user_id (presumably the learner's id, although it appears that it is possible for staff to get grades as well) in `auth_user` table
190-
4. `status`: Enumeration of “Demonstrated”, “AttemptedNotDemonstrated”, and “PartiallyAttempted”. This field should be very small and not varchar(100) as it will be part of an index.
202+
4. `status_id`: Foreign key to `oel_competency_mastery_statuses.id`
191203
5. `created`: The timestamp at which the student's criteria-group status was set.
192-
3. Add a new database table for `student_competencystatus` with these columns:
204+
205+
4. Add a new database table for `student_competencystatus` with these columns:
193206

194207
1. `id`: unique primary key
195208
2. `oel_tagging_tag_id`: Foreign key pointing to Tag id
196209
3. `user_id`: Foreign key pointing to user_id (presumably the learner's id, although it appears that it is possible for staff to get grades as well) in `auth_user` table
197-
4. `status`: Enumeration of “Demonstrated” and “PartiallyAttempted”. This field should be very small and not varchar(100) as it will be part of an index.
210+
4. `status_id`: Foreign key to `oel_competency_mastery_statuses.id`. This table should have a constraint to only allow status values of “Demonstrated” and “PartiallyAttempted” since it represents overall competency demonstration state, not in-progress states.
198211
5. `created`: The timestamp at which the student's competency status was set.
199212

200213
7. Delete protection boundaries
12.6 KB
Loading

0 commit comments

Comments
 (0)