Documentation ¶
Index ¶
Constants ¶
const ( REJECTED = "Rejected" PENDING = "Pending" ACCEPTED = "Accepted" WRONG_ANSWER = "Wrong Answer" COMPILATION_ERROR = "Compilation Error" TIME_LIMIT_EXCEEDED = "Time Limit Exceeded" MEMORY_LIMIT_EXCEEDED = "Memory Limit Exceeded" RUNTIME_ERROR = "Runtime Error" )
const CONTAINER_TIMEOUT_MINUTES = 1
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Challenge ¶
type Challenge struct { gorm.Model ID uint Title string TimeLimit float32 MemoryLimit int Inputs []InputFile `gorm:"ForeignKey:ChallengeID"` Outputs []OutputFile `gorm:"ForeignKey:ChallengeID"` }
Challenge is a representation for the ORM of our challenges and their relevant information such as the challenge title, the memory and time constraints for the submissions and the set of input and outputs that represent the test cases.
type ExecutionResult ¶
type ExecutionResult struct { TestName string `json:"testName"` Status string `json:"status"` Message string `json:"message"` }
ExecutionResult represents the result of executing a given submission against one test case. TestName is the name of the test case, Status is the status of the test (i.e. "OK", "TLE" nad "RTE") and Message is used to store any relevant information, such as error messages.
type InputsArray ¶
type InputsArray []InputFile
func (InputsArray) TestFiles ¶
func (files InputsArray) TestFiles() []TestFile
type OutputFile ¶
type OutputFile struct {
TestFile
}
type OutputsArray ¶
type OutputsArray []OutputFile
func (OutputsArray) TestFiles ¶
func (files OutputsArray) TestFiles() []TestFile
type Submission ¶
type SubmissionForm ¶
type SubmissionForm struct { Language string `form:"language"` Source *multipart.FileHeader `form:"source"` ChallengeID uint `form:"challengeID"` }
SubmissionForm is used to represent a submission. It contains the source code, a string identifiying the language of the source code and the ID of the challenge associated with this submission.
type TestFileArray ¶
type TestFileArray []TestFile
func (TestFileArray) InputFiles ¶
func (files TestFileArray) InputFiles() []InputFile
func (TestFileArray) OutputFiles ¶
func (files TestFileArray) OutputFiles() []OutputFile