Created
March 10, 2017 04:34
-
-
Save Kumassy/518e206bb83c8b394c89b786abe7b8c6 to your computer and use it in GitHub Desktop.
GPA Calculator
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
// Follow instructions below: | |
// | |
// 1. Go to https://www2.adst.keio.ac.jp/rcs/topMenu | |
// 2. Open Chrome Developer Console | |
// 3. Paste Codes | |
const scoreOf = []; scoreOf['A'] = 4; scoreOf['B'] = 3; scoreOf['C'] = 2; scoreOf['D'] = 0; | |
const score = Array.prototype.slice.call(document.querySelectorAll('table tbody table.User tbody tr')).filter((tr) => tr.childNodes.length == 8).slice(1).map((course) => scoreOf[course.childNodes[2].innerText] * course.childNodes[3].innerText).reduce((total, score) => total + score); | |
const totalDegrees = Array.prototype.slice.call(document.querySelectorAll('table tbody table.User tbody tr')).filter((tr) => tr.childNodes.length == 8).slice(1).map((course) => parseInt(course.childNodes[3].innerText)).reduce((total, score) => total + score); | |
score / totalDegrees; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment