Created
December 10, 2018 23:14
-
-
Save anaetrezve/836082ac3fc9073934ccb1bcb355fcea to your computer and use it in GitHub Desktop.
Get CGPA on browser console from ucam.uits.edu.bd. Just paste code to console When you at Course History page then hit Enter. Just it
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
let gpa = []; | |
let credits = []; | |
let creditFiltered = []; | |
let gpaFiltered = []; | |
let totalCredit; | |
let combined = 0; | |
let CGPA; | |
$("#ctl00_MainContainer_gvRegisteredCourse tr td:nth-child(7n)").each( | |
(i, c) => { | |
gpa.push(parseFloat(c.textContent)); | |
} | |
); | |
$("#ctl00_MainContainer_gvRegisteredCourse tr td:nth-child(5n)").each( | |
(i, c) => { | |
credits.push(parseFloat(c.textContent)); | |
} | |
); | |
gpa.forEach((g, i) => { | |
if (!isNaN(g) && g !== 0) { | |
creditFiltered.push(credits[i]); | |
gpaFiltered.push(g); | |
} | |
}); | |
creditFiltered.forEach((item, i) => { | |
combined += gpaFiltered[i] * creditFiltered[i]; | |
}); | |
totalCredit = creditFiltered.reduce((e, c) => e + c); | |
CGPA = (combined / totalCredit).toFixed(2); | |
console.log("\n\n\n=======================================\n"); | |
console.log( | |
"Total Credit Completed: " + totalCredit, | |
"\nAverage CGPA: " + CGPA | |
); | |
console.log("=========================================="); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment