models

package
v0.0.0-...-c6bf461 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2016 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QUIZ_MULTIPLE_ALTERNATIVE = "M"
	QUIZ_NORMAL               = "N"
)

Variables

This section is empty.

Functions

func BootDatabaseConn

func BootDatabaseConn()

func StringSliceEquals

func StringSliceEquals(s1, s2 []string) bool

Types

type CollectionMappable

type CollectionMappable interface {
	// contains filtered or unexported methods
}

func (CollectionMappable) Load

func (c CollectionMappable) Load(id string) error

type Question

type Question struct {
	Id             bson.ObjectId `bson:"_id,omitempty"`
	Type           string        `bson:"type"`
	Question       string        `bson:"question"`
	Answers        []string      `bson:"answers"`
	CorrectAnswers []string      `bson:"correct_answers"`
}

func (Question) Delete

func (q Question) Delete() error

func (*Question) ListAll

func (q *Question) ListAll() []Question

func (*Question) Load

func (q *Question) Load(id string) error

func (*Question) Patch

func (q *Question) Patch(req map[string][]string)

func (*Question) Save

func (q *Question) Save() error

func (*Question) Update

func (q *Question) Update() error

type Quiz

type Quiz struct {
	Id        bson.ObjectId   `bson:"_id,omitempty"`
	Name      string          `bson:"name"`
	Slug      string          `bson:"slug"`
	Questions []bson.ObjectId `bson:"questions"`
}

func (Quiz) ListAll

func (q Quiz) ListAll() []Quiz

func (*Quiz) Load

func (q *Quiz) Load(id string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL