Add a v1 version of input-number options; migrate from v0#3656
Draft
benchristel wants to merge 3 commits into
Draft
Add a v1 version of input-number options; migrate from v0#3656benchristel wants to merge 3 commits into
benchristel wants to merge 3 commits into
Conversation
Contributor
|
Size Change: +1.26 kB (+0.25%) Total Size: 506 kB 📦 View Changed
ℹ️ View Unchanged
|
benchristel
commented
May 21, 2026
Comment on lines
386
to
+407
| type: "input-number", | ||
| version: {major: 0, minor: 0}, | ||
| version: {major: 1, minor: 0}, | ||
| options: { | ||
| simplify: "required", | ||
| answers: [ | ||
| { | ||
| value: 42, | ||
| simplify: "required", | ||
| status: "correct", | ||
| strict: true, | ||
| answerForms: [ | ||
| "integer", | ||
| "decimal", | ||
| "proper", | ||
| "improper", | ||
| "mixed", | ||
| ], | ||
| message: "", | ||
| maxError: 0, | ||
| }, | ||
| ], | ||
| size: "normal", | ||
| value: "", | ||
| coefficient: false, |
Member
Author
There was a problem hiding this comment.
We could use the generator functions here. It might be good to update all these tests to use them.
benchristel
commented
May 21, 2026
| */ | ||
| strict: boolean; | ||
| maxError?: number | undefined; | ||
| /** Unsimplified answers are Ungraded, Accepted, or Wrong. */ |
Member
Author
There was a problem hiding this comment.
This comment could be better.
benchristel
commented
May 21, 2026
Comment on lines
+2262
to
+2271
| /** | ||
| * A list of correct and incorrect answers. Each answer can have a | ||
| * message explaining why it is correct/incorrect. There may be | ||
| * multiple correct answers if multiple formats are accepted. For | ||
| * example, some questions might accept either a fraction or a | ||
| * decimal as correct. | ||
| * | ||
| * The first answer that matches (correct or incorrect) is the scoring | ||
| * result (so order of answers is very important). | ||
| */ |
Member
Author
There was a problem hiding this comment.
This comment isn't really accurate since all input-number widgets will have exactly one answer. Maybe change this type to [PerseusInputNumberAnswer]. Then we could get rid of some optional chaining, and we wouldn't even need assertions!
This file contains hidden or 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
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.
Summary:
We are in the process of replacing
input-numberwithnumeric-input. SeeLEMS-4081 for context.
This PR changes the input-number options schema to match the options of
numeric-input. The idea is that the migrated options can be passed directlyto a
NumericInputcomponent, paving the way for us to replaceInputNumberwith
NumericInputsimply by registeringNumericInputunder theinput-numberwidget name.Issue: LEMS-4111
Test plan:
CI checks should pass.