a-plus
a-plus copied to clipboard
Fix zero division on submissions modal
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.
- How to test your changes in A-plus
- How to test accessibility
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
- [ ] Did you modify or add new strings in the user interface? (Read about how to create 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!