Skip to content

Commit

Permalink
fix: grade statistic chart
Browse files Browse the repository at this point in the history
  • Loading branch information
Okabe-Rintarou-0 committed Apr 21, 2024
1 parent ec71154 commit f9d020a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/grade_statistic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function GradeStatisticChart({ statistic }: {
}
const step = 0.5;
grades.map(grade => {
let section = grade / step - (grade % step ? 0 : 1);
let section = grade / step;
let count = gradeMap.get(section) ?? 0;
gradeMap.set(section, count + 1);
});
Expand All @@ -32,7 +32,7 @@ export default function GradeStatisticChart({ statistic }: {
const step = 0.5;

for (let i = 0; i <= maxSection; i++) {
labels.push(`${step * i}-${step * (i + 1)}`);
labels.push(step * i);
values.push(distribution.get(i) ?? 0);
}

Expand Down

0 comments on commit f9d020a

Please sign in to comment.