apluslms / a-plus

A+ frontend portal - A+ LMS documentation:
https://apluslms.github.io/
Other
64 stars 72 forks source link

Fix zero division on submissions modal #1365

Closed Mikael-Lenander closed 1 month ago

Mikael-Lenander commented 1 month ago

Description

What?

When a teacher opens the submissions modal by clicking "View all submissions", it raises zero division exception. This pr fixes the bug.

Why?

No one likes bugs.

How?

Checks that the denominator is >0 before division.

Testing

Remember to add or update unit tests for new features and changes.

What type of test did you run?

Opened the submissions modal for exercises with 0 and >0 submissions.

Did you test the changes in

Think of what is affected by these changes and could become broken

Translation

Programming style

Have you updated the README or other relevant documentation?

Is it Done?

Clean up your git commit history before submitting the pull request!

ihalaij1 commented 1 month ago

Since I already merged PR apluslms/a-plus#1366, which fixes the same bug, I will close this as a duplicate.