# 2. Student Record Intake Functions

<table border="1" id="bkmrk-calendar-functions-n" style="border-collapse: collapse; width: 99.7531%; height: 470.203px;"><colgroup><col style="width: 17.72%;"></col><col style="width: 12.2677%;"></col><col style="width: 70.0124%;"></col></colgroup><tbody><tr style="height: 70.4219px;"><td style="height: 70.4219px;">[Student Fields](https://bsa.lynops.com/books/personal-education-management-system/page/2-student-intake-functions "Student Fields")</td><td style="height: 70.4219px;"><span style="color: rgb(224, 62, 45);">Not started</span></td><td style="height: 70.4219px;">#### 2.0 Set Intake Value Defaults - <span style="background-color: rgb(251, 238, 184);">COMPLETED</span>

</td></tr><tr style="height: 63.375px;"><td style="height: 63.375px;">  
</td><td style="height: 63.375px;">*Purpose*</td><td style="height: 63.375px;">*Based on the student start grade level, enter the student's current grade level.*</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">*Trigger*</td><td style="height: 29.7969px;">*Runs only one time, when the student record is first entered, never updated.*</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">*Conditions*</td><td style="height: 29.7969px;">*requisite fields are not empty.*</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">*Sequence*</td><td style="height: 29.7969px;">*This function runs after the student record is created.*</td></tr><tr style="height: 57.75px;"><td style="height: 57.75px;"> </td><td style="height: 57.75px;">Step 1</td><td style="height: 57.75px;">Set [Student](https://cs.studianova.org/admin/students) current grade level equal to [Student](https://cs.studianova.org/admin/students) start grade.

</td></tr><tr style="height: 57.75px;"><td style="height: 57.75px;">  
</td><td style="height: 57.75px;">Step 2</td><td style="height: 57.75px;">Set [Student](https://cs.studianova.org/admin/students) promotion equal to "promote".

</td></tr><tr style="height: 57.75px;"><td style="height: 57.75px;">  
</td><td style="height: 57.75px;">Step 3</td><td style="height: 57.75px;">Set [Student](https://cs.studianova.org/admin/students) status equal to "planned".

</td></tr><tr style="height: 35.3906px;"><td style="height: 35.3906px;">  
</td><td style="height: 35.3906px;"><s>Step 4</s></td><td style="height: 35.3906px;"><s>Set [Student](https://cs.studianova.org/admin/students) cohort = linked homeroom record</s>

Creating student logins will be done in a separate step after student record created.

</td></tr><tr style="height: 38.375px;"><td style="height: 38.375px;">END</td><td style="height: 38.375px;">  
</td><td style="height: 38.375px;"> </td></tr></tbody></table>

<table border="1" id="bkmrk-student-fields-not-s" style="border-collapse: collapse; width: 99.7531%; height: 474.094px;"><colgroup><col style="width: 17.72%;"></col><col style="width: 12.2677%;"></col><col style="width: 70.0124%;"></col></colgroup><tbody><tr style="height: 70.4219px;"><td style="height: 70.4219px;">[Student Fields](https://bsa.lynops.com/books/personal-education-management-system/page/2-student-intake-functions "Student Fields")</td><td style="height: 70.4219px;"><span style="color: rgb(224, 62, 45);">Not started</span></td><td style="height: 70.4219px;">#### 2.1 Enter Student's Grade Span and School

</td></tr><tr style="height: 63.375px;"><td style="height: 63.375px;">  
</td><td style="height: 63.375px;">*Purpose*</td><td style="height: 63.375px;">*Reduce data entry by automatically finding the student grade span based on current grade level.*</td></tr><tr style="height: 46.5938px;"><td style="height: 46.5938px;">  
</td><td style="height: 46.5938px;">*Trigger*</td><td style="height: 46.5938px;">*When new student record is entered <s>or when the student's current grade level changes.</s>*</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">*Conditions*</td><td style="height: 29.7969px;">*requisite fields are not empty.*</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">*Sequence*</td><td style="height: 29.7969px;">*This function runs after the student record is created.*</td></tr><tr style="height: 80.1719px;"><td style="height: 80.1719px;"> </td><td style="height: 80.1719px;">Step 1</td><td style="height: 80.1719px;">Find the [Grade Span](https://cs.studianova.org/admin/gradespans) with start grade greater than or equal to the [Student](https://cs.studianova.org/admin/students) <s>current</s> <span style="text-decoration: underline;">start</span> grade level AND [Grade Span](https://cs.studianova.org/admin/gradespans) with end grade after of equal to the [Student](https://cs.studianova.org/admin/students) current: *grade span start grade **≤** student start grade **≤** grade span end grade*

</td></tr><tr style="height: 57.7812px;"><td style="height: 57.7812px;">  
</td><td style="height: 57.7812px;">Step 2</td><td style="height: 57.7812px;">Associate the [Grade Span](https://cs.studianova.org/admin/gradespans) record found above to the [Student](https://cs.studianova.org/admin/students) record with the [Student](https://cs.studianova.org/admin/students) grade span field.

</td></tr><tr style="height: 57.7812px;"><td style="height: 57.7812px;">  
</td><td style="height: 57.7812px;">Step 3</td><td style="height: 57.7812px;">Find the [School](https://cs.studianova.org/admin/schools) record associated to the [Grade Span](https://cs.studianova.org/admin/gradespans) record found above and associate to the [Student](https://cs.studianova.org/admin/students) record with the [Student](https://cs.studianova.org/admin/students) school field.

</td></tr><tr style="height: 38.375px;"><td style="height: 38.375px;">END</td><td style="height: 38.375px;">  
</td><td style="height: 38.375px;"> </td></tr></tbody></table>

<table border="1" id="bkmrk-student-fields-not-s-1" style="border-collapse: collapse; width: 99.7531%; height: 672.453px;"><colgroup><col style="width: 17.72%;"></col><col style="width: 12.2677%;"></col><col style="width: 70.1363%;"></col></colgroup><tbody><tr style="height: 70.4219px;"><td style="height: 70.4219px;">[Student Fields](https://bsa.lynops.com/books/personal-education-management-system/page/2-student-intake-functions "Student Fields")</td><td style="height: 70.4219px;"><span style="color: rgb(224, 62, 45);">Not started</span></td><td style="height: 70.4219px;">#### 2.2 Calculate Graduation Date and Remaining Years

</td></tr><tr style="height: 63.375px;"><td style="height: 63.375px;">  
</td><td style="height: 63.375px;">*Purpose*</td><td style="height: 63.375px;">*By finding the last day of school and how many years left in the school, PEMS helps admins estimate future enrollment.*</td></tr><tr style="height: 46.5938px;"><td style="height: 46.5938px;">  
</td><td style="height: 46.5938px;">*Trigger*</td><td style="height: 46.5938px;">*When a new student record is entered <s>and every time a student completes a year. If a student 'skips' a grade level then their future date will change.</s>*</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">*Conditions*</td><td style="height: 29.7969px;">*requisite fields are not empty.*</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">*Sequence*</td><td style="height: 29.7969px;">*This function runs when the student record is created.*</td></tr><tr style="height: 80.1719px;"><td style="height: 80.1719px;"> </td><td style="height: 80.1719px;">Step 1</td><td style="height: 80.1719px;">[Student](https://cs.studianova.org/admin/students) remaining years = [School Configuration](https://cs.studianova.org/admin/crmfields) highest\_grade\_level - [Student](https://cs.studianova.org/admin/students) <s>current</s> <span style="text-decoration: underline;">start </span>grade level.

*note: remaining years does not include the student's enrollment year/current year*

</td></tr><tr style="height: 52.1875px;"><td style="height: 52.1875px;">  
</td><td style="height: 52.1875px;">Step 2</td><td style="height: 52.1875px;">Find the<s> current (status = current) </s>[Academic Year](https://cs.studianova.org/admin/academicyears) sequence of <span style="text-decoration: underline;">start year based on start and end dates.</span></td></tr><tr style="height: 52.1875px;"><td style="height: 52.1875px;">  
</td><td style="height: 52.1875px;">Step 3</td><td style="height: 52.1875px;">Add [Student](https://cs.studianova.org/admin/students) remaining years to <span style="text-decoration: underline;">start year</span> <s>current (status = current)</s> [Academic Year](https://cs.studianova.org/admin/academicyears) sequence.</td></tr><tr style="height: 80.1719px;"><td style="height: 80.1719px;">  
</td><td style="height: 80.1719px;">Step 4</td><td style="height: 80.1719px;">Find the Academic year with the sequence value found above, this is the graduating academic year. There is no field for the graduating academic year.

<span style="text-decoration: underline;">Find the grad year end date.</span>

</td></tr><tr style="height: 57.7812px;"><td style="height: 57.7812px;">  
</td><td style="height: 57.7812px;"><s>Step 5</s></td><td style="height: 57.7812px;"><s>Find the last [School term](https://cs.studianova.org/admin/terms) associated with the Academic year found above. The last School term has an associated [Term Label](https://cs.studianova.org/admin/termlabels) record with flag = official end term.</s></td></tr><tr style="height: 80.1719px;"><td style="height: 80.1719px;">  
</td><td style="height: 80.1719px;"><s>Step 6</s></td><td style="height: 80.1719px;"><s>The end date of the last [School term](https://cs.studianova.org/admin/terms) of the graduating academic year is the [Student](https://cs.studianova.org/admin/students) graduation date.</s>

<span style="text-decoration: underline;">Use grad year end date, calendar functions will update the year end date based on the school term associated end date when there is a change.</span>

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">END</td><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">  
</td></tr></tbody></table>


<table border="1" id="bkmrk-student-fields-not-s-2" style="border-collapse: collapse; width: 99.7531%; height: 371.531px;"><colgroup><col style="width: 17.72%;"></col><col style="width: 12.2677%;"></col><col style="width: 70.1363%;"></col></colgroup><tbody><tr style="height: 70.4219px;"><td style="height: 70.4219px;">[Student Fields](https://bsa.lynops.com/books/personal-education-management-system/page/2-student-intake-functions "Student Fields")</td><td style="height: 70.4219px;"><span style="color: rgb(224, 62, 45);">Not started</span></td><td style="height: 70.4219px;">#### 2.3 Find and Enter Student's School Start Term - <span style="background-color: rgb(251, 238, 184);">COMPLETED</span>

</td></tr><tr style="height: 63.375px;"><td style="height: 63.375px;">  
</td><td style="height: 63.375px;">*Purpose*</td><td style="height: 63.375px;">*Based on the student start date, auto-enter the student start term, the purpose is to reduce data entry for the user.*</td></tr><tr style="height: 46.5938px;"><td style="height: 46.5938px;">  
</td><td style="height: 46.5938px;">*Trigger*</td><td style="height: 46.5938px;">*When new student record is entered or when the student start date changes. This function only runs if the student status = planned.*</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">*Conditions*</td><td style="height: 29.7969px;">*requisite fields are not empty.*</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">*Sequence*</td><td style="height: 29.7969px;">*This function runs after the student record is created and only once on student intake.*</td></tr><tr style="height: 57.7812px;"><td style="height: 57.7812px;"> </td><td style="height: 57.7812px;">Step 1</td><td style="height: 57.7812px;">Find the [School Term](https://cs.studianova.org/admin/terms) with start date before or equal to the [Student](https://cs.studianova.org/admin/students) start date AND [School Term](https://cs.studianova.org/admin/terms) with end date after or equal to the [Student](https://cs.studianova.org/admin/students) start date:

*school term start date **≤** student start date **≤** school term end date*

</td></tr><tr style="height: 35.3906px;"><td style="height: 35.3906px;">  
</td><td style="height: 35.3906px;">Step 2</td><td style="height: 35.3906px;">Associate the [School Term](https://cs.studianova.org/admin/terms) record to the [Student](https://cs.studianova.org/admin/students) record with the School Start term field.

</td></tr><tr style="height: 38.375px;"><td style="height: 38.375px;">END</td><td style="height: 38.375px;">  
</td><td style="height: 38.375px;">  
</td></tr></tbody></table>


<table border="1" id="bkmrk-student-fields-not-s-3" style="border-collapse: collapse; width: 99.7531%; height: 807.155px;"><colgroup><col style="width: 17.72%;"></col><col style="width: 12.2677%;"></col><col style="width: 70.1363%;"></col></colgroup><tbody><tr style="height: 67.4219px;"><td style="height: 67.4219px;">[Student Fields](https://bsa.lynops.com/books/personal-education-management-system/page/2-student-intake-functions "Student Fields")</td><td style="height: 67.4219px;"><span style="color: rgb(224, 62, 45);">Not started</span></td><td style="height: 67.4219px;">#### 2.4 Calculate Enrollment Year Terms

</td></tr><tr style="height: 80.1875px;"><td style="height: 80.1875px;">  
</td><td style="height: 80.1875px;">*Purpose*</td><td style="height: 80.1875px;">*Students transfer in and out of schools at various times and frequently in the middle of school terms. Many student's do not complete all the terms in their first year enrolled in the term. Based on the student's start date, calculate how many terms the student attends in their first year attending the school.*</td></tr><tr style="height: 46.5938px;"><td style="height: 46.5938px;">  
</td><td style="height: 46.5938px;">*Trigger*</td><td style="height: 46.5938px;">*When new student record is entered or when the student start date changes. This function only runs if the student status = planned.*</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">*Conditions*</td><td style="height: 29.7969px;">*requisite fields are not empty.*</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">*Sequence*</td><td style="height: 29.7969px;">*After function 2.23 runs and only once on student intake.*</td></tr><tr style="height: 57.7812px;"><td style="height: 57.7812px;"> </td><td style="height: 57.7812px;">Step 1</td><td style="height: 57.7812px;">Find <span style="text-decoration: underline;">ordinate </span>of the the [School Term](https://cs.studianova.org/admin/terms) linked to the [Student](https://cs.studianova.org/admin/students) from the school start term field, found in function 2.3 above.

</td></tr><tr style="height: 102.562px;"><td style="height: 102.562px;">  
</td><td style="height: 102.562px;">Step 2</td><td style="height: 102.562px;"><s>If the [Term Label](https://cs.studianova.org/admin/termlabels) record linked to the [School Term](https://cs.studianova.org/admin/terms) has [Term Label](https://cs.studianova.org/admin/termlabels) flag = official end term, then [Student](https://cs.studianova.org/admin/students) Enrollment year terms = 1. (Then quit logic)</s>

<s>Else:</s>

**<span style="text-decoration: underline;">Find the start year's child [School Term](https://cs.studianova.org/admin/terms) record.</span>**

</td></tr><tr style="height: 80.1719px;"><td style="height: 80.1719px;">  
</td><td style="height: 80.1719px;">Step 3</td><td style="height: 80.1719px;"><s>Find the ordinate of the [School Term](https://cs.studianova.org/admin/terms) linked to the [Student](https://cs.studianova.org/admin/students). *("ordinate start")*</s>

<span style="text-decoration: underline;">**Based on the related [Term Label](https://cs.studianova.org/admin/termlabels) flag, flag = official end, find the ordinate of the last school term in the academic start year.**</span>

</td></tr><tr style="height: 102.562px;"><td style="height: 102.562px;">  
</td><td style="height: 102.562px;">Step 4</td><td style="height: 102.562px;"><s>Find the ordinate of the [School Term](https://cs.studianova.org/admin/terms) record in the same [Academic Year ](https://cs.studianova.org/admin/academicyears)= same as [Student](https://cs.studianova.org/admin/students) school start term and has a linked [Term Label](https://cs.studianova.org/admin/termlabels) record with flag = official end term. *("ordinate end")*</s>

**<span style="text-decoration: underline;">Enrollment year terms = end year ordinate - ordinate of school start term + 1</span>**

</td></tr><tr style="height: 80.1719px;"><td style="height: 80.1719px;">  
</td><td style="height: 80.1719px;"><s>Step 5</s></td><td style="height: 80.1719px;"><s>Find remaining terms. Subtract the sequence the student schools start term from the school term record found above, the official end term, then add 1:</s>

<s>*remaining terms = ("ordinate end") - ("ordinate start") + 1*</s>

</td></tr><tr style="height: 38.375px;"><td style="height: 38.375px;">END</td><td style="height: 38.375px;">  
</td><td style="height: 38.375px;"> </td></tr><tr style="height: 91.734px;"><td style="height: 91.734px;"><span style="color: rgb(52, 73, 94); background-color: rgb(251, 238, 184);">*Introduces a Restriction*</span></td><td style="height: 91.734px;">  
</td><td style="height: 91.734px;"><span style="color: rgb(52, 73, 94);">*This method assumes that there are no interim terms that are optional, that the optional terms are either at the beginning or end of an official academic year.* </span>

<span style="color: rgb(52, 73, 94);">*There is one use case where this assumption will fail, the 'intersession' where students can optionally enroll in a short period between terms, usually over the Christmas holiday to make up work that was not completed.*</span>

<span style="color: rgb(52, 73, 94);">*We will not design for intersession, and only allow optional terms to be before or after the standard academic year. This use case is not very common.*</span>

</td></tr></tbody></table>

#### <s>Use Case Test 2.4 Calculate Enrollment Year Terms\*</s>

<table border="1" id="bkmrk-school-term-ordinate" style="border-collapse: collapse; width: 100%; height: 900.391px;"><colgroup><col style="width: 12.4845%;"></col><col style="width: 14.5859%;"></col><col style="width: 11.6193%;"></col><col style="width: 12.979%;"></col><col style="width: 14.3387%;"></col><col style="width: 14.4623%;"></col><col style="width: 19.6539%;"></col></colgroup><tbody><tr style="height: 63.3906px;"><td style="height: 63.3906px;">  
</td><td style="height: 63.3906px;"><s>**School term**</s></td><td style="height: 63.3906px;"><s>**Ordinate school term**</s></td><td style="height: 63.3906px;"><s>**Term Label**</s></td><td style="height: 63.3906px;"><s>**Flag**</s></td><td style="height: 63.3906px;"><s>**Academic Year**</s></td><td style="height: 63.3906px;"><s>**Logic**</s></td></tr><tr style="height: 124.969px;"><td style="height: 124.969px;"><s>*Student enrolled in fall*</s></td><td style="height: 124.969px;"><s>Fall 2023</s></td><td style="height: 124.969px;"><s>23</s></td><td style="height: 124.969px;"><s>Fall</s></td><td style="height: 124.969px;"><s>Official Start</s></td><td style="height: 124.969px;"><s>2023-2024</s></td><td style="height: 124.969px;"><s> 'ordinate start' = 23, flag is not official end term so find the correct record.</s></td></tr><tr style="height: 63.3906px;"><td style="height: 63.3906px;">  
</td><td style="height: 63.3906px;"><s>Spring 2024</s></td><td style="height: 63.3906px;"><s>24</s></td><td style="height: 63.3906px;"><s>Spring</s></td><td style="height: 63.3906px;"><s>Official End Term</s></td><td style="height: 63.3906px;"><s>2023-2024</s></td><td style="height: 63.3906px;"><s>end term for same academic year, so 'ordinate end' = 24</s></td></tr><tr style="height: 46.5938px;"><td style="height: 46.5938px;">  
</td><td style="height: 46.5938px;">  
</td><td style="height: 46.5938px;">  
</td><td style="height: 46.5938px;">  
</td><td style="height: 46.5938px;">  
</td><td style="height: 46.5938px;"><s>*Enrollment year terms:*</s></td><td style="height: 46.5938px;"><s>**24 - 23 + 1 = 2** </s></td></tr><tr style="height: 35.3906px;"><td style="height: 35.3906px;">  
</td><td style="height: 35.3906px;">  
</td><td style="height: 35.3906px;">  
</td><td style="height: 35.3906px;">  
</td><td style="height: 35.3906px;">  
</td><td style="height: 35.3906px;">  
</td><td style="height: 35.3906px;"></td></tr><tr style="height: 35.3906px;"><td style="height: 35.3906px;">  
</td><td style="height: 35.3906px;"><s>Fall 2023</s></td><td style="height: 35.3906px;"><s>23</s></td><td style="height: 35.3906px;"><s>Fall</s></td><td style="height: 35.3906px;"><s>Official Start</s></td><td style="height: 35.3906px;"><s>2023-2024</s></td><td style="height: 35.3906px;"></td></tr><tr style="height: 80.1719px;"><td style="height: 80.1719px;"><s>*Student enrolled in spring*</s></td><td style="height: 80.1719px;"><s>Spring 2024</s></td><td style="height: 80.1719px;"><s>24</s></td><td style="height: 80.1719px;"><s>Spring</s></td><td style="height: 80.1719px;"><s>Official End Term</s></td><td style="height: 80.1719px;"><s>2023-2024</s></td><td style="height: 80.1719px;"><s>"ordinate start" = 24</s>

<s>flag = official end term</s>

</td></tr><tr style="height: 46.5938px;"><td style="height: 46.5938px;">  
</td><td style="height: 46.5938px;">  
</td><td style="height: 46.5938px;">  
</td><td style="height: 46.5938px;">  
</td><td style="height: 46.5938px;">  
</td><td style="height: 46.5938px;"><s>*Enrollment year terms:*</s></td><td style="height: 46.5938px;"><s>**1**</s></td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">  
</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">  
</td></tr><tr style="height: 63.3906px;"><td style="height: 63.3906px;"><s>Student enrolled in summer</s></td><td style="height: 63.3906px;"><s>Summer 2024</s></td><td style="height: 63.3906px;"><s>25</s></td><td style="height: 63.3906px;"><s>Summer</s></td><td style="height: 63.3906px;"><s>Interim</s></td><td style="height: 63.3906px;"><s>2024-2025</s></td><td style="height: 63.3906px;"><s>"ordinate start" = 25</s></td></tr><tr style="height: 124.938px;"><td style="height: 124.938px;">  
</td><td style="height: 124.938px;"><s>Fall 2023</s></td><td style="height: 124.938px;"><s>26</s></td><td style="height: 124.938px;"><s>Fall</s></td><td style="height: 124.938px;"><s>Official Start</s></td><td style="height: 124.938px;"><s>2024-2025</s></td><td style="height: 124.938px;"><s>flag is not official end year, record not found</s></td></tr><tr style="height: 80.1875px;"><td style="height: 80.1875px;">  
</td><td style="height: 80.1875px;"><s>Spring 2024</s></td><td style="height: 80.1875px;"><s>27</s></td><td style="height: 80.1875px;"><s>Spring</s></td><td style="height: 80.1875px;"><s>Official End Term</s></td><td style="height: 80.1875px;"><s>2024-2025</s></td><td style="height: 80.1875px;"><s>flag is equal to official end term for same academic year, so 'ordinate end' = 27</s></td></tr><tr style="height: 46.5938px;"><td style="height: 46.5938px;">  
</td><td style="height: 46.5938px;">  
</td><td style="height: 46.5938px;">  
</td><td style="height: 46.5938px;">  
</td><td style="height: 46.5938px;">  
</td><td style="height: 46.5938px;"><s>*Enrollment year terms:*</s></td><td style="height: 46.5938px;"><s>**27 - 25 + 1 = 23**</s></td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">  
</td></tr></tbody></table>



*\*<s>note: there is a logic problem if there is an optional term 'sandwiched' between the official end and start terms that the student chooses to not attend, this will change the number of enrollment year terms. Do not allow optional terms in between required terms in the same academic year. A required academic year must be continuous.</s>*

<table border="1" id="bkmrk-student-fields-not-s-4" style="border-collapse: collapse; width: 99.7531%; height: 665.016px;"><colgroup><col style="width: 17.72%;"></col><col style="width: 12.2677%;"></col><col style="width: 70.1363%;"></col></colgroup><tbody><tr style="height: 67.4219px;"><td style="height: 67.4219px;">[Student Fields](https://bsa.lynops.com/books/personal-education-management-system/page/2-student-intake-functions "Student Fields")</td><td style="height: 67.4219px;"><span style="color: rgb(224, 62, 45);">Not started</span></td><td style="height: 67.4219px;">#### 2.5 Calculate Remaining Terms in Enrollment Grade Span

</td></tr><tr style="height: 63.375px;"><td style="height: 63.375px;">  
</td><td style="height: 63.375px;">*Purpose*</td><td style="height: 63.375px;">*Calculate the remaining terms in the grade span. This is used for assigning plans. Plans can not be assigned that require more terms than remaining in the grade span.*</td></tr><tr style="height: 80.1719px;"><td style="height: 80.1719px;">  
</td><td style="height: 80.1719px;">*Trigger*</td><td style="height: 80.1719px;">*When new student record is entered and only once on student intake.*

*note: this field is updated in the advancement workflow, but it will use very different logic than this initial value*

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">*Conditions*</td><td style="height: 29.7969px;">*requisite fields are not empty.*</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">*Sequence*</td><td style="height: 29.7969px;">*This function runs after 2.4, find enrollment year terms.*</td></tr><tr style="height: 80.1719px;"><td style="height: 80.1719px;"> </td><td style="height: 80.1719px;">Step 1</td><td style="height: 80.1719px;">Find the remaining academic years in the grade span: Subtract [Student](https://cs.studianova.org/admin/students) current grade level from [Grade Span](https://cs.studianova.org/admin/gradespans) End grade:

*[Grade Span](https://cs.studianova.org/admin/gradespans) End grade - [Student](https://cs.studianova.org/admin/students) current grade*

</td></tr><tr style="height: 57.7812px;"><td style="height: 57.7812px;">  
</td><td style="height: 57.7812px;"><s>Step 2</s></td><td style="height: 57.7812px;"><s>If the value above is zero then set remaining terms = enrollment year terms.</s>

<s>Else:</s>

</td></tr><tr style="height: 57.7812px;"><td style="height: 57.7812px;">  
</td><td style="height: 57.7812px;"><s>Step 3</s>

DONE

</td><td style="height: 57.7812px;"><s>Find required\_terms\_year in the [School Configuration](https://cs.studianova.org/admin/crmfields) </s>

<s>**<span style="color: rgb(224, 62, 45);">NOTE: NEED TO ADD THIS FIELD TO CONFIGURATION PAGE</span>**</s>

</td></tr><tr style="height: 80.1719px;"><td style="height: 80.1719px;">  
</td><td style="height: 80.1719px;">Step 4</td><td style="height: 80.1719px;">Multiply number of required terms times the number of remaining years in the grade span

*required\_terms\_year X ([Grade Span](https://cs.studianova.org/admin/gradespans) End grade - [Student](https://cs.studianova.org/admin/students) current grade)*

</td></tr><tr style="height: 80.1719px;"><td style="height: 80.1719px;">  
</td><td style="height: 80.1719px;">Step 5</td><td style="height: 80.1719px;">Add [Student](https://cs.studianova.org/admin/students) Enrollment year terms to above:

[S*tudent*](https://cs.studianova.org/admin/students) *Enrollment year terms + required\_terms\_year X ([Grade Span](https://cs.studianova.org/admin/gradespans) End grade - [Student](https://cs.studianova.org/admin/students) current grade)*

</td></tr><tr style="height: 38.375px;"><td style="height: 38.375px;">END</td><td style="height: 38.375px;">  
</td><td style="height: 38.375px;">  
</td></tr></tbody></table>