problem

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VerdictAC = Verdict(problems.VerdictAC)
	VerdictWA = Verdict(problems.VerdictWA)
	VerdictRE = Verdict(problems.VerdictRE)
	VerdictTL = Verdict(problems.VerdictTL)
	VerdictML = Verdict(problems.VerdictML)
	VerdictXX = Verdict(problems.VerdictXX)
	VerdictDR = Verdict(problems.VerdictDR)
	VerdictPC = Verdict(problems.VerdictPC)
	VerdictPE = Verdict(problems.VerdictPE)

	VerdictCE Verdict = 998
	VerdictRU Verdict = 999
	VerdictUP Verdict = 1000
)

Variables

View Source
var (
	ErrorFileNotFound      = errors.New("file not found")
	ErrorStatementNotFound = errors.New("statement not found")
)

Functions

This section is empty.

Types

type CategoryFilter

type CategoryFilter struct {
	Type  CategoryFilterType
	Value interface{}
}

func NewCategoryEmptyFilter

func NewCategoryEmptyFilter() CategoryFilter

func NewCategoryIDFilter

func NewCategoryIDFilter(ID int) CategoryFilter

type CategoryFilterType

type CategoryFilterType int
const (
	CategoryFilterNone CategoryFilterType = iota
	CategoryFilterEmpty
	CategoryFilterID
)

type PaginationList

type PaginationList struct {
	Pages    []pagination.Link
	Problems []Problem
}

type Problem

type Problem struct {
	problems.Problem
	models.ProblemRel
}

func (*Problem) GetAttachment

func (p *Problem) GetAttachment(attachment string) (problems.NamedData, error)

func (*Problem) GetFile

func (p *Problem) GetFile(file string) (fileLoc string, err error)

func (*Problem) GetPDF

func (p *Problem) GetPDF(lang string) ([]byte, error)

type ProblemTag

type ProblemTag struct {
	models.ProblemTag
}

type ProblemTagRepository

type ProblemTagRepository interface {
	Get(ctx context.Context, ID int) (*ProblemTag, error)
	Add(ctx context.Context, pt ProblemTag) error
	Delete(ctx context.Context, ID int) error
}

type Repository

type Repository interface {
	Get(ctx context.Context, ID int) (*Problem, error)
	GetAll(ctx context.Context) ([]Problem, error)
	GetByNames(ctx context.Context, problemset string, problemName string) (*Problem, error)
}

type SolvedStatus

type SolvedStatus int
const (
	Unattempted SolvedStatus = iota
	Attempted
	PartiallySolved
	Solved
	Unknown
)

type StatsData

type StatsData struct {
	SolverCount  int
	SolvedStatus SolvedStatus
	LastLanguage string
	CategoryLink ui.Link
	CategoryID   int
	Tags         []Tag
	Submissions  []submission.Submission
}

type Tag

type Tag struct {
	models.Tag
}

type Verdict

type Verdict int

func VerdictFromProblemsVerdictName

func VerdictFromProblemsVerdictName(name problems.VerdictName) Verdict

func (Verdict) String

func (v Verdict) String() string

func (Verdict) Translate

func (v Verdict) Translate(t i18n.Translator) string

Jump to

Keyboard shortcuts

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