Conditional Requirements#

Conditional Requirements allow a degree or group to modify its requirements based on conditions that apply to a student. This can be useful when different students need to follow different requirements based on factors such as the current term.

Note: Conditional Requirements are available only to institutions that have the Conditional Requirements module enabled.


Where to Find Conditional Requirements#

Conditional Requirements are configured from the Edit Degree form.

To access them:

  1. Find the degree or group you want to configure, and edit it.
  2. Locate the appropriate Conditional Requirements field.

Conditional Requirements are entered using a simple syntax that specifies a condition and the action that should be taken when the condition is met.


Basic Syntax#

A conditional requirement follows this general format:

IF condition THEN action( requirement )

For example:

IF term_is_gte(2017F) THEN add_course("ENGL 101")

This can be read as:

If the student’s term is Fall 2017 or later, add ENGL 101 as a requirement.

The syntax consists of four main parts:

PartDescription
IFBegins the condition.
conditionSpecifies when the rule should apply.
THENSeparates the condition from the action.
action()Specifies what should happen when the condition is true.

The IF and THEN keywords are not case-sensitive, and there must be spaces between each keyword.


Conditions#

A condition determines when a conditional requirement should be applied.


term_is_gte()#

The term_is_gte() condition tests whether the student’s term is greater than or equal to a specified term.

For example:

term_is_gte(2017F)

This condition is true for students when the current term is Fall 2017 or later.

A complete IF/THEN action might look like:

IF term_is_gte(2017F) THEN add_course("ENGL 101")

In this example, ENGL 101 is added to the requirements for students when the current term is Fall 2017 or later.


Actions#

An action specifies what FlightPath should do when the condition is met.


add_course()#

The add_course() action adds a course or requirement to the degree.

For example:

IF term_is_gte(2017F) THEN add_course("ENGL 101")

When the condition is true, ENGL 101 is added as a requirement.

The requirement passed to add_course() can use the appropriate FlightPath requirement syntax. Examples:

  • add_course("ENGL 101")
  • add_course("MATH 101 (C)")
  • add_course("MATH 101 [4]")

rem_course()#

The rem_course() action removes a course or requirement.

For example:

IF term_is_gte(2017F) THEN rem_course("ENGL 101")

When the condition is true, ENGL 101 is removed from the requirements.


rem_course_if_not_prev_completed()#

The rem_course_if_not_prev_completed() action removes a course or requirement only if the student has not previously completed it.

For example:

IF term_is_gte(2017F) THEN rem_course_if_not_prev_completed("ENGL 101")

This can be useful when a requirement is no longer applicable to newer students while preserving the requirement for students who have already completed the course.


Requirement Strings#

The requirement supplied to an action can contain the normal FlightPath requirement syntax.

For example:

IF term_is_gte(2017F) THEN add_course("ENGL 101")

A conditional requirement can therefore do more than simply add or remove an individual course. The requirement string can represent the appropriate degree or group requirement.

When creating a conditional requirement, make sure the requirement string is valid for the location in which the conditional rule is being used.


Comments#

Comments can be included in Conditional Requirements by beginning a line with #.

For example:

# Add the new English requirement for students beginning in Fall 2017
IF term_is_gte(2017F) THEN add_course("ENGL 101")

Comments are ignored when the conditional requirements are processed. They can be useful for documenting why a particular rule exists, especially when maintaining degrees with multiple historical curriculum changes.