Skip to content

Commit

Permalink
[Backend] Improve types
Browse files Browse the repository at this point in the history
  • Loading branch information
rikurauhala committed Aug 22, 2024
1 parent 45acf19 commit c24766f
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ export class CourseYearlyStatsCounter {
if (anonymizationSalt && normalStats.students.studentnumbers.length < 6) {
this.obfuscated = true

const gradeSpread = {}
const gradeSpread = {} as { [grade: string]: string[] }
for (const grade of Object.keys(normalStats.attempts.grades)) {
gradeSpread[grade] = []
}
Expand All @@ -363,19 +363,19 @@ export class CourseYearlyStatsCounter {
coursecode: rest.coursecode,
attempts: {
categories: {
failed: [],
passed: [],
failed: [] as string[],
passed: [] as string[],
},
grades: gradeSpread,
},
yearcode: rest.yearcode,
students: {
categories: {
passedFirst: [],
passedEventually: [],
neverPassed: [],
passedFirst: [] as string[],
passedEventually: [] as string[],
neverPassed: [] as string[],
},
studentnumbers: [],
studentnumbers: [] as string[],
},
}
return obfuscatedStats
Expand Down

0 comments on commit c24766f

Please sign in to comment.