Add models for Exam

This commit is contained in:
Andrea Fazzi 2023-10-18 13:40:21 +02:00
parent 478d1e8815
commit a5392a9f1e
5 changed files with 63 additions and 0 deletions

13
models/exam.go Normal file
View file

@ -0,0 +1,13 @@
package models
import "time"
type Exam struct {
ID string `gorm:"primaryKey"`
CreatedAt time.Time
Quizzes []*Quiz
Participant *Participant
Responses []string
}

8
models/participant.go Normal file
View file

@ -0,0 +1,8 @@
package models
type Participant struct {
ID string
Firstname string
Lastname string
}

9
store/db/db.go Normal file
View file

@ -0,0 +1,9 @@
package db
type DBProboCollectorStore struct {
Path string
}
func NewDBProboCollectorStore(path string) (*DBProboCollectorStore, error) {
return nil, nil
}

9
store/db/db.go~ Normal file
View file

@ -0,0 +1,9 @@
package db
type DBProboCollectorStore struct {
Path string
}
func (s *DBProboCollectorStore) NewDBProboCollectorStore(path string) (*DBProboCollectorStore, error) {
return nil, nil
}

24
store/db/db_test.go Normal file
View file

@ -0,0 +1,24 @@
package db
import (
"testing"
"github.com/remogatto/prettytest"
)
type dbTestSuite struct {
prettytest.Suite
}
func TestRunner(t *testing.T) {
prettytest.Run(
t,
new(dbTestSuite),
)
}
func (t *dbTestSuite) TestCreateExam() {
store, err := NewDBProboCollectorStore("testdata/test.sqlite")
t.Nil(err)
t.Not(t.Nil(store))
}