problem

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: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CsvProblemsParser

type CsvProblemsParser struct {
}

CsvProblemsParser extracts problems from a csv content

func (*CsvProblemsParser) Parse

func (pe *CsvProblemsParser) Parse(in io.Reader) ([]*Problem, error)

Parse problems from a csv file

type Problem

type Problem struct {
	Question string
	Answer   string
}

Problem is the data representation of a problem from the input

func (*Problem) IsCorrect

func (p *Problem) IsCorrect(answer string) bool

IsCorrect checks if the given answer is correct for this problem

func (*Problem) String

func (p *Problem) String() string

type ProblemsParser

type ProblemsParser interface {
	Parse(in io.Reader) ([]*Problem, error)
}

ProblemsParser extracts inputs to a slice of Problem

Jump to

Keyboard shortcuts

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