Documentation
¶
Index ¶
- Constants
- Variables
- func CalcMaxScores(userSubms []SubmJoinScoreInfo) map[string]MaxScore
- func RandomShortID() (string, error)
- func ValidShortID(s string) bool
- type Eval
- type EvalError
- type EvalErrorType
- type EvalStage
- type MaxScore
- type ScoreBarInfo
- type ScoreInfo
- type ScoreUnit
- type Subm
- type SubmJoinEvalOld
- type SubmJoinScoreInfo
- type Subtask
- type Test
- type TestGroup
Constants ¶
View Source
const ShortIDLength = 6
Variables ¶
View Source
var ( ErrNotFound = errors.New("submission not found") ErrShortIDTaken = errors.New("submission short id taken") )
Functions ¶
func CalcMaxScores ¶
func CalcMaxScores(userSubms []SubmJoinScoreInfo) map[string]MaxScore
returns a map of task short ids to the max received score the user has received on a subm for that task
func RandomShortID ¶ added in v1.3.0
func ValidShortID ¶ added in v1.3.0
Types ¶
type Eval ¶
type Eval struct {
UUID uuid.UUID
SubmUUID uuid.UUID
Stage EvalStage
ScoreUnit ScoreUnit
Error *EvalError
Subtasks []Subtask
Groups []TestGroup
Tests []Test
Checker *string
Interactor *string
CpuLimMs int
MemLimKiB int
CreatedAt time.Time
}
func (*Eval) CalculateScore ¶
CalculateScore calculates scoring information from an evaluation
type EvalError ¶
type EvalError struct {
Type EvalErrorType
Message *string
}
type EvalErrorType ¶
type EvalErrorType string
const ( ErrorTypeCompilation EvalErrorType = "compilation" ErrorTypeInternal EvalErrorType = "internal" )
type MaxScore ¶
type MaxScore struct {
SubmUuid uuid.UUID
Received int
Possible int
FirstTime time.Time // first time the user got a score this high
}
max score the user has received on a subm for a specific task
type ScoreBarInfo ¶
type ScoreBarInfo struct {
Green int // accepted tests
Red int // wrong/failed tests
Gray int // not reached tests
Yellow int // in progress tests
Purple int // evaluation error
}
ScoreBarInfo contains the percentage distribution of test results
type ScoreInfo ¶
type ScoreInfo struct {
ScoreBar ScoreBarInfo
ReceivedScore int
PossibleScore int
MaxCpuMs int
MaxMemKiB int
ExceededCpu bool
ExceededMem bool
}
ScoreInfo contains all scoring related information for an evaluation
type SubmJoinEvalOld ¶
type SubmJoinScoreInfo ¶
type Test ¶
type Test struct {
Ac bool // accepted
Wa bool // wrong answer
Tle bool // time limit exceeded
Mle bool // memory limit exceeded
Re bool // runtime error
Ig bool // ignored
Reached bool // reached by tester
Finished bool // has finished
InpSha256 string
AnsSha256 string
CpuMs *int // cpu exec 'user' time in milliseconds (nullable)
MemKiB *int // rss memory in kibibytes (nullable)
}
Click to show internal directories.
Click to hide internal directories.