query

package
v0.0.0-...-4df7676 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsoleQuerier

type ConsoleQuerier struct{}

ConsoleQuerier displays the questions in the console

func (*ConsoleQuerier) AskReady

func (cq *ConsoleQuerier) AskReady() (bool, error)

AskReady ask the user if he/she is ready to take the quiz

func (*ConsoleQuerier) Query

func (cq *ConsoleQuerier) Query(pb *problem.Problem) (bool, error)

Query the problem to the user

type Querier

type Querier interface {
	AskReady() (bool, error)
	Query(pbs *problem.Problem) (bool, error)
}

Querier asks the user the questions

type Result

type Result struct {
	NbCorrectAnswers, NbTotalAnswers int
	Err                              error
}

Result of the quiz

func Query

func Query(querier Querier, pbs []*problem.Problem, timer time.Duration) (*Result, error)

Query the questions

func (*Result) String

func (r *Result) String() string

Jump to

Keyboard shortcuts

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