Files
sm-quizzes-plugin/models/attempt.go

36 lines
1.3 KiB
Go

// Code generated by summer make. DO NOT EDIT.
package models
import (
"time"
usermodels "git.golem15.com/golem15/sm-user-plugin/models"
)
// 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"`
MaxPoints int `gorm:"column:max_points"`
ScorePercent *float64 `gorm:"column:score_percent"`
CreatedAt time.Time `gorm:"column:created_at"`
UpdatedAt time.Time `gorm:"column:updated_at"`
Quiz *Quiz `gorm:"foreignKey:QuizID"`
User *usermodels.User `gorm:"foreignKey:UserID"`
}
// TableName is the plugin-prefixed table.
func (Attempt) TableName() string { return "golem15_quizzes_attempts" }
// Fillable is empty: attempts are written by the API, never by mass
// assignment.
func (Attempt) Fillable() []string { return []string{} }