-
Notifications
You must be signed in to change notification settings - Fork 361
Fix getSaveWarnings in Free Response widget #2531
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
Conversation
This commit changes the getSaveWarnings() function definition in the Free Response widget to be defined using public class field syntax of the public method syntax. Previously, `this` wasn't being bound properly, so the function was unable to read `this.props`. The commit also adds some more type annotations and changes all methods on the widget to be defined in the same way. Issue: https://khanacademy.atlassian.net/browse/AX-1005 Test plan: - Load the PR's Perseus bundle in local webapp. - Add a Free Response widget in the exercise editor and verify that it renders properly.
…tion in the Free Response widget
|
Size Change: -5 B (0%) Total Size: 470 kB
ℹ️ View Unchanged
|
npm Snapshot: PublishedGood news!! We've packaged up the latest commit from this PR (275e90b) and published it to npm. You Example: pnpm add @khanacademy/perseus@PR2531If you are working in Khan Academy's webapp, you can run the below command. ./dev/tools/bump_perseus_version.js -s y -t PR2531 |
…Response widget and unhide it
jeremywiebe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry. This is old code that uses refs alot. I'm unclear why this was broken because we call getSaveWarnings on the widget editor ref. Anyways, glad you figured it out.
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @khanacademy/math-input@26.0.0 ### Major Changes - [#2522](#2522) [`ff2f1664d`](ff2f166) Thanks [@benchristel](https://github.com/benchristel)! - Breaking change: version `^3.0.0` of `@khanacademy/mathjax-renderer` is now required as a peer dep, instead of `^2.1.1`. Clients should update `@khanacademy/mathjax-renderer` at their convenience; nothing will immediately break if you stay on 2.x.x for now. ### Patch Changes - [#2519](#2519) [`cf71982e0`](cf71982) Thanks [@dependabot](https://github.com/apps/dependabot)! - Updating wonderblock dependencies. - Updated dependencies \[[`03669d385`](03669d3), [`52ec0bfcb`](52ec0bf), [`d1b6d9a3c`](d1b6d9a), [`86ac76f79`](86ac76f), [`6b747d140`](6b747d1), [`efb99e901`](efb99e9), [`3ec658e38`](3ec658e), [`3e162e616`](3e162e6), [`0913e9397`](0913e93), [`dc864aca8`](dc864ac), [`8ece223ef`](8ece223), [`cf71982e0`](cf71982), [`239be3f6c`](239be3f), [`0d46a8599`](0d46a85), [`1c49ad243`](1c49ad2)]: - @khanacademy/perseus-core@12.1.0 - @khanacademy/keypad-context@3.0.11 - @khanacademy/perseus-utils@2.0.4 ## @khanacademy/perseus-editor@23.0.0 ### Major Changes - [#2522](#2522) [`ff2f1664d`](ff2f166) Thanks [@benchristel](https://github.com/benchristel)! - Breaking change: version `^3.0.0` of `@khanacademy/mathjax-renderer` is now required as a peer dep, instead of `^2.1.1`. Clients should update `@khanacademy/mathjax-renderer` at their convenience; nothing will immediately break if you stay on 2.x.x for now. ### Minor Changes - [#2531](#2531) [`7ce293138`](7ce2931) Thanks [@aag](https://github.com/aag)! - Fix getSaveWarnings in Free Response widget and unhide it ### Patch Changes - [#2519](#2519) [`cf71982e0`](cf71982) Thanks [@dependabot](https://github.com/apps/dependabot)! - Updating wonderblock dependencies. - [#2512](#2512) [`a2778ace8`](a2778ac) Thanks [@Myranae](https://github.com/Myranae)! - Remove preferred pop-over direction dropdown from Label Image editor - Updated dependencies \[[`03669d385`](03669d3), [`52ec0bfcb`](52ec0bf), [`d1b6d9a3c`](d1b6d9a), [`7ce293138`](7ce2931), [`41fcaa918`](41fcaa9), [`555d89762`](555d897), [`86ac76f79`](86ac76f), [`ff2f1664d`](ff2f166), [`6b747d140`](6b747d1), [`efb99e901`](efb99e9), [`3ec658e38`](3ec658e), [`3e162e616`](3e162e6), [`0913e9397`](0913e93), [`dc864aca8`](dc864ac), [`8ece223ef`](8ece223), [`64c89cb15`](64c89cb), [`cf71982e0`](cf71982), [`9c651172d`](9c65117), [`239be3f6c`](239be3f), [`0d46a8599`](0d46a85), [`1c49ad243`](1c49ad2)]: - @khanacademy/perseus-core@12.1.0 - @khanacademy/perseus@63.1.0 - @khanacademy/math-input@26.0.0 - @khanacademy/kas@2.0.5 - @khanacademy/keypad-context@3.0.11 - @khanacademy/kmath@2.0.11 - @khanacademy/perseus-linter@3.0.11 - @khanacademy/perseus-score@7.0.1 - @khanacademy/perseus-utils@2.0.4 - @khanacademy/pure-markdown@2.0.5 ## @khanacademy/perseus@63.1.0 ### Minor Changes - [#2531](#2531) [`7ce293138`](7ce2931) Thanks [@aag](https://github.com/aag)! - Fix getSaveWarnings in Free Response widget and unhide it - [#2495](#2495) [`86ac76f79`](86ac76f) Thanks [@Myranae](https://github.com/Myranae)! - Update label image widget to handle answerless data and do some cleanup ### Patch Changes - [#2510](#2510) [`41fcaa918`](41fcaa9) Thanks [@ivyolamit](https://github.com/ivyolamit)! - Add tab navigation to new radio widget - [#2527](#2527) [`555d89762`](555d897) Thanks [@ivyolamit](https://github.com/ivyolamit)! - Support RTL in new radio widget - [#2443](#2443) [`64c89cb15`](64c89cb) Thanks [@anakaren-rojas](https://github.com/anakaren-rojas)! - Remove deprecated cross out functionality for Radio Choices - [#2519](#2519) [`cf71982e0`](cf71982) Thanks [@dependabot](https://github.com/apps/dependabot)! - Updating wonderblock dependencies. - [#2515](#2515) [`9c651172d`](9c65117) Thanks [@aag](https://github.com/aag)! - Add validation for inputs that are too long to the Free Response widget - [#2509](#2509) [`0d46a8599`](0d46a85) Thanks [@SonicScrewdriver](https://github.com/SonicScrewdriver)! - Ensure that Interactive Graph's labelLocation property can be parsed properly - Updated dependencies \[[`03669d385`](03669d3), [`52ec0bfcb`](52ec0bf), [`d1b6d9a3c`](d1b6d9a), [`86ac76f79`](86ac76f), [`ff2f1664d`](ff2f166), [`6b747d140`](6b747d1), [`efb99e901`](efb99e9), [`3ec658e38`](3ec658e), [`3e162e616`](3e162e6), [`0913e9397`](0913e93), [`dc864aca8`](dc864ac), [`8ece223ef`](8ece223), [`cf71982e0`](cf71982), [`9c651172d`](9c65117), [`239be3f6c`](239be3f), [`0d46a8599`](0d46a85), [`1c49ad243`](1c49ad2)]: - @khanacademy/perseus-core@12.1.0 - @khanacademy/math-input@26.0.0 - @khanacademy/kas@2.0.5 - @khanacademy/keypad-context@3.0.11 - @khanacademy/kmath@2.0.11 - @khanacademy/perseus-linter@3.0.11 - @khanacademy/perseus-score@7.0.1 - @khanacademy/perseus-utils@2.0.4 - @khanacademy/pure-markdown@2.0.5 - @khanacademy/simple-markdown@2.0.5 ## @khanacademy/perseus-core@12.1.0 ### Minor Changes - [#2533](#2533) [`03669d385`](03669d3) Thanks [@benchristel](https://github.com/benchristel)! - Make `parseAndMigratePerseusItem` accept some legacy content items that previously caused parse errors. - [#2495](#2495) [`86ac76f79`](86ac76f) Thanks [@Myranae](https://github.com/Myranae)! - Update label image widget to handle answerless data and do some cleanup - [#2528](#2528) [`dc864aca8`](dc864ac) Thanks [@benchristel](https://github.com/benchristel)! - Add `splitPerseusItemJSON` to `@khanacademy/perseus-core`, for use in the publish pipeline. ### Patch Changes - [#2538](#2538) [`52ec0bfcb`](52ec0bf) Thanks [@Myranae](https://github.com/Myranae)! - Add typesafe parser for Label-image's user input type - [#2520](#2520) [`d1b6d9a3c`](d1b6d9a) Thanks [@Myranae](https://github.com/Myranae)! - Add parsing validation for Matrix's user input - [#2523](#2523) [`6b747d140`](6b747d1) Thanks [@Myranae](https://github.com/Myranae)! - Add typesafe parser for the plotter user input type - [#2516](#2516) [`efb99e901`](efb99e9) Thanks [@Myranae](https://github.com/Myranae)! - Add parsing validation for Categorizer's user input - [#2539](#2539) [`3ec658e38`](3ec658e) Thanks [@Myranae](https://github.com/Myranae)! - Add typesafe parser for Table's user input type - [#2536](#2536) [`3e162e616`](3e162e6) Thanks [@Myranae](https://github.com/Myranae)! - Add typesafe parser for Orderer's user input type - [#2521](#2521) [`0913e9397`](0913e93) Thanks [@Myranae](https://github.com/Myranae)! - Add typesafe parser for Number-line's user input type - [#2524](#2524) [`8ece223ef`](8ece223) Thanks [@Myranae](https://github.com/Myranae)! - Add typesafe parser for Matcher's user input type - [#2519](#2519) [`cf71982e0`](cf71982) Thanks [@dependabot](https://github.com/apps/dependabot)! - Updating wonderblock dependencies. - [#2537](#2537) [`239be3f6c`](239be3f) Thanks [@Myranae](https://github.com/Myranae)! - Add typesafe parser for Input-number's user input type - [#2509](#2509) [`0d46a8599`](0d46a85) Thanks [@SonicScrewdriver](https://github.com/SonicScrewdriver)! - Ensure that Interactive Graph's labelLocation property can be parsed properly - [#2525](#2525) [`1c49ad243`](1c49ad2) Thanks [@Myranae](https://github.com/Myranae)! - Add typesafe parser for Sorter's user input type - Updated dependencies \[[`cf71982e0`](cf71982)]: - @khanacademy/kas@2.0.5 - @khanacademy/perseus-utils@2.0.4 ## @khanacademy/kas@2.0.5 ### Patch Changes - [#2519](#2519) [`cf71982e0`](cf71982) Thanks [@dependabot](https://github.com/apps/dependabot)! - Updating wonderblock dependencies. - Updated dependencies \[[`cf71982e0`](cf71982)]: - @khanacademy/perseus-utils@2.0.4 ## @khanacademy/keypad-context@3.0.11 ### Patch Changes - [#2519](#2519) [`cf71982e0`](cf71982) Thanks [@dependabot](https://github.com/apps/dependabot)! - Updating wonderblock dependencies. - Updated dependencies \[[`03669d385`](03669d3), [`52ec0bfcb`](52ec0bf), [`d1b6d9a3c`](d1b6d9a), [`86ac76f79`](86ac76f), [`6b747d140`](6b747d1), [`efb99e901`](efb99e9), [`3ec658e38`](3ec658e), [`3e162e616`](3e162e6), [`0913e9397`](0913e93), [`dc864aca8`](dc864ac), [`8ece223ef`](8ece223), [`cf71982e0`](cf71982), [`239be3f6c`](239be3f), [`0d46a8599`](0d46a85), [`1c49ad243`](1c49ad2)]: - @khanacademy/perseus-core@12.1.0 - @khanacademy/perseus-utils@2.0.4 ## @khanacademy/kmath@2.0.11 ### Patch Changes - [#2519](#2519) [`cf71982e0`](cf71982) Thanks [@dependabot](https://github.com/apps/dependabot)! - Updating wonderblock dependencies. - Updated dependencies \[[`03669d385`](03669d3), [`52ec0bfcb`](52ec0bf), [`d1b6d9a3c`](d1b6d9a), [`86ac76f79`](86ac76f), [`6b747d140`](6b747d1), [`efb99e901`](efb99e9), [`3ec658e38`](3ec658e), [`3e162e616`](3e162e6), [`0913e9397`](0913e93), [`dc864aca8`](dc864ac), [`8ece223ef`](8ece223), [`cf71982e0`](cf71982), [`239be3f6c`](239be3f), [`0d46a8599`](0d46a85), [`1c49ad243`](1c49ad2)]: - @khanacademy/perseus-core@12.1.0 - @khanacademy/perseus-utils@2.0.4 ## @khanacademy/perseus-linter@3.0.11 ### Patch Changes - [#2519](#2519) [`cf71982e0`](cf71982) Thanks [@dependabot](https://github.com/apps/dependabot)! - Updating wonderblock dependencies. - Updated dependencies \[[`03669d385`](03669d3), [`52ec0bfcb`](52ec0bf), [`d1b6d9a3c`](d1b6d9a), [`86ac76f79`](86ac76f), [`6b747d140`](6b747d1), [`efb99e901`](efb99e9), [`3ec658e38`](3ec658e), [`3e162e616`](3e162e6), [`0913e9397`](0913e93), [`dc864aca8`](dc864ac), [`8ece223ef`](8ece223), [`cf71982e0`](cf71982), [`239be3f6c`](239be3f), [`0d46a8599`](0d46a85), [`1c49ad243`](1c49ad2)]: - @khanacademy/perseus-core@12.1.0 - @khanacademy/perseus-utils@2.0.4 ## @khanacademy/perseus-score@7.0.1 ### Patch Changes - [#2519](#2519) [`cf71982e0`](cf71982) Thanks [@dependabot](https://github.com/apps/dependabot)! - Updating wonderblock dependencies. - [#2515](#2515) [`9c651172d`](9c65117) Thanks [@aag](https://github.com/aag)! - Add validation for inputs that are too long to the Free Response widget - Updated dependencies \[[`03669d385`](03669d3), [`52ec0bfcb`](52ec0bf), [`d1b6d9a3c`](d1b6d9a), [`86ac76f79`](86ac76f), [`6b747d140`](6b747d1), [`efb99e901`](efb99e9), [`3ec658e38`](3ec658e), [`3e162e616`](3e162e6), [`0913e9397`](0913e93), [`dc864aca8`](dc864ac), [`8ece223ef`](8ece223), [`cf71982e0`](cf71982), [`239be3f6c`](239be3f), [`0d46a8599`](0d46a85), [`1c49ad243`](1c49ad2)]: - @khanacademy/perseus-core@12.1.0 - @khanacademy/kas@2.0.5 - @khanacademy/kmath@2.0.11 - @khanacademy/perseus-utils@2.0.4 ## @khanacademy/perseus-utils@2.0.4 ### Patch Changes - [#2519](#2519) [`cf71982e0`](cf71982) Thanks [@dependabot](https://github.com/apps/dependabot)! - Updating wonderblock dependencies. ## @khanacademy/pure-markdown@2.0.5 ### Patch Changes - [#2519](#2519) [`cf71982e0`](cf71982) Thanks [@dependabot](https://github.com/apps/dependabot)! - Updating wonderblock dependencies. - Updated dependencies \[[`cf71982e0`](cf71982)]: - @khanacademy/perseus-utils@2.0.4 - @khanacademy/simple-markdown@2.0.5 ## @khanacademy/simple-markdown@2.0.5 ### Patch Changes - [#2519](#2519) [`cf71982e0`](cf71982) Thanks [@dependabot](https://github.com/apps/dependabot)! - Updating wonderblock dependencies. - Updated dependencies \[[`cf71982e0`](cf71982)]: - @khanacademy/perseus-utils@2.0.4 ## perseus-build-settings@0.6.2 ### Patch Changes - [#2511](#2511) [`1eaf969b9`](1eaf969) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Updates TypeScript configuration to target ES2021 instead of ES2016 - [#2519](#2519) [`cf71982e0`](cf71982) Thanks [@dependabot](https://github.com/apps/dependabot)! - Updating wonderblock dependencies. ## @khanacademy/perseus-dev-ui@5.4.12 ### Patch Changes - [#2519](#2519) [`cf71982e0`](cf71982) Thanks [@dependabot](https://github.com/apps/dependabot)! - Updating wonderblock dependencies. - Updated dependencies \[[`03669d385`](03669d3), [`52ec0bfcb`](52ec0bf), [`d1b6d9a3c`](d1b6d9a), [`86ac76f79`](86ac76f), [`ff2f1664d`](ff2f166), [`6b747d140`](6b747d1), [`efb99e901`](efb99e9), [`3ec658e38`](3ec658e), [`3e162e616`](3e162e6), [`0913e9397`](0913e93), [`dc864aca8`](dc864ac), [`8ece223ef`](8ece223), [`cf71982e0`](cf71982), [`239be3f6c`](239be3f), [`0d46a8599`](0d46a85), [`1c49ad243`](1c49ad2)]: - @khanacademy/perseus-core@12.1.0 - @khanacademy/math-input@26.0.0 - @khanacademy/kas@2.0.5 - @khanacademy/kmath@2.0.11 - @khanacademy/perseus-linter@3.0.11 - @khanacademy/pure-markdown@2.0.5 - @khanacademy/simple-markdown@2.0.5 ## jsdiff@1.0.2 ### Patch Changes - [#2519](#2519) [`cf71982e0`](cf71982) Thanks [@dependabot](https://github.com/apps/dependabot)! - Updating wonderblock dependencies. ## raphael@1.5.4 ### Patch Changes - [#2519](#2519) [`cf71982e0`](cf71982) Thanks [@dependabot](https://github.com/apps/dependabot)! - Updating wonderblock dependencies. Author: khan-actions-bot Reviewers: benchristel Required Reviewers: Approved By: benchristel Checks: ⏭️ 1 check has been skipped, ✅ 4 checks were successful Pull Request URL: #2513
Summary:
This commit changes the getSaveWarnings() function definition in the
Free Response widget editor to be defined using public class field syntax of
the public method syntax. Previously,
thiswasn't being boundproperly, so the function was unable to read
this.props. Additionally,the Free Response widget is unhidden, so that it will appear in the widgets
dropdown in the exercise editor.
The commit also adds some more type annotations and changes all methods
on the widget editor to be defined in the same way.
Issue: https://khanacademy.atlassian.net/browse/AX-1005
Test plan:
Load the PR's Perseus bundle in local webapp.
Go to the exercise editor in devadmin and verify that there is a "Free Response"

option in the "Add a widget..." dropdown.
Add a Free Response widget in the exercise editor and verify that it

renders properly.