Spaces:
Runtime error
Runtime error
Commit ·
d877823
1
Parent(s): 9c9198b
Deploy files from GitHub repository
Browse filesFiles changed (2)
213 unmodified lines2142152162172182192202212222232242252263 unmodified lines230231232233234235236237213 unmodified linesScore float32 `json:"score"`}type ExamEventAnswer struct {Id uuid.UUID `gorm:"type:uuid;primary_key;default:uuid_generate_v4()" json:"id"`AttemptId uuid.UUID `json:"id_attempt" gorm:"index"` // FK ke ExamEventAttemptQuestionId uuid.UUID `json:"id_question" gorm:"index"` // FK ke QuestionsAnswers []string `gorm:"type:text[]" json:"answers"`Score float32 `json:"score"`CreatedAt time.Time `json:"created_at"`UpdatedAt time.Time `json:"updated_at"`}func (ExamEventAnswer) TableName() string { return "exam_event_answer" }3 unmodified linesAccountId uuid.UUID `json:"id_account"`EventId uuid.UUID `json:"id_event"`ExamId uuid.UUID `json:"id_exam"`Questions *[]Questions `json:"questions"`Answers *[]ExamEventAnswer `json:"answers"`Account *Account `gorm:"foreignKey:AccountId"`Event *Events `gorm:"foreignKey:EventId"`Exam *Exam `gorm:"foreignKey:ExamId"`213 unmodified lines2142152162172182192202212222232242252262273 unmodified lines231232233234235236237238213 unmodified linesScore float32 `json:"score"`}type ExamEventAnswer struct {Id uuid.UUID `gorm:"type:uuid;primary_key;default:uuid_generate_v4()" json:"id"`AttemptId uuid.UUID `json:"id_attempt" gorm:"index"` // FK ke ExamEventAttemptQuestionId uuid.UUID `json:"id_question" gorm:"index"` // FK ke QuestionsAnswers []string `gorm:"type:text[]" json:"answers"`Score float32 `json:"score"`ExamEventAttempt *ExamEventAttempt `gorm:"foreignKey:AttemptId" json:"-"`CreatedAt time.Time `json:"created_at"`UpdatedAt time.Time `json:"updated_at"`}func (ExamEventAnswer) TableName() string { return "exam_event_answer" }3 unmodified linesAccountId uuid.UUID `json:"id_account"`EventId uuid.UUID `json:"id_event"`ExamId uuid.UUID `json:"id_exam"`Questions *[]Questions `gorm:"-" json:"questions"`Answers *[]ExamEventAnswer `gorm:"foreignKey:AttemptId;references:Id" json:"answers"`Account *Account `gorm:"foreignKey:AccountId"`Event *Events `gorm:"foreignKey:EventId"`Exam *Exam `gorm:"foreignKey:ExamId"`
38 unmodified lines39404142434438 unmodified lineserr := r.db.WithContext(ctx).Preload("Questions").Where("id_event = ?", eventId).Where("id_exam = ?", examId).Where("id_account = ?", accountId).38 unmodified lines3940414243444538 unmodified lineserr := r.db.WithContext(ctx).Preload("Questions").Preload("Answers").Where("id_event = ?", eventId).Where("id_exam = ?", examId).Where("id_account = ?", accountId).
models/entity/entity.go+10-9
repositories/exam_event_attempt_repository.go+1