util

package
v0.0.0-...-41a0304 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2023 License: MIT Imports: 15 Imported by: 10

Documentation

Index

Constants

View Source
const (
	CorrectionTemplateFilename = "CORRECTION.tmpl"
	SubmissionFilename         = "Abgabe"
	CorrectionFilename         = "Korrektur.yml"
)
View Source
const (
	IconSuccess = "✓"
	IconError   = "✘"

	NoMessage = ""
)
View Source
const (
	WorkspaceFilename = ".workspace.yml"
	UsercacheFilename = ".user"
)

Variables

View Source
var (
	Red   = Color("\033[1;31m%s\033[0m")
	Green = Color("\033[1;32m%s\033[0m")
)

Functions

func Color

func Color(colorString string) func(...interface{}) string

func CreateCorrectionSheet

func CreateCorrectionSheet(name string, corrections []ilias.Correction) *excelize.File

func FilterCorrections

func FilterCorrections(values []ilias.Correction, test func(correction ilias.Correction) bool) (ret []ilias.Correction)

func GetCredentials

func GetCredentials() *ilias.Credentials

func NewIliasClient

func NewIliasClient() *ilias.Client

func ReadCorrection

func ReadCorrection(path string) (*ilias.Correction, error)

func ReadCorrections

func ReadCorrections(members []string) ([]ilias.Correction, error)

func ReadUserCache

func ReadUserCache() string

func WriteCorrectionTemplate

func WriteCorrectionTemplate(path string, params TemplateParams) error

func WriteUserCache

func WriteUserCache(username string)

Types

type CorrectionStats

type CorrectionStats struct {
	Corrected []ilias.Correction
	Pending   []ilias.Correction
}

func GetCorrectionStats

func GetCorrectionStats(corrections []ilias.Correction) CorrectionStats

type CorrectionTemplate

type CorrectionTemplate struct {
	Checksum [20]byte
	Content  []byte
}

type Exercise

type Exercise struct {
	Reference  string `yaml:"reference"`
	Assignment string `yaml:"assignment"`
}

type Spinner

type Spinner struct {
	// contains filtered or unexported fields
}

func StartSpinner

func StartSpinner(title string) *Spinner

func (*Spinner) StopError

func (spin *Spinner) StopError(err error)

func (*Spinner) StopSuccess

func (spin *Spinner) StopSuccess(message string)

func (*Spinner) StopSuccessRemove

func (spin *Spinner) StopSuccessRemove()

func (*Spinner) UpdateMessage

func (spin *Spinner) UpdateMessage(message string)

type Table

type Table struct {
	Reference  string `yaml:"reference"`
	Identifier string `yaml:"identifier"`
	Name       string `yaml:"name"`
}

type TemplateParams

type TemplateParams struct {
	Student string
	Tutor   string
}

type Workspace

type Workspace struct {
	Title    string   `yaml:"title"`
	Exercise Exercise `yaml:"exercise"`
	//Table 		  	  Table						`yaml:"table"`
	Corrections map[string][]string `yaml:"corrections"`
}

func ReadWorkspace

func ReadWorkspace() Workspace

Jump to

Keyboard shortcuts

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