Versions in this module Expand all Collapse all v0 v0.7.5 May 26, 2023 v0.7.4 Apr 29, 2023 v0.7.3 Feb 25, 2023 v0.7.2 Jun 24, 2021 v0.7.1 Dec 14, 2020 v0.7.0 Aug 2, 2020 v0.6.1 Jun 26, 2020 v0.6.0 Apr 23, 2020 Changes in this version + func (r *Problem) AdminLink() string + func (r *Problem) Link() string v0.5.0 Apr 17, 2020 Changes in this version + func (p *Problem) WriteFiles(db db.DBContext, files []*File) error + func (r *Problem) Verify() error + func (r *TestGroup) Hidden() bool + func (r *TestGroup) WriteTests(db db.DBContext, tests []*Test, override bool) error + func (t *TestGroup) DeleteResults(db db.DBContext) error + func BatchAddUsers(db db.DBContext, reset bool, users ...*User) error + func BatchInsertJobs(db db.DBContext, jobs ...*Job) error + func CollectUserProblemResults(db db.DBContext, userID string, problems []*Problem) (map[int]*ProblemResult, error) + func GetProblemByName(db db.DBContext, contestID int, name string) (*Problem, error) + func RejudgeCompile(db db.DBContext, subIDs ...int) error + func RejudgeRun(db db.DBContext, subIDs ...int) error + func RejudgeScore(db db.DBContext, subIDs ...int) error + type Config struct + EnableRegistration bool + EnableUserCustomization bool + SessionKey []byte + func GenerateConfig() (*Config, error) + func GetConfig(db db.DBContext) (*Config, error) + func (c *Config) Verify() error + func (c *Config) Write(database *db.DB) error + type ContestType string + const ContestTypeUnweighted + const ContestTypeWeighted + type JSONProblem struct + DisplayName string + ID int + Name string + type JSONProblemResult struct + BestSubmission int64 + FailedAttempts int + Penalty int + Score float64 + Solved bool + type JSONScoreboard struct + ContestID int + ContestType ContestType + ProblemFirstSolvers map[int]int64 + Problems []JSONProblem + Users []JSONUserResult + type JSONUserResult struct + DisplayName string + ID string + Organization string + ProblemResults map[int]JSONProblemResult + Rank int + SolvedProblems int + TotalPenalty int + TotalScore float64 + type JobType string + const JobTypeCompile + const JobTypeRun + const JobTypeScore + type Language string + const LanguageCpp + const LanguageGo + const LanguageJava + const LanguagePas + const LanguagePy2 + const LanguagePy3 + const LanguageRust + func LanguageByExt(ext string) (Language, error) + type PenaltyPolicy string + const PenaltyPolicyICPC + const PenaltyPolicyNone + const PenaltyPolicySubmitTime + type ProblemWithTestGroups struct + TestGroups []*TestGroup + func CollectTestGroups(db db.DBContext, problems []*Problem, private bool) ([]*ProblemWithTestGroups, error) + func (p *ProblemWithTestGroups) SubtaskScores() string + func (p *ProblemWithTestGroups) TotalScore() float64 + type QueueOverview struct + Compile int + Run int + Score int + func GetQueueOverview(db db.DBContext) (*QueueOverview, error) + func (q *QueueOverview) Total() int + type Scoreboard struct + Contest *Contest + ProblemFirstSolvers map[int]int64 + Problems []*Problem + UserResults []*UserResult + func GetScoreboard(db db.DBContext, contest *Contest, problems []*Problem) (*Scoreboard, error) + func (s *Scoreboard) CSV(w io.Writer) error + func (s *Scoreboard) CSVScoresOnly(w io.Writer) error + func (s *Scoreboard) JSON() JSONScoreboard + type ScoreboardViewStatus string + const ScoreboardViewStatusNoScoreboard + const ScoreboardViewStatusPublic + const ScoreboardViewStatusUser + type ScoringMode string + const ScoringModeBest + const ScoringModeDecay + const ScoringModeLast + const ScoringModeMin + const ScoringModeOnce + type TestGroupWithTests struct + Tests []*Test + func GetProblemTests(db db.DBContext, problemID int) ([]*TestGroupWithTests, error) + func GetProblemTestsMeta(db db.DBContext, problemID int) ([]*TestGroupWithTests, error) + func (tg *TestGroupWithTests) ComputeScore(results map[int]*TestResult) float64 + type TestScoringMode string + const TestScoringModeMin + const TestScoringModeProduct + const TestScoringModeSum + type UserResult struct + ProblemResults map[int]*ProblemResult + Rank int + SolvedProblems int + TotalPenalty int + TotalScore float64 + User *User