feat: add quiz, question, answer and attempt models with migrations
This commit is contained in:
30
models/attempt_answer.go
Normal file
30
models/attempt_answer.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated by summer make. DO NOT EDIT.
|
||||
|
||||
package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"git.golem15.com/golem15/summercms/modules/lagoon"
|
||||
)
|
||||
|
||||
// AttemptAnswer is the user's answer to one question of an attempt. There is
|
||||
// one row per attempt and question; answering again overwrites it.
|
||||
type AttemptAnswer struct {
|
||||
ID uint `gorm:"column:id;primaryKey"`
|
||||
AttemptID uint `gorm:"column:attempt_id"`
|
||||
QuestionID uint `gorm:"column:question_id"`
|
||||
AnswerIDs lagoon.Jsonable[[]uint] `gorm:"column:answer_ids"`
|
||||
SelfCheckKnown *bool `gorm:"column:self_check_known"`
|
||||
IsCorrect bool `gorm:"column:is_correct"`
|
||||
Points float64 `gorm:"column:points"`
|
||||
CreatedAt time.Time `gorm:"column:created_at"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at"`
|
||||
}
|
||||
|
||||
// TableName is the plugin-prefixed table.
|
||||
func (AttemptAnswer) TableName() string { return "golem15_quizzes_attempt_answers" }
|
||||
|
||||
// Fillable is empty: answers are written by the API, never by mass
|
||||
// assignment.
|
||||
func (AttemptAnswer) Fillable() []string { return []string{} }
|
||||
Reference in New Issue
Block a user