Created
December 30, 2021 16:00
-
-
Save Matoex/31c34eba5a13c5b5ed7a5c3865253192 to your computer and use it in GitHub Desktop.
Studon Punkte und Prozent berechnen
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
/* | |
Berechnet die erreichte und maximale Punktzahl (daraus auch die %) einer Übungsseite in Studon der FAU | |
Den Code einfach mit F12 im richtigen Tab in die Browserkonsole einfügen und enter drücken, das Ergebnis erscheint in der Konsole. | |
*/ | |
erreicht = Array.from(document.querySelectorAll(".ilTag")).map(x => x.innerText).map(x=>parseFloat(x.split(" ")[1])).reduce((a,b)=>a+b) | |
maxSumme = Array.from(document.querySelectorAll(".ilExcAssignmentHead")).filter(x=>x.children[0].alt != "Nicht bewertet").map(x=>parseFloat(x.outerText.split("max. ")[1].split(" ")[0])).reduce((a,b)=>a+b) | |
console.log(erreicht + "/"+maxSumme+"="+Math.round((erreicht/maxSumme)*1000)/10 + "%") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I moved the scripts to an separate repository: https://gitlab.cs.fau.de/ja06otbo/studon-score as I made some more bugfixes today and it is a lot easier to commit these changes than actually writing a new comment every day.