workload

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package workload calculates academic credits from institution-mapped Moodle course custom fields.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidationError

func ValidationError(result Result) error

ValidationError explains why --require-minimum failed.

Types

type Backend

type Backend interface {
	Name() site.BackendKind
	Requirement() site.Requirement
	Courses(context.Context, string, config.Academic) ([]Course, error)
}

Backend reads enrolled courses and their custom fields.

type Course

type Course struct {
	ID        string
	ShortName string
	FullName  string
	Credits   *float64
	Level     string
	Term      string
	Missing   []string
}

Course is one enrolled course and the academic metadata Moodle exposed.

type Group

type Group struct {
	Term         string
	Level        string
	Credits      float64
	Minimum      float64
	MeetsMinimum bool
	Complete     bool
	Courses      []Course
}

Group is one term and academic level, which have one applicable minimum.

type Result

type Result struct {
	Groups     []Group
	AllMeet    bool
	Provenance site.Provenance
}

Result is a workload calculation plus provenance.

type Service

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

Service calculates workload without knowing how Moodle was queried.

func NewService

func NewService(backend Backend) *Service

func (*Service) Show

func (s *Service) Show(ctx context.Context, capabilities *site.Capabilities, academic config.Academic, term string) (Result, error)

Show calculates credits, optionally for one term.

Jump to

Keyboard shortcuts

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