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)

Columns of the quiz_attempts table
ColumnTypeConstraintsDescription
iduuidprimary key
quiz_iduuidnot null, references quizzes.id
enrollment_iduuidnot null, references enrollments.id
attempt_numbersmallintnot null
statusattempt_statusnot null
scoredecimal(6,2)
max_scoredecimal(6,2)
started_attimestamptznot null
submitted_attimestamptz

Indexes (2)

  • (quiz_id, enrollment_id, attempt_number) unique
  • (enrollment_id, status)

Relationships