Skip to content

Commit fe36f6f

Browse files
author
Suhas Hariharan
committed
fixed cumulative gpa by checking the most recent term and comparing it to the current semester
Signed-off-by: Suhas Hariharan <[email protected]>
1 parent 4f7a0c9 commit fe36f6f

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

src/js/components/CumulativeGPA.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ export default {
158158
current_term_history = undefined;
159159
}
160160
const tabs = el.getElementsByClassName("tabs")[0].getElementsByTagName("li");
161+
let most_recent_term;
161162
// Iterate until the end of tabs or until no longer at a high school semester
162163
for (let i = 0; i < tabs.length && /HS$/.test(tabs[i].innerText); i++) {
163164
fetches.push(
@@ -171,11 +172,14 @@ export default {
171172
element_list = element_list.getElementsByTagName("tbody")[0].getElementsByTagName("tr");
172173
for (let t = 2; t < element_list.length; t++) {
173174
if (element_list[t].innerText.trim() === ("S2")) {
175+
most_recent_term = "S2";
174176
all_courses.push(courses);
175177
if (i === 0) {
176178
current_term_grades.push(courses);
177179
}
178180
courses = [];
181+
} else {
182+
most_recent_term = "S1";
179183
}
180184
if (element_list[t].getElementsByTagName("th").length > 0) {
181185
continue;
@@ -205,7 +209,8 @@ export default {
205209
} else {
206210
current_semester = "S1";
207211
}
208-
if (current_term === current_semester) {
212+
// checks the most recent term and compares it to current semester, only includes additional courses if they are different.
213+
if (most_recent_term === current_semester) {
209214
include_current_semester = false;
210215
} else {
211216
include_current_semester = true;

src/js/views/Options.vue

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,18 @@
1616
<br>
1717
<footer>
1818
<br>
19-
SAS Powerschool Enhancement Suite is the collective work of many different people working together publicly. Visit our <a href="https://github.com/sas-fossdev/saspes" target="_blank">GitHub page</a> if you'd like to participate as well.<br>
19+
SAS Powerschool Enhancement Suite is the collective work of many different people working together publicly. Visit our <a
20+
href="https://github.com/sas-fossdev/saspes"
21+
target="_blank"
22+
>GitHub page</a> if you'd like to participate as well.<br>
2023
<br>
21-
If you believe you have encountered a bug in the extension, or have any other inquiries, please create an issue on <a href="https://github.com/sas-fossdev/saspes/issues" target="_blank"> the repository</a> or email <a href="mailto:[email protected]" target="_blank">[email protected]</a><br>
24+
If you believe you have encountered a bug in the extension, or have any other inquiries, please create an issue on <a
25+
href="https://github.com/sas-fossdev/saspes/issues"
26+
target="_blank"
27+
> the repository</a> or email <a
28+
href="mailto:[email protected]"
29+
target="_blank"
30+
2231
<br>
2332
Credits: <br>
2433
Special thanks to Alan Chang for the idea. <br>

0 commit comments

Comments
 (0)