polygon

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParserAndIdentifier

func ParserAndIdentifier(opts ...Option) (problems.ConfigParser, problems.ConfigIdentifier)

Types

type Assets

type Assets struct {
	Attachments []Attachment `xml:"attachments>attachment"`
	Stubs       []Stub       `xml:"stubs>stub"`
	Checker     Checker      `xml:"checker"`
	Interactor  Interactor   `xml:"interactor"`
}

type Attachment

type Attachment struct {
	Name     string `xml:"name,attr"`
	Location string `xml:"location,attr"`
}

type Checker

type Checker struct {
	Type   string `xml:"type,attr"`
	Source Source `xml:"source"`
}

type Dependency

type Dependency struct {
	Group string `xml:"group,attr"`
}

type Group

type Group struct {
	Name         string       `xml:"name,attr"`
	PointsPolicy string       `xml:"points-policy,attr"`
	Points       float64      `xml:"points,attr"`
	Dependencies []Dependency `xml:"dependencies>dependency"`
}

type Interactor

type Interactor struct {
	Source Source `xml:"source"`
}

type JSONStatement

type JSONStatement struct {
	Name        string
	TimeLimit   int
	MemoryLimit int
	InputFile   string
	OutputFile  string
	Legend      string
	Input       string
	Interaction string
	Output      string
	Scoring     string
	SampleTests []SampleTest
	Notes       string
}

func ParseJSONStatement

func ParseJSONStatement(fs afero.Fs, path string) (*JSONStatement, error)

func (JSONStatement) Html

func (j JSONStatement) Html() ([]byte, error)

type Judging

type Judging struct {
	CpuName    string `xml:"cpu-name,attr"`
	CpuSpeed   int    `xml:"cpu-speed,attr"`
	InputFile  string `xml:"input-file,attr"`
	OutputFile string `xml:"output-file,attr"`

	Testsets []Testset `xml:"testset"`
}

func (Judging) GetTestset

func (j Judging) GetTestset(name string) (*Testset, error)

type Name

type Name struct {
	Language string `xml:"language,attr"`
	Value    string `xml:"value,attr"`
}

type Option

type Option func(*config)

func CompileBinaries

func CompileBinaries(compile bool) Option

func DontGenHTML added in v0.2.0

func DontGenHTML() Option

type Problem

type Problem struct {
	Path                   string
	JSONStatementList      []JSONStatement
	AttachmentsList        problems.Attachments
	GeneratedStatementList problems.Contents

	TaskType      string      `xml:"njudge-task-type,attr"`
	FeedbackType  string      `xml:"njudge-feedback-type,attr"`
	Revision      int         `xml:"revision,attr"`
	ShortName     string      `xml:"short-name,attr"`
	Url           string      `xml:"url,attr"`
	Names         []Name      `xml:"names>name"`
	StatementList []Statement `xml:"statements>statement"`
	Judging       Judging     `xml:"judging"`
	Assets        Assets      `xml:"assets"`
	TagsList      []struct {
		Value string `xml:"value,attr"`
	} `xml:"tags>tag"`
	// contains filtered or unexported fields
}

func (Problem) Attachments

func (p Problem) Attachments() problems.Attachments

func (Problem) Checker

func (p Problem) Checker() problems.Checker

func (Problem) Files

func (p Problem) Files() []problems.File

func (Problem) GetTaskType

func (p Problem) GetTaskType() problems.TaskType

func (Problem) HTMLStatements

func (p Problem) HTMLStatements() problems.Contents

func (Problem) InputOutputFiles

func (p Problem) InputOutputFiles() (string, string)

func (Problem) Languages

func (p Problem) Languages() []language.Language

func (Problem) MemoryLimit

func (p Problem) MemoryLimit() int

func (Problem) Name

func (p Problem) Name() string

func (Problem) PDFStatements

func (p Problem) PDFStatements() problems.Contents

func (Problem) Statements

func (p Problem) Statements() problems.Contents

func (Problem) StatusSkeleton

func (p Problem) StatusSkeleton(name string) (*problems.Status, error)

func (Problem) Tags

func (p Problem) Tags() (lst []string)

func (Problem) TimeLimit

func (p Problem) TimeLimit() int

func (Problem) Titles

func (p Problem) Titles() problems.Contents

type SampleTest

type SampleTest struct {
	Input  string
	Output string
}

type Source

type Source struct {
	Path string `xml:"path,attr"`
	Type string `xml:"type,attr"`
}

type Statement

type Statement struct {
	Language string `xml:"language,attr"`
	Path     string `xml:"path,attr"`
	Type     string `xml:"type,attr"`
}

type Stub

type Stub struct {
	Name     string `xml:"name,attr"`
	Path     string `xml:"path,attr"`
	Language string `xml:"language,attr"`
}

type Test

type Test struct {
	Method string  `xml:"method,attr"`
	Cmd    string  `xml:"cmd,attr"`
	Sample bool    `xml:"sample,attr"`
	Points float64 `xml:"points,attr"`
	Group  string  `xml:"group,attr"`

	Input  string
	Answer string
	Index  int
}

func (Test) Testcase

func (tc Test) Testcase() problems.Testcase

type Testset

type Testset struct {
	Name              string  `xml:"name,attr"`
	TimeLimit         int     `xml:"time-limit"`
	MemoryLimit       int     `xml:"memory-limit"`
	TestCount         int     `xml:"test-count"`
	InputPathPattern  string  `xml:"input-path-pattern"`
	AnswerPathPattern string  `xml:"answer-path-pattern"`
	Tests             []Test  `xml:"tests>test"`
	Groups            []Group `xml:"groups>group"`
}

func (Testset) Group

func (ts Testset) Group(name string) (*Group, error)

func (Testset) Testset

func (ts Testset) Testset(path string) problems.Testset

Jump to

Keyboard shortcuts

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