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

Limit multiple-digit numbers in Inequality #1214

Merged
merged 2 commits into from
Nov 4, 2024

Conversation

sjd210
Copy link
Contributor

@sjd210 sjd210 commented Nov 1, 2024

Forming a multiple-digit numberInputValue in the Inequality Modal was unlimited, which led to bad behaviour (e.g. overflowing from its menu container, large numbers facing integer limit issues, larger numbers being converted to scientific notation).

I've run a script to check all symbolic questions on the site and found 10 total questions with answers containing 4 or more digits:

  • 7 of them would be fine with 4 positive digits
  • The other 3 are just a single number and so can be answered very easily with just the existing text input (and don't even really need to be symbolic questions anyway!) [e.g. Part A]

4 characters is also the amount that fit cleanly in the menu hexagon, so 4 positive digits / 3 negative digits is the safest answer.


Also to get in simultaneously for the Chemistry Checker, the hasMetaSymbols check now also tests for empty lists. This has already been tested by Content so shouldn't need too much checking.

Copy link

codecov bot commented Nov 1, 2024

Codecov Report

Attention: Patch coverage is 0% with 12 lines in your changes missing coverage. Please review.

Project coverage is 36.61%. Comparing base (d3ecbaf) to head (1de8145).
Report is 36 commits behind head on master.

Files with missing lines Patch % Lines
...nts/elements/modals/inequality/InequalityModal.tsx 0.00% 8 Missing ⚠️
...ponents/content/IsaacSymbolicChemistryQuestion.tsx 0.00% 3 Missing ⚠️
src/app/components/pages/Equality.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1214   +/-   ##
=======================================
  Coverage   36.61%   36.61%           
=======================================
  Files         442      442           
  Lines       19477    19477           
  Branches     6401     6418   +17     
=======================================
+ Hits         7131     7132    +1     
- Misses      11699    11700    +1     
+ Partials      647      645    -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@jacbn jacbn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth adding a warning in the editor if the answer is a single value outside the permitted range to stop content accidentally making unanswerable questions, but that is separate from this. Otherwise looks good!

@jacbn jacbn merged commit 85c09f8 into master Nov 4, 2024
4 checks passed
@jacbn jacbn deleted the hotfix/inequality-limit-multidigit branch November 4, 2024 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants