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

Allow coordinate questions to have n dimensions #663

Merged
merged 12 commits into from
Jan 27, 2025

Conversation

jsharkey13
Copy link
Member

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.

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 jsharkey13 force-pushed the feature/n-dimensional-coordinates branch from 61f9112 to f677ade Compare December 11, 2024 17:44
Copy link

codecov bot commented Dec 11, 2024

Codecov Report

Attention: Patch coverage is 38.04348% with 57 lines in your changes missing coverage. Please review.

Project coverage is 34.88%. Comparing base (127dfc9) to head (c4a1639).
Report is 49 commits behind head on master.

Files with missing lines Patch % Lines
...am/cl/dtg/isaac/quiz/IsaacCoordinateValidator.java 43.18% 18 Missing and 7 partials ⚠️
...ava/uk/ac/cam/cl/dtg/segue/etl/ContentIndexer.java 0.00% 8 Missing and 1 partial ⚠️
...c/cam/cl/dtg/isaac/dos/content/CoordinateItem.java 38.46% 7 Missing and 1 partial ⚠️
...m/cl/dtg/isaac/dto/IsaacCoordinateQuestionDTO.java 0.00% 6 Missing ⚠️
...am/cl/dtg/isaac/dto/content/CoordinateItemDTO.java 0.00% 6 Missing ⚠️
.../cam/cl/dtg/isaac/dos/IsaacCoordinateQuestion.java 50.00% 3 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

axlewin and others added 6 commits December 18, 2024 16:04
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
@jsharkey13 jsharkey13 marked this pull request as ready for review January 16, 2025 17:23
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 axlewin merged commit 0b03e52 into master Jan 27, 2025
3 checks passed
@axlewin axlewin deleted the feature/n-dimensional-coordinates branch January 27, 2025 16:18
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