gui

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: 2

Documentation

Index

Constants

View Source
const (
	//BoxA -- title for question box A
	BoxA = "A"
	//BoxB -- title for question box B
	BoxB = "B"
	//BoxC -- title for question box C
	BoxC = "C"
	//BoxD -- title for question box D
	BoxD = "D"
	//BoxTrue -- title for question box true
	BoxTrue = "True"
	//BoxFalse -- title for question box false
	BoxFalse = "False"
	//BoxBlank -- title for question box fill in the blank
	BoxBlank = "Write Your Answer"
	//ScoreName -- name of the score box
	ScoreName = "score"
	//Explain -- name of the Explanation box
	Explain = "explain"
	//Right -- What the user sees when they are right
	Right = "You were RIGHT!"
	//Wrong -- what the user sees when they are wrong
	Wrong = "You were WRONG!"
	//InfoBarName -- Name of informantion bar
	InfoBarName = "infoBar"
	//InfoBarABCD -- InfoBar content for ABCD quiz screen
	InfoBarABCD = "Term Quiz -- Tab: switch answer   Enter: select answer   Ctrl + C: Quit"
	//InfoBarTrueFalse -- InfoBar content for True False quiz screen
	InfoBarTrueFalse = "Term Quiz -- Tab: switch answer   Enter: select answer   Ctrl + C: Quit"
	//InfoBarFillInBlank -- InfoBar content for Fill in the Blank quiz screen
	InfoBarFillInBlank = "Term Quiz -- Enter: submit answer   Ctrl + C: Quit"
	//InfoBarEndScreen -- InfoBar content for the end screen
	InfoBarEndScreen = "Term Quiz -- Enter: view next answer   Ctrl + C: Quit"
)

Variables

View Source
var (
	//ActiveView -- Index counter used when tabbing through answers
	ActiveView = 0
	//ABCDBoxes -- slice of the A, B, C, and D answer box names
	ABCDBoxes = []string{BoxA, BoxB, BoxC, BoxD}
	//TFBoxes -- slice of the True and False answer box names
	TFBoxes = []string{BoxTrue, BoxFalse}
)

Functions

func ABCDNextView

func ABCDNextView(g *gocui.Gui, v *gocui.View) error

ABCDNextView -- Callback used to interate through the A, B, C, D choices

func Quit

func Quit(g *gocui.Gui, v *gocui.View) error

Quit -- Callback used to quit application

func TFNextView

func TFNextView(g *gocui.Gui, v *gocui.View) error

TFNextView -- Callback used to interate through the True and False choices

Types

type Answer

type Answer struct {
	// contains filtered or unexported fields
}

Answer -- Gui component that holds a Answer

func NewAnswer

func NewAnswer(name, title string, body string) *Answer

NewAnswer -- creates a new Answer gui component

func (*Answer) Layout

func (a *Answer) Layout(g *gocui.Gui) error

Layout -- Tells gocui.Gui how to display this compenent

type Explanation

type Explanation struct {
	// contains filtered or unexported fields
}

Explanation -- Gui component that holds the question

func NewExplanation

func NewExplanation(name, result, question, answer, explain string) *Explanation

NewExplanation -- creates new question gui component

func (*Explanation) Layout

func (e *Explanation) Layout(g *gocui.Gui) error

Layout -- Tells gocui.Gui how to display this compenent

type InfoBar

type InfoBar struct {
	// contains filtered or unexported fields
}

InfoBar -- Gui component that holds one line of information

func NewInfoBar

func NewInfoBar(name, content string) *InfoBar

NewInfoBar -- Creates a new InfoBar gui component

func (*InfoBar) Layout

func (i *InfoBar) Layout(g *gocui.Gui) error

Layout -- tells gocui.Gui how to display this component

type Question

type Question struct {
	// contains filtered or unexported fields
}

Question -- Gui component that holds the question

func NewQuestion

func NewQuestion(name, title string, body string) *Question

NewQuestion -- creates new question gui component

func (*Question) Layout

func (q *Question) Layout(g *gocui.Gui) error

Layout -- Tells gocui.Gui how to display this compenent

type QuestionFrame

type QuestionFrame struct {
	// contains filtered or unexported fields
}

QuestionFrame -- Gui component that holds the question frame

func NewQuestionFrame

func NewQuestionFrame(name string) *QuestionFrame

NewQuestionFrame -- creates new question frame gui component

func (*QuestionFrame) Layout

func (qf *QuestionFrame) Layout(g *gocui.Gui) error

Layout -- Tells gocui.Gui how to display this compenent

type Score

type Score struct {
	// contains filtered or unexported fields
}

Score -- Gui component that holds the question

func NewScore

func NewScore(name, score, questionNumber string) *Score

NewScore -- creates new question gui component

func (*Score) Layout

func (s *Score) Layout(g *gocui.Gui) error

Layout -- Tells gocui.Gui how to display this component

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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