polygon

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

type Checker struct {
	Name   string    `xml:"name,attr"`
	Type   string    `xml:"type,attr"`
	Source *Resource `xml:"source"`
	Binary *Resource `xml:"binary"`
}

type Executable

type Executable struct {
	Source *Resource `xml:"source"`
	Binary *Resource `xml:"binary"`
}

type Group

type Group struct {
	Name           string  `xml:"name,attr"`
	Points         float64 `xml:"points,attr"`
	PointsPolicy   string  `xml:"points-policy,attr"`
	FeedbackPolicy string  `xml:"feedback-policy,attr"`
}

type Interactor

type Interactor struct {
	Source *Resource `xml:"source"`
	Binary *Resource `xml:"binary"`
}

type Name

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

Name represents problem name.

type Problem

type Problem struct {
	Names      []Name         `xml:"names>name"`
	Statements []Statement    `xml:"statements>statement"`
	TestSets   []TestSet      `xml:"judging>testset"`
	Assets     *ProblemAssets `xml:"assets"`
	Files      *ProblemFiles  `xml:"files"`
}

Problem represents a problem.

func ReadProblemConfig

func ReadProblemConfig(path string) (Problem, error)

ReadProblemConfig reads problem config from file.

type ProblemAssets

type ProblemAssets struct {
	Checker    *Checker    `xml:"checker"`
	Interactor *Interactor `xml:"interactor"`
	Solutions  []Solution  `xml:"solutions>solution"`
}

type ProblemFiles

type ProblemFiles struct {
	Resources   []Resource   `xml:"resources>file"`
	Executables []Executable `xml:"executables>executable"`
}

type ProblemStatementConfig

type ProblemStatementConfig struct {
	Name        string       `json:"name"`
	Legend      string       `json:"legend"`
	Input       string       `json:"input"`
	Output      string       `json:"output"`
	Notes       string       `json:"notes"`
	Scoring     string       `json:"scoring"`
	Interaction string       `json:"interaction"`
	Tutorial    string       `json:"tutorial"`
	TimeLimit   int          `json:"timeLimit"`
	MemoryLimit int64        `json:"memoryLimit"`
	InputFile   string       `json:"inputFile"`
	OutputFile  string       `json:"outputFile"`
	SampleTests []SampleTest `json:"sampleTests"`
}

func ReadProblemStatementConfig

func ReadProblemStatementConfig(path string) (ProblemStatementConfig, error)

type Resource

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

type SampleTest

type SampleTest struct {
	Input  string `json:"input"`
	Output string `json:"output"`
}

type Solution

type Solution struct {
	Tag    string    `xml:"tag,attr"`
	Source *Resource `xml:"source"`
	Binary *Resource `xml:"binary"`
}

type Statement

type Statement struct {
	Language string `xml:"language,attr"`
	Charset  string `xml:"charset,attr"`
	Path     string `xml:"path,attr"`
	MathJax  bool   `xml:"mathjax,attr"`
	Type     string `xml:"type,attr"`
}

Statement represents problem statement.

type Test

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

Test represents test.

type TestSet

type TestSet struct {
	Name              string  `xml:"name,attr"`
	TimeLimit         int64   `xml:"time-limit"`
	MemoryLimit       int64   `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"`
}

TestSet represents a group of tests.

Jump to

Keyboard shortcuts

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