score

package
v0.0.0-...-e2fb21b Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Score

type Score struct {
	ID        uint                   `gorm:"primaryKey" json:"-"`
	UserID    uint                   `json:"-"`
	User      *user.User             `gorm:"foreignKey:UserID" json:"user,omitempty"`
	LabID     uint                   `json:"-"`
	Lab       *lab.Lab               `gorm:"foreignKey:LabID" json:"lab,omitempty"`
	Score     float32                `gorm:"-" json:"score"`
	Result    checkpoint.CheckPoints `json:"result,omitempty"`
	Data      content.Contents       `json:"data,omitempty"`
	Stdout    string                 `json:"stdout,omitempty"`
	Stderr    string                 `json:"stderr,omitempty"`
	CreatedAt time.Time              `json:"createdAt"`
}

func GetScore

func GetScore(id uint, usedeadline bool) (score Score, err error)

func MapToScore

func MapToScore(c map[string]any) (result Score)

func (*Score) CalcScore

func (score *Score) CalcScore(usedeadline bool) float32

func (*Score) Create

func (score *Score) Create() error

func (Score) ToMap

func (c Score) ToMap() (result map[string]any)

type ScoreFilter

type ScoreFilter struct {
	LabId       string        `json:"labId"`
	User        user.User     `json:"user"`
	Score       *float32      `json:"score"`
	UseDeadline bool          `json:"usedeadline"`
	ShowFields  []string      `json:"showfields"`
	KeyField    string        `json:"keyfield"`
	Max         bool          `json:"max"`
	Groups      []groupfilter `json:"groups"`
}

func (ScoreFilter) GetScores

func (c ScoreFilter) GetScores(org Scores) (scores Scores, err error)

type Scores

type Scores struct {
	Scores      []Score
	KeyField    string
	ShowFields  []string
	UseDeadline bool
}

func (Scores) Contain

func (c Scores) Contain(score Score) bool

func (Scores) MarshalJSON

func (c Scores) MarshalJSON() ([]byte, error)

func (*Scores) UnmarshalJSON

func (c *Scores) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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