quiz_attempts table
The quiz_attempts table in the Learning Management System Database Schema schema has 9 columns, keyed by id, with 2 foreign keys to quizzes and enrollments. 1 column in quiz_answers references it.
Each attempt is its own row, never an update. max_score is snapshotted so editing the quiz later does not distort an old percentage.
Columns (9)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| quiz_id | uuid | not null, references quizzes.id | |
| enrollment_id | uuid | not null, references enrollments.id | |
| attempt_number | smallint | not null | |
| status | attempt_status | not null | |
| score | decimal(6,2) | ||
| max_score | decimal(6,2) | ||
| started_at | timestamptz | not null | |
| submitted_at | timestamptz |
Indexes (2)
(quiz_id, enrollment_id, attempt_number)unique(enrollment_id, status)
Relationships
quiz_attempts.quiz_idreferencesquizzes.idquiz_attempts.enrollment_idreferencesenrollments.idquiz_answers.attempt_idreferencesquiz_attempts