@khanacademy/perseus 41.1.1 → 41.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all-widgets.d.ts +1 -1
- package/dist/article-renderer.d.ts +2 -2
- package/dist/basic-widgets.d.ts +1 -1
- package/dist/es/index.js +1663 -397
- package/dist/es/index.js.map +1 -1
- package/dist/extra-widgets.d.ts +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1583 -316
- package/dist/index.js.map +1 -1
- package/dist/init.d.ts +1 -8
- package/dist/perseus-api.d.ts +3 -3
- package/dist/perseus-types.d.ts +7 -2
- package/dist/prompt-types.d.ts +33 -0
- package/dist/renderer.d.ts +8 -2
- package/dist/server-item-renderer.d.ts +6 -4
- package/dist/types.d.ts +4 -2
- package/dist/util/parse-perseus-json/error-tracking-parse-context.d.ts +9 -0
- package/dist/util/parse-perseus-json/general-purpose-parsers/any.d.ts +2 -0
- package/dist/util/parse-perseus-json/general-purpose-parsers/array.d.ts +2 -0
- package/dist/util/parse-perseus-json/general-purpose-parsers/array.typetest.d.ts +1 -0
- package/dist/util/parse-perseus-json/general-purpose-parsers/boolean.d.ts +2 -0
- package/dist/util/parse-perseus-json/general-purpose-parsers/compose-parsers.d.ts +2 -0
- package/dist/util/parse-perseus-json/general-purpose-parsers/constant.d.ts +4 -0
- package/dist/util/parse-perseus-json/general-purpose-parsers/defaulted.d.ts +2 -0
- package/dist/util/parse-perseus-json/general-purpose-parsers/enumeration.d.ts +2 -0
- package/dist/util/parse-perseus-json/general-purpose-parsers/enumeration.typetest.d.ts +1 -0
- package/dist/util/parse-perseus-json/general-purpose-parsers/index.d.ts +15 -0
- package/dist/util/parse-perseus-json/general-purpose-parsers/is-object.d.ts +1 -0
- package/dist/util/parse-perseus-json/general-purpose-parsers/nullable.d.ts +2 -0
- package/dist/util/parse-perseus-json/general-purpose-parsers/number.d.ts +2 -0
- package/dist/util/parse-perseus-json/general-purpose-parsers/object.d.ts +6 -0
- package/dist/util/parse-perseus-json/general-purpose-parsers/optional.d.ts +2 -0
- package/dist/util/parse-perseus-json/general-purpose-parsers/pair.d.ts +2 -0
- package/dist/util/parse-perseus-json/general-purpose-parsers/record.d.ts +2 -0
- package/dist/util/parse-perseus-json/general-purpose-parsers/string.d.ts +2 -0
- package/dist/util/parse-perseus-json/general-purpose-parsers/test-helpers.d.ts +8 -0
- package/dist/util/parse-perseus-json/general-purpose-parsers/trio.d.ts +2 -0
- package/dist/util/parse-perseus-json/general-purpose-parsers/union.d.ts +7 -0
- package/dist/util/parse-perseus-json/general-purpose-parsers/union.typetest.d.ts +1 -0
- package/dist/util/{parse-perseus-json.d.ts → parse-perseus-json/index.d.ts} +7 -1
- package/dist/util/parse-perseus-json/object-path.d.ts +2 -0
- package/dist/util/parse-perseus-json/parse-failure-detail.d.ts +2 -0
- package/dist/util/parse-perseus-json/parse.d.ts +3 -0
- package/dist/util/parse-perseus-json/parser-types.d.ts +30 -0
- package/dist/util/parse-perseus-json/perseus-parsers/categorizer-widget.d.ts +3 -0
- package/dist/util/parse-perseus-json/perseus-parsers/cs-program-widget.d.ts +3 -0
- package/dist/util/parse-perseus-json/perseus-parsers/definition-widget.d.ts +3 -0
- package/dist/util/parse-perseus-json/perseus-parsers/dropdown-widget.d.ts +3 -0
- package/dist/util/parse-perseus-json/perseus-parsers/explanation-widget.d.ts +3 -0
- package/dist/util/parse-perseus-json/perseus-parsers/expression-widget.d.ts +3 -0
- package/dist/util/parse-perseus-json/perseus-parsers/hint.d.ts +3 -0
- package/dist/util/parse-perseus-json/perseus-parsers/interactive-graph-widget.d.ts +3 -0
- package/dist/util/parse-perseus-json/perseus-parsers/perseus-image-background.d.ts +3 -0
- package/dist/util/parse-perseus-json/perseus-parsers/perseus-item.d.ts +3 -0
- package/dist/util/parse-perseus-json/perseus-parsers/perseus-renderer.d.ts +3 -0
- package/dist/util/parse-perseus-json/perseus-parsers/widget.d.ts +3 -0
- package/dist/util/parse-perseus-json/perseus-parsers/widgets-map.d.ts +3 -0
- package/dist/util/parse-perseus-json/result.d.ts +16 -0
- package/dist/validation.types.d.ts +0 -3
- package/dist/widget-ai-utils/categorizer/prompt-utils.d.ts +14 -0
- package/dist/widget-ai-utils/cs-program/prompt-utils.d.ts +2 -0
- package/dist/widget-ai-utils/definition/prompt-utils.d.ts +8 -0
- package/dist/widget-ai-utils/dropdown/prompt-utils.d.ts +13 -0
- package/dist/widget-ai-utils/explanation/prompt-utils.d.ts +8 -0
- package/dist/widget-ai-utils/expression/prompt-utils.d.ts +11 -0
- package/dist/widget-ai-utils/graded-group/prompt-utils.d.ts +7 -0
- package/dist/widget-ai-utils/graded-group-set/prompt-utils.d.ts +11 -0
- package/dist/widget-ai-utils/grapher/prompt-utils.d.ts +18 -0
- package/dist/widget-ai-utils/group/prompt-utils.d.ts +5 -0
- package/dist/widget-ai-utils/iframe/prompt-utils.d.ts +2 -0
- package/dist/widget-ai-utils/image/prompt-utils.d.ts +12 -0
- package/dist/widget-ai-utils/input-number/prompt-utils.d.ts +14 -0
- package/dist/widget-ai-utils/interaction/prompt-utils.d.ts +2 -0
- package/dist/widget-ai-utils/interactive-graph/prompt-utils.d.ts +94 -0
- package/dist/widget-ai-utils/label-image/prompt-utils.d.ts +24 -0
- package/dist/widget-ai-utils/matcher/prompt-utils.d.ts +17 -0
- package/dist/widget-ai-utils/matrix/prompt-utils.d.ts +14 -0
- package/dist/widget-ai-utils/measurer/prompt-utils.d.ts +2 -0
- package/dist/widget-ai-utils/number-line/prompt-utils.d.ts +16 -0
- package/dist/widget-ai-utils/numeric-input/prompt-utils.d.ts +11 -0
- package/dist/widget-ai-utils/orderer/prompt-utils.d.ts +13 -0
- package/dist/widget-ai-utils/passage/prompt-utils.d.ts +11 -0
- package/dist/widget-ai-utils/passage-ref/prompt-utils.d.ts +11 -0
- package/dist/widget-ai-utils/phet-simulation/prompt-utils.d.ts +2 -0
- package/dist/widget-ai-utils/plotter/prompt-utils.d.ts +2 -0
- package/dist/widget-ai-utils/python-program/prompt-utils.d.ts +2 -0
- package/dist/widget-ai-utils/radio/prompt-utils.d.ts +15 -0
- package/dist/widget-ai-utils/sorter/prompt-utils.d.ts +9 -0
- package/dist/widget-ai-utils/unsupported-widget.d.ts +11 -0
- package/dist/widget-ai-utils/video/prompt-utils.d.ts +2 -0
- package/dist/widgets/__shared__/{noop-validator.d.ts → score-noop.d.ts} +4 -4
- package/dist/widgets/categorizer/categorizer.d.ts +10 -19
- package/dist/widgets/categorizer/{categorizer-validator.d.ts → score-categorizer.d.ts} +2 -2
- package/dist/widgets/cs-program/cs-program.d.ts +8 -19
- package/dist/widgets/cs-program/{cs-program-validator.d.ts → score-cs-program.d.ts} +2 -1
- package/dist/widgets/definition/definition.d.ts +8 -19
- package/dist/widgets/deprecated-standin/deprecated-standin.d.ts +4 -19
- package/dist/widgets/dropdown/dropdown.d.ts +10 -19
- package/dist/widgets/dropdown/score-dropdown.d.ts +4 -0
- package/dist/widgets/explanation/explanation.d.ts +9 -19
- package/dist/widgets/expression/expression.d.ts +26 -290
- package/dist/widgets/expression/{expression-validator.d.ts → score-expression.d.ts} +2 -2
- package/dist/widgets/graded-group/graded-group.d.ts +13 -21
- package/dist/widgets/graded-group-set/graded-group-set.d.ts +9 -20
- package/dist/widgets/grapher/grapher.d.ts +9 -19
- package/dist/widgets/grapher/score-grapher.d.ts +4 -0
- package/dist/widgets/group/group.d.ts +7 -19
- package/dist/widgets/iframe/iframe.d.ts +7 -19
- package/dist/widgets/iframe/{iframe-validator.d.ts → score-iframe.d.ts} +1 -1
- package/dist/widgets/image/image.d.ts +9 -19
- package/dist/widgets/input-number/input-number.d.ts +11 -19
- package/dist/widgets/input-number/{input-number-validator.d.ts → score-input-number.d.ts} +2 -2
- package/dist/widgets/interaction/interaction.d.ts +7 -19
- package/dist/widgets/interactive-graph.d.ts +8 -19
- package/dist/widgets/interactive-graphs/score-interactive-graph.d.ts +4 -0
- package/dist/widgets/interactive-graphs/utils.d.ts +6 -0
- package/dist/widgets/label-image/label-image.d.ts +10 -86
- package/dist/widgets/label-image/{label-image-validator.d.ts → score-label-image.d.ts} +2 -2
- package/dist/widgets/matcher/matcher.d.ts +7 -19
- package/dist/widgets/matcher/score-matcher.d.ts +4 -0
- package/dist/widgets/matrix/matrix.d.ts +10 -19
- package/dist/widgets/matrix/{matrix-validator.d.ts → score-matrix.d.ts} +2 -2
- package/dist/widgets/measurer/measurer.d.ts +13 -19
- package/dist/widgets/molecule/molecule.d.ts +4 -19
- package/dist/widgets/number-line/number-line.d.ts +8 -19
- package/dist/widgets/number-line/score-number-line.d.ts +4 -0
- package/dist/widgets/numeric-input/numeric-input.d.ts +22 -19
- package/dist/widgets/numeric-input/{numeric-input-validator.d.ts → score-numeric-input.d.ts} +2 -2
- package/dist/widgets/orderer/orderer.d.ts +8 -19
- package/dist/widgets/orderer/{orderer-validator.d.ts → score-orderer.d.ts} +1 -1
- package/dist/widgets/passage/passage.d.ts +8 -19
- package/dist/widgets/passage-ref/passage-ref.d.ts +12 -19
- package/dist/widgets/passage-ref-target/passage-ref-target.d.ts +11 -19
- package/dist/widgets/phet-simulation/phet-simulation.d.ts +5 -19
- package/dist/widgets/plotter/plotter.d.ts +8 -19
- package/dist/widgets/plotter/score-plotter.d.ts +4 -0
- package/dist/widgets/python-program/python-program.d.ts +4 -19
- package/dist/widgets/radio/radio-component.d.ts +3 -1
- package/dist/widgets/radio/radio.d.ts +18 -19
- package/dist/widgets/radio/{radio-validator.d.ts → score-radio.d.ts} +2 -2
- package/dist/widgets/sorter/score-sorter.d.ts +4 -0
- package/dist/widgets/sorter/sorter.d.ts +7 -19
- package/dist/widgets/table/{table-validator.d.ts → score-table.d.ts} +2 -2
- package/dist/widgets/table/table.d.ts +8 -19
- package/dist/widgets/video/video.d.ts +7 -19
- package/dist/widgets.d.ts +2 -2
- package/package.json +4 -4
- package/dist/widgets/dropdown/dropdown-validator.d.ts +0 -4
- package/dist/widgets/grapher/grapher-validator.d.ts +0 -4
- package/dist/widgets/interactive-graphs/interactive-graph-validator.d.ts +0 -4
- package/dist/widgets/matcher/matcher-validator.d.ts +0 -4
- package/dist/widgets/number-line/number-line-validator.d.ts +0 -4
- package/dist/widgets/plotter/plotter-validator.d.ts +0 -4
- package/dist/widgets/sorter/sorter-validator.d.ts +0 -4
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
3
|
+
import scoreExpression from "./score-expression";
|
|
3
4
|
import type { DependenciesContext } from "../../dependencies";
|
|
4
5
|
import type { PerseusExpressionWidgetOptions } from "../../perseus-types";
|
|
5
6
|
import type { FocusPath, Widget, WidgetProps } from "../../types";
|
|
6
7
|
import type { PerseusExpressionRubric, PerseusExpressionUserInput } from "../../validation.types";
|
|
8
|
+
import type { ExpressionPromptJSON } from "../../widget-ai-utils/expression/prompt-utils";
|
|
7
9
|
import type { Keys as Key, KeypadConfiguration } from "@khanacademy/math-input";
|
|
8
10
|
type InputPath = ReadonlyArray<string>;
|
|
9
11
|
type RenderProps = {
|
|
@@ -60,6 +62,7 @@ export declare class Expression extends React.Component<Props, ExpressionState>
|
|
|
60
62
|
componentWillUnmount: () => void;
|
|
61
63
|
_handleMouseDown: () => void;
|
|
62
64
|
getUserInput(): PerseusExpressionUserInput;
|
|
65
|
+
getPromptJSON(): ExpressionPromptJSON;
|
|
63
66
|
change: (...args: any) => any | undefined;
|
|
64
67
|
parse: (value: string, props: Props) => any;
|
|
65
68
|
changeAndTrack: (e: any, cb: () => void) => void;
|
|
@@ -85,10 +88,12 @@ export declare class Expression extends React.Component<Props, ExpressionState>
|
|
|
85
88
|
* forms.
|
|
86
89
|
*/
|
|
87
90
|
declare const keypadConfigurationForProps: (widgetOptions: PerseusExpressionWidgetOptions) => KeypadConfiguration;
|
|
88
|
-
declare const _default:
|
|
91
|
+
declare const _default: {
|
|
89
92
|
name: string;
|
|
90
93
|
displayName: string;
|
|
91
|
-
|
|
94
|
+
accessible: true;
|
|
95
|
+
defaultAlignment: "inline-block";
|
|
96
|
+
widget: React.ForwardRefExoticComponent<Omit<Pick<RenderProps & {
|
|
92
97
|
widgetId: string;
|
|
93
98
|
alignment: string | null | undefined;
|
|
94
99
|
static: boolean | null | undefined;
|
|
@@ -133,277 +138,13 @@ declare const _default: Readonly<{
|
|
|
133
138
|
circle?: boolean | undefined;
|
|
134
139
|
polygon?: boolean | undefined;
|
|
135
140
|
point?: boolean | undefined;
|
|
136
|
-
angle?: boolean | undefined;
|
|
137
|
-
segment?: boolean | undefined;
|
|
138
|
-
"linear-system"?: boolean | undefined;
|
|
139
|
-
ray?: boolean | undefined;
|
|
140
|
-
"unlimited-polygon"?: boolean | undefined;
|
|
141
|
-
quadratic?: boolean | undefined;
|
|
142
|
-
sinusoid?: boolean | undefined;
|
|
143
|
-
"unlimited-point"?: boolean | undefined;
|
|
144
|
-
} & {
|
|
145
|
-
"interactive-graph-locked-features-labels"?: boolean | undefined;
|
|
146
|
-
"locked-figures-aria"?: boolean | undefined;
|
|
147
|
-
"locked-point-labels"?: boolean | undefined;
|
|
148
|
-
"locked-line-labels"?: boolean | undefined;
|
|
149
|
-
"locked-vector-labels"?: boolean | undefined;
|
|
150
|
-
"locked-ellipse-labels"?: boolean | undefined;
|
|
151
|
-
"locked-polygon-labels"?: boolean | undefined;
|
|
152
|
-
"locked-function-labels"?: boolean | undefined;
|
|
153
|
-
}) | undefined;
|
|
154
|
-
} | undefined;
|
|
155
|
-
onWidgetStartProps?: ((widgets: import("../../perseus-types").PerseusWidgetsMap) => void) | undefined;
|
|
156
|
-
}> & {
|
|
157
|
-
GroupMetadataEditor: NonNullable<React.ComponentType<any> | undefined>;
|
|
158
|
-
baseElements: {
|
|
159
|
-
Link: React.ComponentType<any>;
|
|
160
|
-
};
|
|
161
|
-
canScrollPage: NonNullable<boolean | undefined>;
|
|
162
|
-
crossOutEnabled: NonNullable<boolean | undefined>;
|
|
163
|
-
editorChangeDelay: number;
|
|
164
|
-
groupAnnotator: (groupNumber: number, widgetId: string) => React.ReactNode;
|
|
165
|
-
isArticle: NonNullable<boolean | undefined>;
|
|
166
|
-
isMobile: NonNullable<boolean | undefined>;
|
|
167
|
-
onFocusChange: (newFocusPath: FocusPath, oldFocusPath: FocusPath, keypadHeight?: number | undefined, focusedElement?: HTMLElement | undefined) => unknown;
|
|
168
|
-
readOnly: NonNullable<boolean | undefined>;
|
|
169
|
-
setDrawingAreaAvailable: (arg1: boolean) => unknown;
|
|
170
|
-
showAlignmentOptions: NonNullable<boolean | undefined>;
|
|
171
|
-
}>;
|
|
172
|
-
keypadElement?: any;
|
|
173
|
-
questionCompleted?: boolean | undefined;
|
|
174
|
-
onFocus: (blurPath: FocusPath) => void;
|
|
175
|
-
onBlur: (blurPath: FocusPath) => void;
|
|
176
|
-
findWidgets: (criterion: import("../../types").FilterCriterion) => readonly Widget[];
|
|
177
|
-
reviewModeRubric?: PerseusExpressionRubric | null | undefined;
|
|
178
|
-
reviewMode: boolean;
|
|
179
|
-
onChange: import("../../types").ChangeHandler;
|
|
180
|
-
trackInteraction: (extraData?: Empty | undefined) => void;
|
|
181
|
-
isLastUsedWidget: boolean;
|
|
182
|
-
linterContext: import("@khanacademy/perseus-linter").LinterContextProps;
|
|
183
|
-
containerSizeClass: import("../../util/sizing-utils").SizeClass;
|
|
184
|
-
} & Partial<import("../../types").PerseusDependenciesV2> & {
|
|
185
|
-
apiOptions: Readonly<Readonly<{
|
|
186
|
-
isArticle?: boolean | undefined;
|
|
187
|
-
onFocusChange?: ((newFocusPath: FocusPath, oldFocusPath: FocusPath, keypadHeight?: number | undefined, focusedElement?: HTMLElement | undefined) => unknown) | undefined;
|
|
188
|
-
GroupMetadataEditor?: React.ComponentType<any> | undefined;
|
|
189
|
-
showAlignmentOptions?: boolean | undefined;
|
|
190
|
-
readOnly?: boolean | undefined;
|
|
191
|
-
answerableCallback?: ((arg1: boolean) => unknown) | undefined;
|
|
192
|
-
getAnotherHint?: (() => unknown) | undefined;
|
|
193
|
-
interactionCallback?: ((widgetData: {
|
|
194
|
-
[widgetId: string]: any;
|
|
195
|
-
}) => void) | undefined;
|
|
196
|
-
groupAnnotator?: ((groupNumber: number, widgetId: string) => React.ReactNode) | undefined;
|
|
197
|
-
imagePlaceholder?: React.ReactNode;
|
|
198
|
-
widgetPlaceholder?: React.ReactNode;
|
|
199
|
-
baseElements?: {
|
|
200
|
-
Link: React.ComponentType<any>;
|
|
201
|
-
} | undefined;
|
|
202
|
-
imagePreloader?: ((dimensions: import("../../types").Dimensions) => React.ReactNode) | undefined;
|
|
203
|
-
trackInteraction?: ((args: {
|
|
204
|
-
type: string;
|
|
205
|
-
id: string;
|
|
206
|
-
correct?: boolean | undefined;
|
|
207
|
-
} & Partial<import("../../types").TrackingGradedGroupExtraArguments> & Partial<{
|
|
208
|
-
visible: number;
|
|
209
|
-
}>) => void) | undefined;
|
|
210
|
-
customKeypad?: boolean | undefined;
|
|
211
|
-
nativeKeypadProxy?: ((blur: () => void) => import("@khanacademy/math-input").KeypadAPI) | undefined;
|
|
212
|
-
isMobile?: boolean | undefined;
|
|
213
|
-
setDrawingAreaAvailable?: ((arg1: boolean) => unknown) | undefined;
|
|
214
|
-
hintProgressColor?: string | undefined;
|
|
215
|
-
canScrollPage?: boolean | undefined;
|
|
216
|
-
crossOutEnabled?: boolean | undefined;
|
|
217
|
-
editorChangeDelay?: number | undefined;
|
|
218
|
-
flags?: {
|
|
219
|
-
mafs?: false | ({
|
|
220
|
-
none?: boolean | undefined;
|
|
221
|
-
linear?: boolean | undefined;
|
|
222
|
-
circle?: boolean | undefined;
|
|
223
|
-
polygon?: boolean | undefined;
|
|
224
|
-
point?: boolean | undefined;
|
|
225
|
-
angle?: boolean | undefined;
|
|
226
|
-
segment?: boolean | undefined;
|
|
227
|
-
"linear-system"?: boolean | undefined;
|
|
228
|
-
ray?: boolean | undefined;
|
|
229
|
-
"unlimited-polygon"?: boolean | undefined;
|
|
230
141
|
quadratic?: boolean | undefined;
|
|
231
142
|
sinusoid?: boolean | undefined;
|
|
232
|
-
"unlimited-point"?: boolean | undefined;
|
|
233
|
-
} & {
|
|
234
|
-
"interactive-graph-locked-features-labels"?: boolean | undefined;
|
|
235
|
-
"locked-figures-aria"?: boolean | undefined;
|
|
236
|
-
"locked-point-labels"?: boolean | undefined;
|
|
237
|
-
"locked-line-labels"?: boolean | undefined;
|
|
238
|
-
"locked-vector-labels"?: boolean | undefined;
|
|
239
|
-
"locked-ellipse-labels"?: boolean | undefined;
|
|
240
|
-
"locked-polygon-labels"?: boolean | undefined;
|
|
241
|
-
"locked-function-labels"?: boolean | undefined;
|
|
242
|
-
}) | undefined;
|
|
243
|
-
} | undefined;
|
|
244
|
-
onWidgetStartProps?: ((widgets: import("../../perseus-types").PerseusWidgetsMap) => void) | undefined;
|
|
245
|
-
}> & {
|
|
246
|
-
GroupMetadataEditor: NonNullable<React.ComponentType<any> | undefined>;
|
|
247
|
-
baseElements: {
|
|
248
|
-
Link: React.ComponentType<any>;
|
|
249
|
-
};
|
|
250
|
-
canScrollPage: NonNullable<boolean | undefined>;
|
|
251
|
-
crossOutEnabled: NonNullable<boolean | undefined>;
|
|
252
|
-
editorChangeDelay: number;
|
|
253
|
-
groupAnnotator: (groupNumber: number, widgetId: string) => React.ReactNode;
|
|
254
|
-
isArticle: NonNullable<boolean | undefined>;
|
|
255
|
-
isMobile: NonNullable<boolean | undefined>;
|
|
256
|
-
onFocusChange: (newFocusPath: FocusPath, oldFocusPath: FocusPath, keypadHeight?: number | undefined, focusedElement?: HTMLElement | undefined) => unknown;
|
|
257
|
-
readOnly: NonNullable<boolean | undefined>;
|
|
258
|
-
setDrawingAreaAvailable: (arg1: boolean) => unknown;
|
|
259
|
-
showAlignmentOptions: NonNullable<boolean | undefined>;
|
|
260
|
-
}>;
|
|
261
|
-
buttonSets: import("../../perseus-types").LegacyButtonSets;
|
|
262
|
-
functions: readonly string[];
|
|
263
|
-
linterContext: import("@khanacademy/perseus-linter").LinterContextProps;
|
|
264
|
-
onBlur: (blurPath: FocusPath) => void;
|
|
265
|
-
onFocus: (blurPath: FocusPath) => void;
|
|
266
|
-
times: boolean;
|
|
267
|
-
visibleLabel: string | undefined;
|
|
268
|
-
ariaLabel: string | undefined;
|
|
269
|
-
value: string;
|
|
270
|
-
}, "ariaLabel" | "static" | "onChange" | "keypadElement" | "containerSizeClass" | "widgetId" | "problemNum" | "questionCompleted" | "findWidgets" | "trackInteraction" | "reviewMode" | keyof import("../../types").PerseusDependenciesV2 | "alignment" | "buttonsVisible" | "visibleLabel" | "keypadConfiguration" | "reviewModeRubric" | "isLastUsedWidget"> & {
|
|
271
|
-
value?: string | undefined;
|
|
272
|
-
onFocus?: ((blurPath: FocusPath) => void) | undefined;
|
|
273
|
-
onBlur?: ((blurPath: FocusPath) => void) | undefined;
|
|
274
|
-
apiOptions?: Readonly<Readonly<{
|
|
275
|
-
isArticle?: boolean | undefined;
|
|
276
|
-
onFocusChange?: ((newFocusPath: FocusPath, oldFocusPath: FocusPath, keypadHeight?: number | undefined, focusedElement?: HTMLElement | undefined) => unknown) | undefined;
|
|
277
|
-
GroupMetadataEditor?: React.ComponentType<any> | undefined;
|
|
278
|
-
showAlignmentOptions?: boolean | undefined;
|
|
279
|
-
readOnly?: boolean | undefined;
|
|
280
|
-
answerableCallback?: ((arg1: boolean) => unknown) | undefined;
|
|
281
|
-
getAnotherHint?: (() => unknown) | undefined;
|
|
282
|
-
interactionCallback?: ((widgetData: {
|
|
283
|
-
[widgetId: string]: any;
|
|
284
|
-
}) => void) | undefined;
|
|
285
|
-
groupAnnotator?: ((groupNumber: number, widgetId: string) => React.ReactNode) | undefined;
|
|
286
|
-
imagePlaceholder?: React.ReactNode;
|
|
287
|
-
widgetPlaceholder?: React.ReactNode;
|
|
288
|
-
baseElements?: {
|
|
289
|
-
Link: React.ComponentType<any>;
|
|
290
|
-
} | undefined;
|
|
291
|
-
imagePreloader?: ((dimensions: import("../../types").Dimensions) => React.ReactNode) | undefined;
|
|
292
|
-
trackInteraction?: ((args: {
|
|
293
|
-
type: string;
|
|
294
|
-
id: string;
|
|
295
|
-
correct?: boolean | undefined;
|
|
296
|
-
} & Partial<import("../../types").TrackingGradedGroupExtraArguments> & Partial<{
|
|
297
|
-
visible: number;
|
|
298
|
-
}>) => void) | undefined;
|
|
299
|
-
customKeypad?: boolean | undefined;
|
|
300
|
-
nativeKeypadProxy?: ((blur: () => void) => import("@khanacademy/math-input").KeypadAPI) | undefined;
|
|
301
|
-
isMobile?: boolean | undefined;
|
|
302
|
-
setDrawingAreaAvailable?: ((arg1: boolean) => unknown) | undefined;
|
|
303
|
-
hintProgressColor?: string | undefined;
|
|
304
|
-
canScrollPage?: boolean | undefined;
|
|
305
|
-
crossOutEnabled?: boolean | undefined;
|
|
306
|
-
editorChangeDelay?: number | undefined;
|
|
307
|
-
flags?: {
|
|
308
|
-
mafs?: false | ({
|
|
309
|
-
none?: boolean | undefined;
|
|
310
|
-
linear?: boolean | undefined;
|
|
311
|
-
circle?: boolean | undefined;
|
|
312
|
-
polygon?: boolean | undefined;
|
|
313
|
-
point?: boolean | undefined;
|
|
314
143
|
angle?: boolean | undefined;
|
|
315
|
-
segment?: boolean | undefined;
|
|
316
144
|
"linear-system"?: boolean | undefined;
|
|
317
145
|
ray?: boolean | undefined;
|
|
318
|
-
"unlimited-polygon"?: boolean | undefined;
|
|
319
|
-
quadratic?: boolean | undefined;
|
|
320
|
-
sinusoid?: boolean | undefined;
|
|
321
|
-
"unlimited-point"?: boolean | undefined;
|
|
322
|
-
} & {
|
|
323
|
-
"interactive-graph-locked-features-labels"?: boolean | undefined;
|
|
324
|
-
"locked-figures-aria"?: boolean | undefined;
|
|
325
|
-
"locked-point-labels"?: boolean | undefined;
|
|
326
|
-
"locked-line-labels"?: boolean | undefined;
|
|
327
|
-
"locked-vector-labels"?: boolean | undefined;
|
|
328
|
-
"locked-ellipse-labels"?: boolean | undefined;
|
|
329
|
-
"locked-polygon-labels"?: boolean | undefined;
|
|
330
|
-
"locked-function-labels"?: boolean | undefined;
|
|
331
|
-
}) | undefined;
|
|
332
|
-
} | undefined;
|
|
333
|
-
onWidgetStartProps?: ((widgets: import("../../perseus-types").PerseusWidgetsMap) => void) | undefined;
|
|
334
|
-
}> & {
|
|
335
|
-
GroupMetadataEditor: NonNullable<React.ComponentType<any> | undefined>;
|
|
336
|
-
baseElements: {
|
|
337
|
-
Link: React.ComponentType<any>;
|
|
338
|
-
};
|
|
339
|
-
canScrollPage: NonNullable<boolean | undefined>;
|
|
340
|
-
crossOutEnabled: NonNullable<boolean | undefined>;
|
|
341
|
-
editorChangeDelay: number;
|
|
342
|
-
groupAnnotator: (groupNumber: number, widgetId: string) => React.ReactNode;
|
|
343
|
-
isArticle: NonNullable<boolean | undefined>;
|
|
344
|
-
isMobile: NonNullable<boolean | undefined>;
|
|
345
|
-
onFocusChange: (newFocusPath: FocusPath, oldFocusPath: FocusPath, keypadHeight?: number | undefined, focusedElement?: HTMLElement | undefined) => unknown;
|
|
346
|
-
readOnly: NonNullable<boolean | undefined>;
|
|
347
|
-
setDrawingAreaAvailable: (arg1: boolean) => unknown;
|
|
348
|
-
showAlignmentOptions: NonNullable<boolean | undefined>;
|
|
349
|
-
}> | undefined;
|
|
350
|
-
linterContext?: import("@khanacademy/perseus-linter").LinterContextProps | undefined;
|
|
351
|
-
buttonSets?: import("../../perseus-types").LegacyButtonSets | undefined;
|
|
352
|
-
functions?: readonly string[] | undefined;
|
|
353
|
-
times?: boolean | undefined;
|
|
354
|
-
} & {}, keyof import("../../types").PerseusDependenciesV2> & React.RefAttributes<Expression>>) | undefined;
|
|
355
|
-
widget: React.ForwardRefExoticComponent<Omit<Pick<RenderProps & {
|
|
356
|
-
widgetId: string;
|
|
357
|
-
alignment: string | null | undefined;
|
|
358
|
-
static: boolean | null | undefined;
|
|
359
|
-
problemNum: number | null | undefined;
|
|
360
|
-
apiOptions: Readonly<Readonly<{
|
|
361
|
-
isArticle?: boolean | undefined;
|
|
362
|
-
onFocusChange?: ((newFocusPath: FocusPath, oldFocusPath: FocusPath, keypadHeight?: number | undefined, focusedElement?: HTMLElement | undefined) => unknown) | undefined;
|
|
363
|
-
GroupMetadataEditor?: React.ComponentType<any> | undefined;
|
|
364
|
-
showAlignmentOptions?: boolean | undefined;
|
|
365
|
-
readOnly?: boolean | undefined;
|
|
366
|
-
answerableCallback?: ((arg1: boolean) => unknown) | undefined;
|
|
367
|
-
getAnotherHint?: (() => unknown) | undefined;
|
|
368
|
-
interactionCallback?: ((widgetData: {
|
|
369
|
-
[widgetId: string]: any;
|
|
370
|
-
}) => void) | undefined;
|
|
371
|
-
groupAnnotator?: ((groupNumber: number, widgetId: string) => React.ReactNode) | undefined;
|
|
372
|
-
imagePlaceholder?: React.ReactNode;
|
|
373
|
-
widgetPlaceholder?: React.ReactNode;
|
|
374
|
-
baseElements?: {
|
|
375
|
-
Link: React.ComponentType<any>;
|
|
376
|
-
} | undefined;
|
|
377
|
-
imagePreloader?: ((dimensions: import("../../types").Dimensions) => React.ReactNode) | undefined;
|
|
378
|
-
trackInteraction?: ((args: {
|
|
379
|
-
type: string;
|
|
380
|
-
id: string;
|
|
381
|
-
correct?: boolean | undefined;
|
|
382
|
-
} & Partial<import("../../types").TrackingGradedGroupExtraArguments> & Partial<{
|
|
383
|
-
visible: number;
|
|
384
|
-
}>) => void) | undefined;
|
|
385
|
-
customKeypad?: boolean | undefined;
|
|
386
|
-
nativeKeypadProxy?: ((blur: () => void) => import("@khanacademy/math-input").KeypadAPI) | undefined;
|
|
387
|
-
isMobile?: boolean | undefined;
|
|
388
|
-
setDrawingAreaAvailable?: ((arg1: boolean) => unknown) | undefined;
|
|
389
|
-
hintProgressColor?: string | undefined;
|
|
390
|
-
canScrollPage?: boolean | undefined;
|
|
391
|
-
crossOutEnabled?: boolean | undefined;
|
|
392
|
-
editorChangeDelay?: number | undefined;
|
|
393
|
-
flags?: {
|
|
394
|
-
mafs?: false | ({
|
|
395
|
-
none?: boolean | undefined;
|
|
396
|
-
linear?: boolean | undefined;
|
|
397
|
-
circle?: boolean | undefined;
|
|
398
|
-
polygon?: boolean | undefined;
|
|
399
|
-
point?: boolean | undefined;
|
|
400
|
-
angle?: boolean | undefined;
|
|
401
146
|
segment?: boolean | undefined;
|
|
402
|
-
"linear-system"?: boolean | undefined;
|
|
403
|
-
ray?: boolean | undefined;
|
|
404
147
|
"unlimited-polygon"?: boolean | undefined;
|
|
405
|
-
quadratic?: boolean | undefined;
|
|
406
|
-
sinusoid?: boolean | undefined;
|
|
407
148
|
"unlimited-point"?: boolean | undefined;
|
|
408
149
|
} & {
|
|
409
150
|
"interactive-graph-locked-features-labels"?: boolean | undefined;
|
|
@@ -486,13 +227,13 @@ declare const _default: Readonly<{
|
|
|
486
227
|
circle?: boolean | undefined;
|
|
487
228
|
polygon?: boolean | undefined;
|
|
488
229
|
point?: boolean | undefined;
|
|
230
|
+
quadratic?: boolean | undefined;
|
|
231
|
+
sinusoid?: boolean | undefined;
|
|
489
232
|
angle?: boolean | undefined;
|
|
490
|
-
segment?: boolean | undefined;
|
|
491
233
|
"linear-system"?: boolean | undefined;
|
|
492
234
|
ray?: boolean | undefined;
|
|
235
|
+
segment?: boolean | undefined;
|
|
493
236
|
"unlimited-polygon"?: boolean | undefined;
|
|
494
|
-
quadratic?: boolean | undefined;
|
|
495
|
-
sinusoid?: boolean | undefined;
|
|
496
237
|
"unlimited-point"?: boolean | undefined;
|
|
497
238
|
} & {
|
|
498
239
|
"interactive-graph-locked-features-labels"?: boolean | undefined;
|
|
@@ -531,7 +272,7 @@ declare const _default: Readonly<{
|
|
|
531
272
|
visibleLabel: string | undefined;
|
|
532
273
|
ariaLabel: string | undefined;
|
|
533
274
|
value: string;
|
|
534
|
-
}, "ariaLabel" | "static" | "onChange" | "keypadElement" | "containerSizeClass" | "widgetId" | "problemNum" | "questionCompleted" | "findWidgets" | "trackInteraction" | "reviewMode" | keyof import("../../types").PerseusDependenciesV2 | "alignment" | "
|
|
275
|
+
}, "ariaLabel" | "static" | "onChange" | "keypadElement" | "containerSizeClass" | "widgetId" | "problemNum" | "questionCompleted" | "findWidgets" | "trackInteraction" | "reviewMode" | keyof import("../../types").PerseusDependenciesV2 | "alignment" | "reviewModeRubric" | "isLastUsedWidget" | "buttonsVisible" | "visibleLabel" | "keypadConfiguration"> & {
|
|
535
276
|
value?: string | undefined;
|
|
536
277
|
onFocus?: ((blurPath: FocusPath) => void) | undefined;
|
|
537
278
|
onBlur?: ((blurPath: FocusPath) => void) | undefined;
|
|
@@ -575,13 +316,13 @@ declare const _default: Readonly<{
|
|
|
575
316
|
circle?: boolean | undefined;
|
|
576
317
|
polygon?: boolean | undefined;
|
|
577
318
|
point?: boolean | undefined;
|
|
319
|
+
quadratic?: boolean | undefined;
|
|
320
|
+
sinusoid?: boolean | undefined;
|
|
578
321
|
angle?: boolean | undefined;
|
|
579
|
-
segment?: boolean | undefined;
|
|
580
322
|
"linear-system"?: boolean | undefined;
|
|
581
323
|
ray?: boolean | undefined;
|
|
324
|
+
segment?: boolean | undefined;
|
|
582
325
|
"unlimited-polygon"?: boolean | undefined;
|
|
583
|
-
quadratic?: boolean | undefined;
|
|
584
|
-
sinusoid?: boolean | undefined;
|
|
585
326
|
"unlimited-point"?: boolean | undefined;
|
|
586
327
|
} & {
|
|
587
328
|
"interactive-graph-locked-features-labels"?: boolean | undefined;
|
|
@@ -616,21 +357,16 @@ declare const _default: Readonly<{
|
|
|
616
357
|
functions?: readonly string[] | undefined;
|
|
617
358
|
times?: boolean | undefined;
|
|
618
359
|
} & {}, keyof import("../../types").PerseusDependenciesV2> & React.RefAttributes<Expression>>;
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
getOneCorrectAnswerFromRubric?: ((rubric: import("../../validation.types").Rubric) => string | null | undefined) | undefined;
|
|
632
|
-
propUpgrades?: {
|
|
633
|
-
[key: string]: (arg1: any) => any;
|
|
634
|
-
} | undefined;
|
|
635
|
-
}>;
|
|
360
|
+
transform: (widgetOptions: PerseusExpressionWidgetOptions) => RenderProps;
|
|
361
|
+
version: {
|
|
362
|
+
major: number;
|
|
363
|
+
minor: number;
|
|
364
|
+
};
|
|
365
|
+
propUpgrades: {
|
|
366
|
+
readonly "1": (v0props: any) => PerseusExpressionWidgetOptions;
|
|
367
|
+
};
|
|
368
|
+
isLintable: true;
|
|
369
|
+
scorer: typeof scoreExpression;
|
|
370
|
+
getOneCorrectAnswerFromRubric(rubric: PerseusExpressionRubric): string | null | undefined;
|
|
371
|
+
};
|
|
636
372
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PerseusStrings } from "../../strings";
|
|
2
2
|
import type { PerseusScore } from "../../types";
|
|
3
3
|
import type { PerseusExpressionRubric, PerseusExpressionUserInput } from "../../validation.types";
|
|
4
|
-
declare function
|
|
5
|
-
export default
|
|
4
|
+
declare function scoreExpression(userInput: PerseusExpressionUserInput, rubric: PerseusExpressionRubric, strings: PerseusStrings, locale: string): PerseusScore;
|
|
5
|
+
export default scoreExpression;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
3
|
+
import Renderer from "../../renderer";
|
|
3
4
|
import type { ANSWER_BAR_STATES } from "./graded-group-answer-bar";
|
|
4
5
|
import type { PerseusGradedGroupWidgetOptions } from "../../perseus-types";
|
|
5
|
-
import type { TrackingGradedGroupExtraArguments, Widget, WidgetProps } from "../../types";
|
|
6
|
+
import type { FocusPath, TrackingGradedGroupExtraArguments, Widget, WidgetProps } from "../../types";
|
|
6
7
|
import type { PerseusGradedGroupRubric } from "../../validation.types";
|
|
8
|
+
import type { GradedGroupPromptJSON } from "../../widget-ai-utils/graded-group/prompt-utils";
|
|
7
9
|
declare const GRADING_STATUSES: {
|
|
8
10
|
readonly ungraded: "ungraded";
|
|
9
11
|
readonly correct: "correct";
|
|
@@ -38,37 +40,27 @@ export declare class GradedGroup extends React.Component<Props, State> implement
|
|
|
38
40
|
context: React.ContextType<typeof PerseusI18nContext>;
|
|
39
41
|
static defaultProps: DefaultProps;
|
|
40
42
|
state: State;
|
|
43
|
+
rendererRef: React.RefObject<Renderer>;
|
|
44
|
+
hintRendererRef: React.RefObject<Renderer>;
|
|
41
45
|
shouldComponentUpdate(nextProps: Props, nextState: State): boolean;
|
|
42
46
|
change: (...args: ReadonlyArray<unknown>) => any;
|
|
43
47
|
_onInteractWithWidget: (arg1: string) => void;
|
|
44
48
|
_checkAnswer: () => void;
|
|
45
|
-
getInputPaths: () => ReadonlyArray<
|
|
49
|
+
getInputPaths: () => ReadonlyArray<FocusPath>;
|
|
50
|
+
getPromptJSON(): GradedGroupPromptJSON;
|
|
46
51
|
setInputValue: (arg1: any, arg2: any, arg3: any) => any;
|
|
47
52
|
focus: () => boolean;
|
|
48
53
|
focusInputPath: (arg1: any) => void;
|
|
49
54
|
blurInputPath: (arg1: any) => void;
|
|
50
55
|
render(): React.ReactNode;
|
|
51
56
|
}
|
|
52
|
-
declare const _default:
|
|
57
|
+
declare const _default: {
|
|
53
58
|
name: string;
|
|
54
59
|
displayName: string;
|
|
55
|
-
getWidget?: (() => typeof GradedGroup) | undefined;
|
|
56
60
|
widget: typeof GradedGroup;
|
|
57
|
-
|
|
58
|
-
hidden
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
getDefaultAlignment?: (() => import("../../types").Alignment) | undefined;
|
|
63
|
-
isLintable?: boolean | undefined;
|
|
64
|
-
tracking?: import("../../types").Tracking | undefined;
|
|
65
|
-
traverseChildWidgets?: any;
|
|
66
|
-
transform?: import("../../types").WidgetTransform | undefined;
|
|
67
|
-
staticTransform?: import("../../types").WidgetTransform | undefined;
|
|
68
|
-
validator?: import("../../types").WidgetValidatorFunction | undefined;
|
|
69
|
-
getOneCorrectAnswerFromRubric?: ((rubric: import("../../validation.types").Rubric) => string | null | undefined) | undefined;
|
|
70
|
-
propUpgrades?: {
|
|
71
|
-
[key: string]: (arg1: any) => any;
|
|
72
|
-
} | undefined;
|
|
73
|
-
}>;
|
|
61
|
+
traverseChildWidgets: (arg1: any, arg2: any) => any;
|
|
62
|
+
hidden: false;
|
|
63
|
+
tracking: "all";
|
|
64
|
+
isLintable: true;
|
|
65
|
+
};
|
|
74
66
|
export default _default;
|
|
@@ -4,6 +4,7 @@ import { GradedGroup } from "../graded-group/graded-group";
|
|
|
4
4
|
import type { PerseusGradedGroupSetWidgetOptions } from "../../perseus-types";
|
|
5
5
|
import type { FocusPath, Widget, WidgetProps } from "../../types";
|
|
6
6
|
import type { PerseusGradedGroupSetRubric } from "../../validation.types";
|
|
7
|
+
import type { GradedGroupSetPromptJSON } from "../../widget-ai-utils/graded-group-set/prompt-utils";
|
|
7
8
|
type RenderProps = PerseusGradedGroupSetWidgetOptions;
|
|
8
9
|
type Props = Changeable.ChangeableProps & WidgetProps<RenderProps, PerseusGradedGroupSetRubric> & {
|
|
9
10
|
trackInteraction: () => void;
|
|
@@ -21,7 +22,8 @@ declare class GradedGroupSet extends React.Component<Props, State> implements Wi
|
|
|
21
22
|
state: State;
|
|
22
23
|
shouldComponentUpdate(nextProps: Props, nextState: State): boolean;
|
|
23
24
|
change: (...args: ReadonlyArray<unknown>) => any;
|
|
24
|
-
getInputPaths: () => ReadonlyArray<
|
|
25
|
+
getInputPaths: () => ReadonlyArray<FocusPath>;
|
|
26
|
+
getPromptJSON(): GradedGroupSetPromptJSON;
|
|
25
27
|
setInputValue: (arg1: FocusPath, arg2: any, arg3: any) => any;
|
|
26
28
|
focus: () => boolean;
|
|
27
29
|
focusInputPath: (arg1: FocusPath) => void;
|
|
@@ -29,26 +31,13 @@ declare class GradedGroupSet extends React.Component<Props, State> implements Wi
|
|
|
29
31
|
handleNextQuestion: () => void;
|
|
30
32
|
render(): React.ReactNode;
|
|
31
33
|
}
|
|
32
|
-
declare const _default:
|
|
34
|
+
declare const _default: {
|
|
33
35
|
name: string;
|
|
34
36
|
displayName: string;
|
|
35
|
-
getWidget?: (() => typeof GradedGroupSet) | undefined;
|
|
36
37
|
widget: typeof GradedGroupSet;
|
|
37
|
-
|
|
38
|
-
hidden
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
getDefaultAlignment?: (() => import("../../types").Alignment) | undefined;
|
|
43
|
-
isLintable?: boolean | undefined;
|
|
44
|
-
tracking?: import("../../types").Tracking | undefined;
|
|
45
|
-
traverseChildWidgets?: any;
|
|
46
|
-
transform?: import("../../types").WidgetTransform | undefined;
|
|
47
|
-
staticTransform?: import("../../types").WidgetTransform | undefined;
|
|
48
|
-
validator?: import("../../types").WidgetValidatorFunction | undefined;
|
|
49
|
-
getOneCorrectAnswerFromRubric?: ((rubric: import("../../validation.types").Rubric) => string | null | undefined) | undefined;
|
|
50
|
-
propUpgrades?: {
|
|
51
|
-
[key: string]: (arg1: any) => any;
|
|
52
|
-
} | undefined;
|
|
53
|
-
}>;
|
|
38
|
+
traverseChildWidgets: (arg1: any, arg2: any) => any;
|
|
39
|
+
hidden: false;
|
|
40
|
+
tracking: "all";
|
|
41
|
+
isLintable: true;
|
|
42
|
+
};
|
|
54
43
|
export default _default;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import Graphie from "../../components/graphie";
|
|
3
|
+
import scoreGrapher from "./score-grapher";
|
|
3
4
|
import type { Coord } from "../../interactive2/types";
|
|
4
5
|
import type { PerseusGrapherWidgetOptions } from "../../perseus-types";
|
|
5
6
|
import type { Widget, WidgetProps } from "../../types";
|
|
6
7
|
import type { GridDimensions } from "../../util";
|
|
7
8
|
import type { PerseusGrapherRubric, PerseusGrapherUserInput } from "../../validation.types";
|
|
9
|
+
import type { GrapherPromptJSON } from "../../widget-ai-utils/grapher/prompt-utils";
|
|
8
10
|
import type { PropsFor } from "@khanacademy/wonder-blocks-core";
|
|
9
11
|
type RenderProps = {
|
|
10
12
|
availableTypes: PerseusGrapherWidgetOptions["availableTypes"];
|
|
@@ -35,28 +37,16 @@ declare class Grapher extends React.Component<Props> implements Widget {
|
|
|
35
37
|
showHairlines: (arg1: Coord) => void;
|
|
36
38
|
hideHairlines: () => void;
|
|
37
39
|
getUserInput(): PerseusGrapherUserInput;
|
|
40
|
+
getPromptJSON(): GrapherPromptJSON;
|
|
38
41
|
render(): React.ReactNode;
|
|
39
42
|
}
|
|
40
|
-
declare const _default:
|
|
43
|
+
declare const _default: {
|
|
41
44
|
name: string;
|
|
42
45
|
displayName: string;
|
|
43
|
-
|
|
46
|
+
hidden: true;
|
|
44
47
|
widget: typeof Grapher;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
defaultAlignment?: import("../../types").Alignment | undefined;
|
|
50
|
-
getDefaultAlignment?: (() => import("../../types").Alignment) | undefined;
|
|
51
|
-
isLintable?: boolean | undefined;
|
|
52
|
-
tracking?: import("../../types").Tracking | undefined;
|
|
53
|
-
traverseChildWidgets?: any;
|
|
54
|
-
transform?: import("../../types").WidgetTransform | undefined;
|
|
55
|
-
staticTransform?: import("../../types").WidgetTransform | undefined;
|
|
56
|
-
validator?: import("../../types").WidgetValidatorFunction | undefined;
|
|
57
|
-
getOneCorrectAnswerFromRubric?: ((rubric: import("../../validation.types").Rubric) => string | null | undefined) | undefined;
|
|
58
|
-
propUpgrades?: {
|
|
59
|
-
[key: string]: (arg1: any) => any;
|
|
60
|
-
} | undefined;
|
|
61
|
-
}>;
|
|
48
|
+
transform: (arg1: PerseusGrapherWidgetOptions) => RenderProps;
|
|
49
|
+
staticTransform: (arg1: PerseusGrapherWidgetOptions) => RenderProps;
|
|
50
|
+
scorer: typeof scoreGrapher;
|
|
51
|
+
};
|
|
62
52
|
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { PerseusScore } from "../../types";
|
|
2
|
+
import type { PerseusGrapherRubric, PerseusGrapherUserInput } from "../../validation.types";
|
|
3
|
+
declare function scoreGrapher(userInput: PerseusGrapherUserInput, rubric: PerseusGrapherRubric): PerseusScore;
|
|
4
|
+
export default scoreGrapher;
|
|
@@ -4,6 +4,7 @@ import Renderer from "../../renderer";
|
|
|
4
4
|
import type { PerseusGroupWidgetOptions } from "../../perseus-types";
|
|
5
5
|
import type { ChangeFn, FocusPath, Widget, WidgetProps } from "../../types";
|
|
6
6
|
import type { PerseusGroupRubric, UserInputArray } from "../../validation.types";
|
|
7
|
+
import type { GroupPromptJSON } from "../../widget-ai-utils/group/prompt-utils";
|
|
7
8
|
type RenderProps = PerseusGroupWidgetOptions;
|
|
8
9
|
type Props = WidgetProps<RenderProps, PerseusGroupRubric>;
|
|
9
10
|
type DefaultProps = {
|
|
@@ -27,6 +28,7 @@ declare class Group extends React.Component<Props> implements Widget {
|
|
|
27
28
|
* @deprecated getUserInputMap should be used for Groups
|
|
28
29
|
*/
|
|
29
30
|
getUserInput(): UserInputArray | undefined;
|
|
31
|
+
getPromptJSON(): GroupPromptJSON;
|
|
30
32
|
getSerializedState: () => any;
|
|
31
33
|
restoreSerializedState: (arg1: any, arg2: any) => null;
|
|
32
34
|
getInputPaths(): readonly FocusPath[];
|
|
@@ -37,26 +39,12 @@ declare class Group extends React.Component<Props> implements Widget {
|
|
|
37
39
|
showRationalesForCurrentlySelectedChoices: () => void;
|
|
38
40
|
render(): React.ReactNode;
|
|
39
41
|
}
|
|
40
|
-
declare const _default:
|
|
42
|
+
declare const _default: {
|
|
41
43
|
name: string;
|
|
42
44
|
displayName: string;
|
|
43
|
-
getWidget?: (() => typeof Group) | undefined;
|
|
44
45
|
widget: typeof Group;
|
|
45
|
-
|
|
46
|
-
hidden
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
defaultAlignment?: import("../../types").Alignment | undefined;
|
|
50
|
-
getDefaultAlignment?: (() => import("../../types").Alignment) | undefined;
|
|
51
|
-
isLintable?: boolean | undefined;
|
|
52
|
-
tracking?: import("../../types").Tracking | undefined;
|
|
53
|
-
traverseChildWidgets?: any;
|
|
54
|
-
transform?: import("../../types").WidgetTransform | undefined;
|
|
55
|
-
staticTransform?: import("../../types").WidgetTransform | undefined;
|
|
56
|
-
validator?: import("../../types").WidgetValidatorFunction | undefined;
|
|
57
|
-
getOneCorrectAnswerFromRubric?: ((rubric: import("../../validation.types").Rubric) => string | null | undefined) | undefined;
|
|
58
|
-
propUpgrades?: {
|
|
59
|
-
[key: string]: (arg1: any) => any;
|
|
60
|
-
} | undefined;
|
|
61
|
-
}>;
|
|
46
|
+
traverseChildWidgets: (props: any, traverseRenderer: any) => any;
|
|
47
|
+
hidden: true;
|
|
48
|
+
isLintable: true;
|
|
49
|
+
};
|
|
62
50
|
export default _default;
|