Skip to content

Conversation

@SonicScrewdriver
Copy link
Contributor

@SonicScrewdriver SonicScrewdriver commented Nov 21, 2025

Summary:

This PR is part of the cleanup work for Server Side Scoring.

This PR removes scoreNoop and ensures that we're only registering scorers for widgets where necessary. It also creates the new isScorable function for determining whether a widget is scorable or not.

isScorable is exported so that it can be used upstream, for some custom scoring logic in our reporting tools.

Issue: LEMS-2543

Test plan:

  • Tests pass
  • Manual testing up stream

@SonicScrewdriver SonicScrewdriver self-assigned this Nov 21, 2025
@SonicScrewdriver SonicScrewdriver changed the title Remove Noop Remove Noop in favour of using a new isScorable function that checks whether we've registered a scorer for a widget. Remove Noop Nov 21, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 21, 2025

🗄️ Schema Change: No Changes ✅

@github-actions
Copy link
Contributor

github-actions bot commented Nov 21, 2025

🛠️ Item Splitting: No Changes ✅

@github-actions
Copy link
Contributor

github-actions bot commented Nov 21, 2025

Size Change: -43 B (-0.01%)

Total Size: 498 kB

Filename Size Change
packages/perseus-score/dist/es/index.js 9.15 kB -43 B (-0.47%)
ℹ️ View Unchanged
Filename Size
packages/kas/dist/es/index.js 20.8 kB
packages/keypad-context/dist/es/index.js 1 kB
packages/kmath/dist/es/index.js 5.98 kB
packages/math-input/dist/es/index.js 99.2 kB
packages/math-input/dist/es/strings.js 1.61 kB
packages/perseus-core/dist/es/index.item-splitting.js 13.1 kB
packages/perseus-core/dist/es/index.js 22.5 kB
packages/perseus-editor/dist/es/index.js 97.9 kB
packages/perseus-linter/dist/es/index.js 8.64 kB
packages/perseus-utils/dist/es/index.js 403 B
packages/perseus/dist/es/index.js 202 kB
packages/perseus/dist/es/strings.js 7.73 kB
packages/pure-markdown/dist/es/index.js 1.39 kB
packages/simple-markdown/dist/es/index.js 6.71 kB

compressed-size-action

@github-actions
Copy link
Contributor

github-actions bot commented Nov 21, 2025

npm Snapshot: Published

Good news!! We've packaged up the latest commit from this PR (fbdbad1) and published it to npm. You
can install it using the tag PR3064.

Example:

pnpm add @khanacademy/perseus@PR3064

If you are working in Khan Academy's frontend, you can run the below command.

./dev/tools/bump_perseus_version.ts -t PR3064

If you are working in Khan Academy's webapp, you can run the below command.

./dev/tools/bump_perseus_version.js -t PR3064

Remove Noop in favour of using a new isScorable function that checks whether we've registered a scorer for a widget.
registerWidget("sorter", scoreSorter as any, validateSorter as any);
registerWidget("table", scoreTable as any, validateTable as any);
registerWidget("deprecated-standin", () => scoreNoop(1) as any);
registerWidget("measurer", () => scoreNoop(1) as any);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have no idea why the measurer was set to 1 versus the other widgets. I could add a score-measurer file, but I wasn't sure if it would ever actually be required.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is good. Probably just need to make sure Measurer still works in a ZND before shipping.

@SonicScrewdriver SonicScrewdriver marked this pull request as ready for review November 28, 2025 18:00
Copy link
Contributor

@handeyeco handeyeco left a comment

Choose a reason for hiding this comment

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

Awesome, thanks Third!

registerWidget("sorter", scoreSorter as any, validateSorter as any);
registerWidget("table", scoreTable as any, validateTable as any);
registerWidget("deprecated-standin", () => scoreNoop(1) as any);
registerWidget("measurer", () => scoreNoop(1) as any);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is good. Probably just need to make sure Measurer still works in a ZND before shipping.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants