@khanacademy/perseus 35.0.0 → 35.1.1
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/es/index.js +756 -615
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +756 -613
- package/dist/index.js.map +1 -1
- package/dist/perseus-api.d.ts +2 -0
- package/dist/perseus-types.d.ts +7 -0
- package/dist/server-item-renderer.d.ts +2 -0
- package/dist/types.d.ts +3 -4
- package/dist/validation.types.d.ts +5 -2
- package/dist/widgets/cs-program/cs-program-validator.d.ts +3 -0
- package/dist/widgets/cs-program/cs-program.d.ts +2 -2
- package/dist/widgets/expression/expression.d.ts +14 -2
- package/dist/widgets/grapher/grapher-validator.d.ts +4 -0
- package/dist/widgets/grapher/util.d.ts +0 -2
- package/dist/widgets/iframe/iframe-validator.d.ts +3 -0
- package/dist/widgets/iframe/iframe.d.ts +3 -2
- package/dist/widgets/interactive-graph.d.ts +3 -3
- package/dist/widgets/interactive-graphs/backgrounds/axis-ticks.d.ts +1 -1
- package/dist/widgets/interactive-graphs/graph-locked-layer.d.ts +2 -0
- package/dist/widgets/interactive-graphs/interactive-graph-question-builder.d.ts +7 -0
- package/dist/widgets/interactive-graphs/interactive-graph-validator.d.ts +4 -0
- package/dist/widgets/interactive-graphs/locked-figures/locked-ellipse.d.ts +5 -1
- package/dist/widgets/interactive-graphs/locked-figures/locked-function.d.ts +5 -1
- package/dist/widgets/interactive-graphs/locked-figures/locked-line.d.ts +2 -0
- package/dist/widgets/interactive-graphs/locked-figures/locked-point.d.ts +5 -1
- package/dist/widgets/interactive-graphs/locked-figures/locked-polygon.d.ts +5 -1
- package/dist/widgets/interactive-graphs/locked-figures/locked-vector.d.ts +5 -1
- package/dist/widgets/interactive-graphs/mafs-state-to-interactive-graph.d.ts +3 -0
- package/dist/widgets/label-image/label-image.d.ts +4 -0
- package/dist/widgets/matcher/matcher-validator.d.ts +4 -0
- package/dist/widgets/matcher/matcher.d.ts +3 -2
- package/dist/widgets/matrix/matrix-validator.d.ts +5 -0
- package/dist/widgets/matrix/matrix.d.ts +1 -0
- package/dist/widgets/number-line/number-line-validator.d.ts +4 -0
- package/dist/widgets/number-line/number-line.d.ts +3 -2
- package/dist/widgets/plotter/plotter-validator.d.ts +4 -0
- package/dist/widgets/plotter/plotter.d.ts +1 -0
- package/dist/widgets/table/table-validator.d.ts +5 -0
- package/dist/widgets/table/table.d.ts +1 -0
- package/package.json +1 -1
package/dist/perseus-api.d.ts
CHANGED
|
@@ -103,10 +103,12 @@ export declare const ApiOptions: {
|
|
|
103
103
|
"unlimited-point"?: boolean | undefined;
|
|
104
104
|
} & {
|
|
105
105
|
"interactive-graph-locked-features-labels"?: boolean | undefined;
|
|
106
|
+
"locked-figures-aria"?: boolean | undefined;
|
|
106
107
|
"locked-point-labels"?: boolean | undefined;
|
|
107
108
|
"locked-line-labels"?: boolean | undefined;
|
|
108
109
|
"locked-vector-labels"?: boolean | undefined;
|
|
109
110
|
"locked-ellipse-labels"?: boolean | undefined;
|
|
111
|
+
"locked-polygon-labels"?: boolean | undefined;
|
|
110
112
|
"locked-function-labels"?: boolean | undefined;
|
|
111
113
|
}) | undefined;
|
|
112
114
|
} | undefined;
|
package/dist/perseus-types.d.ts
CHANGED
|
@@ -378,6 +378,7 @@ export type LockedPointType = {
|
|
|
378
378
|
color: LockedFigureColor;
|
|
379
379
|
filled: boolean;
|
|
380
380
|
labels?: LockedLabelType[];
|
|
381
|
+
ariaLabel?: string;
|
|
381
382
|
};
|
|
382
383
|
export type LockedLineType = {
|
|
383
384
|
type: "line";
|
|
@@ -388,12 +389,14 @@ export type LockedLineType = {
|
|
|
388
389
|
showPoint1: boolean;
|
|
389
390
|
showPoint2: boolean;
|
|
390
391
|
labels?: LockedLabelType[];
|
|
392
|
+
ariaLabel?: string;
|
|
391
393
|
};
|
|
392
394
|
export type LockedVectorType = {
|
|
393
395
|
type: "vector";
|
|
394
396
|
points: [tail: Coord, tip: Coord];
|
|
395
397
|
color: LockedFigureColor;
|
|
396
398
|
labels?: LockedLabelType[];
|
|
399
|
+
ariaLabel?: string;
|
|
397
400
|
};
|
|
398
401
|
export type LockedFigureFillType = "none" | "white" | "translucent" | "solid";
|
|
399
402
|
export declare const lockedFigureFillStyles: Record<LockedFigureFillType, number>;
|
|
@@ -406,6 +409,7 @@ export type LockedEllipseType = {
|
|
|
406
409
|
fillStyle: LockedFigureFillType;
|
|
407
410
|
strokeStyle: LockedLineStyle;
|
|
408
411
|
labels?: LockedLabelType[];
|
|
412
|
+
ariaLabel?: string;
|
|
409
413
|
};
|
|
410
414
|
export type LockedPolygonType = {
|
|
411
415
|
type: "polygon";
|
|
@@ -414,6 +418,8 @@ export type LockedPolygonType = {
|
|
|
414
418
|
showVertices: boolean;
|
|
415
419
|
fillStyle: LockedFigureFillType;
|
|
416
420
|
strokeStyle: LockedLineStyle;
|
|
421
|
+
labels?: LockedLabelType[];
|
|
422
|
+
ariaLabel?: string;
|
|
417
423
|
};
|
|
418
424
|
export type LockedFunctionType = {
|
|
419
425
|
type: "function";
|
|
@@ -423,6 +429,7 @@ export type LockedFunctionType = {
|
|
|
423
429
|
directionalAxis: "x" | "y";
|
|
424
430
|
domain?: Interval;
|
|
425
431
|
labels?: LockedLabelType[];
|
|
432
|
+
ariaLabel?: string;
|
|
426
433
|
};
|
|
427
434
|
export type LockedLabelType = {
|
|
428
435
|
type: "label";
|
|
@@ -143,10 +143,12 @@ declare const ref: React.ForwardRefExoticComponent<Omit<Pick<SharedRendererProps
|
|
|
143
143
|
"unlimited-point"?: boolean | undefined;
|
|
144
144
|
} & {
|
|
145
145
|
"interactive-graph-locked-features-labels"?: boolean | undefined;
|
|
146
|
+
"locked-figures-aria"?: boolean | undefined;
|
|
146
147
|
"locked-point-labels"?: boolean | undefined;
|
|
147
148
|
"locked-line-labels"?: boolean | undefined;
|
|
148
149
|
"locked-vector-labels"?: boolean | undefined;
|
|
149
150
|
"locked-ellipse-labels"?: boolean | undefined;
|
|
151
|
+
"locked-polygon-labels"?: boolean | undefined;
|
|
150
152
|
"locked-function-labels"?: boolean | undefined;
|
|
151
153
|
}) | undefined;
|
|
152
154
|
} | undefined;
|
package/dist/types.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { ILogger } from "./logging/log";
|
|
2
2
|
import type { Item } from "./multi-items/item-types";
|
|
3
|
-
import type { Hint, PerseusAnswerArea, PerseusWidget, PerseusWidgetsMap } from "./perseus-types";
|
|
3
|
+
import type { Hint, PerseusAnswerArea, PerseusGraphType, PerseusWidget, PerseusWidgetsMap } from "./perseus-types";
|
|
4
4
|
import type { PerseusStrings } from "./strings";
|
|
5
5
|
import type { SizeClass } from "./util/sizing-utils";
|
|
6
|
-
import type { InteractiveGraphState } from "./widgets/interactive-graphs/types";
|
|
7
6
|
import type { KeypadAPI } from "@khanacademy/math-input";
|
|
8
7
|
import type { AnalyticsEventHandlerFn } from "@khanacademy/perseus-core";
|
|
9
8
|
import type { LinterContextProps } from "@khanacademy/perseus-linter";
|
|
@@ -63,7 +62,7 @@ export type ChangeHandler = (arg1: {
|
|
|
63
62
|
currentValue?: string;
|
|
64
63
|
selected?: number;
|
|
65
64
|
plot?: any;
|
|
66
|
-
graph?:
|
|
65
|
+
graph?: PerseusGraphType;
|
|
67
66
|
}, callback?: () => unknown | null | undefined, silent?: boolean) => unknown;
|
|
68
67
|
export type ImageUploader = (file: File, callback: (url: string) => unknown) => unknown;
|
|
69
68
|
export type WidgetSize = "normal" | "small" | "mini";
|
|
@@ -75,7 +74,7 @@ type TrackInteractionArgs = {
|
|
|
75
74
|
correct?: boolean;
|
|
76
75
|
} & Partial<TrackingGradedGroupExtraArguments> & Partial<TrackingSequenceExtraArguments>;
|
|
77
76
|
export declare const MafsGraphTypeFlags: readonly ["angle", "segment", "linear", "linear-system", "ray", "polygon", "circle", "quadratic", "sinusoid", "point", "unlimited-point", "none"];
|
|
78
|
-
export declare const InteractiveGraphLockedFeaturesFlags: readonly ["interactive-graph-locked-features-labels", "locked-point-labels", "locked-line-labels", "locked-vector-labels", "locked-ellipse-labels", "locked-function-labels"];
|
|
77
|
+
export declare const InteractiveGraphLockedFeaturesFlags: readonly ["interactive-graph-locked-features-labels", "locked-figures-aria", "locked-point-labels", "locked-line-labels", "locked-vector-labels", "locked-ellipse-labels", "locked-polygon-labels", "locked-function-labels"];
|
|
79
78
|
/**
|
|
80
79
|
* APIOptions provides different ways to customize the behaviour of Perseus.
|
|
81
80
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Coord } from "./interactive2/types";
|
|
2
|
-
import type { PerseusCategorizerWidgetOptions, PerseusCSProgramWidgetOptions, PerseusDefinitionWidgetOptions, PerseusDropdownWidgetOptions, PerseusExplanationWidgetOptions,
|
|
2
|
+
import type { PerseusCategorizerWidgetOptions, PerseusCSProgramWidgetOptions, PerseusDefinitionWidgetOptions, PerseusDropdownWidgetOptions, PerseusExplanationWidgetOptions, PerseusExpressionAnswerForm, PerseusGradedGroupSetWidgetOptions, PerseusGradedGroupWidgetOptions, PerseusGrapherWidgetOptions, PerseusGraphType, PerseusIFrameWidgetOptions, PerseusImageWidgetOptions, PerseusInputNumberWidgetOptions, PerseusInteractionWidgetOptions, PerseusLabelImageWidgetOptions, PerseusMatcherWidgetOptions, PerseusMatrixWidgetOptions, PerseusNumberLineWidgetOptions, PerseusNumericInputWidgetOptions, PerseusOrdererWidgetOptions, PerseusPassageRefWidgetOptions, PerseusPassageWidgetOptions, PerseusPlotterWidgetOptions, PerseusRadioWidgetOptions, PerseusSorterWidgetOptions, PerseusTableWidgetOptions, PerseusVideoWidgetOptions } from "./perseus-types";
|
|
3
3
|
import type { InteractiveMarkerType } from "./widgets/label-image/types";
|
|
4
4
|
import type { Relationship } from "./widgets/number-line/number-line";
|
|
5
5
|
export type UserInputStatus = "correct" | "incorrect" | "incomplete";
|
|
@@ -20,7 +20,10 @@ export type PerseusDropdownUserInput = {
|
|
|
20
20
|
};
|
|
21
21
|
export type PerseusExplanationRubric = PerseusExplanationWidgetOptions;
|
|
22
22
|
export type PerseusExplanationUserInput = Empty;
|
|
23
|
-
export type PerseusExpressionRubric =
|
|
23
|
+
export type PerseusExpressionRubric = {
|
|
24
|
+
answerForms: ReadonlyArray<PerseusExpressionAnswerForm>;
|
|
25
|
+
functions: ReadonlyArray<string>;
|
|
26
|
+
};
|
|
24
27
|
export type PerseusExpressionUserInput = string;
|
|
25
28
|
export type PerseusGradedGroupRubric = PerseusGradedGroupWidgetOptions;
|
|
26
29
|
export type PerseusGradedGroupSetRubric = PerseusGradedGroupSetWidgetOptions;
|
|
@@ -18,12 +18,12 @@ type DefaultProps = {
|
|
|
18
18
|
};
|
|
19
19
|
declare class CSProgram extends React.Component<Props> {
|
|
20
20
|
static defaultProps: DefaultProps;
|
|
21
|
-
static validate(state: PerseusCSProgramUserInput
|
|
21
|
+
static validate(state: PerseusCSProgramUserInput): PerseusScore;
|
|
22
22
|
componentDidMount(): void;
|
|
23
23
|
componentWillUnmount(): void;
|
|
24
24
|
handleMessageEvent: (arg1: any) => void;
|
|
25
25
|
change: (...args: ReadonlyArray<unknown>) => any;
|
|
26
|
-
simpleValidate(
|
|
26
|
+
simpleValidate(): PerseusScore;
|
|
27
27
|
render(): React.ReactNode;
|
|
28
28
|
}
|
|
29
29
|
declare const _default: Readonly<{
|
|
@@ -147,10 +147,12 @@ declare const _default: Readonly<{
|
|
|
147
147
|
"unlimited-point"?: boolean | undefined;
|
|
148
148
|
} & {
|
|
149
149
|
"interactive-graph-locked-features-labels"?: boolean | undefined;
|
|
150
|
+
"locked-figures-aria"?: boolean | undefined;
|
|
150
151
|
"locked-point-labels"?: boolean | undefined;
|
|
151
152
|
"locked-line-labels"?: boolean | undefined;
|
|
152
153
|
"locked-vector-labels"?: boolean | undefined;
|
|
153
154
|
"locked-ellipse-labels"?: boolean | undefined;
|
|
155
|
+
"locked-polygon-labels"?: boolean | undefined;
|
|
154
156
|
"locked-function-labels"?: boolean | undefined;
|
|
155
157
|
}) | undefined;
|
|
156
158
|
} | undefined;
|
|
@@ -176,7 +178,7 @@ declare const _default: Readonly<{
|
|
|
176
178
|
onFocus: (blurPath: import("../../types").FocusPath) => void;
|
|
177
179
|
onBlur: (blurPath: import("../../types").FocusPath) => void;
|
|
178
180
|
findWidgets: (arg1: import("../../types").FilterCriterion) => readonly any[];
|
|
179
|
-
reviewModeRubric:
|
|
181
|
+
reviewModeRubric: PerseusExpressionRubric;
|
|
180
182
|
onChange: import("../../types").ChangeHandler;
|
|
181
183
|
trackInteraction: (extraData?: Empty | undefined) => void;
|
|
182
184
|
isLastUsedWidget: boolean;
|
|
@@ -230,10 +232,12 @@ declare const _default: Readonly<{
|
|
|
230
232
|
"unlimited-point"?: boolean | undefined;
|
|
231
233
|
} & {
|
|
232
234
|
"interactive-graph-locked-features-labels"?: boolean | undefined;
|
|
235
|
+
"locked-figures-aria"?: boolean | undefined;
|
|
233
236
|
"locked-point-labels"?: boolean | undefined;
|
|
234
237
|
"locked-line-labels"?: boolean | undefined;
|
|
235
238
|
"locked-vector-labels"?: boolean | undefined;
|
|
236
239
|
"locked-ellipse-labels"?: boolean | undefined;
|
|
240
|
+
"locked-polygon-labels"?: boolean | undefined;
|
|
237
241
|
"locked-function-labels"?: boolean | undefined;
|
|
238
242
|
}) | undefined;
|
|
239
243
|
} | undefined;
|
|
@@ -315,10 +319,12 @@ declare const _default: Readonly<{
|
|
|
315
319
|
"unlimited-point"?: boolean | undefined;
|
|
316
320
|
} & {
|
|
317
321
|
"interactive-graph-locked-features-labels"?: boolean | undefined;
|
|
322
|
+
"locked-figures-aria"?: boolean | undefined;
|
|
318
323
|
"locked-point-labels"?: boolean | undefined;
|
|
319
324
|
"locked-line-labels"?: boolean | undefined;
|
|
320
325
|
"locked-vector-labels"?: boolean | undefined;
|
|
321
326
|
"locked-ellipse-labels"?: boolean | undefined;
|
|
327
|
+
"locked-polygon-labels"?: boolean | undefined;
|
|
322
328
|
"locked-function-labels"?: boolean | undefined;
|
|
323
329
|
}) | undefined;
|
|
324
330
|
} | undefined;
|
|
@@ -395,10 +401,12 @@ declare const _default: Readonly<{
|
|
|
395
401
|
"unlimited-point"?: boolean | undefined;
|
|
396
402
|
} & {
|
|
397
403
|
"interactive-graph-locked-features-labels"?: boolean | undefined;
|
|
404
|
+
"locked-figures-aria"?: boolean | undefined;
|
|
398
405
|
"locked-point-labels"?: boolean | undefined;
|
|
399
406
|
"locked-line-labels"?: boolean | undefined;
|
|
400
407
|
"locked-vector-labels"?: boolean | undefined;
|
|
401
408
|
"locked-ellipse-labels"?: boolean | undefined;
|
|
409
|
+
"locked-polygon-labels"?: boolean | undefined;
|
|
402
410
|
"locked-function-labels"?: boolean | undefined;
|
|
403
411
|
}) | undefined;
|
|
404
412
|
} | undefined;
|
|
@@ -424,7 +432,7 @@ declare const _default: Readonly<{
|
|
|
424
432
|
onFocus: (blurPath: import("../../types").FocusPath) => void;
|
|
425
433
|
onBlur: (blurPath: import("../../types").FocusPath) => void;
|
|
426
434
|
findWidgets: (arg1: import("../../types").FilterCriterion) => readonly any[];
|
|
427
|
-
reviewModeRubric:
|
|
435
|
+
reviewModeRubric: PerseusExpressionRubric;
|
|
428
436
|
onChange: import("../../types").ChangeHandler;
|
|
429
437
|
trackInteraction: (extraData?: Empty | undefined) => void;
|
|
430
438
|
isLastUsedWidget: boolean;
|
|
@@ -478,10 +486,12 @@ declare const _default: Readonly<{
|
|
|
478
486
|
"unlimited-point"?: boolean | undefined;
|
|
479
487
|
} & {
|
|
480
488
|
"interactive-graph-locked-features-labels"?: boolean | undefined;
|
|
489
|
+
"locked-figures-aria"?: boolean | undefined;
|
|
481
490
|
"locked-point-labels"?: boolean | undefined;
|
|
482
491
|
"locked-line-labels"?: boolean | undefined;
|
|
483
492
|
"locked-vector-labels"?: boolean | undefined;
|
|
484
493
|
"locked-ellipse-labels"?: boolean | undefined;
|
|
494
|
+
"locked-polygon-labels"?: boolean | undefined;
|
|
485
495
|
"locked-function-labels"?: boolean | undefined;
|
|
486
496
|
}) | undefined;
|
|
487
497
|
} | undefined;
|
|
@@ -563,10 +573,12 @@ declare const _default: Readonly<{
|
|
|
563
573
|
"unlimited-point"?: boolean | undefined;
|
|
564
574
|
} & {
|
|
565
575
|
"interactive-graph-locked-features-labels"?: boolean | undefined;
|
|
576
|
+
"locked-figures-aria"?: boolean | undefined;
|
|
566
577
|
"locked-point-labels"?: boolean | undefined;
|
|
567
578
|
"locked-line-labels"?: boolean | undefined;
|
|
568
579
|
"locked-vector-labels"?: boolean | undefined;
|
|
569
580
|
"locked-ellipse-labels"?: boolean | undefined;
|
|
581
|
+
"locked-polygon-labels"?: boolean | undefined;
|
|
570
582
|
"locked-function-labels"?: boolean | undefined;
|
|
571
583
|
}) | undefined;
|
|
572
584
|
} | undefined;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { PerseusScore } from "../../types";
|
|
2
|
+
import type { PerseusGrapherRubric, PerseusGrapherUserInput } from "../../validation.types";
|
|
3
|
+
declare function grapherValidator(state: PerseusGrapherUserInput, rubric: PerseusGrapherRubric): PerseusScore;
|
|
4
|
+
export default grapherValidator;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import type { Coord } from "../../interactive2/types";
|
|
2
|
-
import type { PerseusScore } from "../../types";
|
|
3
2
|
export declare const DEFAULT_BACKGROUND_IMAGE: {
|
|
4
3
|
readonly url: null;
|
|
5
4
|
};
|
|
6
5
|
export declare const allTypes: any;
|
|
7
6
|
export declare function functionForType(type: string): any;
|
|
8
|
-
export declare const validate: (state: any, rubric: any) => PerseusScore;
|
|
9
7
|
export declare const getEquationString: (props: any) => string;
|
|
10
8
|
export declare const pointsFromNormalized: (coordsList: ReadonlyArray<Coord>, range: [Coord, Coord], step: [number, number], snapStep: [number, number]) => ReadonlyArray<Coord>;
|
|
11
9
|
export declare const maybePointsFromNormalized: (coordsList: ReadonlyArray<Coord> | null | undefined, range: [Coord, Coord], step: [number, number], snapStep: [number, number]) => ReadonlyArray<Coord> | null | undefined;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import * as React from "react";
|
|
10
10
|
import type { PerseusIFrameWidgetOptions } from "../../perseus-types";
|
|
11
|
-
import type { WidgetProps } from "../../types";
|
|
11
|
+
import type { PerseusScore, WidgetProps } from "../../types";
|
|
12
12
|
import type { PerseusIFrameRubric, PerseusIFrameUserInput, UserInputStatus } from "../../validation.types";
|
|
13
13
|
type RenderProps = PerseusIFrameWidgetOptions & {
|
|
14
14
|
status: UserInputStatus;
|
|
@@ -25,12 +25,13 @@ type DefaultProps = {
|
|
|
25
25
|
};
|
|
26
26
|
declare class Iframe extends React.Component<Props> {
|
|
27
27
|
static defaultProps: DefaultProps;
|
|
28
|
+
static validate(state: PerseusIFrameUserInput): PerseusScore;
|
|
28
29
|
componentDidMount(): void;
|
|
29
30
|
componentWillUnmount(): void;
|
|
30
31
|
getUserInput(): PerseusIFrameUserInput;
|
|
31
32
|
handleMessageEvent: (arg1: any) => void;
|
|
32
33
|
change: (...args: ReadonlyArray<unknown>) => any;
|
|
33
|
-
simpleValidate
|
|
34
|
+
simpleValidate(): PerseusScore;
|
|
34
35
|
render(): React.ReactNode;
|
|
35
36
|
}
|
|
36
37
|
declare const _default: Readonly<{
|
|
@@ -20,6 +20,8 @@ type DefaultProps = {
|
|
|
20
20
|
showProtractor: Props["showProtractor"];
|
|
21
21
|
graph: Props["graph"];
|
|
22
22
|
};
|
|
23
|
+
export declare function getSinusoidCoefficients(coords: ReadonlyArray<Coord>): SineCoefficient;
|
|
24
|
+
export declare function getQuadraticCoefficients(coords: ReadonlyArray<Coord>): QuadraticCoefficient;
|
|
23
25
|
declare class LegacyInteractiveGraph extends React.Component<Props, State> {
|
|
24
26
|
static contextType: React.Context<{
|
|
25
27
|
strings: import("../strings").PerseusStrings;
|
|
@@ -110,8 +112,6 @@ declare class InteractiveGraph extends React.Component<Props, State> {
|
|
|
110
112
|
getUserInput(): PerseusInteractiveGraphUserInput;
|
|
111
113
|
simpleValidate(rubric: PerseusInteractiveGraphRubric): PerseusScore;
|
|
112
114
|
render(): React.JSX.Element;
|
|
113
|
-
static getQuadraticCoefficients(coords: ReadonlyArray<Coord>): QuadraticCoefficient;
|
|
114
|
-
static getSinusoidCoefficients(coords: ReadonlyArray<Coord>): SineCoefficient;
|
|
115
115
|
/**
|
|
116
116
|
* @param {object} graph Like props.graph or props.correct
|
|
117
117
|
* @param {object} props of an InteractiveGraph instance
|
|
@@ -160,7 +160,7 @@ declare class InteractiveGraph extends React.Component<Props, State> {
|
|
|
160
160
|
static getRayEquationString(props: Props): string;
|
|
161
161
|
static getPolygonEquationString(props: Props): string;
|
|
162
162
|
static getAngleEquationString(props: Props): string;
|
|
163
|
-
static validate(userInput: PerseusGraphType, rubric: PerseusInteractiveGraphRubric
|
|
163
|
+
static validate(userInput: PerseusGraphType, rubric: PerseusInteractiveGraphRubric): PerseusScore;
|
|
164
164
|
static getUserInputFromProps(props: Props): PerseusGraphType;
|
|
165
165
|
}
|
|
166
166
|
export declare function shouldUseMafs(mafsFlags: Record<string, boolean> | undefined | boolean, graph: PerseusGraphType): boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { Interval } from "mafs";
|
|
3
|
-
export declare const shouldShowLabel: (
|
|
3
|
+
export declare const shouldShowLabel: (currentTick: number, range: [Interval, Interval], tickStep: number) => boolean;
|
|
4
4
|
export declare function generateTickLocations(tickStep: number, min: number, max: number): number[];
|
|
5
5
|
export declare const AxisTicks: () => React.JSX.Element;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { LockedFigure } from "../../perseus-types";
|
|
3
|
+
import type { APIOptions } from "../../types";
|
|
3
4
|
import type { Interval } from "mafs";
|
|
4
5
|
type Props = {
|
|
6
|
+
flags?: APIOptions["flags"];
|
|
5
7
|
lockedFigures: ReadonlyArray<LockedFigure>;
|
|
6
8
|
range: [x: Interval, y: Interval];
|
|
7
9
|
};
|
|
@@ -8,6 +8,7 @@ export type LockedFunctionOptions = {
|
|
|
8
8
|
directionalAxis?: "x" | "y";
|
|
9
9
|
domain?: Interval;
|
|
10
10
|
labels?: LockedFigureLabelOptions[];
|
|
11
|
+
ariaLabel?: string;
|
|
11
12
|
};
|
|
12
13
|
type LockedFigureLabelOptions = {
|
|
13
14
|
text: string;
|
|
@@ -111,6 +112,7 @@ declare class InteractiveGraphQuestionBuilder {
|
|
|
111
112
|
color?: LockedFigureColor;
|
|
112
113
|
filled?: boolean;
|
|
113
114
|
labels?: LockedFigureLabelOptions[];
|
|
115
|
+
ariaLabel?: string;
|
|
114
116
|
}): InteractiveGraphQuestionBuilder;
|
|
115
117
|
addLockedLine(point1: vec.Vector2, point2: vec.Vector2, options?: {
|
|
116
118
|
kind?: "line" | "ray" | "segment";
|
|
@@ -120,10 +122,12 @@ declare class InteractiveGraphQuestionBuilder {
|
|
|
120
122
|
showPoint1?: boolean;
|
|
121
123
|
showPoint2?: boolean;
|
|
122
124
|
labels?: LockedFigureLabelOptions[];
|
|
125
|
+
ariaLabel?: string;
|
|
123
126
|
}): InteractiveGraphQuestionBuilder;
|
|
124
127
|
addLockedVector(tail: vec.Vector2, tip: vec.Vector2, options?: {
|
|
125
128
|
color?: LockedFigureColor;
|
|
126
129
|
labels?: LockedFigureLabelOptions[];
|
|
130
|
+
ariaLabel?: string;
|
|
127
131
|
}): InteractiveGraphQuestionBuilder;
|
|
128
132
|
addLockedEllipse(center: vec.Vector2, radius: [x: number, y: number], options?: {
|
|
129
133
|
angle?: number;
|
|
@@ -131,12 +135,15 @@ declare class InteractiveGraphQuestionBuilder {
|
|
|
131
135
|
fillStyle?: LockedFigureFillType;
|
|
132
136
|
strokeStyle?: "solid" | "dashed";
|
|
133
137
|
labels?: LockedFigureLabelOptions[];
|
|
138
|
+
ariaLabel?: string;
|
|
134
139
|
}): InteractiveGraphQuestionBuilder;
|
|
135
140
|
addLockedPolygon(points: vec.Vector2[], options?: {
|
|
136
141
|
color?: LockedFigureColor;
|
|
137
142
|
showVertices?: boolean;
|
|
138
143
|
fillStyle?: LockedFigureFillType;
|
|
139
144
|
strokeStyle?: "solid" | "dashed";
|
|
145
|
+
labels?: LockedFigureLabelOptions[];
|
|
146
|
+
ariaLabel?: string;
|
|
140
147
|
}): InteractiveGraphQuestionBuilder;
|
|
141
148
|
addLockedFunction(equation: string, options?: LockedFunctionOptions): this;
|
|
142
149
|
addLockedLabel(text: string, coord: Coord, options?: {
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { PerseusScore } from "../../types";
|
|
2
|
+
import type { PerseusInteractiveGraphRubric, PerseusInteractiveGraphUserInput } from "../../validation.types";
|
|
3
|
+
declare function interactiveGraphValidator(userInput: PerseusInteractiveGraphUserInput, rubric: PerseusInteractiveGraphRubric): PerseusScore;
|
|
4
|
+
export default interactiveGraphValidator;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { type LockedEllipseType } from "../../../perseus-types";
|
|
3
|
-
|
|
3
|
+
import type { APIOptions } from "../../../types";
|
|
4
|
+
type Props = LockedEllipseType & {
|
|
5
|
+
flags?: APIOptions["flags"];
|
|
6
|
+
};
|
|
7
|
+
declare const LockedEllipse: (props: Props) => React.JSX.Element;
|
|
4
8
|
export default LockedEllipse;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { LockedFunctionType } from "../../../perseus-types";
|
|
3
|
-
|
|
3
|
+
import type { APIOptions } from "../../../types";
|
|
4
|
+
type Props = LockedFunctionType & {
|
|
5
|
+
flags?: APIOptions["flags"];
|
|
6
|
+
};
|
|
7
|
+
declare const LockedFunction: (props: Props) => React.JSX.Element | null;
|
|
4
8
|
export default LockedFunction;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { LockedLineType } from "../../../perseus-types";
|
|
3
|
+
import type { APIOptions } from "../../../types";
|
|
3
4
|
import type { Interval } from "mafs";
|
|
4
5
|
type Props = LockedLineType & {
|
|
6
|
+
flags?: APIOptions["flags"];
|
|
5
7
|
range: [Interval, Interval];
|
|
6
8
|
};
|
|
7
9
|
declare const LockedLine: (props: Props) => React.JSX.Element;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { type LockedPointType } from "../../../perseus-types";
|
|
3
|
-
|
|
3
|
+
import type { APIOptions } from "../../../types";
|
|
4
|
+
type Props = LockedPointType & {
|
|
5
|
+
flags?: APIOptions["flags"];
|
|
6
|
+
};
|
|
7
|
+
declare const LockedPoint: (props: Props) => React.JSX.Element;
|
|
4
8
|
export default LockedPoint;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { LockedPolygonType } from "../../../perseus-types";
|
|
3
|
-
|
|
3
|
+
import type { APIOptions } from "../../../types";
|
|
4
|
+
type Props = LockedPolygonType & {
|
|
5
|
+
flags?: APIOptions["flags"];
|
|
6
|
+
};
|
|
7
|
+
declare const LockedPolygon: (props: Props) => React.JSX.Element;
|
|
4
8
|
export default LockedPolygon;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { LockedVectorType } from "../../../perseus-types";
|
|
3
|
-
|
|
3
|
+
import type { APIOptions } from "../../../types";
|
|
4
|
+
type Props = LockedVectorType & {
|
|
5
|
+
flags?: APIOptions["flags"];
|
|
6
|
+
};
|
|
7
|
+
declare const LockedVector: (props: Props) => React.JSX.Element;
|
|
4
8
|
export default LockedVector;
|
|
@@ -141,10 +141,12 @@ declare const _default: Readonly<{
|
|
|
141
141
|
"unlimited-point"?: boolean | undefined;
|
|
142
142
|
} & {
|
|
143
143
|
"interactive-graph-locked-features-labels"?: boolean | undefined;
|
|
144
|
+
"locked-figures-aria"?: boolean | undefined;
|
|
144
145
|
"locked-point-labels"?: boolean | undefined;
|
|
145
146
|
"locked-line-labels"?: boolean | undefined;
|
|
146
147
|
"locked-vector-labels"?: boolean | undefined;
|
|
147
148
|
"locked-ellipse-labels"?: boolean | undefined;
|
|
149
|
+
"locked-polygon-labels"?: boolean | undefined;
|
|
148
150
|
"locked-function-labels"?: boolean | undefined;
|
|
149
151
|
}) | undefined;
|
|
150
152
|
} | undefined;
|
|
@@ -209,10 +211,12 @@ declare const _default: Readonly<{
|
|
|
209
211
|
"unlimited-point"?: boolean | undefined;
|
|
210
212
|
} & {
|
|
211
213
|
"interactive-graph-locked-features-labels"?: boolean | undefined;
|
|
214
|
+
"locked-figures-aria"?: boolean | undefined;
|
|
212
215
|
"locked-point-labels"?: boolean | undefined;
|
|
213
216
|
"locked-line-labels"?: boolean | undefined;
|
|
214
217
|
"locked-vector-labels"?: boolean | undefined;
|
|
215
218
|
"locked-ellipse-labels"?: boolean | undefined;
|
|
219
|
+
"locked-polygon-labels"?: boolean | undefined;
|
|
216
220
|
"locked-function-labels"?: boolean | undefined;
|
|
217
221
|
}) | undefined;
|
|
218
222
|
} | undefined;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { PerseusScore } from "../../types";
|
|
2
|
+
import type { PerseusMatcherRubric, PerseusMatcherUserInput } from "../../validation.types";
|
|
3
|
+
declare function matcherValidator(state: PerseusMatcherUserInput, rubric: PerseusMatcherRubric): PerseusScore;
|
|
4
|
+
export default matcherValidator;
|
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
3
3
|
import type { SortableOption } from "../../components/sortable";
|
|
4
4
|
import type { PerseusMatcherWidgetOptions } from "../../perseus-types";
|
|
5
|
-
import type { WidgetProps } from "../../types";
|
|
5
|
+
import type { PerseusScore, WidgetProps } from "../../types";
|
|
6
6
|
import type { PerseusMatcherRubric, PerseusMatcherUserInput } from "../../validation.types";
|
|
7
7
|
type RenderProps = PerseusMatcherWidgetOptions;
|
|
8
8
|
type Props = WidgetProps<RenderProps, PerseusMatcherRubric>;
|
|
@@ -29,13 +29,14 @@ export declare class Matcher extends React.Component<Props, State> {
|
|
|
29
29
|
context: React.ContextType<typeof PerseusI18nContext>;
|
|
30
30
|
static defaultProps: DefaultProps;
|
|
31
31
|
state: State;
|
|
32
|
+
static validate(state: PerseusMatcherUserInput, rubric: PerseusMatcherRubric): PerseusScore;
|
|
32
33
|
changeAndTrack: (arg1: any) => void;
|
|
33
34
|
onMeasureLeft: (arg1: any) => void;
|
|
34
35
|
onMeasureRight: (arg1: any) => void;
|
|
35
36
|
getUserInput: () => PerseusMatcherUserInput;
|
|
36
37
|
moveLeftOptionToIndex: (option: SortableOption, index: number) => void;
|
|
37
38
|
moveRightOptionToIndex: (option: SortableOption, index: number) => void;
|
|
38
|
-
simpleValidate(rubric: PerseusMatcherRubric):
|
|
39
|
+
simpleValidate(rubric: PerseusMatcherRubric): PerseusScore;
|
|
39
40
|
render(): React.ReactElement;
|
|
40
41
|
}
|
|
41
42
|
declare const _default: Readonly<{
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { PerseusStrings } from "../../strings";
|
|
2
|
+
import type { PerseusScore } from "../../types";
|
|
3
|
+
import type { PerseusMatrixRubric, PerseusMatrixUserInput } from "../../validation.types";
|
|
4
|
+
declare function matrixValidator(state: PerseusMatrixUserInput, rubric: PerseusMatrixRubric, strings: PerseusStrings): PerseusScore;
|
|
5
|
+
export default matrixValidator;
|
|
@@ -4,6 +4,7 @@ import type { PerseusMatrixWidgetOptions } from "../../perseus-types";
|
|
|
4
4
|
import type { PerseusStrings } from "../../strings";
|
|
5
5
|
import type { WidgetProps, PerseusScore } from "../../types";
|
|
6
6
|
import type { PerseusMatrixRubric, PerseusMatrixUserInput } from "../../validation.types";
|
|
7
|
+
export declare function getMatrixSize(matrix: ReadonlyArray<ReadonlyArray<number>>): number[];
|
|
7
8
|
type ExternalProps = WidgetProps<PerseusMatrixWidgetOptions, PerseusMatrixRubric>;
|
|
8
9
|
type Props = ExternalProps & {
|
|
9
10
|
onChange: (arg1: {
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { PerseusScore } from "../../types";
|
|
2
|
+
import type { PerseusNumberLineRubric, PerseusNumberLineUserInput } from "../../validation.types";
|
|
3
|
+
declare function numberLineValidator(state: PerseusNumberLineUserInput, rubric: PerseusNumberLineRubric): PerseusScore;
|
|
4
|
+
export default numberLineValidator;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
3
3
|
import type { ChangeableProps } from "../../mixins/changeable";
|
|
4
|
-
import type { APIOptions } from "../../types";
|
|
4
|
+
import type { APIOptions, PerseusScore } from "../../types";
|
|
5
5
|
import type { PerseusNumberLineRubric, PerseusNumberLineUserInput } from "../../validation.types";
|
|
6
6
|
export type Relationship = "lt" | "gt" | "le" | "ge";
|
|
7
7
|
type Props = ChangeableProps & {
|
|
@@ -50,6 +50,7 @@ declare class NumberLine extends React.Component<Props, State> {
|
|
|
50
50
|
context: React.ContextType<typeof PerseusI18nContext>;
|
|
51
51
|
static defaultProps: DefaultProps;
|
|
52
52
|
state: any;
|
|
53
|
+
static validate(state: PerseusNumberLineUserInput, rubric: PerseusNumberLineRubric): PerseusScore;
|
|
53
54
|
change: (...args: ReadonlyArray<unknown>) => any;
|
|
54
55
|
isValid: () => boolean;
|
|
55
56
|
onNumDivisionsChange: (arg1: number, arg2: any) => void;
|
|
@@ -72,7 +73,7 @@ declare class NumberLine extends React.Component<Props, State> {
|
|
|
72
73
|
_renderInequality: (arg1: any) => React.ReactElement;
|
|
73
74
|
_setupGraphie: (arg1: any, arg2: any) => void;
|
|
74
75
|
getUserInput(): PerseusNumberLineUserInput;
|
|
75
|
-
simpleValidate(rubric: PerseusNumberLineRubric):
|
|
76
|
+
simpleValidate(rubric: PerseusNumberLineRubric): PerseusScore;
|
|
76
77
|
render(): React.ReactNode;
|
|
77
78
|
}
|
|
78
79
|
declare const _default: Readonly<{
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { PerseusScore } from "../../types";
|
|
2
|
+
import type { PerseusPlotterRubric, PerseusPlotterUserInput } from "../../validation.types";
|
|
3
|
+
declare function plotterValidator(userInput: PerseusPlotterUserInput, rubric: PerseusPlotterRubric): PerseusScore;
|
|
4
|
+
export default plotterValidator;
|
|
@@ -38,6 +38,7 @@ export declare class Plotter extends React.Component<Props, State> {
|
|
|
38
38
|
graphie: any;
|
|
39
39
|
static defaultProps: DefaultProps;
|
|
40
40
|
state: State;
|
|
41
|
+
static validate(userInput: PerseusPlotterUserInput, rubric: PerseusPlotterRubric): PerseusScore;
|
|
41
42
|
componentDidMount(): void;
|
|
42
43
|
UNSAFE_componentWillReceiveProps(nextProps: Props): void;
|
|
43
44
|
componentDidUpdate(prevProps: Props, prevState: State): void;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { PerseusStrings } from "../../strings";
|
|
2
|
+
import type { PerseusScore } from "../../types";
|
|
3
|
+
import type { PerseusTableRubric, PerseusTableUserInput } from "../../validation.types";
|
|
4
|
+
declare function tableValidator(state: PerseusTableUserInput, rubric: PerseusTableRubric, strings: PerseusStrings): PerseusScore;
|
|
5
|
+
export default tableValidator;
|
|
@@ -26,6 +26,7 @@ declare class Table extends React.Component<Props> {
|
|
|
26
26
|
}>;
|
|
27
27
|
context: React.ContextType<typeof PerseusI18nContext>;
|
|
28
28
|
static defaultProps: DefaultProps;
|
|
29
|
+
static validate(state: PerseusTableUserInput, rubric: PerseusTableRubric, strings: PerseusStrings): PerseusScore;
|
|
29
30
|
_getRows: () => number;
|
|
30
31
|
_getColumns: () => number;
|
|
31
32
|
getUserInput(): PerseusTableUserInput;
|