Skip to content

Instantly share code, notes, and snippets.

@Matoex
Created December 30, 2021 16:00
Show Gist options
  • Save Matoex/31c34eba5a13c5b5ed7a5c3865253192 to your computer and use it in GitHub Desktop.
Save Matoex/31c34eba5a13c5b5ed7a5c3865253192 to your computer and use it in GitHub Desktop.
Studon Punkte und Prozent berechnen
/*
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 + "%")
@quwepiro
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment