Add models for Exam
This commit is contained in:
parent
478d1e8815
commit
a5392a9f1e
5 changed files with 63 additions and 0 deletions
13
models/exam.go
Normal file
13
models/exam.go
Normal 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
8
models/participant.go
Normal file
|
@ -0,0 +1,8 @@
|
|||
package models
|
||||
|
||||
type Participant struct {
|
||||
ID string
|
||||
|
||||
Firstname string
|
||||
Lastname string
|
||||
}
|
9
store/db/db.go
Normal file
9
store/db/db.go
Normal 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
9
store/db/db.go~
Normal 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
24
store/db/db_test.go
Normal 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))
|
||||
}
|
Loading…
Reference in a new issue