Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added STS Major #469

Merged
merged 6 commits into from
Apr 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,12 @@ Array [
"Major-PHYS-Physics Core",
"Major-PHYS-Physics Intermediate Courses",
"Major-PHYS-Physics Lab",
"Major-STS-2000 Level STS Courses",
"Major-STS-3000+ STS Courses",
"Major-STS-4000+ STS Courses",
"Major-STS-Core Course",
"Major-STS-One S&TS course",
"Major-STS-Science Requirement",
"Minor-AEROSPACE-Group A",
"Minor-AEROSPACE-Group B or C",
"Minor-APPLIEDMATH-6 courses",
Expand Down
6 changes: 6 additions & 0 deletions src/requirements/data/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import oldIsstRequirements from './majors/oldIsst';
import orieRequirements from './majors/orie';
import pamRequirements from './majors/pam';
import physRequirements from './majors/phys';
import stsRequirements from './majors/sts';
import aerospaceMinorRequirements from './minors/aerospace';
import appliedMathMinorRequirements from './minors/applied-math';
import buMinorRequirements from './minors/bu';
Expand Down Expand Up @@ -240,6 +241,11 @@ const json: RequirementsJson = {
schools: ['AS1', 'AS2'],
requirements: physRequirements,
},
STS: {
name: 'Science & Technology Studies',
schools: ['AS1', 'AS2'],
requirements: stsRequirements,
},
},
minor: {
AEROSPACE: {
Expand Down
95 changes: 95 additions & 0 deletions src/requirements/data/majors/sts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
import { Course, CollegeOrMajorRequirement } from '../../types';
import { ifCodeMatch, includesWithSubRequirements } from '../checkers-common';

// from here https://courses.cornell.edu/preview_program.php?catoid=31&poid=15425
const stsScienceRequirement: readonly string[] = ['PBS', 'PBSS', 'OPHLS', 'BIOLS', 'BIO'];

const stsRequirements: readonly CollegeOrMajorRequirement[] = [
{
name: 'One S&TS course',
description: 'Any level, excluding STS 2011.',
source: 'https://sts.cornell.edu/sts-major',
checker: [(course: Course): boolean => course.subject === 'STS' && course.crseId !== 2011],
fulfilledBy: 'courses',
perSlotMinCount: [1],
slotNames: ['Course'],
},
{
name: 'Core Course',
description: 'STS 2011',
source: 'https://sts.cornell.edu/sts-major',
checker: includesWithSubRequirements(['STS 2011']),
fulfilledBy: 'courses',
perSlotMinCount: [1],
slotNames: ['Course'],
},
{
name: '2000 Level STS Courses',
description: 'Three additional 2000 level STS courses.',
source: 'https://sts.cornell.edu/sts-major',
checker: includesWithSubRequirements(['STS 2***']),
fulfilledBy: 'courses',
perSlotMinCount: [3],
slotNames: ['2000 Level Course'],
},

// TODO: Add a check for 37 credit split between the next two categories
// Additional S&TS courses to total 37 credit hours in the major.
{
name: '3000+ STS Courses',
description: 'Additional 3000 level or above STS courses.',
source: 'https://sts.cornell.edu/sts-major',
checker: [
(course: Course): boolean => {
const { catalogNbr } = course;
return (
ifCodeMatch(course.subject, 'STS') &&
!(ifCodeMatch(catalogNbr, '1***') || ifCodeMatch(catalogNbr, '2***'))
);
},
],
fulfilledBy: 'courses',
perSlotMinCount: [2],
slotNames: ['3000+ STS Course'],
},
{
name: '4000+ STS Courses',
description: 'Additional 4000 level or above STS courses.',
source: 'https://sts.cornell.edu/sts-major',
checker: [
(course: Course): boolean => {
const { catalogNbr } = course;
return (
ifCodeMatch(course.subject, 'STS') &&
!(
ifCodeMatch(catalogNbr, '1***') ||
ifCodeMatch(catalogNbr, '2***') ||
ifCodeMatch(catalogNbr, '3***')
)
);
},
],
fulfilledBy: 'courses',
perSlotMinCount: [2],
slotNames: ['4000+ STS Course'],
},
{
name: 'Science Requirement',
description:
'Two courses of at least 3 credits each in natural science or engineering (including computer science).',
source: 'https://sts.cornell.edu/sts-major',
checker: [
(course: Course): boolean =>
stsScienceRequirement.some(
distribution =>
((course.catalogDistr?.includes(distribution) ?? false) || course.acadGroup === 'EN') &&
course.enrollGroups.some(group => group.unitsMinimum >= 3)
),
],
fulfilledBy: 'courses',
perSlotMinCount: [2],
slotNames: ['Science Requirement'],
},
];

export default stsRequirements;
Loading