Skip to main content
Skip table of contents

Best Fit Logic

Identifying SHSM Credit Courses

The GetStudentSHSMCourses common function is used to identify the courses for a student for which credit is deemed SHSM credit. This function is for the purpose of flagging the courses as SHSM courses on a number of reports, including the Status Sheet, SHSM Record, Ontario Student Transcript, Secondary Report Card, OnSIS Secondary Submission, and the OCAS/OUAC Transmissions.

SHSM courses for a student are determined based on:

  • The SHSM program in which the student is enrolled as of a passed effective date. Note that the passed effective date program may not be the same as the student's current SHSM program.
  • The courses associated with each of the credit requirements in the graduation set associated with the SHSM program.

When a student is enrolled in a SHSM program and has more than one instance of a course for which credit was earned, only the instance containing the highest mark is used. If more than one such instance with the highest mark is present, the instance with the earliest completion is used. Instances where credit is earned after the student exited or completed a SHSM program are not used.

Identifying SHSM Categories

The best fit processing described below requires that Major, English, Math, and Co-op SHSM categories be identified. This is done by examining the content of the requirement name ([GradReq]Name) associated with the category. The requirement name is converted to upper case, compressed (i.e. spaces removed), and special characters (such as '-') removed.

  • If the string 'MAJOR' appears anywhere in the result, the category is considered a Major SHSM category.
  • If the string 'ENG' appears anywhere in the result, the category is considered an English SHSM category.
  • If the string 'MATH' appears anywhere in the result, the category is considered a Math SHSM category.
  • If the string 'COOP' appears anywhere in the result, the category is considered a Co-op category. For example, "Co-op", "Co-operative Education", and "Construction Co-op" are all considered to be co-op categories.

Note: For the purposes of the processing described below, the 'MAJOR' and 'COOP' categories are considered non-Math/non-English categories.

Identifying Co-op Courses

For the purposes of this process, co-op courses are those for which the [Courses/CC/StoredGrades]ON_Transcript_C flag is on and that are listed in the Graduation Set.

Best Fit Processing

The function uses the following 'best fit' logic to maximize the number of courses identified as SHSM courses:

  1. For each student course, determine the number of requirement categories the course COULD be used to fulfill. This is a number between 0 (if the course doesn't appear in the course list for any requirement) and the number of requirements (if the course appears in the course list for all requirements). We'll call this the number of potential categories for the student course. If a course doesn't appear in the course list for any requirement but the [S_ON_SGR_X/S_ON_CC_X]Transcript_H flag is turned on for the course, the number of potential categories for the course should be set to 99.
    • Note: Credit for co-op courses can not be used to fulfill English or Math categories (see above).

  2. Order the student courses ascending by the number of potential categories, ignoring courses where the number of potential categories is 0. If more than one course has the same number of potential categories, use the first 5 characters of the course to order them ascending by number of potential categories (non- co-op categories). If more than one course has the same number of potential categories, then order them ascending by completion date within the ascending number of potential categories. If more than one course has the same number of potential categories and completion date, order them ascending by DCID.

    The idea is that within the set of courses with the same number of potential categories, the courses (using the first 5 characters) with the least number of non-co-op potential categories are processed first. If within this set, there are courses with the same number of non-co-op potential categories, the courses with the earliest completion date are processed first. For courses with the same completion date, the earliest course added, based on the DCID, is processed first.

  3. Process the requirement categories ascending by [GradReq]SortOrder. If more than one requirement has the same sort order, they are ordered by [GradReq]Id within that sort order. For each category, assign the course with the lowest sort key (as described above) which applies to the category and which has not already been assigned. Mark the course as assigned. If the requirement category requires more credit than that of the course just assigned, also assign the next applicable course in the ordered course list. Keep assigning courses until the category is 'full'. If the credit for the course just assigned exceeds the credit remaining to be assigned for the category, mark the course as 'partially assigned' keeping track of how much credit is still available to assign to another category.

  4. If one or more Major categories, except Math or English categories, have 'unfilled' credit and there is still unassigned credit from co-op courses, processing the Major, non-Math/non_English categories by [GradReq]SortOrder, assign credit from co-op courses by sort key until either one Major, non-Math/non-English category is filled or no unassigned co-op courses remain.
    • Notes: a) credit from a co-op course can count towards any non Math/non English category, as long as the 5 character course code exists ANYWHERE in the entire bundle; for example, if a 2 credit co-op was granted in ENG3C, and the student was short 1 credit in the Major Grade 11 and 12 category, then the ENG3C co-op would fulfill this deficiency, even if ENG3C did not exist in the Major Grade 11 and 12 set of courses; b) credit from co-op courses can be used to fulfill at most one credit across all Major, non-Math/non-English category.

  5. If one or more non-Major categories, except Math or English categories, have 'unfilled' credit and there is still unassigned credit from co-op courses, processing the non-Major, non-Math/non_English categories by [GradReq]SortOrder, assign credit from co-op courses by sort key until either each non-Major, non-Math/non-English category is filled, two credits from co-op courses have been used to fufill Major and non-Major, non-Math/non-English category, or no unassigned co-op courses remain.
    • Notes: a) credit from a co-op course can count towards any non Math/non English category, as long as the 5 character course code exists ANYWHERE in the entire bundle; for example, if a 2 credit co-op was granted in ENG3C, and the student was short 1 credit in the Major Grade 11 and 12 category, then the ENG3C co-op would fulfill this deficiency, even if ENG3C did not exist in the Major Grade 11 and 12 set of courses b) credit from co-op courses can be used to fulfill at most one credit in a non-Math/non-English category.

  6. If one or more categories still have 'unfilled' credit, and there are unassigned courses for which [S_ON_SGR_X/S_ON_CC_X]Transcript_H is turned on; again processing each of the 'unfilled' categories by [GradReq]SortOrder, assign the unassigned Transcript_H course with the lowest sort key to the category, mark the course assigned, keep assigning such courses until the category is full, and then move on to the next 'unfilled' category, splitting credit where necessary. Note: the credit for a course for which the Transcript_H flag is on is used to fulfill a Co-op category only if the course is a co-op course.

The function does not return courses which have been completed after the student completes the requirements for the SHSM program or the student exits the program - i.e. if the course completion date is not later than either [S_ON_SEN_X]SHSM_Progam_Date or [SPEnrollments]Exit_Date.

The course completion date is determined as follows:

  • If [StoredGrades]ON_Credit_Date is defined use that value.
  • If [StoredGrades]ON_Credit is undefined and there is an associated CC record, use the calendar day immediately prior to [CC]DateLeft.
  • If [StoredGrades]ON_Credit_Date is undefined and there is no associated CC record and [StoredGrades]TermId is defined (i.e. non-zero), use [Terms]LastDay for the associated term.
  • If [StoredGrades]ON_Credit_Date is undefined and there is no associated CC record and [StoredGrades]TermId is undefined, use [StoredGrades]DateStored (TermID should never be undefined).

The function supports a parameter controlling whether it returns courses for which credit has not been earned. Normally a course is not identified as a SHSM course until credit is earned for the course. However the Status Sheet and the Secondary Report Card report in-progress SHSM courses (i.e. a final mark has not been posted and the student has not left the class).

No Graduation Set

If a SHSM graduation set is not associated with the student, the function returns the courses for which the SHSM flag[S_ON_SGR_X]Transcript_H) is turned on. The course is not associated with a particular SHSM credit category (because these are defined in a graduation set), but the course is returned as a SHSM course so that calling reports can set the SHSM note flag and determine the number of SHSM credits correctly. Note that, as above, a course is not considered SHSM if the flag is on but the course was completed after the student exited/completed the SHSM program.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.