weekdaze-0.0.0.1: A school-timetable problem-solver.

Safe HaskellNone
LanguageHaskell2010

WeekDaze.TeacherView.Timetable

Contents

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION
  • Defines the timetable for any week, for all teachers.
  • It contains identical information to Timetable, but the data has been re-indexed to present it in a form relevant to a teacher rather than a student.
Synopsis

Types

Type-synonyms

type Timetable teacherId timeslotId locationId level = Timetable teacherId timeslotId (LessonResourceIds locationId) level Source #

An association-list of the timetables for all teachers.

type InterCampusMigrationsByTeacherId teacherId = Map teacherId NTimeslots Source #

The type of a map passed to toXHtml.

type TimesByTeacherId teacherId timeslotId = Map teacherId (TimeSet timeslotId) Source #

A map indexed by teacherId, of sets of times.

Functions

findStudentClassesByLocationId :: (Ix timeslotId, Ord locationId) => Timetable teacherId timeslotId locationId level -> Map locationId [StudentClass] Source #

Catalogue the student-classes booked in the specified timetable, indexed by location-Id.

calculateMeanStudentClassSize :: (Ix timeslotId, Fractional meanValue) => Timetable teacherId timeslotId locationId level -> meanValue Source #

Calculates the mean over all bookings, of the size of the student-class.

countLocationChangesByTeacherId :: (Ix timeslotId, Eq locationId) => Timetable teacherId timeslotId locationId level -> Map teacherId Int Source #

  • Counts the location-changes made by each teacher.
  • The minimum value of zero can be achieved either by a completely unbooked timetable, or one completely booked by the lessons in the same location.
  • CAVEAT: doesn't account for the location of any meetings.

Mutators

bookStudentViewLesson Source #

Arguments

:: (Ix timeslotId, Eq locationId, Eq level, Ord teacherId, Show level, Show locationId, Show teacherId, Show timeslotId) 
=> Bool

Permit a temporary student-body merger.

-> Booking timeslotId locationId teacherId level

The coordinates & lesson from the perspective of the student-view of the timetable.

-> Timetable teacherId timeslotId locationId level

The timetable as seen from the teacher's perspective.

-> Timetable teacherId timeslotId locationId level 

Apply a Booking to a TeacherView-timetable.

Translation

fromStudentViewTimetable Source #

Arguments

:: (Ix timeslotId, Enum timeslotId, Eq level, Eq locationId, Ord teacherId, Show level, Show locationId, Show teacherId, Show timeslotId) 
=> Bool

Permit a temporary student-body merger.

-> Timetable teacherId timeslotId locationId level

An unallocated timetable, supplied for efficiency.

-> Timetable timeslotId locationId teacherId level 
-> Timetable teacherId timeslotId locationId level 
  • Builds a Timetable by inverting a Timetable.
  • CAVEAT: in the original Timetable, different student-bodies may simultaneously reference a single teacher. This is normal behaviour, provided the teacher can cope with the class-size, & is implemented seemlessly, as a map-structure with one or more keys referencing a value, containing the same teacher.
  • When inverting such a timetable, this many-to-one relationship becomes a one-to-many, & a single teacher-id must now reference many student-bodies. The simple map-structure, unlike a multi-map, can't directly accommodate multiple identical keys, with different values, so this is achieved by merging student-bodies into student-classes.

toStudentViewTimetable Source #

Arguments

:: (Ix timeslotId, Enum timeslotId) 
=> Timetable timeslotId locationId teacherId level

An unallocated timetable, supplied for efficiency.

-> Timetable teacherId timeslotId locationId level 
-> Timetable timeslotId locationId teacherId level 
  • Build a Timetable, by inverting a Timetable.
  • Each lesson in the timetable seen from the teacher's perspective, contains a student-class. This student-class must be broken into student-bodies, before inserting repeatedly into the required timetable as seen from the student-body's perpective.

toXHtml Source #

Arguments

:: (Ix timeslotId, Fractional minimumContrastRatio, Ord level, Ord locationId, Ord minimumContrastRatio, Ord teacherId, RealFrac teachingRatio, Show level, Show locationId, HTML level, HTML locationId, HTML synchronisationId, HTML teacherId, HTML timeslotId) 
=> InterCampusMigrationsByTeacherId teacherId

The number of inter-campus teacher-migrations, indexed by teacherId.

-> TimesByTeacherId teacherId timeslotId

Unbooked but specified times, by teacherId.

-> NTimeslots

The number of time-slots per day.

-> (teacherId -> Lesson locationId level -> Course synchronisationId level timeslotId)

Find the course to which the specified lesson belongs.

-> TeacherRegister teacherId synchronisationId level timeslotId locationId teachingRatio 
-> GenericTimetableToMarkup locationId minimumContrastRatio teacherId timeslotId (Timetable teacherId timeslotId locationId level) 

Render in XHTML, as a definition-list.