Documentation ¶
Index ¶
- Variables
- func GenerateArchive(ctx context.Context, pb *kilonova.Problem, w io.Writer, base *sudoapi.BaseAPI, ...) *kilonova.StatusError
- func ProcessArchiveFile(ctx *ArchiveCtx, file *zip.File) *kilonova.StatusError
- func ProcessAttachmentFile(ctx *ArchiveCtx, file *zip.File) *kilonova.StatusError
- func ProcessPolygonCheckFile(ctx *ArchiveCtx, file *zip.File) *kilonova.StatusError
- func ProcessProblemXMLFile(actx *ArchiveCtx, file io.Reader) *kilonova.StatusError
- func ProcessPropertiesFile(ctx *ArchiveCtx, file *zip.File) *kilonova.StatusError
- func ProcessSubmissionFile(ctx *ArchiveCtx, file *zip.File) *kilonova.StatusError
- func ProcessTestInputFile(ctx *ArchiveCtx, file *zip.File) *kilonova.StatusError
- func ProcessTestOutputFile(ctx *ArchiveCtx, file *zip.File) *kilonova.StatusError
- func ProcessZipTestArchive(ctx context.Context, pb *kilonova.Problem, ar *zip.Reader, ...) *kilonova.StatusError
- type ArchiveCtx
- type ArchiveGenOptions
- type PropertiesRaw
- type ScoreFileEntries
- type ScoreParamEntry
- type Subtask
- type TestProcessParams
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrBadTestFile = kilonova.Statusf(400, "Bad test score file") ErrBadArchive = kilonova.Statusf(400, "Bad archive") )
View Source
var (
ErrInvalidTestID = kilonova.Statusf(400, "Invalid test ID")
)
Functions ¶
func GenerateArchive ¶
func ProcessArchiveFile ¶
func ProcessArchiveFile(ctx *ArchiveCtx, file *zip.File) *kilonova.StatusError
func ProcessAttachmentFile ¶
func ProcessAttachmentFile(ctx *ArchiveCtx, file *zip.File) *kilonova.StatusError
func ProcessPolygonCheckFile ¶
func ProcessPolygonCheckFile(ctx *ArchiveCtx, file *zip.File) *kilonova.StatusError
func ProcessProblemXMLFile ¶
func ProcessProblemXMLFile(actx *ArchiveCtx, file io.Reader) *kilonova.StatusError
func ProcessPropertiesFile ¶
func ProcessPropertiesFile(ctx *ArchiveCtx, file *zip.File) *kilonova.StatusError
TODO: Allow having multiple .properties files And split grader.properties from generator.go into multiple files
func ProcessSubmissionFile ¶
func ProcessSubmissionFile(ctx *ArchiveCtx, file *zip.File) *kilonova.StatusError
func ProcessTestInputFile ¶
func ProcessTestInputFile(ctx *ArchiveCtx, file *zip.File) *kilonova.StatusError
func ProcessTestOutputFile ¶
func ProcessTestOutputFile(ctx *ArchiveCtx, file *zip.File) *kilonova.StatusError
func ProcessZipTestArchive ¶
Types ¶
type ArchiveCtx ¶
type ArchiveCtx struct {
// contains filtered or unexported fields
}
func NewArchiveCtx ¶
func NewArchiveCtx(params *TestProcessParams) *ArchiveCtx
type ArchiveGenOptions ¶
type ArchiveGenOptions struct { Tests bool `json:"tests"` Attachments bool `json:"attachments"` // If PrivateAttachments is true, the generator also adds attachments marked private // It's an option since non-editors should not be able to download private attachments. PrivateAttachments bool `json:"private_attachments"` // ProblemDetails includes problem metadata such as time/memory limits, problem name, whether it's console input, etc ProblemDetails bool `json:"details"` // Tags also adds tag list in a safe format Tags bool `json:"tags"` // Editors also includes a list of editor usernames Editors bool `json:"editors"` // Submissions only includes submissions from the problem editors, // whereas AllSubmissions includes ALL submissions Submissions bool `json:"submissions"` AllSubmissions bool `json:"all_submissions"` SubsLook bool `json:"-"` SubsLookingUser *kilonova.UserBrief `json:"-"` }
type PropertiesRaw ¶
type PropertiesRaw struct { Groups string `props:"groups"` Weights string `props:"weights"` Dependencies string `props:"dependencies"` Time *float64 `props:"time"` Memory *float64 `props:"memory"` Tags *string `props:"tags"` Source *string `props:"source"` ConsoleInput *string `props:"console_input"` TestName *string `props:"test_name"` ProblemName *string `props:"problem_name"` Editors *string `props:"editors"` DefaultScore *string `props:"default_score"` ScorePrecision *int32 `props:"score_precision"` ScoringStrategy *string `props:"scoring_strategy"` }
func ParsePropertiesFile ¶
func ParsePropertiesFile(r io.Reader) (*PropertiesRaw, bool, error)
type ScoreFileEntries ¶
TestID -> Score
func ParseScoreFile ¶
func ParseScoreFile(file *zip.File) (ScoreFileEntries, *kilonova.StatusError)
type ScoreParamEntry ¶
func ParseScoreParameters ¶
func ParseScoreParameters(params []byte) ([]ScoreParamEntry, *kilonova.StatusError)
func (*ScoreParamEntry) UnmarshalJSON ¶
func (p *ScoreParamEntry) UnmarshalJSON(input []byte) error
func (ScoreParamEntry) Valid ¶
func (p ScoreParamEntry) Valid() bool
Click to show internal directories.
Click to hide internal directories.