feat: serve the quiz API under /_quizzes/api/v1 behind jwt.auth

This commit is contained in:
Jakub Zych
2026-10-02 14:13:30 +02:00
parent 4d4da5dc14
commit effe640549
16 changed files with 2232 additions and 11 deletions

View File

@@ -4,12 +4,14 @@ package models
import "time"
// Attempt is one user's run through a quiz. The score columns are set when
// the attempt is finished.
// Attempt is one user's run through a quiz, or through one category of its
// questions when Category is set. The score columns are set when the attempt
// is finished.
type Attempt struct {
ID uint `gorm:"column:id;primaryKey"`
QuizID uint `gorm:"column:quiz_id"`
UserID uint `gorm:"column:user_id"`
Category *string `gorm:"column:category"`
StartedAt time.Time `gorm:"column:started_at"`
CompletedAt *time.Time `gorm:"column:completed_at"`
ScorePoints float64 `gorm:"column:score_points"`