getSelectedModIds
There can be a situation where const checkbox = document.getElementById(sectionBoxes[sectionNumber][i].boxId); can return null resulting in error and blocking.
This can be fixed by checking for null:
const checkbox = document.getElementById(sectionBoxes[sectionNumber][i].boxId);
if (checkbox && checkbox.checked) {
moduleIds.push(sectionBoxes[sectionNumber][i].moduleId);
}