questions

package
v0.0.0-...-e141d51 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2018 License: MIT Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Question

type Question struct {
	Question    string
	Answers     answers.Answers
	Explanation string
}

Question -- the interface for a question

func (Question) CorrectAnswer

func (q Question) CorrectAnswer() (*answers.Answer, error)

CorrectAnswer -- returns the currect answer

type Questions

type Questions struct {
	Questions []*Question
	Index     int
}

Questions -- The container that holds the questions

func CreateQuestions

func CreateQuestions(qs Questions, files []string) (Questions, error)

CreateQuestions -- used to create questions

func NewQuestions

func NewQuestions() Questions

NewQuestions -- returns an empty Question container

func (Questions) Current

func (qs Questions) Current() (*Question, error)

Current -- returns the current question

func (Questions) Next

func (qs Questions) Next() (*Question, error)

Next -- Moves index pointer to the next question

func (Questions) NextExist

func (qs Questions) NextExist() bool

NextExist -- Checks to see if there is a next question

func (Questions) Previous

func (qs Questions) Previous() (*Question, error)

Previous -- movies index pointer to the previous question

func (Questions) PreviousExist

func (qs Questions) PreviousExist() bool

PreviousExist -- Check to see if there is a previous question

func (Questions) Shuffle

func (qs Questions) Shuffle() error

Shuffle -- In place Shuffle of the questions

Jump to

Keyboard shortcuts

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