Skip to content

Commit

Permalink
[Class statistics] Remove 'Passed after retry' and 'Failed multiple t…
Browse files Browse the repository at this point in the history
…imes'
  • Loading branch information
rikurauhala committed Oct 18, 2024
1 parent b3449fc commit 2e760c7
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 31 deletions.
16 changes: 0 additions & 16 deletions services/backend/src/services/courses/courseStatsCounter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ type Stats = {
students: number
passed: number
failed: number
failedMany: number
retryPassed: number
attempts: number
improvedPassedGrade: number
percentage: number | undefined
Expand All @@ -76,8 +74,6 @@ type Students = {
all: Record<string, boolean>
passed: Record<string, boolean>
failed: Record<string, boolean>
retryPassed: Record<string, boolean>
failedMany: Record<string, boolean>
improvedPassedGrade: Record<string, boolean>
markedToSemester: Record<string, boolean>
enrolledNoGrade: Record<string, boolean>
Expand Down Expand Up @@ -126,8 +122,6 @@ export class CourseStatsCounter {
all: {},
passed: {},
failed: {},
retryPassed: {},
failedMany: {},
improvedPassedGrade: {},
markedToSemester: {},
enrolledNoGrade: {},
Expand All @@ -136,8 +130,6 @@ export class CourseStatsCounter {
students: 0,
passed: 0,
failed: 0,
failedMany: 0,
retryPassed: 0,
attempts: 0,
improvedPassedGrade: 0,
percentage: undefined,
Expand Down Expand Up @@ -216,13 +208,11 @@ export class CourseStatsCounter {

private removeFromFailed(studentNumber: string) {
delete this.students.failed[studentNumber]
delete this.students.failedMany[studentNumber]
}

private markPassingGrade(studentNumber: string) {
this.students.passed[studentNumber] = true
if (this.failedBefore(studentNumber)) {
this.students.retryPassed[studentNumber] = true
this.removeFromFailed(studentNumber)
}
}
Expand All @@ -235,12 +225,8 @@ export class CourseStatsCounter {

private markFailedGrade(studentNumber: string) {
if (this.passedBefore(studentNumber)) {
this.students.retryPassed[studentNumber] = true
this.removeFromFailed(studentNumber)
} else {
if (this.failedBefore(studentNumber)) {
this.students.failedMany[studentNumber] = true
}
this.students.failed[studentNumber] = true
}
}
Expand Down Expand Up @@ -284,8 +270,6 @@ export class CourseStatsCounter {
stats.students = lengthOf(students.all)
stats.passed = lengthOf(students.passed)
stats.failed = lengthOf(students.failed)
stats.failedMany = lengthOf(students.failedMany)
stats.retryPassed = lengthOf(students.retryPassed)
stats.improvedPassedGrade = lengthOf(students.improvedPassedGrade)
stats.percentage = percentageOf(stats.passed, stats.students)
stats.passedOfPopulation = percentageOf(stats.passed, this.studentsInTotal)
Expand Down
3 changes: 0 additions & 3 deletions services/backend/src/services/statMerger.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,10 @@ const populationCourseStatsMerger = multiyearstats => {
const index = stats.coursestatistics.findIndex(s => s.course.code === courseStats.course.code)
stats.coursestatistics[index].stats.attempts += courseStats.stats.attempts
stats.coursestatistics[index].stats.failed += courseStats.stats.failed
stats.coursestatistics[index].stats.failedMany += courseStats.stats.failedMany
stats.coursestatistics[index].stats.improvedPassedGrade += courseStats.stats.improvedPassedGrade
stats.coursestatistics[index].stats.passed += courseStats.stats.passed
stats.coursestatistics[index].stats.students += courseStats.stats.students

stats.coursestatistics[index].stats.retryPassed += courseStats.stats.retryPassed

stats.coursestatistics[index].stats.perStudent =
stats.coursestatistics[index].stats.attempts / stats.coursestatistics[index].stats.students

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,18 +126,6 @@ export const PassFailEnrollments = ({ flat, onlyIamRights }) => {
},
],
},
{
key: 'passed-after-retry',
title: 'Passed\nafter retry',
filterType: 'range',
getRowVal: row => row.stats?.retryPassed ?? 0,
},
{
key: 'failed-many',
title: 'Failed\nmultiple times',
filterType: 'range',
getRowVal: row => row.stats?.failedMany ?? 0,
},
{
key: 'of-population',
title: 'Percentage of population',
Expand Down

0 comments on commit 2e760c7

Please sign in to comment.