a-plus icon indicating copy to clipboard operation
a-plus copied to clipboard

Fix zero division on submissions modal

Open Mikael-Lenander opened this issue 1 year ago • 0 comments

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?

  • [ ] Accessibility test using the WAVE extension.
  • [ ] Django unit tests.
  • [ ] Selenium tests.
  • [ ] Other test. (Add a description below)
  • [x] Manual testing.

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

Did you test the changes in

  • [ ] Chrome
  • [x] Firefox
  • [ ] This pull request cannot be tested in the browser.

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

Translation

Programming style

  • [x] Did you follow our style guides?
  • [x] Did you use Python type hinting in all functions that you added or edited? (type hints for function parameters and return values)

Have you updated the README or other relevant documentation?

  • [ ] documents inside the doc directory.
  • [ ] README.md.
  • [ ] Aplus Manual.
  • [ ] Other documentation (mention below which documentation).

Is it Done?

  • [ ] Reviewer has finished the code review
  • [ ] After the review, the developer has made changes accordingly
  • [ ] Customer/Teacher has accepted the implementation of the feature

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

Mikael-Lenander avatar May 20 '24 12:05 Mikael-Lenander