Skip to main content

Create Student Term Records

Student Term Records

From the student table, we know the following fields:

  • Student first term - calculated by looking up the school term based on the start date
  • Enrollment year terms - the number of terms the student will attend in their first year
  • Grade level - the students current grade level
  • Grade span - the planning horizon for that student based on their grade level

Obejctive

  1. Make a new set of student term records for a new student (status = planned) when the following are true

    1. start date is not empty
    2. first student term is not empty
    3. student plan is not empty
  2. Make one student term record for every term the student attends in the associated grade span

  3. Associate new student term records to Student and Term records

Make the first student term record

  • Make a new student term record, associated the student term record with the school term which has been entered into the "student first term" field in the student table

  • Enter the "flag" from the term record into the "flag" field  in the student term record.

  • Enter the "current program" from the student table into the "student program" in the student term record
  • Enter the "current grade level" from the student table into the "at grade" field in the student term record

  • Set the S"tudent Sequence" in the student term record to 1





Determining Grade level for each student term for the “at_grade” field

The student’s grade_level increases after the student has completed all the terms in an academic year.  The term record has a field called 'flag" which notes if the term is the official end term. After the official enter term, the student's grade level is expected to increase, and so the "at_grade" field will increase by one.


Create the student term records in sequential order, according to the term records. When you get to a term record that is “official end” then you know to increase the grade level integer by one for the next record.



Loop Algorithm

  1. Find the term record name where the student record's start_date is between the term's start and end date and ENTER the name of the term in the Student records' school_start_term field. This is the student's first term, with student sequence = 1.

  2. Loop to create associated student terms records

    1. define a "variable for the student's current grade level number", this value will increment in this loop

    2. associate the student term record to the student

    3. associate the student term record to the term record found above (the term the student is first enrolled)

    4. set the student terms student_sequence field to "1"

    5. set the at_grade field to the start_grade in the student record

    6. If the associated term has a  flag field = "official end" then increase the variable defined or the student's grade level number by one

    1. check the student's associated grade span, if the "variable for the student grade level" is greater than the end_year of the associated grade span, then stop. If the variable is equal to or less than the grade span end_year, continue to create records

    2. create a student terms record

      • note: student term records are created for optional as well as required terms

      1. Find the next sequential term record (using term ordinate field) and associate this term record with the student terms record

      2. Associate the student term record to the student

      3. Set the student sequence field to the previous value plus one

      4. Set the at-grade field value to the variable defined for student's grade level

      5. If the associated term is associated with a term label record with flag field = "official end" then increase the variable defined or the student's grade level number by one

      6. Repeat the loop until you exit according to step one, (the student's variable for grade level exceeds the span end_grade)

    1. Create the first student terms record

    2. Create the next student terms record (until the end of the loop)

 

Calculate Field Values

Student Term Name

Concatenate: Term Name, StudentInitials, Student Code, “GL” grade level number:

Example from Kassidy’s Record: Spring 2023 KKB14 GL3

Update the record name every time the record is saved with a change to the associated term, associated student fields, or grade level field.