diff --git a/scrapers/fireroad.py b/scrapers/fireroad.py index ac525eaf..74263297 100644 --- a/scrapers/fireroad.py +++ b/scrapers/fireroad.py @@ -437,6 +437,7 @@ def get_course_data( "name": course.get("title", ""), "inCharge": ",".join(course.get("instructors", [])), # type: ignore "virtualStatus": course.get("virtual_status", "") == "Virtual", + "is_half_class": course.get("is_half_class", False), } ) diff --git a/scrapers/overrides.toml.d/override-schema.json b/scrapers/overrides.toml.d/override-schema.json index 3aff4f74..c734f7a9 100644 --- a/scrapers/overrides.toml.d/override-schema.json +++ b/scrapers/overrides.toml.d/override-schema.json @@ -388,6 +388,11 @@ "title": "New", "description": "True if subject is new" }, + "is_half_class": { + "type": "boolean", + "title": "Half HASS-A", + "description": "True if class counts as half HASS-A" + }, "rating": { "type": "number", "title": "Rating", diff --git a/scrapers/overrides.toml.d/sem/21h.toml b/scrapers/overrides.toml.d/sem/21h.toml index f201e3dc..70335e04 100644 --- a/scrapers/overrides.toml.d/sem/21h.toml +++ b/scrapers/overrides.toml.d/sem/21h.toml @@ -15,3 +15,6 @@ inCharge = "I. Kumekawa" url = "https://history.mit.edu/subjects/special-subject-history-4/" hass = ["H"] new = true + +["21M.460"] +is_half_class = true \ No newline at end of file diff --git a/scrapers/package.py b/scrapers/package.py index 07cc45f8..5330e937 100644 --- a/scrapers/package.py +++ b/scrapers/package.py @@ -151,6 +151,9 @@ def run() -> None: | get_include(overrides_all) | get_include(overrides_sem), ) + for course_num, course in courses.items(): + if course_num.startswith("21M.1") or course_num.startswith("21M.4"): + course["is_half_class"] = True term_info = get_term_info(sem) url_name = term_info["urlName"] diff --git a/src/components/ActivityDescription.tsx b/src/components/ActivityDescription.tsx index 3d74dff3..5c7b441b 100644 --- a/src/components/ActivityDescription.tsx +++ b/src/components/ActivityDescription.tsx @@ -1,5 +1,6 @@ import { useContext } from "react"; import { decode } from "html-entities"; +import { HASS } from "../lib/raw"; import { Flex, @@ -110,7 +111,12 @@ function ClassTypes(props: { cls: Class }) { ["phys2", "Physics 2"], ["rest", "REST"], ["hassH", "HASS-H"], - ["hassA", "HASS-A"], + [ + "hassA", + cls.rawClass.hass.includes(HASS.A) && cls.rawClass.is_half_class + ? "HASS-A (half)" + : "HASS-A", + ], ["hassS", "HASS-S"], ["hassE", "HASS-E"], ["cih", "CI-H"], diff --git a/src/lib/raw.ts b/src/lib/raw.ts index 9e7b3178..9424f7f9 100644 --- a/src/lib/raw.ts +++ b/src/lib/raw.ts @@ -10,6 +10,8 @@ export interface RawClass { subject: string; /** True if some section is not scheduled yet */ tba: boolean; + /** True if this counts as half of a HASS-A class */ + is_half_class?: boolean; /** Kinds of sections (among LECTURE, RECITATION, LAB, DESIGN) that exist */ sectionKinds: SectionKind[];