-
Notifications
You must be signed in to change notification settings - Fork 357
Update Matrix to render with answerless data #2387
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
Size Change: +23 B (0%) Total Size: 466 kB
ℹ️ View Unchanged
|
…t to render with answerless data. Adds tests and stories for answerless rendering.
npm Snapshot: PublishedGood news!! We've packaged up the latest commit from this PR (ed16766) and published it to npm. You Example: pnpm add @khanacademy/perseus@PR2387 If you are working in Khan Academy's webapp, you can run: ./dev/tools/bump_perseus_version.js -t PR2387 |
type RenderProps = MatrixPublicWidgetOptions & { | ||
answers: ReadonlyArray<ReadonlyArray<string>>; | ||
}; |
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.
Not sure if this should be up with the other props. ExternalProps doesn't have the same optional properties as MatrixPublicWidgetOptions, so I didn't think I should add RenderProps to it. The typing for answers is a little strange; transform converts it to a string, so the matrix gets rendered with an array of strings, but there's other logic using it as numbers. The matrix editor creates the array with numbers, but then all the interaction is with strings, until you get back to scoring.
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.
I belive the difference between RenderProps
and ExternalProps
is that RenderProps
is supposed to be what appears inside the component (after defaultProps
have been applied) and ExternalProps
is what callers of this component need to pass in. But TBH I am a little confused about why we need both types here. It seems like maybe we could define type RenderProps = ExternalProps
for this component? I will look into this more after lunch.
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.
tbh I was very confused by props in Table
too. I think for some of these older widgets, the architecture wasn't as clear.
There's some info here: https://github.com/Khan/perseus/blob/main/docs/architecture.md
I think it's:
PerseusMatrixWidgetOptions
: all the data we store about the specific widgetMatrixPublicWidgetOptions
: all the answerless data for the pre-scoring renderingRenderProps
: the output of thetransform
which takesPerseusMatrixWidgetOptions
(and in the futureMatrixPublicWidgetOptions
) as inputExternalProps
: wrapsRenderProps
with additional stuff fromWidgetOptions
*DefaultProps
: is the defaults for things that are optional inExternalProps
Props
: is the combination ofExternalProps
andDefaultProps
- it's everything inExternalProps
except optional fields are filled in fromDefaultProps
*WidgetOptions
is its own thing:
/**
* The type representing the common structure of all widget's options. The
* `Options` generic type represents the widget-specific option data.
*/
export type WidgetOptions<Type extends string, Options> = {
// The "type" of widget which will define what the Options field looks like
type: Type;
// Whether this widget is displayed with the values and is immutable. For display only
// NOTE: perseus_data.go says this is required even though it isn't necessary.
static?: boolean;
// Whether a widget is scored. Usually true except for IFrame widgets (deprecated)
// Default: true
graded?: boolean;
// The HTML alignment of the widget. "default" or "block"
// NOTE: perseus_data.go says this is required even though it isn't necessary.
alignment?: string;
// Options specific to the type field of the widget. See Perseus*WidgetOptions for more details
options: Options;
// Only used by interactive child widgets (line, point, etc) to identify the components
// NOTE: perseus_data.go says this is required even though it isn't necessary.
key?: number | null;
// The version of the widget data spec. Used to differentiate between newer and older content data.
// NOTE: perseus_data.go says this is required even though it isn't necessary.
version?: Version;
};
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.
Alright, I didn't make any changes to ExternalProps or Props. Just added in the RenderProps type. I did notice that getUserInput returns an object with an answers property, but changing the naming there requires a lot of changes, so if that's important, might do that in another PR. Otherwise, will be landing this tomorrow :)
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.
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
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.
LGTM! I left some suggestions inline, but nothing blocking.
type RenderProps = MatrixPublicWidgetOptions & { | ||
answers: ReadonlyArray<ReadonlyArray<string>>; | ||
}; |
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.
I belive the difference between RenderProps
and ExternalProps
is that RenderProps
is supposed to be what appears inside the component (after defaultProps
have been applied) and ExternalProps
is what callers of this component need to pass in. But TBH I am a little confused about why we need both types here. It seems like maybe we could define type RenderProps = ExternalProps
for this component? I will look into this more after lunch.
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.
I don't feel super comfortable approving until the AI generated code has tests/comments/etc, but I also don't want to block you. So I'll just leave some comments.
type RenderProps = MatrixPublicWidgetOptions & { | ||
answers: ReadonlyArray<ReadonlyArray<string>>; | ||
}; |
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.
tbh I was very confused by props in Table
too. I think for some of these older widgets, the architecture wasn't as clear.
There's some info here: https://github.com/Khan/perseus/blob/main/docs/architecture.md
I think it's:
PerseusMatrixWidgetOptions
: all the data we store about the specific widgetMatrixPublicWidgetOptions
: all the answerless data for the pre-scoring renderingRenderProps
: the output of thetransform
which takesPerseusMatrixWidgetOptions
(and in the futureMatrixPublicWidgetOptions
) as inputExternalProps
: wrapsRenderProps
with additional stuff fromWidgetOptions
*DefaultProps
: is the defaults for things that are optional inExternalProps
Props
: is the combination ofExternalProps
andDefaultProps
- it's everything inExternalProps
except optional fields are filled in fromDefaultProps
*WidgetOptions
is its own thing:
/**
* The type representing the common structure of all widget's options. The
* `Options` generic type represents the widget-specific option data.
*/
export type WidgetOptions<Type extends string, Options> = {
// The "type" of widget which will define what the Options field looks like
type: Type;
// Whether this widget is displayed with the values and is immutable. For display only
// NOTE: perseus_data.go says this is required even though it isn't necessary.
static?: boolean;
// Whether a widget is scored. Usually true except for IFrame widgets (deprecated)
// Default: true
graded?: boolean;
// The HTML alignment of the widget. "default" or "block"
// NOTE: perseus_data.go says this is required even though it isn't necessary.
alignment?: string;
// Options specific to the type field of the widget. See Perseus*WidgetOptions for more details
options: Options;
// Only used by interactive child widgets (line, point, etc) to identify the components
// NOTE: perseus_data.go says this is required even though it isn't necessary.
key?: number | null;
// The version of the widget data spec. Used to differentiate between newer and older content data.
// NOTE: perseus_data.go says this is required even though it isn't necessary.
version?: Version;
};
Specifically item to renderer as a renderer is what's being created
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/[email protected] ### Major Changes - [#2402](#2402) [`558cc1cc6`](558cc1c) Thanks [@benchristel](https://github.com/benchristel)! - Add typetests to ensure that the data format accepted by `parseAndMigratePerseusItem` stays in sync with the types in `data-schema.ts`, exported from `@khanacademy/perseus-core`. Breaking change: `PerseusGraphTypeAngle.coords` can no longer be `null`; use `undefined` instead. - [#2436](#2436) [`79a84d31b`](79a84d3) Thanks [@benchristel](https://github.com/benchristel)! - Change the type of `PerseusNumberLineWidgetOptions.correctRel` to `"eq" | "lt" | "gt" | "le" | "ge"`, to better reflect our data and the semantics of this field. - [#2425](#2425) [`4282de2b2`](4282de2) Thanks [@benchristel](https://github.com/benchristel)! - Add `isInequality` to the `PerseusNumberLineWidgetOptions` type. The NumberLine component was using this field, but it wasn't represented in the types. - [#2417](#2417) [`4184314fe`](4184314) Thanks [@handeyeco](https://github.com/handeyeco)! - Enable Group to be rendered/answered with answerless item data - [#2380](#2380) [`1f88cc191`](1f88cc1) Thanks [@benchristel](https://github.com/benchristel)! - Removes `undefined` from the types of `PerseusInteractiveGraphWidgetOptions.lockedFigures` and the `labels` property of locked figures. Removes the `coords` property from interactive graph widget options types, for graphs that do not use it (all but the `point` graph type). This is a breaking change because assigning `undefined` to `lockedFigures` or `labels`, or setting `coord` in an object literal, will now give a type error. Callers should use an empty array instead of `undefined` for `lockedFigures` and `labels`. Avoid setting `coord` for graph types other than `point`. ### Minor Changes - [#2423](#2423) [`22e7de307`](22e7de3) Thanks [@Myranae](https://github.com/Myranae)! - Update Plotter widget to render with answerless data. Adds test and stories for answerless rendering. - [#2448](#2448) [`b7d3b9eaf`](b7d3b9e) Thanks [@tony-dinh](https://github.com/tony-dinh)! - Introduce `itemHasHints` & `itemHasRationales` methods to detect when a parsed PerseusItem contains widgets with hints or rationales, respectively. - [#2441](#2441) [`f1662239e`](f166223) Thanks [@Myranae](https://github.com/Myranae)! - Update Orderer widget to render with answerless data. Adds tests and stories for answerless rendering. - [#2387](#2387) [`aa7b1b621`](aa7b1b6) Thanks [@Myranae](https://github.com/Myranae)! - Update Matrix widget to render with answerless data. Adds tests and stories for answerless rendering. ### Patch Changes - [#2426](#2426) [`a2701f002`](a2701f0) Thanks [@handeyeco](https://github.com/handeyeco)! - Add tests/stories to prove InputNumber is interactive with answerless data - [#2446](#2446) [`ca4df1cf8`](ca4df1c) Thanks [@benchristel](https://github.com/benchristel)! - Internal: suppress immutable-data lint rule in a test - [#2414](#2414) [`e7807485e`](e780748) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Fix dependencies so that the package correctly depends on all of the packages it uses - [#2459](#2459) [`c27162249`](c271622) Thanks [@benchristel](https://github.com/benchristel)! - Internal: use 'require' instead of 'import' in test script so it will work on more platforms - [#2434](#2434) [`28c395f8e`](28c395f) Thanks [@benchristel](https://github.com/benchristel)! - Internal: add tests verifying that NumberLine widgets work with answerless data - [#2403](#2403) [`bfa5ce68a`](bfa5ce6) Thanks [@benchristel](https://github.com/benchristel)! - Internal: add tests to ensure Perseus JSON parsers are idempotent - [#2439](#2439) [`1b773e2a0`](1b773e2) Thanks [@benchristel](https://github.com/benchristel)! - The Perseus JSON parser now accepts cross-realm objects. - [#2438](#2438) [`3f32593c9`](3f32593) Thanks [@benchristel](https://github.com/benchristel)! - Internal: Add a linter to prevent accidental mutation of object and array values - Updated dependencies \[[`e7807485e`](e780748), [`3f32593c9`](3f32593)]: - @khanacademy/[email protected] - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Minor Changes - [#2423](#2423) [`22e7de307`](22e7de3) Thanks [@Myranae](https://github.com/Myranae)! - Update Plotter widget to render with answerless data. Adds test and stories for answerless rendering. - [#2449](#2449) [`2243316be`](2243316) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Add option to ButtonGroup component to allow selected button to be styled - [#2441](#2441) [`f1662239e`](f166223) Thanks [@Myranae](https://github.com/Myranae)! - Update Orderer widget to render with answerless data. Adds tests and stories for answerless rendering. - [#2387](#2387) [`aa7b1b621`](aa7b1b6) Thanks [@Myranae](https://github.com/Myranae)! - Update Matrix widget to render with answerless data. Adds tests and stories for answerless rendering. ### Patch Changes - [#2426](#2426) [`a2701f002`](a2701f0) Thanks [@handeyeco](https://github.com/handeyeco)! - Add tests/stories to prove InputNumber is interactive with answerless data - [#2447](#2447) [`39ca81d0f`](39ca81d) Thanks [@handeyeco](https://github.com/handeyeco)! - Clean up a ServerItemRenderer test to make it more focused - [#2436](#2436) [`79a84d31b`](79a84d3) Thanks [@benchristel](https://github.com/benchristel)! - Change the type of `PerseusNumberLineWidgetOptions.correctRel` to `"eq" | "lt" | "gt" | "le" | "ge"`, to better reflect our data and the semantics of this field. - [#2425](#2425) [`4282de2b2`](4282de2) Thanks [@benchristel](https://github.com/benchristel)! - Add `isInequality` to the `PerseusNumberLineWidgetOptions` type. The NumberLine component was using this field, but it wasn't represented in the types. - [#2452](#2452) [`4b25852db`](4b25852) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Fix types used for forwardref in `expression` widget - [#2414](#2414) [`e7807485e`](e780748) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Fix dependencies so that the package correctly depends on all of the packages it uses - [#2417](#2417) [`4184314fe`](4184314) Thanks [@handeyeco](https://github.com/handeyeco)! - Enable Group to be rendered/answered with answerless item data - [#2380](#2380) [`1f88cc191`](1f88cc1) Thanks [@benchristel](https://github.com/benchristel)! - Removes `undefined` from the types of `PerseusInteractiveGraphWidgetOptions.lockedFigures` and the `labels` property of locked figures. Removes the `coords` property from interactive graph widget options types, for graphs that do not use it (all but the `point` graph type). This is a breaking change because assigning `undefined` to `lockedFigures` or `labels`, or setting `coord` in an object literal, will now give a type error. Callers should use an empty array instead of `undefined` for `lockedFigures` and `labels`. Avoid setting `coord` for graph types other than `point`. - [#2416](#2416) [`a90ebca08`](a90ebca) Thanks [@ivyolamit](https://github.com/ivyolamit)! - Update Radio Widget docs to include rationales in the test data - [#2434](#2434) [`28c395f8e`](28c395f) Thanks [@benchristel](https://github.com/benchristel)! - Internal: add tests verifying that NumberLine widgets work with answerless data - [#2438](#2438) [`3f32593c9`](3f32593) Thanks [@benchristel](https://github.com/benchristel)! - Internal: Add a linter to prevent accidental mutation of object and array values - Updated dependencies \[[`a2701f002`](a2701f0), [`558cc1cc6`](558cc1c), [`79a84d31b`](79a84d3), [`ca4df1cf8`](ca4df1c), [`4282de2b2`](4282de2), [`e7807485e`](e780748), [`4184314fe`](4184314), [`1f88cc191`](1f88cc1), [`22e7de307`](22e7de3), [`c27162249`](c271622), [`28c395f8e`](28c395f), [`bfa5ce68a`](bfa5ce6), [`b7d3b9eaf`](b7d3b9e), [`f1662239e`](f166223), [`aa7b1b621`](aa7b1b6), [`1b773e2a0`](1b773e2), [`3f32593c9`](3f32593)]: - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Minor Changes - [#2449](#2449) [`2243316be`](2243316) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - UI updates to Expression editor ### Patch Changes - [#2402](#2402) [`558cc1cc6`](558cc1c) Thanks [@benchristel](https://github.com/benchristel)! - Add typetests to ensure that the data format accepted by `parseAndMigratePerseusItem` stays in sync with the types in `data-schema.ts`, exported from `@khanacademy/perseus-core`. Breaking change: `PerseusGraphTypeAngle.coords` can no longer be `null`; use `undefined` instead. - [#2421](#2421) [`bedcfc6f2`](bedcfc6) Thanks [@mahtabsabet](https://github.com/mahtabsabet)! - Allow widgets within hints to be collapsed/expanded through editor controls - [#2414](#2414) [`e7807485e`](e780748) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Fix dependencies so that the package correctly depends on all of the packages it uses - [#2430](#2430) [`312166b0b`](312166b) Thanks [@jandrade](https://github.com/jandrade)! - Updates the `ExpressionEditor` widget to use a WB `Button` instance that resembles the previously supported `light` variant (now deprecated). - [#2417](#2417) [`4184314fe`](4184314) Thanks [@handeyeco](https://github.com/handeyeco)! - Enable Group to be rendered/answered with answerless item data - [#2380](#2380) [`1f88cc191`](1f88cc1) Thanks [@benchristel](https://github.com/benchristel)! - Removes `undefined` from the types of `PerseusInteractiveGraphWidgetOptions.lockedFigures` and the `labels` property of locked figures. Removes the `coords` property from interactive graph widget options types, for graphs that do not use it (all but the `point` graph type). This is a breaking change because assigning `undefined` to `lockedFigures` or `labels`, or setting `coord` in an object literal, will now give a type error. Callers should use an empty array instead of `undefined` for `lockedFigures` and `labels`. Avoid setting `coord` for graph types other than `point`. - [#2438](#2438) [`3f32593c9`](3f32593) Thanks [@benchristel](https://github.com/benchristel)! - Internal: Add a linter to prevent accidental mutation of object and array values - Updated dependencies \[[`a2701f002`](a2701f0), [`39ca81d0f`](39ca81d), [`558cc1cc6`](558cc1c), [`79a84d31b`](79a84d3), [`ca4df1cf8`](ca4df1c), [`4282de2b2`](4282de2), [`4b25852db`](4b25852), [`e7807485e`](e780748), [`4184314fe`](4184314), [`1f88cc191`](1f88cc1), [`22e7de307`](22e7de3), [`a90ebca08`](a90ebca), [`c27162249`](c271622), [`28c395f8e`](28c395f), [`2243316be`](2243316), [`bfa5ce68a`](bfa5ce6), [`b7d3b9eaf`](b7d3b9e), [`f1662239e`](f166223), [`aa7b1b621`](aa7b1b6), [`1b773e2a0`](1b773e2), [`3f32593c9`](3f32593)]: - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - [#2414](#2414) [`e7807485e`](e780748) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Fix dependencies so that the package correctly depends on all of the packages it uses - [#2438](#2438) [`3f32593c9`](3f32593) Thanks [@benchristel](https://github.com/benchristel)! - Internal: Add a linter to prevent accidental mutation of object and array values - Updated dependencies \[[`e7807485e`](e780748), [`3f32593c9`](3f32593)]: - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - [#2414](#2414) [`e7807485e`](e780748) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Fix dependencies so that the package correctly depends on all of the packages it uses - Updated dependencies \[[`a2701f002`](a2701f0), [`558cc1cc6`](558cc1c), [`79a84d31b`](79a84d3), [`ca4df1cf8`](ca4df1c), [`4282de2b2`](4282de2), [`e7807485e`](e780748), [`4184314fe`](4184314), [`1f88cc191`](1f88cc1), [`22e7de307`](22e7de3), [`c27162249`](c271622), [`28c395f8e`](28c395f), [`bfa5ce68a`](bfa5ce6), [`b7d3b9eaf`](b7d3b9e), [`f1662239e`](f166223), [`aa7b1b621`](aa7b1b6), [`1b773e2a0`](1b773e2), [`3f32593c9`](3f32593)]: - @khanacademy/[email protected] - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - [#2414](#2414) [`e7807485e`](e780748) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Fix dependencies so that the package correctly depends on all of the packages it uses - [#2438](#2438) [`3f32593c9`](3f32593) Thanks [@benchristel](https://github.com/benchristel)! - Internal: Add a linter to prevent accidental mutation of object and array values - Updated dependencies \[[`a2701f002`](a2701f0), [`558cc1cc6`](558cc1c), [`79a84d31b`](79a84d3), [`ca4df1cf8`](ca4df1c), [`4282de2b2`](4282de2), [`e7807485e`](e780748), [`4184314fe`](4184314), [`1f88cc191`](1f88cc1), [`22e7de307`](22e7de3), [`c27162249`](c271622), [`28c395f8e`](28c395f), [`bfa5ce68a`](bfa5ce6), [`b7d3b9eaf`](b7d3b9e), [`f1662239e`](f166223), [`aa7b1b621`](aa7b1b6), [`1b773e2a0`](1b773e2), [`3f32593c9`](3f32593)]: - @khanacademy/[email protected] - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - [#2414](#2414) [`e7807485e`](e780748) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Fix dependencies so that the package correctly depends on all of the packages it uses - [#2438](#2438) [`3f32593c9`](3f32593) Thanks [@benchristel](https://github.com/benchristel)! - Internal: Add a linter to prevent accidental mutation of object and array values - Updated dependencies \[[`a2701f002`](a2701f0), [`558cc1cc6`](558cc1c), [`79a84d31b`](79a84d3), [`ca4df1cf8`](ca4df1c), [`4282de2b2`](4282de2), [`e7807485e`](e780748), [`4184314fe`](4184314), [`1f88cc191`](1f88cc1), [`22e7de307`](22e7de3), [`c27162249`](c271622), [`28c395f8e`](28c395f), [`bfa5ce68a`](bfa5ce6), [`b7d3b9eaf`](b7d3b9e), [`f1662239e`](f166223), [`aa7b1b621`](aa7b1b6), [`1b773e2a0`](1b773e2), [`3f32593c9`](3f32593)]: - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - [#2414](#2414) [`e7807485e`](e780748) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Fix dependencies so that the package correctly depends on all of the packages it uses - [#2438](#2438) [`3f32593c9`](3f32593) Thanks [@benchristel](https://github.com/benchristel)! - Internal: Add a linter to prevent accidental mutation of object and array values - Updated dependencies \[[`a2701f002`](a2701f0), [`558cc1cc6`](558cc1c), [`79a84d31b`](79a84d3), [`ca4df1cf8`](ca4df1c), [`4282de2b2`](4282de2), [`e7807485e`](e780748), [`4184314fe`](4184314), [`1f88cc191`](1f88cc1), [`22e7de307`](22e7de3), [`c27162249`](c271622), [`28c395f8e`](28c395f), [`bfa5ce68a`](bfa5ce6), [`b7d3b9eaf`](b7d3b9e), [`f1662239e`](f166223), [`aa7b1b621`](aa7b1b6), [`1b773e2a0`](1b773e2), [`3f32593c9`](3f32593)]: - @khanacademy/[email protected] - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - [#2414](#2414) [`e7807485e`](e780748) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Fix dependencies so that the package correctly depends on all of the packages it uses - [#2417](#2417) [`4184314fe`](4184314) Thanks [@handeyeco](https://github.com/handeyeco)! - Enable Group to be rendered/answered with answerless item data - [#2438](#2438) [`3f32593c9`](3f32593) Thanks [@benchristel](https://github.com/benchristel)! - Internal: Add a linter to prevent accidental mutation of object and array values - Updated dependencies \[[`a2701f002`](a2701f0), [`558cc1cc6`](558cc1c), [`79a84d31b`](79a84d3), [`ca4df1cf8`](ca4df1c), [`4282de2b2`](4282de2), [`e7807485e`](e780748), [`4184314fe`](4184314), [`1f88cc191`](1f88cc1), [`22e7de307`](22e7de3), [`c27162249`](c271622), [`28c395f8e`](28c395f), [`bfa5ce68a`](bfa5ce6), [`b7d3b9eaf`](b7d3b9e), [`f1662239e`](f166223), [`aa7b1b621`](aa7b1b6), [`1b773e2a0`](1b773e2), [`3f32593c9`](3f32593)]: - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - [#2414](#2414) [`e7807485e`](e780748) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Fix dependencies so that the package correctly depends on all of the packages it uses - [#2438](#2438) [`3f32593c9`](3f32593) Thanks [@benchristel](https://github.com/benchristel)! - Internal: Add a linter to prevent accidental mutation of object and array values ## @khanacademy/[email protected] ### Patch Changes - [#2414](#2414) [`e7807485e`](e780748) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Fix dependencies so that the package correctly depends on all of the packages it uses - Updated dependencies \[[`e7807485e`](e780748), [`3f32593c9`](3f32593)]: - @khanacademy/[email protected] - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - [#2414](#2414) [`e7807485e`](e780748) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Fix dependencies so that the package correctly depends on all of the packages it uses - [#2438](#2438) [`3f32593c9`](3f32593) Thanks [@benchristel](https://github.com/benchristel)! - Internal: Add a linter to prevent accidental mutation of object and array values - Updated dependencies \[[`e7807485e`](e780748), [`3f32593c9`](3f32593)]: - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - [#2414](#2414) [`e7807485e`](e780748) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Fix dependencies so that the package correctly depends on all of the packages it uses - [#2438](#2438) [`3f32593c9`](3f32593) Thanks [@benchristel](https://github.com/benchristel)! - Internal: Add a linter to prevent accidental mutation of object and array values - Updated dependencies \[[`a2701f002`](a2701f0), [`558cc1cc6`](558cc1c), [`79a84d31b`](79a84d3), [`ca4df1cf8`](ca4df1c), [`4282de2b2`](4282de2), [`e7807485e`](e780748), [`4184314fe`](4184314), [`1f88cc191`](1f88cc1), [`22e7de307`](22e7de3), [`c27162249`](c271622), [`28c395f8e`](28c395f), [`bfa5ce68a`](bfa5ce6), [`b7d3b9eaf`](b7d3b9e), [`f1662239e`](f166223), [`aa7b1b621`](aa7b1b6), [`1b773e2a0`](1b773e2), [`3f32593c9`](3f32593)]: - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] ## [email protected] ### Patch Changes - [#2414](#2414) [`e7807485e`](e780748) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Fix dependencies so that the package correctly depends on all of the packages it uses ## [email protected] ### Patch Changes - [#2414](#2414) [`e7807485e`](e780748) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Fix dependencies so that the package correctly depends on all of the packages it uses Author: khan-actions-bot Reviewers: benchristel Required Reviewers: Approved By: benchristel Checks: ⏭️ 1 check has been skipped, ✅ 4 checks were successful Pull Request URL: #2412
Summary:
Updates the Matrix widget to render using MatrixPublicWidgetOptions instead of the full widget options. Adds a Storybook story showing the widget can render, is interactive, and is scorable when rendered with answerless data. Answerful data is still required for the actual scoring. Tests showing this functionality are also included.
The render section of Matrix still references
this.props.answers
, but thetransform
function takes a widgetOptions object without answers and adds in an answers array shaped after the board size. The default props are set for an empty nested array, so I think that's all good. The answers field is also what carries the user input.Issue: LEMS-2975
Test plan: