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

[WIP] Expose a way to get user input from ServerItemRenderer #1910

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

handeyeco
Copy link
Contributor

@handeyeco handeyeco commented Nov 25, 2024

Summary:

This is a repeat of PR #1753 (which was reverted in #1905)


I'm trying to tread lightly, maybe being overly cautious at the expense of keeping too much old code around. I tried to make everything we can get rid of after the move with @deprecated.

Basically this should expose everything we need to move the actual scoring process out of ServerItemRenderer and the React tree. We now have getUserInput on ServerItemRenderer and scorePerseusItem which is a non-React, pure function that returns a score.

Next step is to replace uses of scoreInput in Webapp with scorePerseusItem; then we can come back and delete a lot of this legacy code 🤞

Issue: LEMS-XXXX

Test plan:

After the swap in Webapp, we should be able to complete an exercise with scorePerseusItem and everything else will work the same.

@handeyeco handeyeco self-assigned this Nov 25, 2024
@khan-actions-bot
Copy link
Contributor

khan-actions-bot commented Nov 25, 2024

Gerald

Required Reviewers
  • @Khan/perseus for changes to .changeset/rotten-starfishes-provide.md, dev/flipbook.tsx, testing/renderer-with-debug-ui.tsx, packages/perseus/src/index.ts, packages/perseus/src/renderer-util.test.ts, packages/perseus/src/renderer-util.ts, packages/perseus/src/renderer.tsx, packages/perseus/src/server-item-renderer.tsx, packages/perseus/src/types.ts, packages/perseus/src/interactive2/objective_.ts, packages/perseus/src/components/__tests__/sorter.test.tsx, packages/perseus/src/widgets/categorizer/categorizer.test.ts, packages/perseus/src/widgets/definition/definition.test.ts, packages/perseus/src/widgets/expression/expression.test.tsx, packages/perseus/src/widgets/group/group.test.tsx, packages/perseus/src/widgets/group/group.tsx, packages/perseus/src/widgets/matcher/matcher.test.tsx, packages/perseus/src/widgets/matrix/matrix.test.ts, packages/perseus/src/widgets/deprecated-standin/__tests__/deprecated-standin.test.ts, packages/perseus/src/widgets/passage/__tests__/passage.test.tsx

Don't want to be involved in this pull request? Comment #removeme and we won't notify you of further changes.

@khan-actions-bot khan-actions-bot requested a review from a team November 25, 2024 19:48
@handeyeco handeyeco changed the title add some comments after digging in more [WIP] Expose a way to get user input from ServerItemRenderer Nov 25, 2024
Copy link
Contributor

github-actions bot commented Nov 25, 2024

npm Snapshot: Published

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

Example:

yarn add @khanacademy/perseus@PR1910

If you are working in Khan Academy's webapp, you can run:

./dev/tools/bump_perseus_version.sh -t PR1910

Copy link
Contributor

github-actions bot commented Nov 25, 2024

Size Change: +590 B (+0.05%)

Total Size: 1.29 MB

Filename Size Change
packages/perseus/dist/es/index.js 422 kB +590 B (+0.14%)
ℹ️ View Unchanged
Filename Size
packages/kas/dist/es/index.js 39 kB
packages/keypad-context/dist/es/index.js 760 B
packages/kmath/dist/es/index.js 4.27 kB
packages/math-input/dist/es/index.js 77.9 kB
packages/math-input/dist/es/strings.js 1.79 kB
packages/perseus-core/dist/es/index.js 1.48 kB
packages/perseus-editor/dist/es/index.js 697 kB
packages/perseus-linter/dist/es/index.js 22.2 kB
packages/perseus/dist/es/strings.js 3.57 kB
packages/pure-markdown/dist/es/index.js 3.66 kB
packages/simple-markdown/dist/es/index.js 12.5 kB

compressed-size-action

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