Skip to content

[FITB] Add the new Fill in the Blank widget's schema and logic to perseus-core - #4181

Open
ivyolamit wants to merge 2 commits into
mainfrom
LEMS-4321/fitb-widget-base-code
Open

[FITB] Add the new Fill in the Blank widget's schema and logic to perseus-core#4181
ivyolamit wants to merge 2 commits into
mainfrom
LEMS-4321/fitb-widget-base-code

Conversation

@ivyolamit

Copy link
Copy Markdown
Contributor

Summary:

This PR is the base code for Fill in the Blank widget and this adds the schema and logic to perseus-core.

Issue: LEMS-4321

Test plan:

…n the Blank widget's schema and logic to perseus-core
@ivyolamit ivyolamit self-assigned this Sep 3, 2026
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

npm Snapshot

Want to try this PR's changes before it merges? Comment /snapshot below and we'll publish an npm snapshot you can install right away.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Size Change: +512 B (+0.1%)

Total Size: 514 kB

📦 View Changed
Filename Size Change
packages/perseus-core/dist/es/index.item-splitting.js 13.4 kB +153 B (+1.15%)
packages/perseus-core/dist/es/index.js 29.1 kB +359 B (+1.25%)
ℹ️ View Unchanged
Filename Size
packages/kas/dist/es/index.js 20.6 kB
packages/keypad-context/dist/es/index.js 1 kB
packages/kmath/dist/es/index.js 6.31 kB
packages/math-input/dist/es/index.js 98.7 kB
packages/math-input/dist/es/strings.js 1.63 kB
packages/perseus-editor/dist/es/index.js 106 kB
packages/perseus-linter/dist/es/index.js 10.3 kB
packages/perseus-score/dist/es/index.js 9.91 kB
packages/perseus-utils/dist/es/index.js 403 B
packages/perseus/dist/es/index.js 196 kB
packages/perseus/dist/es/strings.js 12.9 kB
packages/pure-markdown/dist/es/index.js 1.39 kB
packages/simple-markdown/dist/es/index.js 6.12 kB

compressed-size-action

@ivyolamit
ivyolamit force-pushed the LEMS-4321/fitb-widget-base-code branch from 4f61dc2 to 6ff82e0 Compare September 3, 2026 20:49
@github-actions github-actions Bot added item-splitting-change schema-change Attached to PRs when we detect Perseus Schema changes in it labels Sep 3, 2026
@ivyolamit
ivyolamit marked this pull request as ready for review September 3, 2026 20:54

@SonicScrewdriver SonicScrewdriver left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sweet, great work! Tentatively approved but I recommend double checking the schema approach / split perseus changes with Jeremy or Ben, just in case they have any deeper insights.

// Tests are fine to import, main files aren't
// eslint-disable-next-line import/no-restricted-paths
import {generateVideoWidget} from "../../utils/generators/video-widget-generator";
// Tests are fine to import, main files aren't

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Non-blocking Nit: I wonder if we should have a block comment above this section rather than duplicating this same line for every override. Perhaps something clearer like "Tests can override the restricted imports, while main files cannot."

* from its own getPublicWidgetOptions.
*/
export function splitWidgetsMap(widgets: PerseusWidgetsMap): PerseusWidgetsMap {
const upgradedWidgets = applyDefaultsToWidgets(deepClone(widgets ?? {}));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This PR generally looks great to me, but I'm curious about @jeremywiebe / @benchristel 's thoughts regarding our approach/updates here. It seems fine, but it would be good to check in before we start locking in our schema.

label: string;
/** Display height in px for an image tile. The editor offers 24, 36,
* 48, 60, 72, 84 and 96 */
imageHeight?: number;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One opportunity here is to have this be a direct enum, but tbh I could also see that biting us later if we get feedback that requests new image sizes. number is probably fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

item-splitting-change olc-5.0.4c55d schema-change Attached to PRs when we detect Perseus Schema changes in it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants