diff --git a/src/controllers/OsscSession.ts b/src/controllers/OsscSession.ts index 282545d..530e951 100644 --- a/src/controllers/OsscSession.ts +++ b/src/controllers/OsscSession.ts @@ -310,7 +310,7 @@ export default class OsscSession { * Each `Score` gets scraped and then uploaded to firebase. * If the particular `Score` has already been uploaded to firebase * it gets sckipped. - * @param extract + * @param extract A reference to the `ModuleExtract`. * @param cookie The session cookie. */ private static async getAllScores(extract: ModuleExtract, cookie: string) { @@ -324,6 +324,8 @@ export default class OsscSession { if (exam.score === undefined && exam.scoreLink !== undefined && cookie !== undefined) { console.log(`No score found for ${module.name} on the ${exam.examinationDate?.toDateString()}`) exam.score = await this.getScore(exam.scoreLink, cookie) + + // save the score object to firebase storeScore(exam.score) } } diff --git a/src/models/Exam.ts b/src/models/Exam.ts index e62d21e..b44f092 100644 --- a/src/models/Exam.ts +++ b/src/models/Exam.ts @@ -25,9 +25,5 @@ export default class Exam { const decoded = row['Note'].link.replace(/&/g, '&') this.scoreLink = new URL(decoded) } - - // Check if firestore has score - - // Else download score } } diff --git a/src/models/Score.ts b/src/models/Score.ts index 7a022d1..ca9ba3a 100644 --- a/src/models/Score.ts +++ b/src/models/Score.ts @@ -56,6 +56,4 @@ export default class Score { failed: failed } } - - // TODO: Simple Index values of each grade enum }