{"You will need to go to your course assignments page "}
HERE
{" > settings ("}
{") > Assignment Group Weights"}
{"and check the 'Weight final grade based on assignment groups' box"}
)}
);
}
function areAssignmentGroupsEqual(
list1: LocalAssignmentGroup[],
list2: LocalAssignmentGroup[]
): boolean {
// Check if lists have the same length
if (list1.length !== list2.length) return false;
// Sort both lists by the unique 'id' or 'canvasId' as a fallback
const sortedList1 = [...list1].sort((a, b) => {
if (a.id !== b.id) return a.id > b.id ? 1 : -1;
if (a.canvasId !== b.canvasId) return (a.canvasId || 0) - (b.canvasId || 0);
return 0;
});
const sortedList2 = [...list2].sort((a, b) => {
if (a.id !== b.id) return a.id > b.id ? 1 : -1;
if (a.canvasId !== b.canvasId) return (a.canvasId || 0) - (b.canvasId || 0);
return 0;
});
// Deep compare each object in the sorted lists
for (let i = 0; i < sortedList1.length; i++) {
const group1 = sortedList1[i];
const group2 = sortedList2[i];
if (
group1.id !== group2.id ||
group1.name !== group2.name ||
group1.weight !== group2.weight ||
group1.canvasId !== group2.canvasId
) {
return false;
}
}
return true;
}