Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion js/grades.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ var fetchQueue = [];
throw new Error("Assignment details could not be read");
}

let pts = Number.parseFloat(json.section[0].period[0].assignment.filter(x => x.assignment_id == Number.parseInt(assignment.dataset.id.substr(2)))[0].max_points);
const assignments = json.section[0].period.reduce((prevVal,curVal)=> prevVal.concat(curVal.assignment),[]);//combines the assignment arrays from each period
let pts = Number.parseFloat(assignments.filter(x => x.assignment_id == assignment.dataset.id.substr(2))[0].max_points);
if (!assignment.classList.contains("dropped")) {
max += pts;
Logger.log(`Max points for assignment ${assignment.dataset.id.substr(2)} is ${pts}`);
Expand Down