Kunniii / edn_auto_ext

Edunext's Auto Grading Tool: Efficiency and Accuracy Combined Streamline grading with Edunext's auto grading tool. Say goodbye to manual grading and enjoy efficient automation. Developed by education technology experts, this user-friendly tool saves time and ensures accuracy. Upgrade your grading experience today with Edunext.
https://chrome.google.com/webstore/detail/edn-auto-v2/jcoanhnlcggnjkefelkngdpongoaipdk
4 stars 0 forks source link

Fail when execute `atob()` #4

Closed Kunniii closed 1 year ago

Kunniii commented 1 year ago

Need more info...

Kunniii commented 1 year ago

For some devices that failed when executing atob(), even though they can launch the extension, they can only do grade_group(). When trying grade_indie() there is no output, the error from the console shows something like it's a problem with Arrays when retrieving student info from API.

Kunniii commented 1 year ago

The problem is that the Base64 in JWT token is being compressed, which means there is no padding on the encoded string. That will cause error when trying to decode it using atob().

Grading individuals require an email to check the group that the user is in. So, when atob() failed, there is no email to check, causing the function fails.

Resolve that by adding a function named addPaddingToBase64() and use it to add padding before converting it to a string.