models

package
v0.0.0-...-f970f26 Latest Latest
Warning

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

Go to latest
Published: May 3, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FillBlank ...
	FillBlank = 1
	// MCQ ...
	MCQ = 2
	// MultiSelect ...
	MultiSelect = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Answers

type Answers [][]int

Answers represent answer type

func (*Answers) Scan

func (a *Answers) Scan(value interface{}) error

Scan indicate how application read Answers type

func (Answers) Value

func (a Answers) Value() (driver.Value, error)

Value indicate how database store Answers type

type Options

type Options [][]string

Options represent options type

func (*Options) Scan

func (o *Options) Scan(value interface{}) error

Scan indicate how application read Options type

func (Options) Value

func (o Options) Value() (driver.Value, error)

Value indicate how database store Options type

type Question

type Question struct {
	ID          int64        `json:"id"`
	Category    string       `json:"category"`
	SubCategory string       `json:"subcategory"`
	Type        QuestionType `json:"type"`
	Description string       `json:"description"`
	Options     Options      `json:"options"` // e.g [["option a", "option b"], ["option c, option d"]]
	Answers     Answers      `json:"answers"` // e.g [[1][0]]
	Image       *string      `json:"image,omitempty"`
}

Question ...

func (*Question) TableName

func (*Question) TableName() string

TableName ...

func (*Question) Validate

func (q *Question) Validate() error

Validate checks whether question is valid

type QuestionType

type QuestionType int

QuestionType represent type of question

Jump to

Keyboard shortcuts

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