contests

package
v0.7.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClarificationForm added in v0.6.0

type ClarificationForm struct {
	Problem int64
	Content string
}

ClarificationForm is a form for sending clarifications.

func (*ClarificationForm) Bind added in v0.6.0

Bind binds the form into a Clarification.

type ContestCtx

type ContestCtx struct {
	*user.AuthCtx

	Contest  *models.Contest
	Problems []*models.Problem
}

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 New

func New(db *db.DB, g *echo.Group) (*Group, error)

New creates a new group

func (*Group) ConestsGetNearestOngoingContest

func (g *Group) ConestsGetNearestOngoingContest(c echo.Context) error

Render the nearest ongoing contest or a table of all contests

func (*Group) ContestsGet

func (g *Group) ContestsGet(c echo.Context) error

Render a table of all contests

func (*Group) FileGet

func (g *Group) FileGet(c echo.Context) error

FileGet implements GET /contest/:id/problems/:problem/files/:file

func (*Group) MessagesGet added in v0.6.0

func (g *Group) MessagesGet(c echo.Context) error

MessagesGet implements GET /contests/:id/messages.

func (*Group) MessagesUnreadGet added in v0.6.0

func (g *Group) MessagesUnreadGet(c echo.Context) error

MessagesUnreadGet returns the number of unread messages. Implements GET /contests/:id/messages/unread

func (*Group) OverviewGet

func (g *Group) OverviewGet(c echo.Context) error

OverviewGet implements GET "/contests/:id"

func (*Group) ProblemGet

func (g *Group) ProblemGet(c echo.Context) error

ProblemGet implements GET /contest/:id/problems/:problem

func (*Group) ScoreboardCSVGet

func (g *Group) ScoreboardCSVGet(c echo.Context) error

ScoreboardCSVGet implements GET /contests/:id/scoreboard/csv

func (*Group) ScoreboardGet

func (g *Group) ScoreboardGet(c echo.Context) error

ScoreboardGet implements GET /contest/:id/scoreboard

func (*Group) ScoreboardJSONGet

func (g *Group) ScoreboardJSONGet(c echo.Context) error

ScoreboardJSONGet implements GET /contest/:id/scoreboard/json

func (*Group) SendClarificationPost added in v0.6.0

func (g *Group) SendClarificationPost(c echo.Context) error

SendClarificationPost implements POST /contests/:id/messages.

func (*Group) SubmissionDownload

func (g *Group) SubmissionDownload(c echo.Context) error

SubmissionDownload implements GET /contests/:id/submissions/:submission/download

func (*Group) SubmissionGet

func (g *Group) SubmissionGet(c echo.Context) error

SubmissionGet implements GET /contests/:id/submissions/:submission

func (*Group) SubmissionVerdictGet

func (g *Group) SubmissionVerdictGet(c echo.Context) error

SubmissionVerdictGet implements GET /contests/:id/submissions/:submission/verdict

func (*Group) SubmitPost

func (g *Group) SubmitPost(c echo.Context) error

SubmitPost implements POST /contest/:id/problems/:problem/submit.

type Message added in v0.6.0

type Message struct {
	*models.Announcement
	*models.Clarification
}

Message is either an Announcement or a Clarification.

func (Message) UpdatedAt added in v0.6.0

func (m Message) UpdatedAt() time.Time

UpdatedAt returns the last updated time of the Message.

type MessagesCtx added in v0.6.0

type MessagesCtx struct {
	*ContestCtx

	ProblemsMap map[int]*models.Problem
	Messages    []Message

	FormError error
	Form      ClarificationForm
}

MessagesCtx is the context for rendering contests/messages.

func (*MessagesCtx) Render added in v0.6.0

func (a *MessagesCtx) Render(c echo.Context) error

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 {
	*user.AuthCtx
	*models.Scoreboard
}

ScoreboardCtx is the context required to display the scoreboard page

func (s *ScoreboardCtx) JSONLink() string

JSONLink returns the link to the JSON scoreboard.

func (*ScoreboardCtx) Render

func (s *ScoreboardCtx) Render(c echo.Context, wide bool) error

Render renders the scoreboard context

func (*ScoreboardCtx) RenderJSON

func (s *ScoreboardCtx) RenderJSON(c echo.Context) error

RenderJSON renders a scoreboard in JSON.

func (*ScoreboardCtx) Show

func (s *ScoreboardCtx) Show() error

Show decides whether the scoreboard can be shown.

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.

Jump to

Keyboard shortcuts

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