gpa presets

This commit is contained in:
Guy Sandler 2026-01-16 14:10:10 -08:00
parent d37d2f565b
commit 27218d1119
3 changed files with 47 additions and 2 deletions

View File

@ -299,3 +299,6 @@ here is some proof the lisence was changed and this is based on the reverted MIT
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
![Better Canvas](/icon/icon-48.png)
Copyright (c) 2026 Guy Sandler

View File

@ -696,8 +696,9 @@
The letter grade will be calculated as greater than or equal to the percentage given. <br><br>
If your school doesn't use the +/- system, you can enter 101 for those grades to remove them from the
calculation. (for example A+ = 101, A = 90, A- = 101)
<button class="big-button gpa-plus-minus">+/- GPA Scale</button>
<button class="big-button gpa-by-letter">By Letter GPA Scale</button>
<h3 class="header-small" style="margin-top: 20px;">GPA Scale Presets 0-4</h3>
<button class="big-button" id="gpa-plus-minus">+/- GPA Scale</button>
<button class="big-button" id="gpa-by-letter">By Letter GPA Scale</button>
</div>
</div>

View File

@ -563,6 +563,47 @@ function setup() {
// document.getElementById("view-submissions-btn").addEventListener("click", displayMySubmissions);
document.getElementById("submit-form-btn").addEventListener("click", displayThemeSubmissionForm);
document.getElementById("gpa-plus-minus").addEventListener("click", () => {
applyGPAPreset({
"A+": { "cutoff": 97, "gpa": 4.0 },
"A": { "cutoff": 93, "gpa": 4.0 },
"A-": { "cutoff": 90, "gpa": 3.7 },
"B+": { "cutoff": 87, "gpa": 3.3 },
"B": { "cutoff": 83, "gpa": 3.0 },
"B-": { "cutoff": 80, "gpa": 2.7 },
"C+": { "cutoff": 77, "gpa": 2.3 },
"C": { "cutoff": 73, "gpa": 2.0 },
"C-": { "cutoff": 70, "gpa": 1.7 },
"D+": { "cutoff": 67, "gpa": 1.3 },
"D": { "cutoff": 63, "gpa": 1.0 },
"D-": { "cutoff": 60, "gpa": 0.7 },
"F": { "cutoff": 0, "gpa": 0 }
});
});
document.getElementById("gpa-by-letter").addEventListener("click", () => {
applyGPAPreset({
"A+": { "cutoff": 90, "gpa": 4.0 },
"A": { "cutoff": 80, "gpa": 4.0 },
"A-": { "cutoff": 70, "gpa": 4.0 },
"B+": { "cutoff": 65, "gpa": 3.0 },
"B": { "cutoff": 60, "gpa": 3.0 },
"B-": { "cutoff": 55, "gpa": 3.0 },
"C+": { "cutoff": 50, "gpa": 2.0 },
"C": { "cutoff": 45, "gpa": 2.0 },
"C-": { "cutoff": 40, "gpa": 2.0 },
"D+": { "cutoff": 35, "gpa": 1.0 },
"D": { "cutoff": 30, "gpa": 1.0 },
"D-": { "cutoff": 25, "gpa": 1.0 },
"F": { "cutoff": 0, "gpa": 0 }
});
});
}
function applyGPAPreset(bounds) {
chrome.storage.sync.set({ "gpa_calc_bounds": bounds }, () => {
displayGPABounds();
});
}
function setupCustomStyle(initial) {