diff --git a/public/js/clock.js b/public/js/clock.js index c1646479..1d7c27e7 100755 --- a/public/js/clock.js +++ b/public/js/clock.js @@ -232,6 +232,28 @@ function get_period_name(default_name, day_of_week) { bs_day = document.getElementById("schedule_title").innerHTML .toLowerCase(); } + + if (default_name === "Study Support") { + // Number of period whose study support block is today + let block = 0; + switch (day_of_week) { + case 1: + case 2: + block = day_of_week; + break; + case 4: + case 5: + block = day_of_week - 1; + break; + } + for (const { name, period } of period_names[bs_day]) { + if (period.includes(block)) { + return name; + } + } + return default_name; + } + // period_names has class names now for (const { name, period } of period_names[bs_day]) { if (period === default_name) diff --git a/src/scrape.ts b/src/scrape.ts index e6941f74..a2e66011 100644 --- a/src/scrape.ts +++ b/src/scrape.ts @@ -51,6 +51,13 @@ export async function get_student( if (!details.grades.has(quarter)) { return undefined; } + // exclude classes that don't recieve grades in Aspen + if ([ + "Study Support", "Advisory", "Community Meeting", "PE Athletics", + "PE 10-12 Wellness Elective", + ].includes(details.name)) { + return undefined; + } let categories: { [key: string]: string } = {}; for (const [cat, { weight} ] of details.categories) {