Skip to content

Commit e7f6204

Browse files
authored
fix: implement correct grouping for engineering liberal studies (#962)
1 parent 556f310 commit e7f6204

File tree

2 files changed

+2238
-4878
lines changed

2 files changed

+2238
-4878
lines changed

src/data/colleges/en.ts

+46-35
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,40 @@ import {
1010
import { AdvisorGroup } from '../../tools/advisors/types';
1111
import { lastNameRange, lastNameRanges } from '../../tools/advisors/checkers';
1212

13-
const engineeringLiberalArtsDistributions: readonly string[] = [
14-
'CA',
15-
'HA',
16-
'LA',
17-
'LAD',
18-
'KCM',
19-
'SBA',
20-
'FL',
21-
'CE',
22-
'ALC',
23-
'SCD',
24-
'HST',
25-
'ETM',
26-
'SSC',
27-
'GLC',
28-
];
13+
const engineeringLiberalArtsGroups: string[][] = Object.values({
14+
'Group 1': [
15+
'CA-AAP',
16+
'CA-AG',
17+
'CA-AS',
18+
'CA-HE',
19+
'LA-AAP',
20+
'LA-AG',
21+
'LA-AS',
22+
'LAD-HE',
23+
'ALC-AAP',
24+
'ALC-AS',
25+
'ALC-HA',
26+
'SCD-AAP',
27+
'SCD-AS',
28+
'SCD-HA',
29+
],
30+
'Group 2': ['HA-AAP', 'HA-AG', 'HA-AS', 'HA-HE', 'HST-AAP', 'HST-AS', 'HST-HA'],
31+
'Group 3': ['KCM-AAP', 'KCM-AG', 'KCM-AS', 'KCM-HE', 'ETM-AAP', 'ETM-AS', 'ETM-HA'],
32+
'Group 4': [
33+
'SBA-AAP',
34+
'SBA-AG',
35+
'SBA-AS',
36+
'SBA-HE',
37+
'SSC-AAP',
38+
'SSC-AS',
39+
'SSC-HA',
40+
'GLC-AAP',
41+
'GLC-AS',
42+
'GLC-HA',
43+
],
44+
'Group 5': ['FL-AAP', 'FL-AG'],
45+
'Group 6': ['CE-EN'],
46+
});
2947

3048
const engineeringRequirements: readonly CollegeOrMajorRequirement[] = [
3149
{
@@ -111,37 +129,30 @@ const engineeringRequirements: readonly CollegeOrMajorRequirement[] = [
111129
'https://www.engineering.cornell.edu/students/undergraduate-students/advising/liberal-studies',
112130
checker: [
113131
(course: Course): boolean =>
114-
engineeringLiberalArtsDistributions.some(
115-
distribution => hasCategory(course, distribution) ?? false
132+
engineeringLiberalArtsGroups.some(group =>
133+
group.some(distribution => hasCategory(course, distribution) ?? false)
116134
) || courseIsForeignLang(course),
117135
],
118136
fulfilledBy: 'courses',
119137
perSlotMinCount: [6],
120138
slotNames: ['Course'],
121139
additionalRequirements: {
122-
'Courses must be from 3 categories.': {
140+
'Courses must be from 3 groups.': {
123141
checker: [
124-
(course: Course): boolean =>
125-
(course.catalogDistr?.includes('LA') || course.catalogDistr?.includes('LAD')) ?? false,
126-
...engineeringLiberalArtsDistributions
127-
.filter(it => it !== 'LA' && it !== 'LAD')
128-
.map(distribution => (course: Course): boolean =>
129-
hasCategory(course, distribution) ?? false
130-
),
142+
...engineeringLiberalArtsGroups.map(group => (course: Course): boolean =>
143+
group.some(distribution => hasCategory(course, distribution) ?? false)
144+
),
131145
],
132146
fulfilledBy: 'courses',
133-
perSlotMinCount: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
134-
slotNames: [
135-
'LA',
136-
...engineeringLiberalArtsDistributions.filter(it => it !== 'LA' && it !== 'LAD'),
137-
],
147+
perSlotMinCount: [1, 1, 1, 1, 1, 1],
148+
slotNames: ['Group 1', 'Group 2', 'Group 3', 'Group 4', 'Group 5', 'Group 6'],
138149
minNumberOfSlots: 3,
139150
},
140151
'Courses must have at least 18 credits.': {
141152
checker: [
142153
(course: Course): boolean =>
143-
engineeringLiberalArtsDistributions.some(
144-
distribution => hasCategory(course, distribution) ?? false
154+
engineeringLiberalArtsGroups.some(group =>
155+
group.some(distribution => hasCategory(course, distribution) ?? false)
145156
) || courseIsForeignLang(course),
146157
],
147158
fulfilledBy: 'credits',
@@ -153,8 +164,8 @@ const engineeringRequirements: readonly CollegeOrMajorRequirement[] = [
153164
const { catalogNbr } = course;
154165
return (
155166
!ifCodeMatch(catalogNbr, '1***') &&
156-
(engineeringLiberalArtsDistributions.some(
157-
category => hasCategory(course, category) ?? false
167+
(engineeringLiberalArtsGroups.some(group =>
168+
group.some(distribution => hasCategory(course, distribution) ?? false)
158169
) ||
159170
courseIsForeignLang(course))
160171
);

0 commit comments

Comments
 (0)