You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Client Validation] Use emptyWidgetsFunctional in scoring (#2083)
This PR completes the work of extracting validation logic from scoring logic. This retains most of the validation that used to be intermingled with scoring.
This means that even when we strip scoring data from the widget options, we'll still be able to check if an answer is scorable.
Notably: `input-number` and `numeric-input` missed the train here. Both of these widgets use `KhanAnswerTypes` right at the beginning of scoring. Further, the `coefficient` answer type [allows](https://github.com/Khan/perseus/blob/f7160d66f6e0185dd11d8b802ad88f94cf4b92dd/packages/perseus/src/util/answer-types.ts#L394) an empty value (`""`) and bare negative (`"-"`) to be treated as answers by coercing them to `1` and `-1` respectively. This means that we cannot do any validation/empty checking for these widgets because we need the full `KhanAnswerTypes` logic (which requires scoring data to work).
Issue: LEMS-2561
# Test plan:
`yarn test`
`yarn typecheck`
Author: jeremywiebe
Reviewers: handeyeco, Myranae, jeremywiebe
Required Reviewers:
Approved By: handeyeco, Myranae
Checks: ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), ✅ Check builds for changes in size (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Cypress (ubuntu-latest, 20.x), ✅ Publish Storybook to Chromatic (ubuntu-latest, 20.x)
Pull Request URL: #2083
0 commit comments