Skip to content

Commit

Permalink
fix: Divide by zero error in rubric icon [PT-187021082]
Browse files Browse the repository at this point in the history
  • Loading branch information
dougmartin committed Mar 7, 2024
1 parent 1c26af9 commit 1fb2a23
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const RubricSummaryIcon: React.FC<IProps> = (props) => {
return (
<div className={css.rubricSummaryIconRow} key={id} style={rowStyle}>
{rubric.ratings.map(rating => {
const percentage = (ratings[rating.id] / numStudents) * 100;
const percentage = numStudents > 0 ? (ratings[rating.id] / numStudents) * 100 : 0;
const title = `${Math.round(percentage)}% ${rating.label} - click for details`;
const ratingStyle: React.CSSProperties = {
height: rowHeight,
Expand Down

0 comments on commit 1fb2a23

Please sign in to comment.