evaluation

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2024 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeepCopyStatus

func DeepCopyStatus(skeleton problems.Status) (ans problems.Status)

Types

type ACRunner

type ACRunner struct{}

func (ACRunner) Run

func (a ACRunner) Run(_ context.Context, _ sandbox.Provider, testcase *problems.Testcase) error

func (ACRunner) SetSolution

func (a ACRunner) SetSolution(_ context.Context, _ problems.Solution) error

type BasicRunner

type BasicRunner struct {
	// contains filtered or unexported fields
}

func NewBasicRunner

func NewBasicRunner(options ...BasicRunnerOption) *BasicRunner

func (*BasicRunner) Run

func (r *BasicRunner) Run(ctx context.Context, sandboxProvider sandbox.Provider, testcase *problems.Testcase) error

func (*BasicRunner) SetSolution

func (r *BasicRunner) SetSolution(ctx context.Context, solution problems.Solution) error

type BasicRunnerOption

type BasicRunnerOption func(r *BasicRunner)

func BasicRunnerWithChecker

func BasicRunnerWithChecker(c problems.Checker) BasicRunnerOption

func BasicRunnerWithFiles

func BasicRunnerWithFiles(inputFile, outputFile string) BasicRunnerOption

func BasicRunnerWithFs

func BasicRunnerWithFs(fs afero.Fs) BasicRunnerOption

type BytesSolution

type BytesSolution struct {
	// contains filtered or unexported fields
}

func NewByteSolution

func NewByteSolution(lang language.Language, src []byte) *BytesSolution

func (*BytesSolution) GetFile

func (b *BytesSolution) GetFile(ctx context.Context) (sandbox.File, error)

func (*BytesSolution) GetLanguage

func (b *BytesSolution) GetLanguage() language.Language

type CachedRunner added in v0.5.0

type CachedRunner struct {
	// contains filtered or unexported fields
}

func NewCachedRunner added in v0.5.0

func NewCachedRunner(inner problems.Runner) *CachedRunner

func (*CachedRunner) Run added in v0.5.0

func (c *CachedRunner) Run(ctx context.Context, sandboxProvider sandbox.Provider, testcase *problems.Testcase) error

func (*CachedRunner) SetSolution added in v0.5.0

func (c *CachedRunner) SetSolution(ctx context.Context, solution problems.Solution) error

type ChanStatusUpdate

type ChanStatusUpdate struct {
	// contains filtered or unexported fields
}

func NewChanStatusUpdate

func NewChanStatusUpdate() (ChanStatusUpdate, <-chan Status)

func (ChanStatusUpdate) Done

func (ChanStatusUpdate) UpdateStatus

func (c ChanStatusUpdate) UpdateStatus(_ context.Context, testcase string, status problems.Status) error

type Compile

type Compile struct{}

func (Compile) Compile

func (Compile) CompileWithExtras

func (c Compile) CompileWithExtras(ctx context.Context, solution problems.Solution, s sandbox.Sandbox, extras []sandbox.File) (*problems.CompilationResult, error)

type CompileCheckSupported

type CompileCheckSupported struct {
	List         []language.Language
	NextCompiler problems.Compiler
}

func (CompileCheckSupported) Compile

type CompileCopyFile

type CompileCopyFile struct {
}

func (CompileCopyFile) Compile

type CompileWithStubs

type CompileWithStubs struct {
	// contains filtered or unexported fields
}

func NewCompilerWithStubs

func NewCompilerWithStubs() *CompileWithStubs

func (*CompileWithStubs) AddStub

func (c *CompileWithStubs) AddStub(lang language.Language, stub problems.EvaluationFile)

func (*CompileWithStubs) Compile

type IgnoreStatusUpdate

type IgnoreStatusUpdate struct{}

func (IgnoreStatusUpdate) Done

func (IgnoreStatusUpdate) UpdateStatus

func (i IgnoreStatusUpdate) UpdateStatus(ctx context.Context, testcase string, status problems.Status) error

type InteractiveRunner

type InteractiveRunner struct {
	// contains filtered or unexported fields
}

func NewInteractiveRunner

func NewInteractiveRunner(interactorBinary []byte, checker problems.Checker, opts ...InteractiveRunnerOption) *InteractiveRunner

func (*InteractiveRunner) Run

func (r *InteractiveRunner) Run(ctx context.Context, sandboxProvider sandbox.Provider, testcase *problems.Testcase) error

func (*InteractiveRunner) SetSolution

func (r *InteractiveRunner) SetSolution(ctx context.Context, solution problems.Solution) error

type InteractiveRunnerOption

type InteractiveRunnerOption func(runner *InteractiveRunner)

func InteractiveRunnerWithExecutor

func InteractiveRunnerWithExecutor(executor UserInteractorExecutor) InteractiveRunnerOption

func InteractiveRunnerWithFs

func InteractiveRunnerWithFs(fs afero.Fs) InteractiveRunnerOption

type LinearEvaluator

type LinearEvaluator struct {
	Runner problems.Runner
}

func NewLinearEvaluator

func NewLinearEvaluator(runner problems.Runner) *LinearEvaluator

func (*LinearEvaluator) Evaluate

func (le *LinearEvaluator) Evaluate(ctx context.Context, skeleton problems.Status, compiledSolution problems.Solution, sandboxProvider sandbox.Provider, statusUpdater problems.StatusUpdater) (problems.Status, error)

type PolygonUserInteractorExecute

type PolygonUserInteractorExecute struct{}

func (PolygonUserInteractorExecute) ExecuteInteractor

func (p PolygonUserInteractorExecute) ExecuteInteractor(ctx context.Context, interactorSandbox sandbox.Sandbox, userStdin, userStdout *os.File, testcase *problems.Testcase) (*sandbox.Status, error)

func (PolygonUserInteractorExecute) ExecuteUser

func (p PolygonUserInteractorExecute) ExecuteUser(ctx context.Context, userSandbox sandbox.Sandbox, language language.Language, userBin sandbox.File, userStdin, userStdout *os.File, timeLimit time.Duration, memoryLimit memory.Amount) (*sandbox.Status, error)

type RateLimitStatusUpdate

type RateLimitStatusUpdate struct {
	// contains filtered or unexported fields
}

func NewRateLimitStatusUpdate

func NewRateLimitStatusUpdate(innerUpdater problems.StatusUpdater, r rate.Limit) *RateLimitStatusUpdate

func (RateLimitStatusUpdate) Done

func (RateLimitStatusUpdate) UpdateStatus

func (r RateLimitStatusUpdate) UpdateStatus(ctx context.Context, testcase string, status problems.Status) error

type Status

type Status struct {
	Testcase string
	Status   problems.Status
}

type TaskYAMLUserInteractorExecute

type TaskYAMLUserInteractorExecute struct {
	// contains filtered or unexported fields
}

func (*TaskYAMLUserInteractorExecute) Check

func (*TaskYAMLUserInteractorExecute) ExecuteInteractor

func (t *TaskYAMLUserInteractorExecute) ExecuteInteractor(ctx context.Context, interactorSandbox sandbox.Sandbox, userStdin, userStdout *os.File, testcase *problems.Testcase) (*sandbox.Status, error)

func (*TaskYAMLUserInteractorExecute) ExecuteUser

func (t *TaskYAMLUserInteractorExecute) ExecuteUser(ctx context.Context, userSandbox sandbox.Sandbox, language language.Language, userBin sandbox.File, userStdin, userStdout *os.File, timeLimit time.Duration, memoryLimit memory.Amount) (*sandbox.Status, error)

type UserInteractorExecutor

type UserInteractorExecutor interface {
	ExecuteUser(ctx context.Context, userSandbox sandbox.Sandbox, language language.Language, userBin sandbox.File, userStdin, userStdout *os.File, timeLimit time.Duration, memoryLimit memory.Amount) (*sandbox.Status, error)
	ExecuteInteractor(ctx context.Context, interactorSandbox sandbox.Sandbox, userStdin, userStdout *os.File, testcase *problems.Testcase) (*sandbox.Status, error)
}

type ZipRunner

type ZipRunner struct {
	// contains filtered or unexported fields
}

func NewZipRunner

func NewZipRunner(checker problems.Checker) *ZipRunner

func (*ZipRunner) Run

func (z *ZipRunner) Run(ctx context.Context, _ sandbox.Provider, testcase *problems.Testcase) error

func (*ZipRunner) SetSolution

func (z *ZipRunner) SetSolution(ctx context.Context, solution problems.Solution) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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