Skip to content

Commit 175a1b4

Browse files
author
Suhas Hariharan
committed
changed to using semester instead of date
Signed-off-by: Suhas Hariharan <[email protected]>
1 parent afb92dc commit 175a1b4

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/js/saspowerschoolff.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -348,12 +348,14 @@ async function getCourses (second_semester, sem1_col, sem2_col) {
348348
const page = document.implementation.createHTMLDocument();
349349
page.documentElement.innerHTML = response;
350350
const sectionId = page.querySelector("div[data-pss-student-assignment-scores]").getAttribute("data-sectionid");
351-
let startDate = currentUrl.searchParams.get("begdate");
352-
startDate = startDate.split("/")[2] + "-" + startDate.split("/")[0] + "-" + startDate.split("/")[1];
353-
let endDate = currentUrl.searchParams.get("enddate");
354-
endDate = endDate.split("/")[2] + "-" + endDate.split("/")[0] + "-" + endDate.split("/")[1];
355351
const studentId = page.querySelector("div .xteContentWrapper").getAttribute("data-ng-init").split("\n")[0].split("= '")[1].replace("';", "").substring(3);
356-
const assignment_list = assignmentsFromAPI(studentId, sectionId, startDate, endDate);
352+
let currentSemester;
353+
if (second_semester) {
354+
currentSemester = "S2";
355+
} else {
356+
currentSemester = "S1";
357+
}
358+
const assignment_list = assignmentsFromAPI(studentId, sectionId, currentSemester);
357359
courses.push(new Course(temp.trim(), currentUrlString, $course.text(), finalPercent, assignment_list));
358360
if (gradeToGPA($course.text()) !== -1) {
359361
new (Vue.extend(ClassGrade))({

0 commit comments

Comments
 (0)