-
Notifications
You must be signed in to change notification settings - Fork 5
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
Allow coordinate questions to have n dimensions #663
Merged
Merged
+451
−98
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Instead of a hardcoded x and y value, now use a list of Strings to represent the coordinates. This also requires the placeholders to be a list of values too. In order not to break existing questions whilst the changes are deployed, we leave the existing x, y values in the model. Then the content can be updated with both, and we can remove the deprecated values in a later change.
This moves the validator to use the new list-of-strings representation of coordinates to allow an arbitrary number of dimensions in a coordinate. There are some subtleties, because "ordering" the coordinates for comparison is complicated - as is the quadratic nature of the checking algorithm. It also cleans up some log messages and comments for clarity.
jsharkey13
force-pushed
the
feature/n-dimensional-coordinates
branch
from
December 11, 2024 17:44
61f9112
to
f677ade
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #663 +/- ##
==========================================
+ Coverage 34.41% 34.88% +0.46%
==========================================
Files 521 520 -1
Lines 23447 23337 -110
Branches 2874 2841 -33
==========================================
+ Hits 8070 8141 +71
+ Misses 14565 14362 -203
- Partials 812 834 +22 ☔ View full report in Codecov by Sentry. |
Move the generally useful too few/many sig fig functions from the numeric validator to utils, and use them to check for correctness of significant figures in coordinate questions.
Co-authored-by: James Sharkey <[email protected]>
…inates-fixes Coordinate validator changes
The significant figure checking was taking issue with the 1sf values because it defaults to 2sf unless specified.
We were defaulting to 2sf if the sig figs were not set for coordinate questions. Adding feedback about sig figs made the content team realise this and that it was not what was expected. Now, only validate using sig figs if they are provided in the editor. Also, warn if inconsistent values are used for these bounds.
axlewin
approved these changes
Jan 27, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This moves the validator to use the new list-of-strings representation of coordinates to allow an arbitrary number of dimensions in a coordinate.
There are some subtleties, because "ordering" the coordinates for comparison is complicated - as is the quadratic nature of the checking algorithm.
It also cleans up some log messages and comments for clarity, and adds unit tests.
#662 should be merged first, and deployed before this can safely be merged.