Skip to content

Commit

Permalink
Merge pull request #280 from Aspine/study-support
Browse files Browse the repository at this point in the history
Show classes for study support, remove dummy classes
  • Loading branch information
jadebuckwalter authored Mar 18, 2021
2 parents 5e3b87b + 8a73fd6 commit a5196c6
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
22 changes: 22 additions & 0 deletions public/js/clock.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 7 additions & 0 deletions src/scrape.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit a5196c6

Please sign in to comment.