models

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddToQueue

func AddToQueue(db *db.DB, q *Queue) error

func DeleteFromQueue

func DeleteFromQueue(db *db.DB, id int) error

func GetMaxScore

func GetMaxScore(db *db.DB, dpid int, tid int) (float64, error)

func ReadSubsCode

func ReadSubsCode(db *db.DB, rid int) (string, error)

func Resolve1

func Resolve1(db *db.DB, drid int) error

func ResolveQueue

func ResolveQueue(db *db.DB) error

func UpdateDebugSubmission

func UpdateDebugSubmission(db *db.DB, id int, result string, score float64) error

func WriteDebugProblem

func WriteDebugProblem(db *db.DB, prob *DebugProblem) (int64, error)

func WriteDebugSubmission

func WriteDebugSubmission(db *db.DB, sub *DebugSubmission) (int64, error)

Types

type DebugProblem

type DebugProblem struct {
	Dpid     int
	Code     string
	Name     string
	Status   string
	Solved   int
	Total    int
	Rid      int
	Pid      int
	Language string
	Score    float64
	Result   string
	MinDiff  int
}

func ReadDebugProblemWithCode

func ReadDebugProblemWithCode(db *db.DB, code string) (*DebugProblem, error)

func ReadDebugProblemWithID

func ReadDebugProblemWithID(db *db.DB, dpid int) (*DebugProblem, error)

type DebugSubmission

type DebugSubmission struct {
	Drid       int
	Dpid       int
	Rid        int
	Tid        int
	Language   string
	Submittime int64
	Result     string
	Score      float64
	Diff       int
	Code       string
}

func ReadDebugSubmission

func ReadDebugSubmission(db *db.DB, id int) (*DebugSubmission, error)

type JSONDebugProblem

type JSONDebugProblem struct {
	Problem  *JSONProblem `json:"problem"`
	Language string       `json:"language"`
	Result   string       `json:"result"`
	MaxScore float64      `json:"best_score"`
	Code     string       `json:"code"`
	Judge    *Judge       `json:"judge"`
}

func ReadJSONDebugProblemWithCode

func ReadJSONDebugProblemWithCode(db *db.DB, code string, tid int) (*JSONDebugProblem, error)

type JSONDebugSubmission

type JSONDebugSubmission struct {
	Dpcode   string  `json:"debug_problem_code"`
	Rid      int     `json:"codefun_id"`
	Score    float64 `json:"edit_result"`
	Diff     int     `json:"edit_score"`
	CFResult string  `json:"result"`
	CFScore  float64 `json:"score"`
}

func ReadJSONDebugSubmission

func ReadJSONDebugSubmission(db *db.DB, id int) (*JSONDebugSubmission, error)

type JSONProblem

type JSONProblem struct {
	Code string `json:"code"`
	Pid  int    `json:"id"`
	Name string `json:"name"`
}

func ReadJSONProblemWithID

func ReadJSONProblemWithID(db *db.DB, id int) (*JSONProblem, error)

type JSONVerify

type JSONVerify struct {
	Data  *JSONVerifyUser `json:"data"`
	Valid bool
}

func Verify

func Verify(bearer_token string) (*JSONVerify, error)

type JSONVerifyUser

type JSONVerifyUser struct {
	Tid int `json:"id"`
}

type Judge

type Judge struct {
	Correct int    `json:"correct"`
	Total   int    `json:"total"`
	Tests   []Test `json:"tests"`
}

func ConvertToJudge

func ConvertToJudge(raw string) (*Judge, error)

func ReadJudge

func ReadJudge(db *db.DB, rid int) (*Judge, error)

type Problem

type Problem struct {
	Pid         int
	Sid         int
	Code        string
	Name        string
	Type        string
	Scoretype   string
	Cid         sql.NullInt32
	Status      sql.NullString
	Pgroup      string
	Statement   string
	Timelimit   float32
	Score       float64
	Usechecker  int
	Checkercode string
	Solved      int
	Total       int
}

func ReadProblemWithID

func ReadProblemWithID(db *db.DB, id int) (*Problem, error)

type Queue

type Queue struct {
	Rid  int
	Drid int
}

type Run

type Run struct {
	Rid        int
	Pid        int
	Tid        int
	Language   string
	Time       float64
	Result     string
	Access     string
	Submittime int
	Scored     int
	Score      float64
}

func ReadRun

func ReadRun(db *db.DB, rid int) (*Run, error)

type Test

type Test struct {
	Verdict     string  `json:"verdict"`
	RunningTime float64 `json:"runningTime"`
	Message     string  `json:"message"`
}

Jump to

Keyboard shortcuts

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