Calendar Generation
Calendar Generation is the process of generating all necessary Sessions that will be associated with each of the Cohorts for which we are generating the calendar. This means we are creating the individual classes for each of the class periods for each of the class groups, according to the timetable and calendar schedule that has been defined.
There are different structures that are used depending on whether a Cohort has its timetable managed externally or not.
Timetable Managed Externally equals True
In the case where timetable is managed externally for a cohort, then a process such as the LISS Publish Daily Data and Publish Daily Deltas will generally be executed from a platform such as EdVal Daily. This exchange of data instructs PosiEd to create individual session records for each class period.
The data relationship looks like this:
For each Cohort we create a Session and Cohort Session record for each class period that is specified by the external system. Note that the relationship between Cohort and Session is a many-to-many relationship through the Cohort Session object. This is because each Cohort will likely have multiple Sessions and each Session might (if it is a Joint session) also have an association with multiple Cohorts.
Timetable Managed Externally equals False
In the case where the timetable is managed by PosiEd; either because the school is using a timetable product such as Edval and its Publish Timetable feature via LISS; or because the Cohort Schedules have been set up manually, the following architecture is applied instead.
In this case, the relationship between Cohort and Cohort Session can be ignored because it is not used. Instead Cohort has one or more Cohort Schedule records and it is these Cohort Schedule records that have the relationship to the Cohort Session and Session objects. The various generate calendar processes will generate these Cohort Session and Session records as per the process we'll get into in a minute.
Note that once again Cohort Session is the centerpiece of a many-to-many relationship in order to accommodate joint classes. The calendar generation process as it pertains to PosiEd generating the calendar only works when Timetable Managed Externally is False.
This process can be either a process run for a single cohort by pressing the Generate Calendar button on the Cohort window.
It can be executed for a group of cohorts in a process called Bulk Generate Calendar execution. This is done through the Cohort tab of the Timetable Structure page. By opening this page you can select one or more or all cohorts before clicking on the Generate Calendar button.
This performs the same process, but it executes it across all selected cohorts.
How Sessions are Generated
Regardless of the method of calendar generation you use the process of generating the calendar for a particular cohort is the same.
From the Cohort record get a list of Cohort Schedule records, the Timetable Structure, Timetable Term and Primary Grade Level.
The Timetable Term will be used to define such characteristics as whether the Timetable Structure is active, the Weeks in the Cycle, Days Per Week and Date Map.
The Primary Grade Level value is required because this will provide a reference into the Date Map. On any given day in the Date Map there might be different Day Types depending on the Grade Level - for example, grades 7-10 might have Day Type=1 but grades 11-12 might be on Holiday. If a Cohort is combining multiple grade levels then it is vital that all classes defined for that cohort have exactly the same Date Map and Bell Time details for all grade levels included in that cohort.
The system now cycles through each of the Cohort Schedule records. In each case it identifies the Start and End date range of the Cohort Schedule which may in some situations differ from the Start and End dates of the Cohort.
If the Bell Time value is populated on the Cohort Schedule we can identify the Day Number, Week Number, Period, Start and End Time from this record.
If the Bell Time value is not populated on the Cohort Schedule we get the Day Number, Week Number, Period, Start and End Time values from the Cohort Schedule record.
Using the Start and End date, the Primary grade level, the Day and Week numbers the Date Map is queried to find all Date Map entries with values of this combination. For example we will find all Date Map entries for Grade Level 7 with a Day Type of 1 and a Week Type of A.
A Session and Cohort Session record combination is then created for each of these dates and these are linked to the Cohort Schedule.
DO WE GENERATE THESE HERE OR IN GENERATE ATTENDANCE???
It will then duplicate any cohort schedule connection records for each session through session connection records. It will also create various event record entries for each cohort schedule connection record for each session. For example if there are two teachers, two classrooms and a resource booking listed in the cohort schedule connections, then it will create two session staff, two session location and a session resource event record for each session record that it creates.
Joint sessions
Whether or not a cohort’s timetable is managed externally or not, we manage Joint classes using the same objects and relationships as described previously but with an extra degree of complexity.
Both Composite and Vertical class architectures require each Session to be associated with two or more Cohort or Cohort schedule records. Examples of the record creation are described in Joint Cohorts & Sessions - PosiEd