summaryrefslogtreecommitdiffstats
path: root/assets/js/grades.js
diff options
context:
space:
mode:
authorsijanec <sijanecantonluka@gmail.com>2020-06-04 14:42:13 +0200
committersijanec <sijanecantonluka@gmail.com>2020-06-04 14:42:13 +0200
commit4501c407bab73552c846df236a6c361a2e1b88a8 (patch)
treece9d28ed89cb0c31897b0cfb71515bc44eecd51c /assets/js/grades.js
parentMerge branch 'current-release' into dev (diff)
downloadbeziapp-4501c407bab73552c846df236a6c361a2e1b88a8.tar
beziapp-4501c407bab73552c846df236a6c361a2e1b88a8.tar.gz
beziapp-4501c407bab73552c846df236a6c361a2e1b88a8.tar.bz2
beziapp-4501c407bab73552c846df236a6c361a2e1b88a8.tar.lz
beziapp-4501c407bab73552c846df236a6c361a2e1b88a8.tar.xz
beziapp-4501c407bab73552c846df236a6c361a2e1b88a8.tar.zst
beziapp-4501c407bab73552c846df236a6c361a2e1b88a8.zip
Diffstat (limited to '')
-rw-r--r--assets/js/grades.js16
1 files changed, 13 insertions, 3 deletions
diff --git a/assets/js/grades.js b/assets/js/grades.js
index aff62e4..480a82a 100644
--- a/assets/js/grades.js
+++ b/assets/js/grades.js
@@ -68,8 +68,13 @@ async function loadGrades(force_refresh = false) {
}
function displayGrades() {
- let grades_by_subject = {};
+ let grades_by_subject = {};
+ let zakljucne_grades_by_subject = {};
grades.forEach((grade, index) => {
+ if(grade["gradeType"] != GSEC_NORMAL_GRADE) {
+ zakljucne_grades_by_subject[grade["subject"]] = grade["grade"];
+ break; // gfuck
+ }
if (!(grade["subject"] in grades_by_subject)) {
grades_by_subject[grade["subject"]] = [];
}
@@ -149,8 +154,13 @@ function displayGrades() {
});
let grade_average = (grade_tot === 0) ? "N/A" : (Math.round(((grade_sum / grade_tot) + Number.EPSILON) * 100) / 100);
let subject_header_average = document.createElement("div");
- subject_header_average.className = "collapsible-header-right";
- subject_header_average.innerText = grade_average.toString();
+ subject_header_average.className = "collapsible-header-right";
+ if(subject in zakljucne_grades_by_subject) {
+ subject_header_average.innerText = zakljucne_grades_by_subject[subject];
+ subject_header_average.classList.add = "zakljucna-grade";
+ } else {
+ subject_header_average.innerText = grade_average.toString();
+ }
subject_header.appendChild(subject_header_text);
subject_header.appendChild(subject_header_average);
subject_body.append(subject_body_root);