Skip to content

Commit

Permalink
fix calculating the semster credits
Browse files Browse the repository at this point in the history
  • Loading branch information
Lextum committed Oct 16, 2021
1 parent 85878d9 commit 5925c14
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,10 @@ function createChart(div, modules) {
const creditsDoneBySemesterCount = [0, 0, 0, 0, 0, 0, 0, 0, 0];

// calculate how many credits were achieved for each semester
// Only show the modules that are passed or are from the active semester
const activeSemester = Math.max.apply(Math, modules.map(function(o) { return o.semester; }))
modules.forEach(m => {
if (m.grade != 'F' && m.semester != undefined && m.UseInStats) {
if ((m.passed && m.semester != undefined && m.UseInStats) || m.semester == activeSemester) {
creditsDoneBySemesterCount[m.semester] += Number(m.credits);
}
})
Expand Down

0 comments on commit 5925c14

Please sign in to comment.