learning-unlimited/ESP-Website — pull request #394 by ruthie (2012-09-03 17:15:39+00:00)
Title: Scheduling Checks

Provides a view through the admin interface that runs diagnostics on a proposed splash schedule. These diagnostics check for:

Incompletely scheduled classes
classes in the wrong classroom type
classes missing resources
double booked classrooms
teachers scheduled when they aren't available
teachers teaching two classes at once
classes scheduled over both lunch blocks
classrooms too big or too small for the classes in them
middle school classes in the evening blocks
distribution of classes by category and grade range for each timeblock
number of admins teaching each timeblock
teachers teaching adjacent classes in distant classrooms

This pull request contains ~no changes to core classes (one function was added), so it shouldn't break anything. There is potential for more refactoring of common functions (specifically the ones which figure out which blocks are lunch blocks), but I didn't do this because I didn't have time to do it well (write unit tests, etc.).

This code hasn't been tested on any programs except for recent MIT splashes and sparks, so there may be some program-compatibility issues here. Specifically, if other programs have different names for the "Classroom Type" resource type, or a very different way of organizing lunch, some checks may not work for non-MIT schools.

I wrote most of this code on my way to work on the train. Other modes of transportation on which work on this happened include light rail, boats, planes, and busses.