Created
May 10, 2015 22:33
-
-
Save AstroCB/753e93276d3ad588daca to your computer and use it in GitHub Desktop.
Show numerical grades that teachers have hidden on BCPS One
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Show Hidden Grades | |
// @namespace http://github.com/AstroCB | |
// @author Cameron Bernhardt | |
// @description Show numerical grades that teachers have hidden on BCPS One | |
// @version 1.0 | |
// @include *://bcpsone.bcps.org/student/?* | |
// ==/UserScript== | |
var grades = document.querySelectorAll("a .hidden"); | |
for (var i = 0; i < grades.length; i++) { | |
var parentEl = grades[i].parentElement; | |
if (parentEl && !parentEl.innerText.match(/\(/)) { | |
var grade = parseFloat(grades[i].textContent).toFixed(1); | |
if (("" + grade).match(/\d+\.0/)) { | |
grade = Math.round(grade); | |
} | |
grades[i].remove(); | |
parentEl.textContent += " (" + grade + "%)"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment