ModuleRevealState stores the exercises of the module. If the module has none, an empty list is passed to max function, which throws an exception.
Why?
It is unlikely that any chapter should be hidden before a module with no exercises is "completed". However, if a teacher does set a model solution to this kind of module, the site will crash.
How?
Check if the list is empty before feeding it to the max function.
Testing
Remember to add or update unit tests for new features and changes.
Description
What?
ModuleRevealState stores the exercises of the module. If the module has none, an empty list is passed to max function, which throws an exception.
Why?
It is unlikely that any chapter should be hidden before a module with no exercises is "completed". However, if a teacher does set a model solution to this kind of module, the site will crash.
How?
Check if the list is empty before feeding it to the max function.
Testing
Remember to add or update unit tests for new features and changes.
What type of test did you run?
The site does not crash anymore if a module with no exercises has a model solution.
Did you test the changes in
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!