states

package module
v0.0.0-...-0192bcb Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddQuestionAction

type AddQuestionAction string
const (
	AddQuestionToggle         AddQuestionAction = "True/False"
	AddQuestionMultipleChoice AddQuestionAction = "Multiple Choice"
)

type AddQuestionState

type AddQuestionState struct {
	IState
	// contains filtered or unexported fields
}

func (*AddQuestionState) Run

func (state *AddQuestionState) Run() IState

type EditQuestionState

type EditQuestionState struct {
	IState
	// contains filtered or unexported fields
}

func (*EditQuestionState) Run

func (state *EditQuestionState) Run() IState

type EditQuizAction

type EditQuizAction int
const (
	EditQuizBack         EditQuizAction = 0
	EditQuizAddQuestion  EditQuizAction = 1
	EditQuizEditQuestion EditQuizAction = 2
)

type EditQuizState

type EditQuizState struct {
	IState
	// contains filtered or unexported fields
}

func (*EditQuizState) DeleteQuestion

func (state *EditQuizState) DeleteQuestion(quiz *quiz.Quiz, event *tcell.EventKey, table *tview.Table) *tcell.EventKey

func (*EditQuizState) Run

func (state *EditQuizState) Run() IState

func (*EditQuizState) RunTable

func (state *EditQuizState) RunTable(app *tview.Application, table *tview.Table, questions []quiz.IQuestion) (quiz.IQuestion, EditQuizAction, error)

func (*EditQuizState) RunWindow

func (state *EditQuizState) RunWindow(app *tview.Application, table *tview.Table, footer *tview.TextView, questions []quiz.IQuestion) (quiz.IQuestion, EditQuizAction, error)

type ExitState

type ExitState struct{}

func (*ExitState) Run

func (i *ExitState) Run() IState

type IState

type IState interface {
	Run() IState
}

type InitAction

type InitAction string
const (
	InitLogin    InitAction = "Login"
	InitRegister InitAction = "Register"
	InitJoin     InitAction = "Join Quiz"
	InitExit     InitAction = "Exit"
)

type InitState

type InitState struct {
	IState
}

func (*InitState) Run

func (i *InitState) Run() IState

type JoinQuizState

type JoinQuizState struct {
	IState
}

func (*JoinQuizState) Run

func (state *JoinQuizState) Run() IState

type LoggedInState

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

func (*LoggedInState) Run

func (state *LoggedInState) Run() IState

type LoginState

type LoginState struct{}

func (*LoginState) Run

func (state *LoginState) Run() IState

type ManageQuizzesAction

type ManageQuizzesAction int
const (
	ManageQuizzesNewQuiz  ManageQuizzesAction = 0
	ManageQuizzesEditQuiz ManageQuizzesAction = 1
	ManageQuizzesBack     ManageQuizzesAction = 2
)

type ManageQuizzesState

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

func NewManageQuizzesState

func NewManageQuizzesState(user user.IUser) *ManageQuizzesState

func (*ManageQuizzesState) DeleteQuiz

func (state *ManageQuizzesState) DeleteQuiz(quizzes []*quiz.Quiz, event *tcell.EventKey, table *tview.Table) (*tcell.EventKey, []*quiz.Quiz)

func (*ManageQuizzesState) Run

func (state *ManageQuizzesState) Run() IState

func (*ManageQuizzesState) RunTable

func (state *ManageQuizzesState) RunTable(app *tview.Application, table *tview.Table, quizzes []*quiz.Quiz) (*quiz.Quiz, ManageQuizzesAction, error)

func (*ManageQuizzesState) RunWindow

func (state *ManageQuizzesState) RunWindow(app *tview.Application, table *tview.Table, footer *tview.TextView, quizzes []*quiz.Quiz) (*quiz.Quiz, ManageQuizzesAction, error)

type NewQuizState

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

func (*NewQuizState) Run

func (state *NewQuizState) Run() IState

type RegisterState

type RegisterState struct{}

func (*RegisterState) Run

func (state *RegisterState) Run() IState

type RunQuizState

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

func (*RunQuizState) Run

func (state *RunQuizState) Run() IState

Jump to

Keyboard shortcuts

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