sas-fossdev / saspes

SAS Powerschool Enhancement Suite - A browser extension to improve the experience of using Powerschool at SAS.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Typing in a percent over 100% in hypothetical assignment causes visual bugs

DGET-Program opened this issue · comments

Hey, just a quick note: I'm @Crystalflxme just on another account. Anyways, if you add a hypothetical assignment with a weighting percentage of over 100% it causes the letter grade to not show. Just see for yourself:

image

I know this isn't important at all, but it's just something to polish.

I know this isn't important at all, but it's just something to polish.

Don't worry, this is important. Even papercuts are often worth fixing.

Looks like bug was accidental reintroduced when the hypothetical assignments was moved to Vue. This should be a pretty easy fix.
Replace this line with the following:
https://github.com/gary-kim/saspes/blob/623f92616e93fad60ad8e14a7676f7f7b8d99fc6/src/js/components/HypoAssignment.vue#L72

const weight = getInRange(this.assignment.weight, 0, 100, true)
const new_fp = weight * 0.01 * gradeToFP(this.assignment.grade) + ((100 - weight) * 0.01 * this.currentFP);

and import get-in-range at the top of the <script> section.

const getInRange = require('get-in-range');

Anyone want to make a PR?

Hey, I just created a pull request for this issue. You should check to make sure that I didn't miss anything.