Skip to content

Commit

Permalink
[Course statistics] Fix missing enrollments
Browse files Browse the repository at this point in the history
  • Loading branch information
rikurauhala committed Oct 7, 2024
1 parent 2d98a77 commit 16fd293
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,7 @@ const SingleCourseStats = ({
}

const countStudentEnrollmentStats = (allAttempts, filteredEnrollments, displayEnrollments) => {
const enrolledStudentsWithNoGrade = filteredEnrollments.filter(({ studentNumber, state }) => {
if (state !== 'ENROLLED') {
return false
}
const enrolledStudentsWithNoGrade = filteredEnrollments.filter(({ studentNumber }) => {
const hasFailed = allAttempts.categories.failed ? allAttempts.categories.failed.includes(studentNumber) : false
const hasPassed = allAttempts.categories.passed ? allAttempts.categories.passed.includes(studentNumber) : false
return !hasFailed && !hasPassed
Expand Down

0 comments on commit 16fd293

Please sign in to comment.