testhub/store/store.go

24 lines
470 B
Go

package store
import (
"git.andreafazzi.eu/andrea/testhub/models"
)
type CreateQuestionRequest struct {
Text string `json:"text"`
}
type CreateAnswerRequest struct {
Text string
Correct bool
}
type CreateQuizRequest struct {
Question *CreateQuestionRequest `json:"question"`
Answers []*CreateAnswerRequest `json:"answers"`
}
type QuizHubCollectorStore interface {
ReadAllQuizzes() ([]*models.Quiz, error)
CreateQuiz(r *CreateQuizRequest) *models.Quiz
}