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

Expose a way to get user input from ServerItemRenderer (#1753) #1753

Merged
merged 17 commits into from
Nov 18, 2024
Merged
18 changes: 16 additions & 2 deletions packages/perseus/src/server-item-renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,24 @@ type DefaultProps = Required<
>;

type State = {
/**
* questionCompleted is used by Radio and LabelImage to change what
* it renders after a learner has checked the correctness of an answer.
* For instance LabelImage disables inputs for correct answers and marks
* incorrect answers so learners can update what they submitted.
handeyeco marked this conversation as resolved.
Show resolved Hide resolved
*/
questionCompleted: boolean;
/**
* As far as I can tell, this is used to highlight empty widgets
* after a learner has clicked the "check" button. I don't think this could
* still be used though, because the "check" button is disabled while there
* are empty widgets.
*/
questionHighlightedWidgets: ReadonlyArray<any>;
handeyeco marked this conversation as resolved.
Show resolved Hide resolved
// Keeps track of whether each asset (SvgImage or TeX) rendered by
// the questionRenderer has finished loading or rendering.
/**
* Keeps track of whether each asset (SvgImage or TeX) rendered by
* the questionRenderer has finished loading or rendering.
*/
assetStatuses: {
[assetKey: string]: boolean;
};
Expand Down