checkers

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrOut     = "translate:internal_error"
	CorrectOut = "translate:success"
	WrongOut   = "translate:wrong"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker added in v0.25.0

type Checker interface {
	Prepare(context.Context) (string, error)
	Cleanup(context.Context) error

	// RunChecker returns a comment and a decimal number [0, 100] signifying the percentage of correctness of the subtest
	RunChecker(ctx context.Context, subtestID int, testID int) (string, decimal.Decimal)
}

Checker is an interface for a function that statelessly tries to evaluate a subtest from a submission

func NewLegacyCustomChecker

func NewLegacyCustomChecker(mgr eval.BoxScheduler, logger *slog.Logger, pb *kilonova.Problem, filename string, code []byte, subCode []byte, lastUpdatedAt time.Time) Checker

func NewStandardCustomChecker

func NewStandardCustomChecker(mgr eval.BoxScheduler, logger *slog.Logger, pb *kilonova.Problem, filename string, code []byte, subCode []byte, lastUpdatedAt time.Time) Checker

type DiffChecker

type DiffChecker struct{}

func (*DiffChecker) Cleanup

func (d *DiffChecker) Cleanup(_ context.Context) error

func (*DiffChecker) Prepare

func (d *DiffChecker) Prepare(_ context.Context) (string, error)

func (*DiffChecker) RunChecker

func (d *DiffChecker) RunChecker(ctx context.Context, subtestID int, testID int) (string, decimal.Decimal)

Jump to

Keyboard shortcuts

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