plexams

package
v1.99.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: BSD-3-Clause Imports: 38 Imported by: ? 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculatedAllowedSlots

func CalculatedAllowedSlots(semesterConfigSlots []*model.Slot, goSlots [][]int, isGO bool, constraints *model.Constraints) []*model.Slot

func PrintGOSlots

func PrintGOSlots(semesterConfigSlots []*model.Slot, goSlots [][]int) error

Types

type AnnyBooking added in v1.77.0

type AnnyBooking struct {
	Number               string          `json:"number"`
	StartDate            time.Time       `json:"start_date"`
	EndDate              time.Time       `json:"end_date"`
	BlockerStartDate     time.Time       `json:"blocker_start_date"`
	BlockerEndDate       time.Time       `json:"blocker_end_date"`
	ChargedDuration      int             `json:"charged_duration"`
	Description          string          `json:"description"`
	CreatedAt            time.Time       `json:"created_at"`
	UpdatedAt            time.Time       `json:"updated_at"`
	CanceledAt           *time.Time      `json:"canceled_at,omitempty"`
	Status               string          `json:"status"`
	StatusReason         json.RawMessage `json:"status_reason,omitempty"`
	IsBlocker            bool            `json:"is_blocker"`
	CanEdit              bool            `json:"can_edit"`
	IsEditable           bool            `json:"is_editable"`
	ManuallyCreated      bool            `json:"manually_created"`
	Note                 string          `json:"note"`
	Room                 string          `json:"room,omitempty"`
	Self                 string          `json:"self"`
	PersonalizationName  string          `json:"personalization_name"`
	BookingGroupID       string          `json:"booking_group_identifier,omitempty"`
	CancelableUntil      *time.Time      `json:"cancelable_until,omitempty"`
	HasCustomDescription bool            `json:"has_custom_description"`
	ResourceID           string          `json:"-"`
}

type BookedEntry

type BookedEntry struct {
	From     time.Time
	Until    time.Time
	Rooms    []string
	Approved bool
}

type ConsoleReporter added in v1.98.0

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

ConsoleReporter writes to stdout exactly like the CLI did before the Reporter abstraction was introduced: colored output via aurora and a yacspin spinner for progress.

func NewConsoleReporter added in v1.98.0

func NewConsoleReporter() *ConsoleReporter

NewConsoleReporter returns a Reporter that prints to the terminal.

func (*ConsoleReporter) Printf added in v1.98.0

func (r *ConsoleReporter) Printf(format string, a ...any)

func (*ConsoleReporter) Println added in v1.98.0

func (r *ConsoleReporter) Println(a ...any)

func (*ConsoleReporter) Progress added in v1.98.0

func (r *ConsoleReporter) Progress(p invigplan.Progress)

func (*ConsoleReporter) Step added in v1.99.0

func (r *ConsoleReporter) Step(msg string)

func (*ConsoleReporter) StopProgress added in v1.98.0

func (r *ConsoleReporter) StopProgress(finalMsg string)

func (*ConsoleReporter) StopProgressFail added in v1.99.0

func (r *ConsoleReporter) StopProgressFail(finalMsg string)

func (*ConsoleReporter) Warnf added in v1.98.0

func (r *ConsoleReporter) Warnf(format string, a ...any)

type ConstraintsEmail added in v1.17.0

type ConstraintsEmail struct {
	FromDate     string
	FromFK07Date string
	UntilDate    string
	FeedbackDate string
	PlanerName   string
}

type CoverMailData added in v1.40.0

type CoverMailData struct {
	Teacher       *model.Teacher
	PlanerName    string
	GeneratorName string
}

type CsvExam

type CsvExam struct {
	Ancode     int    `csv:"Ancode"`
	Module     string `csv:"Modul"`
	MainExamer string `csv:"Erstprüfer:in"`
	ExamDate   string `csv:"Termin"`
	Rooms      string `csv:"Räume"`
	Comment    string `csv:"Anmerkungen"`
}

type CsvExamEXaHM

type CsvExamEXaHM struct {
	Ancode      int    `csv:"Ancode"`
	Module      string `csv:"Modul"`
	MainExamer  string `csv:"Erstprüfender"`
	ExamDate    string `csv:"Termin"`
	MaxDuration int    `csv:"Maximale Länge"`
	Students    int    `csv:"Anmeldungen"`
	Rooms       string `csv:"Räume"`
	Type        string `csv:"Typ"`
	Jira        string `csv:"Jira"`
}

type CsvLBARepeater added in v1.41.0

type CsvLBARepeater struct {
	Ancode             int    `csv:"Ancode"`
	Module             string `csv:"Modul"`
	MainExamer         string `csv:"Erstprüfender"`
	EmailMainExamer    string `csv:"E-Mail Erstprüfender"`
	ExamDate           string `csv:"Termin"`
	Invigilators       string `csv:"Aufsichten"`
	EmailsInvigilators string `csv:"E-Mails Aufsichten"`
}

type Email

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

type Event added in v1.4.0

type Event struct {
	Summary string
	Start   time.Time
}

type ExahmEmail added in v1.66.0

type ExahmEmail struct {
	PlanerName string
}

type ExportNtas added in v1.15.0

type ExportNtas struct {
	Name     string `json:"name"`
	Duration int    `json:"duration"`
}

type ExportPlannedRooms added in v1.15.0

type ExportPlannedRooms struct {
	MainExamer       string       `json:"mainExamer"`
	MainExamerID     int          `json:"mainExamerID"`
	Module           string       `json:"module"`
	Room             string       `json:"room"`
	Date             string       `json:"date"`
	Starttime        string       `json:"starttime"`
	NumberOfStudents int          `json:"numberOfStudents"`
	Duration         int          `json:"duration"`
	MaxDuration      int          `json:"maxDuration"`
	Invigilator      string       `json:"invigilator"`
	Ntas             []ExportNtas `json:"ntas"`
}

type GeneratedExamMailData

type GeneratedExamMailData struct {
	FromFK07Date   string
	ToDate         string
	Exam           *model.GeneratedExam
	Teacher        *model.Teacher
	PlanerName     string
	HasStudentRegs bool
}

type HandicapExam

type HandicapExam struct {
	AnCode           int
	Module           string
	TypeExamFull     string
	HandicapStudents []*HandicapStudent
}

type HandicapStudent

type HandicapStudent struct {
	Name         string
	Compensation string
}

type HandicapsEmail

type HandicapsEmail struct {
	MainExamer string
	Exams      []*HandicapExam
	PlanerName string
}

type InvigilationMissingMailData added in v1.82.0

type InvigilationMissingMailData struct {
	Teacher    *model.Teacher
	Semester   string
	PlanerName string
	Minutes    int
}

type InvigilationsEmail added in v1.39.0

type InvigilationsEmail struct {
	NoOfInvigilators    int
	InvigilationInRooms int
	ReserveInvigilation int
	OtherContributions  int
	TodoPerInvigilator  int
	MaxDeviation        int
	MinDeviation        int
	PlanerName          string
}

type KnownConflict

type KnownConflict struct {
	Mtknr, Ancode1, Ancode2 string
}

type NTAEmail

type NTAEmail struct {
	NTA        *model.Student
	Exams      []*model.PlannedExam
	PlanerName string
}

type NTAEmailExamAndRoom added in v1.11.0

type NTAEmailExamAndRoom struct {
	Exam        *model.PlannedExam
	Room        *model.PlannedRoom
	Invigilator *model.Teacher
}

type NTAEmailWithRooms added in v1.11.0

type NTAEmailWithRooms struct {
	NTA           *model.Student
	ExamsWithRoom []NTAEmailExamAndRoom
	PlanerName    string
}

type NewNTA added in v1.65.0

type NewNTA struct {
	Student    *model.Student
	Exams      []*model.PlannedExam
	PlanerName string
}

type Planer

type Planer struct {
	Name  string
	Email string
}

type Plexams

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

func NewPlexams

func NewPlexams(semester, dbUri, zpaBaseurl, zpaUsername, zpaPassword string, fk07programs, oldprograms []string) (*Plexams, error)

func (*Plexams) AddAncode

func (p *Plexams) AddAncode(ctx context.Context, zpaAncode int, program string, primussAncode int) error

func (*Plexams) AddConstraints added in v1.20.0

func (p *Plexams) AddConstraints(ctx context.Context, ancode int, constraintsInput model.ConstraintsInput) (*model.Constraints, error)

func (*Plexams) AddExamToSlot

func (p *Plexams) AddExamToSlot(ctx context.Context, ancode int, dayNumber int, timeNumber int, force bool) (bool, error)

func (*Plexams) AddExamToSlottime added in v1.74.0

func (p *Plexams) AddExamToSlottime(ctx context.Context, ancode int, time time.Time) (bool, error)

func (*Plexams) AddInvigilation

func (p *Plexams) AddInvigilation(ctx context.Context, room string, day, slot, invigilatorID int) error

func (*Plexams) AddInvigilatorsToInvigilationTodos

func (p *Plexams) AddInvigilatorsToInvigilationTodos(ctx context.Context, todos *model.InvigilationTodos) error

func (*Plexams) AddMucDaiExam added in v1.3.0

func (p *Plexams) AddMucDaiExam(ctx context.Context, zpaAncode int, mucdaiExam *model.MucDaiExam) (*model.ZPAExam, error)

func (*Plexams) AddNta

func (p *Plexams) AddNta(ctx context.Context, input model.NTAInput) (*model.NTA, error)

func (*Plexams) AddStudentReg added in v1.36.0

func (p *Plexams) AddStudentReg(ctx context.Context, program string, ancode int, mtknr string) error

func (*Plexams) AddZpaExamToPlan

func (p *Plexams) AddZpaExamToPlan(ctx context.Context, ancode int) (bool, error)

func (*Plexams) AllAnnyBookings added in v1.77.0

func (p *Plexams) AllAnnyBookings(ctx context.Context) ([]*model.AnnyBooking, error)

func (*Plexams) AllProgramsInPlan

func (p *Plexams) AllProgramsInPlan(ctx context.Context) ([]string, error)

func (*Plexams) AllowedSlots

func (p *Plexams) AllowedSlots(ctx context.Context, ancode int) ([]*model.Slot, error)

func (*Plexams) AncodesInPlan

func (p *Plexams) AncodesInPlan(ctx context.Context) ([]int, error)

func (*Plexams) AnnyBookings added in v1.77.0

func (p *Plexams) AnnyBookings(ctx context.Context, room *string) ([]*model.AnnyBooking, error)

func (*Plexams) AwkwardSlots

func (p *Plexams) AwkwardSlots(ctx context.Context, ancode int) ([]*model.Slot, error)

func (*Plexams) ChangeAncode

func (p *Plexams) ChangeAncode(ctx context.Context, program string, ancode, newAncode int) (*model.PrimussExam, error)

func (*Plexams) ChangeAncodeInConflicts

func (p *Plexams) ChangeAncodeInConflicts(ctx context.Context, program string, ancode, newAncode int) (*model.Conflicts, error)

func (*Plexams) ChangeAncodeInStudentRegs

func (p *Plexams) ChangeAncodeInStudentRegs(ctx context.Context, program string, ancode, newAncode int) ([]*model.StudentReg, error)

func (*Plexams) ChangeRoom

func (p *Plexams) ChangeRoom(ctx context.Context, ancode int, oldRoomName, newRoomName string) (bool, error)

func (*Plexams) ConflictingAncodes

func (p *Plexams) ConflictingAncodes(ctx context.Context, ancode int) ([]*model.Conflict, error)

func (*Plexams) ConnectExam

func (p *Plexams) ConnectExam(ancode int, program string) error

TODO: check if there are Exams with same Ancode in other programs

func (*Plexams) ConstraintForAncode

func (p *Plexams) ConstraintForAncode(ctx context.Context, ancode int) (*model.Constraints, error)

func (*Plexams) Constraints

func (p *Plexams) Constraints(ctx context.Context) ([]*model.Constraints, error)

func (*Plexams) ConstraintsMap

func (p *Plexams) ConstraintsMap(ctx context.Context) (map[int]*model.Constraints, error)

func (*Plexams) ConstraintsPDF

func (p *Plexams) ConstraintsPDF(ctx context.Context, outfile string) error

func (*Plexams) CsvForEXaHM

func (p *Plexams) CsvForEXaHM(filename string) error

func (*Plexams) CsvForLBARepeater added in v1.41.0

func (p *Plexams) CsvForLBARepeater(filename string) error

func (*Plexams) CsvForProgram

func (p *Plexams) CsvForProgram(program, filename string) error

func (*Plexams) DraftExahmPDF

func (p *Plexams) DraftExahmPDF(ctx context.Context, outfile string) error

func (*Plexams) DraftFS

func (p *Plexams) DraftFS(ctx context.Context, outfile string) error

func (*Plexams) DraftFSBytes added in v1.29.0

func (p *Plexams) DraftFSBytes(ctx context.Context) ([]byte, error)

func (*Plexams) DraftFk08PDF

func (p *Plexams) DraftFk08PDF(ctx context.Context, outfile string) error

func (*Plexams) DraftFk10PDF

func (p *Plexams) DraftFk10PDF(ctx context.Context, outfile string) error

func (*Plexams) DraftLbaRep

func (p *Plexams) DraftLbaRep(ctx context.Context) error

func (*Plexams) DraftMucDaiPDF

func (p *Plexams) DraftMucDaiPDF(ctx context.Context, outfile string) error

func (*Plexams) DraftSI

func (p *Plexams) DraftSI(ctx context.Context) error

func (*Plexams) EndValidation added in v1.99.0

func (p *Plexams) EndValidation()

EndValidation deregisters a finished validation.

func (*Plexams) EndZPATransfer added in v1.99.0

func (p *Plexams) EndZPATransfer()

EndZPATransfer deregisters a finished ZPA transfer.

func (*Plexams) Exahm

func (p *Plexams) Exahm(ctx context.Context, ancode int) (bool, error)

func (*Plexams) ExahmRoomsFromAnnyBookings added in v1.77.0

func (p *Plexams) ExahmRoomsFromAnnyBookings(ctx context.Context) ([]BookedEntry, error)

func (*Plexams) ExahmRoomsFromBooked

func (p *Plexams) ExahmRoomsFromBooked() ([]BookedEntry, error)

func (*Plexams) ExamInfo added in v1.58.0

func (p *Plexams) ExamInfo(ancode int) (string, error)

func (*Plexams) ExamerInPlan

func (p *Plexams) ExamerInPlan(ctx context.Context) ([]*model.ExamerInPlan, error)

func (*Plexams) ExamsInSlot

func (p *Plexams) ExamsInSlot(ctx context.Context, day int, time int) ([]*model.PlannedExam, error)

func (*Plexams) ExamsWithNtas added in v1.75.0

func (p *Plexams) ExamsWithNtas(ctx context.Context) ([]*model.PlannedExam, error)

func (*Plexams) ExamsWithoutDuration added in v1.76.0

func (p *Plexams) ExamsWithoutDuration() (string, error)

func (*Plexams) ExamsWithoutSlot

func (p *Plexams) ExamsWithoutSlot(ctx context.Context) ([]*model.PlannedExam, error)

func (*Plexams) ExcludeDays

func (p *Plexams) ExcludeDays(ctx context.Context, ancode int, dayStrings []string) (bool, error)

func (*Plexams) ExportICS added in v1.57.0

func (p *Plexams) ExportICS(program string, filename string) error

func (*Plexams) ExportPlannedRooms added in v1.15.0

func (p *Plexams) ExportPlannedRooms(jsonfile string) error

func (*Plexams) FetchFromAnny added in v1.77.0

func (p *Plexams) FetchFromAnny() error

func (*Plexams) GenerateExamsToPlanPDF

func (p *Plexams) GenerateExamsToPlanPDF(ctx context.Context, outfile string) error

func (*Plexams) GenerateInvigilations added in v1.84.0

func (p *Plexams) GenerateInvigilations(ctx context.Context, dryRun bool, opts invigplan.Options, reporter Reporter) (*model.InvigilationReport, error)

GenerateInvigilations refreshes the self-invigilations and the todos, builds the planning problem, optimizes it and (unless dryRun) writes the result to invigilations_other, dropping the previous content. Self-invigilations stay in invigilations_self; pre-planned invigilations are included as fixed seeds. To fix an assignment across runs, move it to the pre-planning.

func (*Plexams) GeneratedExam

func (p *Plexams) GeneratedExam(ctx context.Context, ancode int) (*model.GeneratedExam, error)

func (*Plexams) GeneratedExams

func (p *Plexams) GeneratedExams(ctx context.Context) ([]*model.GeneratedExam, error)

func (*Plexams) GeneratedExamsForExamer

func (p *Plexams) GeneratedExamsForExamer(ctx context.Context, examerID int) ([]*model.GeneratedExam, error)

func (*Plexams) GetAllSemesterNames

func (p *Plexams) GetAllSemesterNames(ctx context.Context) ([]*model.Semester, error)

func (*Plexams) GetConflicts

func (p *Plexams) GetConflicts(ctx context.Context, exam *model.PrimussExam) (*model.Conflicts, error)

func (*Plexams) GetConnectedExam

func (p *Plexams) GetConnectedExam(ctx context.Context, ancode int) (*model.ConnectedExam, error)

func (*Plexams) GetConnectedExams

func (p *Plexams) GetConnectedExams(ctx context.Context) ([]*model.ConnectedExam, error)

func (*Plexams) GetEnhancedStudentRegs added in v1.64.0

func (p *Plexams) GetEnhancedStudentRegs(ctx context.Context, program string, ancode int) ([]*model.EnhancedStudentReg, error)

func (*Plexams) GetExamsForStudent deprecated

func (p *Plexams) GetExamsForStudent(name string) error

Deprecated: rm me

func (*Plexams) GetFk07programs

func (p *Plexams) GetFk07programs(ctx context.Context) ([]*model.FK07Program, error)

func (*Plexams) GetGoSlots

func (p *Plexams) GetGoSlots() [][]int

func (*Plexams) GetInvigilationTodos

func (p *Plexams) GetInvigilationTodos(ctx context.Context) (*model.InvigilationTodos, error)

func (*Plexams) GetInvigilator

func (p *Plexams) GetInvigilator(ctx context.Context, invigilatorID int) (*model.Invigilator, error)

func (*Plexams) GetInvigilatorForRoom added in v1.41.0

func (p *Plexams) GetInvigilatorForRoom(ctx context.Context, name string, day, time int) (*model.Teacher, error)

func (*Plexams) GetInvigilatorInSlot

func (p *Plexams) GetInvigilatorInSlot(ctx context.Context, roomname string, day, time int) (*model.Teacher, error)

func (*Plexams) GetInvigilators

func (p *Plexams) GetInvigilators(ctx context.Context) ([]*model.ZPAInvigilator, error)

func (*Plexams) GetPrimussExam

func (p *Plexams) GetPrimussExam(ctx context.Context, program string, ancode int) (*model.PrimussExam, error)

func (*Plexams) GetPrimussExamsForAncode

func (p *Plexams) GetPrimussExamsForAncode(ctx context.Context, ancode int) ([]*model.PrimussExam, error)

func (*Plexams) GetReservations

func (p *Plexams) GetReservations() (map[string][]TimeRange, error)

func (*Plexams) GetRoomInfo

func (p *Plexams) GetRoomInfo(roomName string) *model.Room

func (*Plexams) GetRoomsForNTAOld

func (p *Plexams) GetRoomsForNTAOld(name string) error

FIXME: rewrite me

func (*Plexams) GetSemester

func (p *Plexams) GetSemester(ctx context.Context) *model.Semester

func (*Plexams) GetSemesterConfig

func (p *Plexams) GetSemesterConfig() *model.SemesterConfig

func (*Plexams) GetStarttime

func (p *Plexams) GetStarttime(dayNumber, slotNumber int) (*time.Time, error)

func (*Plexams) GetStudentRegs

func (p *Plexams) GetStudentRegs(ctx context.Context, exam *model.PrimussExam) ([]*model.StudentReg, error)

func (*Plexams) GetStudentRegsForAncode

func (p *Plexams) GetStudentRegsForAncode(ancode int) (*model.StudentRegsForAncode, error)

func (*Plexams) GetStudents

func (p *Plexams) GetStudents(ctx context.Context, mtknr string) ([]*model.ZPAStudent, error)

func (*Plexams) GetStudentsFromZPA added in v1.60.0

func (p *Plexams) GetStudentsFromZPA(ctx context.Context, reporter Reporter) (studentsFound int, studentsNotFound int, err error)

func (*Plexams) GetSupervisorRequirements

func (p *Plexams) GetSupervisorRequirements(ctx context.Context) ([]*zpa.SupervisorRequirements, error)

func (*Plexams) GetTeacher

func (p *Plexams) GetTeacher(ctx context.Context, id int) (*model.Teacher, error)

func (*Plexams) GetTeacherIdByRegex added in v1.39.0

func (p *Plexams) GetTeacherIdByRegex(ctx context.Context, name string) (int, error)

func (*Plexams) GetTeachers

func (p *Plexams) GetTeachers(ctx context.Context, fromZpa *bool) ([]*model.Teacher, error)

func (*Plexams) GetZPAExam

func (p *Plexams) GetZPAExam(ctx context.Context, ancode int) (*model.ZPAExam, error)

func (*Plexams) GetZPAExams

func (p *Plexams) GetZPAExams(ctx context.Context, fromZpa *bool) ([]*model.ZPAExam, error)

func (*Plexams) GetZPAExamsGroupedByType

func (p *Plexams) GetZPAExamsGroupedByType(ctx context.Context) ([]*model.ZPAExamsForType, error)

func (*Plexams) GetZPAStudents added in v1.62.0

func (p *Plexams) GetZPAStudents(ctx context.Context) ([]*model.ZPAStudent, error)

func (*Plexams) GetZpaAnCodes

func (p *Plexams) GetZpaAnCodes(ctx context.Context) ([]*model.AnCode, error)

func (*Plexams) GetZpaAnCodesToPlan

func (p *Plexams) GetZpaAnCodesToPlan(ctx context.Context) ([]*model.AnCode, error)

func (*Plexams) GetZpaExamByAncode

func (p *Plexams) GetZpaExamByAncode(ctx context.Context, ancode int) (*model.ZPAExam, error)

func (*Plexams) GetZpaExamsNotToPlan

func (p *Plexams) GetZpaExamsNotToPlan(ctx context.Context) ([]*model.ZPAExam, error)

func (*Plexams) GetZpaExamsToPlan

func (p *Plexams) GetZpaExamsToPlan(ctx context.Context) ([]*model.ZPAExam, error)

func (*Plexams) ImportExamsFromZPA added in v1.99.0

func (p *Plexams) ImportExamsFromZPA(ctx context.Context, reporter Reporter) (int, error)

ImportExamsFromZPA fetches the exams from ZPA, caches them and streams a CLI-style listing via the reporter. It returns the number fetched.

func (*Plexams) ImportInvigilatorRequirementsFromZPA added in v1.99.0

func (p *Plexams) ImportInvigilatorRequirementsFromZPA(ctx context.Context, reporter Reporter) (int, error)

ImportInvigilatorRequirementsFromZPA fetches the invigilator requirements from ZPA, streams which invigilators are still missing and returns the number of requirements fetched.

func (*Plexams) ImportTeachersFromZPA added in v1.99.0

func (p *Plexams) ImportTeachersFromZPA(ctx context.Context, reporter Reporter) (int, error)

ImportTeachersFromZPA fetches the teachers from ZPA, caches them and streams a CLI-style listing via the reporter. It returns the number fetched.

func (*Plexams) InvigilationTodos deprecated

func (p *Plexams) InvigilationTodos(ctx context.Context) (*model.InvigilationTodos, error)

Deprecated: split to other functions

func (*Plexams) Invigilator added in v1.68.0

func (p *Plexams) Invigilator(ctx context.Context, room string, day int, time int) (*model.Teacher, error)

func (*Plexams) InvigilatorsForDay

func (p *Plexams) InvigilatorsForDay(ctx context.Context, day int) (*model.InvigilatorsForDay, error)

func (*Plexams) InvigilatorsWithReq

func (p *Plexams) InvigilatorsWithReq(ctx context.Context) ([]*model.Invigilator, error)

func (*Plexams) Lab

func (p *Plexams) Lab(ctx context.Context, ancode int) (bool, error)

func (*Plexams) LockExam

func (p *Plexams) LockExam(ctx context.Context, ancode int) (*model.PlanEntry, *model.GeneratedExam, error)

func (*Plexams) LockPlan

func (p *Plexams) LockPlan(ctx context.Context) error

func (*Plexams) MakeSelfInvigilations

func (p *Plexams) MakeSelfInvigilations(ctx context.Context) ([]*model.Invigilation, error)

func (*Plexams) MucDaiExam added in v1.3.0

func (p *Plexams) MucDaiExam(ctx context.Context, program string, ancode int) (*model.MucDaiExam, error)

func (*Plexams) MucDaiExamsForProgram added in v1.3.0

func (p *Plexams) MucDaiExamsForProgram(ctx context.Context, program string) ([]*model.MucDaiExam, error)

func (*Plexams) MucdaiExams

func (p *Plexams) MucdaiExams(ctx context.Context) ([]*model.MucDaiExam, error)

func (*Plexams) NotPlannedByMe

func (p *Plexams) NotPlannedByMe(ctx context.Context, ancode int) (bool, error)

func (*Plexams) Nta deprecated

func (p *Plexams) Nta(ctx context.Context, mtknr string) (*model.NTAWithRegs, error)

Deprecated: use StudentByMtknr

func (*Plexams) NtaByMtknr

func (p *Plexams) NtaByMtknr(ctx context.Context, mtknr string) (*model.NTA, error)

func (*Plexams) Ntas

func (p *Plexams) Ntas(ctx context.Context) ([]*model.NTA, error)

func (*Plexams) NtasWithRegs

func (p *Plexams) NtasWithRegs(ctx context.Context) ([]*model.Student, error)

func (*Plexams) Online

func (p *Plexams) Online(ctx context.Context, ancode int) (bool, error)

func (*Plexams) OptimizerOptionsFromConfig added in v1.84.0

func (p *Plexams) OptimizerOptionsFromConfig(seed int64, iterations int) invigplan.Options

OptimizerOptionsFromConfig builds the optimizer options from viper, applying the given seed and iteration overrides (0 = keep config/default).

func (*Plexams) PlacesWithSockets

func (p *Plexams) PlacesWithSockets(ctx context.Context, ancode int) (bool, error)

func (*Plexams) PlanEntries

func (p *Plexams) PlanEntries(ctx context.Context) ([]*model.PlanEntry, error)

func (*Plexams) PlannedAncodes added in v1.53.0

func (p *Plexams) PlannedAncodes() error

func (*Plexams) PlannedExam

func (p *Plexams) PlannedExam(ctx context.Context, ancode int) (*model.PlannedExam, error)

func (*Plexams) PlannedExams

func (p *Plexams) PlannedExams(ctx context.Context) ([]*model.PlannedExam, error)

func (*Plexams) PlannedExamsByExamer

func (p *Plexams) PlannedExamsByExamer(ctx context.Context, examerID int) ([]*model.PlannedExam, error)

func (*Plexams) PlannedExamsForProgram

func (p *Plexams) PlannedExamsForProgram(ctx context.Context, program string, onlyPlannedByMe bool) ([]*model.PlannedExam, error)

func (*Plexams) PlannedRoomForStudent added in v1.10.0

func (p *Plexams) PlannedRoomForStudent(ctx context.Context, ancode int, mtknr string) (*model.PlannedRoom, error)

func (*Plexams) PlannedRoomInfo added in v1.35.0

func (p *Plexams) PlannedRoomInfo(roomName string) error

PlannedRoomInfo prints the planned room for a given room name.

func (*Plexams) PlannedRoomNames

func (p *Plexams) PlannedRoomNames(ctx context.Context) ([]string, error)

func (*Plexams) PlannedRoomNamesInSlot

func (p *Plexams) PlannedRoomNamesInSlot(ctx context.Context, day int, time int) ([]string, error)

func (*Plexams) PlannedRooms

func (p *Plexams) PlannedRooms(ctx context.Context) ([]*model.PlannedRoom, error)

func (*Plexams) PlannedRoomsInSlot

func (p *Plexams) PlannedRoomsInSlot(ctx context.Context, day int, time int) ([]*model.PlannedRoom, error)

func (*Plexams) PossibleDays

func (p *Plexams) PossibleDays(ctx context.Context, ancode int, dayStrings []string) (bool, error)

func (*Plexams) PostStudentRegsToZPA

func (p *Plexams) PostStudentRegsToZPA(ctx context.Context, jsonOutputFile string, reporter Reporter) ([]*model.ZPAStudentReg, []*model.RegWithError, error)

func (*Plexams) PreAddExamToSlot added in v1.18.0

func (p *Plexams) PreAddExamToSlot(ctx context.Context, ancode int, dayNumber int, timeNumber int) (bool, error)

func (*Plexams) PreAddInvigilation added in v1.84.0

func (p *Plexams) PreAddInvigilation(ctx context.Context, invigilatorID, day, slot int, roomName *string) (bool, error)

PreAddInvigilation fixes an invigilator for a room (roomName != nil) or the reserve (roomName == nil) in a slot before the automatic invigilation planning runs. It validates the same constraints as AddInvigilation.

func (*Plexams) PreAddRoomToExam added in v1.30.0

func (p *Plexams) PreAddRoomToExam(ctx context.Context, ancode int, roomName string, mtknr *string, reserve bool) (bool, error)

func (*Plexams) PreExamsInSlot added in v1.23.0

func (p *Plexams) PreExamsInSlot(ctx context.Context, day int, time int) ([]*model.PreExam, error)

func (*Plexams) PrePlanInvigilationInSlot added in v1.85.0

func (p *Plexams) PrePlanInvigilationInSlot(ctx context.Context, day, slot int, roomName *string) (bool, error)

PrePlanInvigilationInSlot promotes the invigilation currently planned for a room (roomName != nil) or the reserve (roomName == nil) in a slot to a pre-planned, fixed assignment. It looks up the assigned invigilator, stores a pre-planned invigilation for them and marks the live invigilation as pre-planned so the GUI can show it.

func (*Plexams) PrePlannedInvigilations added in v1.84.0

func (p *Plexams) PrePlannedInvigilations(ctx context.Context) ([]*model.PrePlannedInvigilation, error)

func (*Plexams) PrePlannedInvigilationsForInvigilator added in v1.84.0

func (p *Plexams) PrePlannedInvigilationsForInvigilator(ctx context.Context, invigilatorID int) ([]*model.PrePlannedInvigilation, error)

func (*Plexams) PrePlannedRooms added in v1.56.0

func (p *Plexams) PrePlannedRooms(ctx context.Context) ([]*model.PrePlannedRoom, error)

func (*Plexams) PrePlannedRoomsForExam added in v1.50.0

func (p *Plexams) PrePlannedRoomsForExam(ctx context.Context, ancode int) ([]*model.PrePlannedRoom, error)

func (*Plexams) PrepareConnectedExam

func (p *Plexams) PrepareConnectedExam(ancode int) error

func (*Plexams) PrepareConnectedExams

func (p *Plexams) PrepareConnectedExams() error

func (*Plexams) PrepareGeneratedExams

func (p *Plexams) PrepareGeneratedExams() error

func (*Plexams) PrepareInvigilationTodos

func (p *Plexams) PrepareInvigilationTodos(ctx context.Context) (*model.InvigilationTodos, error)

func (*Plexams) PrepareRoomForExams

func (p *Plexams) PrepareRoomForExams() error

func (*Plexams) PrepareRoomsForSlots added in v1.31.0

func (p *Plexams) PrepareRoomsForSlots(approvedOnly bool) error

func (*Plexams) PrepareSelfInvigilation

func (p *Plexams) PrepareSelfInvigilation() error

func (*Plexams) PrepareStudentRegs

func (p *Plexams) PrepareStudentRegs() error

func (*Plexams) PrimussExamExists

func (p *Plexams) PrimussExamExists(ctx context.Context, program string, ancode int) (bool, error)

func (*Plexams) PrimussExams

func (p *Plexams) PrimussExams(ctx context.Context) ([]*model.PrimussExamByProgram, error)

func (*Plexams) PrintInfo

func (p *Plexams) PrintInfo()

func (*Plexams) PrintSameName

func (p *Plexams) PrintSameName()

func (*Plexams) PrintSemesterConfig added in v1.12.0

func (p *Plexams) PrintSemesterConfig()

func (*Plexams) PrintStatistics

func (p *Plexams) PrintStatistics() error

func (*Plexams) PrintStudentInfo added in v1.14.0

func (p *Plexams) PrintStudentInfo(name string, long, zpa bool) error

func (*Plexams) ReadMucdaiICS added in v1.4.0

func (p *Plexams) ReadMucdaiICS(filename string) error

func (*Plexams) RemoveStudentReg

func (p *Plexams) RemoveStudentReg(ctx context.Context, program string, ancode int, mtknr string) (int, error)

func (*Plexams) RequestRoomsInfo added in v1.76.2

func (p *Plexams) RequestRoomsInfo() error

special logic: check slot: 1. want all (R1.006, R1.046 and R1.049) 2. entferne alle Prüfungen die roomConstraints haben

func (*Plexams) RmConstraints added in v1.20.0

func (p *Plexams) RmConstraints(ctx context.Context, ancode int) (bool, error)

func (*Plexams) RmZpaExamFromPlan

func (p *Plexams) RmZpaExamFromPlan(ctx context.Context, ancode int) (bool, error)

func (*Plexams) RoomByName added in v1.33.0

func (p *Plexams) RoomByName(ctx context.Context, roomName string) (*model.Room, error)

func (*Plexams) Rooms

func (p *Plexams) Rooms(ctx context.Context) ([]*model.Room, error)

func (*Plexams) RoomsForSlot

func (p *Plexams) RoomsForSlot(ctx context.Context, day int, time int) (*model.RoomsForSlot, error)

func (*Plexams) RoomsForSlots added in v1.31.0

func (p *Plexams) RoomsForSlots(ctx context.Context) ([]*model.RoomsForSlot, error)

func (*Plexams) RoomsFromRoomNames added in v1.33.0

func (p *Plexams) RoomsFromRoomNames(ctx context.Context, roomNames []string) ([]*model.Room, error)

func (*Plexams) RoomsWithInvigilationsForSlot

func (p *Plexams) RoomsWithInvigilationsForSlot(ctx context.Context, day int, time int) (*model.InvigilationSlot, error)

TODO: rewrite me

func (*Plexams) SafeExamBrowser

func (p *Plexams) SafeExamBrowser(ctx context.Context, ancode int) (bool, error)

func (*Plexams) SameModulNames

func (p *Plexams) SameModulNames(ctx context.Context, outfile string) error

func (*Plexams) SameSlot

func (p *Plexams) SameSlot(ctx context.Context, ancodeInput int, ancodesInput []int) (bool, error)

func (*Plexams) SendCoverPageMail added in v1.40.0

func (p *Plexams) SendCoverPageMail(ctx context.Context, examerID int, run bool) error

func (*Plexams) SendCoverPagesMails added in v1.40.0

func (p *Plexams) SendCoverPagesMails(ctx context.Context, run bool) error

func (*Plexams) SendEmailConstraints added in v1.12.0

func (p *Plexams) SendEmailConstraints(ctx context.Context, run bool) error

func (*Plexams) SendEmailDraft added in v1.29.0

func (p *Plexams) SendEmailDraft(run bool) error

func (*Plexams) SendEmailExaHM added in v1.66.0

func (p *Plexams) SendEmailExaHM(ctx context.Context, run bool) error

func (*Plexams) SendEmailInvigilationReqMissing added in v1.82.0

func (p *Plexams) SendEmailInvigilationReqMissing(ctx context.Context, run bool) error

SendEmailInvigilationReqMissing sends an email to every invigilator who has not yet entered their invigilation requirements ("Anforderungen an die Planung der Prüfungsaufsichten") in the ZPA. They are warned that, without these requirements, they have to be planned with the full amount of invigilation duty (100%).

func (*Plexams) SendEmailInvigilations added in v1.31.0

func (p *Plexams) SendEmailInvigilations(ctx context.Context, run bool) error

func (*Plexams) SendEmailPrepared added in v1.21.0

func (p *Plexams) SendEmailPrepared(ctx context.Context, run bool) error

func (*Plexams) SendEmailPublishedExams added in v1.39.0

func (p *Plexams) SendEmailPublishedExams(ctx context.Context, run bool) error

func (*Plexams) SendEmailPublishedInvigilations added in v1.39.0

func (p *Plexams) SendEmailPublishedInvigilations(ctx context.Context, run bool) error

func (*Plexams) SendEmailPublishedRooms added in v1.39.0

func (p *Plexams) SendEmailPublishedRooms(ctx context.Context, run bool) error

func (*Plexams) SendGeneratedExamMail added in v1.3.0

func (p *Plexams) SendGeneratedExamMail(ctx context.Context, ancode int, updated, run bool) error

func (*Plexams) SendGeneratedExamMails

func (p *Plexams) SendGeneratedExamMails(ctx context.Context, emailAddresses, run bool) error

func (*Plexams) SendHandicapsMailToStudentPlanned added in v1.11.0

func (p *Plexams) SendHandicapsMailToStudentPlanned(ctx context.Context, to []string, cc []string, handicapsEmail *NTAEmailWithRooms) error

func (*Plexams) SendHandicapsMailToStudentRoomAlone added in v1.11.0

func (p *Plexams) SendHandicapsMailToStudentRoomAlone(ctx context.Context, to []string, cc []string, handicapsEmail *NTAEmail) error

func (*Plexams) SendHandicapsMailsNTAPlanned added in v1.11.0

func (p *Plexams) SendHandicapsMailsNTAPlanned(ctx context.Context, run bool) error

func (*Plexams) SendHandicapsMailsNTARoomAlone

func (p *Plexams) SendHandicapsMailsNTARoomAlone(ctx context.Context, mtknr string, run bool) error

func (*Plexams) SendMailNewNTA added in v1.65.0

func (p *Plexams) SendMailNewNTA(ctx context.Context, mtknr string, run bool) error

func (*Plexams) SendTestMail

func (p *Plexams) SendTestMail() error

func (*Plexams) SendUnplannedExamMail added in v1.54.0

func (p *Plexams) SendUnplannedExamMail(ctx context.Context, program string, ancode int, emailAddress string, run bool) error

func (*Plexams) SetZPA

func (p *Plexams) SetZPA() error

func (*Plexams) ShowInvigilationProblem added in v1.84.0

func (p *Plexams) ShowInvigilationProblem(ctx context.Context) error

ShowInvigilationProblem builds the invigilation snapshot from the DB and prints a summary. It is read-only and meant to sanity-check the inputs before the optimizer (Phase 3) is run.

func (*Plexams) SlotForAncode

func (p *Plexams) SlotForAncode(ctx context.Context, ancode int) (*model.Slot, error)

func (*Plexams) SlotsWithRoomsFromBookedEntries

func (p *Plexams) SlotsWithRoomsFromBookedEntries(bookedEntries []BookedEntry) (map[SlotNumber][]*model.Room, error)

func (*Plexams) StudentByMtknr

func (p *Plexams) StudentByMtknr(ctx context.Context, mtknr string) (*model.Student, error)

func (*Plexams) StudentRegsForProgram

func (p *Plexams) StudentRegsForProgram(ctx context.Context, program string) ([]*model.StudentReg, error)

func (*Plexams) StudentRegsImportErrors

func (p *Plexams) StudentRegsImportErrors(ctx context.Context) ([]*model.RegWithError, error)

func (*Plexams) StudentRegsPerStudentPlanned

func (p *Plexams) StudentRegsPerStudentPlanned(ctx context.Context) ([]*model.Student, error)

func (*Plexams) Students

func (p *Plexams) Students(ctx context.Context) ([]*model.Student, error)

func (*Plexams) StudentsByName

func (p *Plexams) StudentsByName(ctx context.Context, regex string) ([]*model.Student, error)

func (*Plexams) TryBeginValidation added in v1.99.0

func (p *Plexams) TryBeginValidation() bool

TryBeginValidation registers a running validation, unless a ZPA transfer is in progress. Returns false if the validation must not start. On success the caller must call EndValidation when done.

func (*Plexams) TryBeginZPATransfer added in v1.99.0

func (p *Plexams) TryBeginZPATransfer() bool

TryBeginZPATransfer registers a running ZPA transfer, unless a validation or another transfer is in progress. Returns false if the transfer must not start. On success the caller must call EndZPATransfer when done.

func (*Plexams) UnlockExam

func (p *Plexams) UnlockExam(ctx context.Context, ancode int) (*model.PlanEntry, *model.GeneratedExam, error)

func (*Plexams) UploadPlan

func (p *Plexams) UploadPlan(ctx context.Context, withRooms, withInvigilators, upload bool, reporter Reporter) ([]*model.ZPAExamPlan, error)

func (*Plexams) ValidateConflicts

func (p *Plexams) ValidateConflicts(onlyPlannedByMe bool, ancode int, reporter Reporter) (*model.ValidationReport, error)

func (*Plexams) ValidateConstraints

func (p *Plexams) ValidateConstraints(reporter Reporter) (*model.ValidationReport, error)

func (*Plexams) ValidateDB

func (p *Plexams) ValidateDB(reporter Reporter) (*model.ValidationReport, error)

TODO: all planned_rooms okay? especially after moving an exam? check room -> slot -> ancode sameslot?

func (*Plexams) ValidateInvigilationConstraints added in v1.84.0

func (p *Plexams) ValidateInvigilationConstraints(reporter Reporter) (*model.ValidationReport, error)

ValidateInvigilationConstraints checks the persisted invigilation plan (invigilations_self + invigilations_other) against the shared invigplan constraints – the exact same hard and soft rules the automatic generator uses. It runs in addition to the hand-written invigilator validations.

func (*Plexams) ValidateInvigilationDups

func (p *Plexams) ValidateInvigilationDups(reporter Reporter) (*model.ValidationReport, error)

func (*Plexams) ValidateInvigilationsTimeDistance

func (p *Plexams) ValidateInvigilationsTimeDistance(reporter Reporter) (*model.ValidationReport, error)

func (*Plexams) ValidateInvigilatorRequirements

func (p *Plexams) ValidateInvigilatorRequirements(reporter Reporter) (*model.ValidationReport, error)

func (*Plexams) ValidateInvigilatorSlots

func (p *Plexams) ValidateInvigilatorSlots(reporter Reporter) (*model.ValidationReport, error)

TODO: NTA- und Reserve-Aufsicht (wenn NTA) nicht im folgenden Slot einteilen!

func (*Plexams) ValidatePrePlannedExahmRooms added in v1.52.0

func (p *Plexams) ValidatePrePlannedExahmRooms(reporter Reporter) (*model.ValidationReport, error)

func (*Plexams) ValidateRoomsNeedRequest

func (p *Plexams) ValidateRoomsNeedRequest(reporter Reporter) (*model.ValidationReport, error)

func (*Plexams) ValidateRoomsPerExam

func (p *Plexams) ValidateRoomsPerExam(reporter Reporter) (*model.ValidationReport, error)

func (*Plexams) ValidateRoomsPerSlot

func (p *Plexams) ValidateRoomsPerSlot(reporter Reporter) (*model.ValidationReport, error)

func (*Plexams) ValidateRoomsTimeDistance

func (p *Plexams) ValidateRoomsTimeDistance(reporter Reporter) (*model.ValidationReport, error)

func (*Plexams) ValidateStudentRegs added in v1.57.0

func (p *Plexams) ValidateStudentRegs(reporter Reporter) (*model.ValidationReport, error)

TODO: all planned_rooms okay? especially after moving an exam? check room -> slot -> ancode sameslot?

func (*Plexams) ValidateZPADateTimes

func (p *Plexams) ValidateZPADateTimes(reporter Reporter) (*model.ValidationReport, error)

func (*Plexams) ValidateZPAInvigilators

func (p *Plexams) ValidateZPAInvigilators(reporter Reporter) (*model.ValidationReport, error)

func (*Plexams) ValidateZPARooms

func (p *Plexams) ValidateZPARooms(reporter Reporter) (*model.ValidationReport, error)

func (*Plexams) WritesAllowed added in v1.99.0

func (p *Plexams) WritesAllowed() bool

WritesAllowed reports whether writes are currently permitted, i.e. no validation and no ZPA transfer is running.

func (*Plexams) ZpaExamsPlaningStatusUnknown

func (p *Plexams) ZpaExamsPlaningStatusUnknown(ctx context.Context) ([]*model.ZPAExam, error)

func (*Plexams) ZpaExamsToPlan

func (p *Plexams) ZpaExamsToPlan(ctx context.Context, input []int) ([]*model.ZPAExam, error)

func (*Plexams) ZpaExamsToPlanWithConstraints

func (p *Plexams) ZpaExamsToPlanWithConstraints(ctx context.Context) ([]*model.ZPAExamWithConstraints, error)

type PrimussAncode

type PrimussAncode struct {
	Program string
	Ancode  int
}

type Reporter added in v1.98.0

type Reporter interface {
	// Printf / Println emit a normal output line (may contain ANSI color codes).
	Printf(format string, a ...any)
	Println(a ...any)
	// Step emits a transient status message. Consumers should render it in-place
	// (spinner style) instead of appending a new line each time.
	Step(msg string)
	// Progress emits a throttled optimizer snapshot, rendered in-place like Step.
	Progress(p invigplan.Progress)
	// StopProgress ends the current progress display with a success message.
	StopProgress(finalMsg string)
	// StopProgressFail ends the current progress display with a failure message.
	StopProgressFail(finalMsg string)
	// Warnf emits a warning line.
	Warnf(format string, a ...any)
}

Reporter receives the human-readable output of a long-running operation (e.g. GenerateInvigilations). It decouples the operation from where the output goes: the CLI uses ConsoleReporter (stdout, colored, with a spinner), the GraphQL server uses a streaming reporter that forwards every line to a subscription. Implementations must be safe to call from the goroutine that runs the operation.

type Slot

type Slot []int

type SlotNumber

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

type TimeRange

type TimeRange struct {
	From       time.Time
	Until      time.Time
	DayNumber  int
	SlotNumber int
	Approved   bool
}

type UnpplannedExamMailData added in v1.54.0

type UnpplannedExamMailData struct {
	Exam       *model.PrimussExam
	PlanerName string
}

type ZPA

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

Directories

Path Synopsis
Package invigplan contains the pure (DB- and ZPA-free) domain model and the hard/soft constraints used to plan invigilations (Aufsichten) automatically.
Package invigplan contains the pure (DB- and ZPA-free) domain model and the hard/soft constraints used to plan invigilations (Aufsichten) automatically.

Jump to

Keyboard shortcuts

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