Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slash grades are buggy #174

Open
Agilulfo opened this issue Oct 1, 2024 · 0 comments
Open

Slash grades are buggy #174

Agilulfo opened this issue Oct 1, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Agilulfo
Copy link
Contributor

Agilulfo commented Oct 1, 2024

While working at the Polish scale implementation I've noticed that there is a bug in the validation of the slash grades.

The implementation of the french scale is affected but also other scales use the same logic.

In the case of the french scale It looks like a regex checks that the syntax of the grade is correct but not the semantic.
in particular "5a/6a" is considered a valid grade.
I don't think is intentional also because the score range returned in this case is the same that 5a/5a+ would return.

in the definition of the function get score there is an assumption that the part after the slash is related to the first part.
however the regexp used in the initial validation alone cannot validate the relation between the grades.

A solution could be to extend the validation to also check that in case of / grades the relation between them is valid.

It is worth in my opinion to check also the remaining scales to make sure the same logic has not been copy-pasted in there too and eventually consider reusable / grade validation logic.

here you will find a commit where I've added a test that is failing

@musoke musoke added the bug Something isn't working label Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants