Documentation
¶
Index ¶
- type ContestCtx
- type ContestsCtx
- type Group
- func (g *Group) ConestsGetNearestOngoingContest(c echo.Context) error
- func (g *Group) ContestsGet(c echo.Context) error
- func (g *Group) FileGet(c echo.Context) error
- func (g *Group) OverviewGet(c echo.Context) error
- func (g *Group) ProblemGet(c echo.Context) error
- func (g *Group) ScoreboardGet(c echo.Context) error
- func (g *Group) ScoreboardJSONGet(c echo.Context) error
- func (g *Group) SubmissionDownload(c echo.Context) error
- func (g *Group) SubmissionGet(c echo.Context) error
- func (g *Group) SubmissionVerdictGet(c echo.Context) error
- func (g *Group) SubmitPost(c echo.Context) error
- type JSONProblem
- type JSONProblemResult
- type JSONScoreboard
- type JSONUserResult
- type OverviewCtx
- type ProblemCtx
- type ScoreboardCtx
- type SubmissionCtx
- type UserResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContestCtx ¶
ContestCtx implements a context that is common to all Contest UI page.
type ContestsCtx ¶
type ContestsCtx struct { *user.AuthCtx ActiveContests []*models.Contest PastContests []*models.Contest }
ContestsCtx is a context for rendering a list of all contests
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
Group is the /contests handling group
func (*Group) ConestsGetNearestOngoingContest ¶
Render the nearest ongoing contest or a table of all contests
func (*Group) ContestsGet ¶
Render a table of all contests
func (*Group) FileGet ¶
FileGet implements GET /contest/:id/problems/:problem/files/:file
func (*Group) OverviewGet ¶
OverviewGet implements GET "/contests/:id"
func (*Group) ProblemGet ¶
ProblemGet implements GET /contest/:id/problems/:problem
func (*Group) ScoreboardGet ¶
ScoreboardGet implements GET /contest/:id/scoreboard
func (*Group) ScoreboardJSONGet ¶ added in v0.3.0
ScoreboardJSONGet implements GET /contest/:id/scoreboard/json
func (*Group) SubmissionDownload ¶ added in v0.3.0
SubmissionDownload implements GET /contests/:id/submissions/:submission/download
func (*Group) SubmissionGet ¶
SubmissionGet implements GET /contests/:id/submissions/:submission
func (*Group) SubmissionVerdictGet ¶
SubmissionVerdictGet implements GET /contests/:id/submissions/:submission/verdict
type JSONProblem ¶ added in v0.3.0
type JSONProblem struct { ID int `json:"id"` Name string `json:"name"` DisplayName string `json:"display_name"` }
JSONProblem represents a JSON encoded problem metadata.
type JSONProblemResult ¶ added in v0.3.0
type JSONProblemResult struct { Score float64 `json:"score"` Solved bool `json:"solved"` Penalty int `json:"penalty"` FailedAttempts int `json:"failed_attempts"` }
JSONProblemResult represents a JSON encoded user's result of a problem in the scoreboard.
type JSONScoreboard ¶ added in v0.3.0
type JSONScoreboard struct { ContestID int `json:"contest_id"` ContestType models.ContestType `json:"contest_type"` Problems []JSONProblem `json:"problems"` Users []JSONUserResult `json:"users"` }
JSONScoreboard represents a JSON encoded scoreboard.
type JSONUserResult ¶ added in v0.3.0
type JSONUserResult struct { ID string `json:"id"` Rank int `json:"rank"` TotalPenalty int `json:"total_penalty"` SolvedProblems int `json:"solved_problems"` TotalScore float64 `json:"total_score"` ProblemResults map[int]JSONProblemResult `json:"problem_results"` }
JSONUserResult represents a JSON encoded user in the scoreboard.
type OverviewCtx ¶
type OverviewCtx struct { *ContestCtx Problems []*models.ProblemWithTestGroups Scores map[int]*models.ProblemResult }
OverviewCtx is the context for rendering "/contests/:id"
func (*OverviewCtx) Render ¶
func (o *OverviewCtx) Render(c echo.Context) error
Render renders the template corresponding to the context.
type ProblemCtx ¶
type ProblemCtx struct { *ContestCtx Problem *models.Problem Files map[string]*models.File Submissions []*models.Submission }
ProblemCtx is the context required to display a problem page.
func (*ProblemCtx) Render ¶
func (p *ProblemCtx) Render(c echo.Context) error
Render renders the context.
type ScoreboardCtx ¶
type ScoreboardCtx struct { *ContestCtx UserResults []*UserResult }
ScoreboardCtx is the context required to display the scoreboard page
func (*ScoreboardCtx) JSON ¶ added in v0.3.0
func (s *ScoreboardCtx) JSON() JSONScoreboard
JSON returns the JSON representation of the scoreboard.
func (*ScoreboardCtx) Render ¶
func (s *ScoreboardCtx) Render(c echo.Context) error
Render renders the scoreboard context
func (*ScoreboardCtx) RenderJSON ¶ added in v0.3.0
func (s *ScoreboardCtx) RenderJSON(c echo.Context) error
RenderJSON renders a scoreboard in JSON.
type SubmissionCtx ¶
type SubmissionCtx struct { *ContestCtx Submission *models.Submission Problem *models.Problem TestGroups []*models.TestGroupWithTests TestResults map[int]*models.TestResult }
SubmissionCtx is the context for rendering the submission page.
func (*SubmissionCtx) Render ¶
func (ctx *SubmissionCtx) Render(c echo.Context) error
Render renders the context.