diff --git a/index.ts b/index.ts index fcd6bf9..dcefc93 100644 --- a/index.ts +++ b/index.ts @@ -804,6 +804,7 @@ async function navigateToGrading(page: Page, allClassGrades: any[]) { try { // Check if this row is a grade type header (Major Grades / Minor Grades) const gradeTypeSpan = await row.$('span.anchorText'); + if (gradeTypeSpan) { const gradeTypeText = (await gradeTypeSpan.textContent())?.trim(); @@ -817,14 +818,20 @@ async function navigateToGrading(page: Page, allClassGrades: any[]) { logger.info(` → Set current grade type to MINOR`); continue; } + else if (gradeTypeText === 'Semester Exam') { + currentGradeType = 'minor'; + logger.info(` → Semester Exam Detected → defaulting to MINOR`); + continue; + } } - - // Skip if we haven't found a grade type yet + + if (!currentGradeType) { logger.info(` Row ${j}: Skipping (no grade type set yet)`); + currentGradeType = 'minor'; // default continue; } - + // Try to extract grade data from this row // Look for any link in the row (could be linkDetails or other classes) const nameLink = await row.$('a');