@khanacademy/perseus-core 7.1.1 → 9.0.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/data-schema.d.ts +74 -83
- package/dist/es/index.js +11 -9
- package/dist/es/index.js.map +1 -1
- package/dist/feature-flags.d.ts +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +11 -8
- package/dist/index.js.map +1 -1
- package/dist/keypad.d.ts +1 -1
- package/dist/parse-perseus-json/general-purpose-parsers/object-types.d.ts +11 -0
- package/dist/parse-perseus-json/general-purpose-parsers/object-types.typetest.d.ts +1 -0
- package/dist/parse-perseus-json/general-purpose-parsers/object.d.ts +5 -1
- package/dist/parse-perseus-json/perseus-parsers/dropdown-user-input.d.ts +2 -2
- package/dist/parse-perseus-json/perseus-parsers/graded-group-widget.d.ts +4 -4
- package/dist/parse-perseus-json/perseus-parsers/legacy-button-sets.d.ts +2 -1
- package/dist/parse-perseus-json/perseus-parsers/numeric-input-user-input.d.ts +2 -2
- package/dist/parse-perseus-json/perseus-parsers/radio-user-input.d.ts +2 -2
- package/dist/parse-perseus-json/perseus-parsers/radio-widget.d.ts +18 -3
- package/dist/parse-perseus-json/perseus-parsers/radio-widget.typetest.d.ts +1 -0
- package/dist/parse-perseus-json/perseus-parsers/widget.d.ts +2 -2
- package/dist/types.d.ts +5 -2
- package/dist/utils/random-util.d.ts +1 -1
- package/dist/utils/split-perseus-item.d.ts +2 -2
- package/dist/utils/test-utils.d.ts +11 -0
- package/dist/validation.types.d.ts +27 -27
- package/package.json +3 -3
package/dist/data-schema.d.ts
CHANGED
|
@@ -50,8 +50,8 @@ export type ShowSolutions = "all" | "selected" | "none";
|
|
|
50
50
|
*
|
|
51
51
|
* ```
|
|
52
52
|
* interface DummyRegistry {
|
|
53
|
-
* categorizer: { categories:
|
|
54
|
-
* dropdown: { choices:
|
|
53
|
+
* categorizer: { categories: string[] };
|
|
54
|
+
* dropdown: { choices: string[] }:
|
|
55
55
|
* }
|
|
56
56
|
* ```
|
|
57
57
|
*
|
|
@@ -65,8 +65,8 @@ export type ShowSolutions = "all" | "selected" | "none";
|
|
|
65
65
|
*
|
|
66
66
|
* ```
|
|
67
67
|
* type DummyMap = {
|
|
68
|
-
* `categorizer ${number}`: { categories:
|
|
69
|
-
* `dropdown ${number}`: { choices:
|
|
68
|
+
* `categorizer ${number}`: { categories: string[] };
|
|
69
|
+
* `dropdown ${number}`: { choices: string[] };
|
|
70
70
|
* }
|
|
71
71
|
* ```
|
|
72
72
|
*
|
|
@@ -192,23 +192,14 @@ export type PerseusWidget = PerseusWidgetTypes[keyof PerseusWidgetTypes];
|
|
|
192
192
|
*/
|
|
193
193
|
export type PerseusItem = {
|
|
194
194
|
question: PerseusRenderer;
|
|
195
|
-
hints:
|
|
195
|
+
hints: Hint[];
|
|
196
196
|
answerArea: PerseusAnswerArea | null | undefined;
|
|
197
|
-
/**
|
|
198
|
-
* The version of the item.
|
|
199
|
-
* @deprecated Not used.
|
|
200
|
-
*/
|
|
201
|
-
itemDataVersion: any;
|
|
202
|
-
/**
|
|
203
|
-
* @deprecated Superseded by per-widget answers.
|
|
204
|
-
*/
|
|
205
|
-
answer: any;
|
|
206
197
|
};
|
|
207
198
|
/**
|
|
208
199
|
* A "PerseusArticle" is an item that is meant to be rendered as an article.
|
|
209
200
|
* This item is never scored and is rendered by the `ArticleRenderer`.
|
|
210
201
|
*/
|
|
211
|
-
export type PerseusArticle = PerseusRenderer |
|
|
202
|
+
export type PerseusArticle = PerseusRenderer | PerseusRenderer[];
|
|
212
203
|
export type Version = {
|
|
213
204
|
major: number;
|
|
214
205
|
minor: number;
|
|
@@ -307,7 +298,7 @@ export type DeprecatedStandinWidget = WidgetOptions<'deprecated-standin', object
|
|
|
307
298
|
* A background image applied to various widgets.
|
|
308
299
|
*/
|
|
309
300
|
export type PerseusImageBackground = {
|
|
310
|
-
url
|
|
301
|
+
url?: string | null;
|
|
311
302
|
width?: number;
|
|
312
303
|
height?: number;
|
|
313
304
|
top?: number;
|
|
@@ -325,18 +316,18 @@ export type PerseusImageBackground = {
|
|
|
325
316
|
export type MarkingsType = "axes" | "graph" | "grid" | "none";
|
|
326
317
|
export type AxisLabelLocation = "onAxis" | "alongEdge";
|
|
327
318
|
export type PerseusCategorizerWidgetOptions = {
|
|
328
|
-
items:
|
|
329
|
-
categories:
|
|
319
|
+
items: string[];
|
|
320
|
+
categories: string[];
|
|
330
321
|
randomizeItems: boolean;
|
|
331
322
|
static: boolean;
|
|
332
|
-
values:
|
|
323
|
+
values: number[];
|
|
333
324
|
highlightLint?: boolean;
|
|
334
325
|
linterContext?: PerseusLinterContext;
|
|
335
326
|
};
|
|
336
327
|
export type PerseusLinterContext = {
|
|
337
328
|
contentType: string;
|
|
338
|
-
paths:
|
|
339
|
-
stack:
|
|
329
|
+
paths: string[];
|
|
330
|
+
stack: string[];
|
|
340
331
|
};
|
|
341
332
|
export type PerseusDefinitionWidgetOptions = {
|
|
342
333
|
togglePrompt: string;
|
|
@@ -344,7 +335,7 @@ export type PerseusDefinitionWidgetOptions = {
|
|
|
344
335
|
static: boolean;
|
|
345
336
|
};
|
|
346
337
|
export type PerseusDropdownWidgetOptions = {
|
|
347
|
-
choices:
|
|
338
|
+
choices: PerseusDropdownChoice[];
|
|
348
339
|
placeholder: string;
|
|
349
340
|
static: boolean;
|
|
350
341
|
visibleLabel?: string;
|
|
@@ -361,13 +352,13 @@ export type PerseusExplanationWidgetOptions = {
|
|
|
361
352
|
widgets: PerseusWidgetsMap;
|
|
362
353
|
static: boolean;
|
|
363
354
|
};
|
|
364
|
-
export type LegacyButtonSets =
|
|
355
|
+
export type LegacyButtonSets = Array<"basic" | "basic+div" | "trig" | "prealgebra" | "logarithms" | "basic relations" | "advanced relations" | "scientific">;
|
|
365
356
|
export type PerseusExpressionWidgetOptions = {
|
|
366
|
-
answerForms:
|
|
357
|
+
answerForms: PerseusExpressionAnswerForm[];
|
|
367
358
|
buttonSets: LegacyButtonSets;
|
|
368
|
-
functions:
|
|
359
|
+
functions: string[];
|
|
369
360
|
times: boolean;
|
|
370
|
-
extraKeys?:
|
|
361
|
+
extraKeys?: KeypadKey[];
|
|
371
362
|
visibleLabel?: string;
|
|
372
363
|
ariaLabel?: string;
|
|
373
364
|
buttonsVisible?: "always" | "never" | "focused";
|
|
@@ -393,7 +384,7 @@ export type PerseusGradedGroupWidgetOptions = {
|
|
|
393
384
|
};
|
|
394
385
|
};
|
|
395
386
|
export type PerseusGradedGroupSetWidgetOptions = {
|
|
396
|
-
gradedGroups:
|
|
387
|
+
gradedGroups: PerseusGradedGroupWidgetOptions[];
|
|
397
388
|
};
|
|
398
389
|
export type GraphRange = [
|
|
399
390
|
x: [min: number, max: number],
|
|
@@ -424,7 +415,7 @@ export type GrapherAnswerTypes = {
|
|
|
424
415
|
coords: null | [Coord, Coord];
|
|
425
416
|
};
|
|
426
417
|
export type PerseusGrapherWidgetOptions = {
|
|
427
|
-
availableTypes:
|
|
418
|
+
availableTypes: Array<"absolute_value" | "exponential" | "linear" | "logarithm" | "quadratic" | "sinusoid" | "tangent">;
|
|
428
419
|
correct: GrapherAnswerTypes;
|
|
429
420
|
graph: {
|
|
430
421
|
backgroundImage: {
|
|
@@ -436,7 +427,7 @@ export type PerseusGrapherWidgetOptions = {
|
|
|
436
427
|
width?: number;
|
|
437
428
|
};
|
|
438
429
|
box?: [number, number];
|
|
439
|
-
editableSettings?:
|
|
430
|
+
editableSettings?: Array<"graph" | "snap" | "image" | "measure">;
|
|
440
431
|
gridStep?: [number, number];
|
|
441
432
|
labels: [string, string];
|
|
442
433
|
markings: MarkingsType;
|
|
@@ -458,14 +449,14 @@ export type PerseusImageWidgetOptions = {
|
|
|
458
449
|
alt?: string;
|
|
459
450
|
backgroundImage: PerseusImageBackground;
|
|
460
451
|
static?: boolean;
|
|
461
|
-
labels?:
|
|
452
|
+
labels?: Array<PerseusImageLabel>;
|
|
462
453
|
range?: [Interval, Interval];
|
|
463
454
|
box?: Size;
|
|
464
455
|
};
|
|
465
456
|
export type PerseusImageLabel = {
|
|
466
457
|
content: string;
|
|
467
458
|
alignment: string;
|
|
468
|
-
coordinates:
|
|
459
|
+
coordinates: number[];
|
|
469
460
|
};
|
|
470
461
|
export type PerseusInteractiveGraphWidgetOptions = {
|
|
471
462
|
step: [number, number];
|
|
@@ -476,7 +467,7 @@ export type PerseusInteractiveGraphWidgetOptions = {
|
|
|
476
467
|
* The type of markings to display on the graph.
|
|
477
468
|
*/
|
|
478
469
|
markings: MarkingsType;
|
|
479
|
-
labels?:
|
|
470
|
+
labels?: string[];
|
|
480
471
|
/**
|
|
481
472
|
* Specifies the location of the labels on the graph. default: "onAxis".
|
|
482
473
|
* - "onAxis": Labels are positioned on the axis at the right (x) and top (y) of the graph.
|
|
@@ -512,7 +503,7 @@ export type PerseusInteractiveGraphWidgetOptions = {
|
|
|
512
503
|
range: GraphRange;
|
|
513
504
|
graph: PerseusGraphType;
|
|
514
505
|
correct: PerseusGraphType;
|
|
515
|
-
lockedFigures?:
|
|
506
|
+
lockedFigures?: LockedFigure[];
|
|
516
507
|
fullGraphAriaLabel?: string;
|
|
517
508
|
fullGraphAriaDescription?: string;
|
|
518
509
|
};
|
|
@@ -563,7 +554,7 @@ export type LockedEllipseType = {
|
|
|
563
554
|
};
|
|
564
555
|
export type LockedPolygonType = {
|
|
565
556
|
type: "polygon";
|
|
566
|
-
points:
|
|
557
|
+
points: Coord[];
|
|
567
558
|
color: LockedFigureColor;
|
|
568
559
|
showVertices: boolean;
|
|
569
560
|
fillStyle: LockedFigureFillType;
|
|
@@ -638,8 +629,8 @@ export type PerseusGraphTypeNone = {
|
|
|
638
629
|
export type PerseusGraphTypePoint = {
|
|
639
630
|
type: "point";
|
|
640
631
|
numPoints?: number | "unlimited";
|
|
641
|
-
coords?:
|
|
642
|
-
startCoords?:
|
|
632
|
+
coords?: Coord[] | null;
|
|
633
|
+
startCoords?: Coord[];
|
|
643
634
|
} & PerseusGraphTypeCommon;
|
|
644
635
|
export type PerseusGraphTypePolygon = {
|
|
645
636
|
type: "polygon";
|
|
@@ -648,8 +639,8 @@ export type PerseusGraphTypePolygon = {
|
|
|
648
639
|
showSides?: boolean;
|
|
649
640
|
snapTo?: "grid" | "angles" | "sides";
|
|
650
641
|
match?: "similar" | "congruent" | "approx" | "exact";
|
|
651
|
-
coords?:
|
|
652
|
-
startCoords?:
|
|
642
|
+
coords?: Coord[] | null;
|
|
643
|
+
startCoords?: Coord[];
|
|
653
644
|
} & PerseusGraphTypeCommon;
|
|
654
645
|
export type PerseusGraphTypeQuadratic = {
|
|
655
646
|
type: "quadratic";
|
|
@@ -664,8 +655,8 @@ export type PerseusGraphTypeSegment = {
|
|
|
664
655
|
} & PerseusGraphTypeCommon;
|
|
665
656
|
export type PerseusGraphTypeSinusoid = {
|
|
666
657
|
type: "sinusoid";
|
|
667
|
-
coords?:
|
|
668
|
-
startCoords?:
|
|
658
|
+
coords?: Coord[] | null;
|
|
659
|
+
startCoords?: Coord[];
|
|
669
660
|
} & PerseusGraphTypeCommon;
|
|
670
661
|
export type PerseusGraphTypeRay = {
|
|
671
662
|
type: "ray";
|
|
@@ -696,12 +687,12 @@ type NoneGraphCorrect = {
|
|
|
696
687
|
};
|
|
697
688
|
type PointGraphCorrect = {
|
|
698
689
|
type: "point";
|
|
699
|
-
coords:
|
|
690
|
+
coords: Coord[];
|
|
700
691
|
};
|
|
701
692
|
type PolygonGraphCorrect = {
|
|
702
693
|
type: "polygon";
|
|
703
694
|
match: "similar" | "congruent" | "approx";
|
|
704
|
-
coords:
|
|
695
|
+
coords: Coord[];
|
|
705
696
|
};
|
|
706
697
|
type QuadraticGraphCorrect = {
|
|
707
698
|
type: "quadratic";
|
|
@@ -721,36 +712,36 @@ type RayGraphCorrect = {
|
|
|
721
712
|
};
|
|
722
713
|
export type PerseusGraphCorrectType = AngleGraphCorrect | CircleGraphCorrect | LinearGraphCorrect | LinearSystemGraphCorrect | NoneGraphCorrect | PointGraphCorrect | PolygonGraphCorrect | QuadraticGraphCorrect | RayGraphCorrect | SegmentGraphCorrect | SinusoidGraphCorrect;
|
|
723
714
|
export type PerseusLabelImageWidgetOptions = {
|
|
724
|
-
choices:
|
|
715
|
+
choices: string[];
|
|
725
716
|
imageUrl: string;
|
|
726
717
|
imageAlt: string;
|
|
727
718
|
imageHeight: number;
|
|
728
719
|
imageWidth: number;
|
|
729
|
-
markers:
|
|
720
|
+
markers: PerseusLabelImageMarker[];
|
|
730
721
|
hideChoicesFromInstructions: boolean;
|
|
731
722
|
multipleAnswers: boolean;
|
|
732
723
|
static: boolean;
|
|
733
724
|
};
|
|
734
725
|
export type PerseusLabelImageMarker = {
|
|
735
|
-
answers:
|
|
726
|
+
answers: string[];
|
|
736
727
|
label: string;
|
|
737
728
|
x: number;
|
|
738
729
|
y: number;
|
|
739
730
|
};
|
|
740
731
|
export type PerseusMatcherWidgetOptions = {
|
|
741
|
-
labels:
|
|
742
|
-
left:
|
|
743
|
-
right:
|
|
732
|
+
labels: string[];
|
|
733
|
+
left: string[];
|
|
734
|
+
right: string[];
|
|
744
735
|
orderMatters: boolean;
|
|
745
736
|
padding: boolean;
|
|
746
737
|
};
|
|
747
|
-
export type PerseusMatrixWidgetAnswers =
|
|
738
|
+
export type PerseusMatrixWidgetAnswers = number[][];
|
|
748
739
|
export type PerseusMatrixWidgetOptions = {
|
|
749
740
|
prefix?: string | undefined;
|
|
750
741
|
suffix?: string | undefined;
|
|
751
742
|
answers: PerseusMatrixWidgetAnswers;
|
|
752
|
-
cursorPosition?:
|
|
753
|
-
matrixBoardSize:
|
|
743
|
+
cursorPosition?: number[] | undefined;
|
|
744
|
+
matrixBoardSize: number[];
|
|
754
745
|
static?: boolean | undefined;
|
|
755
746
|
};
|
|
756
747
|
export type PerseusMeasurerWidgetOptions = {
|
|
@@ -779,7 +770,7 @@ export type PerseusNumericInputAnswerForm = {
|
|
|
779
770
|
*/
|
|
780
771
|
export type PerseusNumericInputSimplify = "required" | "enforced" | "optional";
|
|
781
772
|
export type PerseusNumericInputWidgetOptions = {
|
|
782
|
-
answers:
|
|
773
|
+
answers: PerseusNumericInputAnswer[];
|
|
783
774
|
labelText?: string | undefined;
|
|
784
775
|
size: string;
|
|
785
776
|
coefficient: boolean;
|
|
@@ -790,31 +781,31 @@ export type PerseusNumericInputAnswer = {
|
|
|
790
781
|
message: string;
|
|
791
782
|
value?: number | null;
|
|
792
783
|
status: string;
|
|
793
|
-
answerForms?:
|
|
784
|
+
answerForms?: MathFormat[];
|
|
794
785
|
strict: boolean;
|
|
795
|
-
maxError
|
|
786
|
+
maxError?: number | null;
|
|
796
787
|
simplify: PerseusNumericInputSimplify;
|
|
797
788
|
};
|
|
798
789
|
export type PerseusNumberLineWidgetOptions = {
|
|
799
|
-
range:
|
|
800
|
-
labelRange:
|
|
790
|
+
range: number[];
|
|
791
|
+
labelRange: Array<number | null>;
|
|
801
792
|
labelStyle: string;
|
|
802
793
|
labelTicks: boolean;
|
|
803
|
-
isTickCtrl?: boolean | null
|
|
804
|
-
divisionRange:
|
|
805
|
-
numDivisions
|
|
794
|
+
isTickCtrl?: boolean | null;
|
|
795
|
+
divisionRange: number[];
|
|
796
|
+
numDivisions?: number | null;
|
|
806
797
|
snapDivisions: number;
|
|
807
|
-
tickStep
|
|
808
|
-
correctRel
|
|
798
|
+
tickStep?: number | null;
|
|
799
|
+
correctRel?: string | null;
|
|
809
800
|
correctX: number | null;
|
|
810
|
-
initialX
|
|
801
|
+
initialX?: number | null;
|
|
811
802
|
showTooltips?: boolean;
|
|
812
803
|
static: boolean;
|
|
813
804
|
};
|
|
814
805
|
export type PerseusOrdererWidgetOptions = {
|
|
815
|
-
options:
|
|
816
|
-
correctOptions:
|
|
817
|
-
otherOptions:
|
|
806
|
+
options: PerseusRenderer[];
|
|
807
|
+
correctOptions: PerseusRenderer[];
|
|
808
|
+
otherOptions: PerseusRenderer[];
|
|
818
809
|
height: "normal" | "auto";
|
|
819
810
|
layout: "horizontal" | "vertical";
|
|
820
811
|
};
|
|
@@ -833,22 +824,22 @@ export type PerseusPassageRefWidgetOptions = {
|
|
|
833
824
|
export declare const plotterPlotTypes: readonly ["bar", "line", "pic", "histogram", "dotplot"];
|
|
834
825
|
export type PlotType = (typeof plotterPlotTypes)[number];
|
|
835
826
|
export type PerseusPlotterWidgetOptions = {
|
|
836
|
-
labels:
|
|
837
|
-
categories:
|
|
827
|
+
labels: string[];
|
|
828
|
+
categories: string[];
|
|
838
829
|
type: PlotType;
|
|
839
830
|
maxY: number;
|
|
840
831
|
scaleY: number;
|
|
841
|
-
labelInterval
|
|
832
|
+
labelInterval?: number | null;
|
|
842
833
|
snapsPerLine: number;
|
|
843
|
-
starting:
|
|
844
|
-
correct:
|
|
845
|
-
picUrl
|
|
846
|
-
picSize
|
|
847
|
-
picBoxHeight
|
|
848
|
-
plotDimensions:
|
|
834
|
+
starting: number[];
|
|
835
|
+
correct: number[];
|
|
836
|
+
picUrl?: string | null;
|
|
837
|
+
picSize?: number | null;
|
|
838
|
+
picBoxHeight?: number | null;
|
|
839
|
+
plotDimensions: number[];
|
|
849
840
|
};
|
|
850
841
|
export type PerseusRadioWidgetOptions = {
|
|
851
|
-
choices:
|
|
842
|
+
choices: PerseusRadioChoice[];
|
|
852
843
|
hasNoneOfTheAbove?: boolean;
|
|
853
844
|
countChoices?: boolean;
|
|
854
845
|
numCorrect?: number;
|
|
@@ -867,25 +858,25 @@ export type PerseusRadioChoice = {
|
|
|
867
858
|
widgets?: PerseusWidgetsMap;
|
|
868
859
|
};
|
|
869
860
|
export type PerseusSorterWidgetOptions = {
|
|
870
|
-
correct:
|
|
861
|
+
correct: string[];
|
|
871
862
|
padding: boolean;
|
|
872
863
|
layout: "horizontal" | "vertical";
|
|
873
864
|
};
|
|
874
865
|
export type PerseusTableWidgetOptions = {
|
|
875
|
-
headers:
|
|
866
|
+
headers: string[];
|
|
876
867
|
rows: number;
|
|
877
868
|
columns: number;
|
|
878
|
-
answers:
|
|
869
|
+
answers: string[][];
|
|
879
870
|
};
|
|
880
871
|
export type PerseusInteractionWidgetOptions = {
|
|
881
872
|
graph: PerseusInteractionGraph;
|
|
882
|
-
elements:
|
|
873
|
+
elements: PerseusInteractionElement[];
|
|
883
874
|
static: boolean;
|
|
884
875
|
};
|
|
885
876
|
export type PerseusInteractionGraph = {
|
|
886
|
-
editableSettings?:
|
|
877
|
+
editableSettings?: Array<"canvas" | "graph">;
|
|
887
878
|
box: Size;
|
|
888
|
-
labels:
|
|
879
|
+
labels: string[];
|
|
889
880
|
range: [Interval, Interval];
|
|
890
881
|
gridStep: [number, number];
|
|
891
882
|
/**
|
|
@@ -1010,7 +1001,7 @@ export type PerseusInteractionRectangleElementOptions = {
|
|
|
1010
1001
|
export type PerseusCSProgramWidgetOptions = {
|
|
1011
1002
|
programID: string;
|
|
1012
1003
|
programType?: any;
|
|
1013
|
-
settings:
|
|
1004
|
+
settings: PerseusCSProgramSetting[];
|
|
1014
1005
|
showEditor: boolean;
|
|
1015
1006
|
showButtons: boolean;
|
|
1016
1007
|
height: number;
|
|
@@ -1026,7 +1017,7 @@ export type PerseusPythonProgramWidgetOptions = {
|
|
|
1026
1017
|
};
|
|
1027
1018
|
export type PerseusIFrameWidgetOptions = {
|
|
1028
1019
|
url: string;
|
|
1029
|
-
settings?:
|
|
1020
|
+
settings?: PerseusCSProgramSetting[];
|
|
1030
1021
|
width: number | string;
|
|
1031
1022
|
height: number | string;
|
|
1032
1023
|
allowFullScreen: boolean;
|
package/dist/es/index.js
CHANGED
|
@@ -21,7 +21,9 @@ var grapherUtil = /*#__PURE__*/Object.freeze({
|
|
|
21
21
|
functionForType: functionForType
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
const genericPerseusItemData={question:{content:"",images:{},widgets:{}},answerArea:{calculator:false,chi2Table:false,periodicTable:false,tTable:false,zTable:false,financialCalculatorMonthlyPayment:false,financialCalculatorTotalAmount:false,financialCalculatorTimeToPayOff:false,periodicTableWithKey:false},hints:[]};function generateTestPerseusItem(customFields={}){return {...genericPerseusItemData,...customFields}}
|
|
25
|
+
|
|
26
|
+
function isRealJSONParse(jsonParse){const randomPhrase=buildRandomPhrase();const randomHintPhrase=buildRandomPhrase();const randomString=buildRandomString();const testingObject=JSON.stringify({answerArea:{calculator:false,chi2Table:false,financialCalculatorMonthlyPayment:false,financialCalculatorTimeToPayOff:false,financialCalculatorTotalAmount:false,periodicTable:false,periodicTableWithKey:false,tTable:false,zTable:false},hints:[randomHintPhrase,`=${Math.floor(Math.random()*50)+1}`],question:{content:`${randomPhrase}`,images:{},widgets:{expression1:{alignment:"default",graded:false,options:{answerForms:[{considered:"wrong",form:false,key:0,simplify:false,value:`${randomString}`}],ariaLabel:"Answer",buttonSets:["basic"],functions:["f","g","h"],static:true,times:false,visibleLabel:"Answer"},static:true,type:"expression",version:{major:1,minor:0}}}}});const testJSON=buildTestData(testingObject.replace(/"/g,'\\"'));const parsedTestJSON=jsonParse(testJSON);const parsedTestItemData=parsedTestJSON.data.assessmentItem.item.itemData;return approximateDeepEqual(parsedTestItemData,testingObject)}function buildRandomString(capitalize=false){let randomString="";const randomLength=Math.floor(Math.random()*8)+3;for(let i=0;i<randomLength;i++){const randomLetter=String.fromCharCode(97+Math.floor(Math.random()*26));randomString+=capitalize&&i===0?randomLetter.toUpperCase():randomLetter;}return randomString}function buildRandomPhrase(){const phrases=[];const randomLength=Math.floor(Math.random()*10)+5;for(let i=0;i<randomLength;i++){phrases.push(buildRandomString(i===0));}const modifierStart=["**","$"];const modifierEnd=["**","$"];const modifierIndex=Math.floor(Math.random()*modifierStart.length);return `${modifierStart[modifierIndex]}${phrases.join(" ")}${modifierEnd[modifierIndex]}`}function buildTestData(testObject){return `{"data":{"assessmentItem":{"__typename":"AssessmentItemOrError","error":null,"item":{"__typename":"AssessmentItem","id":"x890b3c70f3e8f4a6","itemData":"${testObject}","problemType":"Type 1","sha":"c7284a3ad65214b4e62bccce236d92f7f5d35941"}}}}`}
|
|
25
27
|
|
|
26
28
|
function success(value){return {type:"success",value}}function failure(detail){return {type:"failure",detail}}function isFailure(result){return result.type==="failure"}function isSuccess(result){return result.type==="success"}function all(results,combineFailureDetails=a=>a){const values=[];const failureDetails=[];for(const result of results){if(result.type==="success"){values.push(result.value);}else {failureDetails.push(result.detail);}}if(failureDetails.length>0){return failure(failureDetails.reduce(combineFailureDetails))}return success(values)}
|
|
27
29
|
|
|
@@ -49,7 +51,7 @@ function nullable(parseValue){return (rawValue,ctx)=>{if(rawValue===null){return
|
|
|
49
51
|
|
|
50
52
|
const number=(rawValue,ctx)=>{if(typeof rawValue==="number"){return ctx.success(rawValue)}return ctx.failure("number",rawValue)};
|
|
51
53
|
|
|
52
|
-
function object(schema){return (rawValue,ctx)=>{if(!isObject(rawValue)){return ctx.failure("object",rawValue)}const ret={...rawValue};const mismatches=[];for(const[prop,propParser]of Object.entries(schema)){const result=propParser(rawValue[prop],ctx.forSubtree(prop));if(isSuccess(result)){if(result.value!==undefined||prop in rawValue){ret[prop]=result.value;}}else {mismatches.push(...result.detail);}}if(mismatches.length>0){return failure(mismatches)}return ctx.success(ret)}}
|
|
54
|
+
function objectWithAllPropertiesRequired(schema){return object(schema)}function object(schema){return (rawValue,ctx)=>{if(!isObject(rawValue)){return ctx.failure("object",rawValue)}const ret={...rawValue};const mismatches=[];for(const[prop,propParser]of Object.entries(schema)){const result=propParser(rawValue[prop],ctx.forSubtree(prop));if(isSuccess(result)){if(result.value!==undefined||prop in rawValue){ret[prop]=result.value;}}else {mismatches.push(...result.detail);}}if(mismatches.length>0){return failure(mismatches)}return ctx.success(ret)}}
|
|
53
55
|
|
|
54
56
|
function optional(parseValue){return (rawValue,ctx)=>{if(rawValue===undefined){return ctx.success(rawValue)}return parseValue(rawValue,ctx)}}
|
|
55
57
|
|
|
@@ -69,7 +71,7 @@ function defaulted(parser,fallback){return (rawValue,ctx)=>{if(rawValue==null){r
|
|
|
69
71
|
|
|
70
72
|
const parseImages=defaulted(record(string,object({width:number,height:number})),()=>({}));
|
|
71
73
|
|
|
72
|
-
function parseWidget(parseType,parseOptions){return
|
|
74
|
+
function parseWidget(parseType,parseOptions){return objectWithAllPropertiesRequired({type:parseType,static:optional(boolean),graded:optional(boolean),alignment:optional(string),options:parseOptions,key:optional(nullable(number)),version:optional(object({major:number,minor:number}))})}function parseWidgetWithVersion(parseVersion,parseType,parseOptions){return objectWithAllPropertiesRequired({type:parseType,static:optional(boolean),graded:optional(boolean),alignment:optional(string),options:parseOptions,key:optional(nullable(number)),version:parseVersion})}
|
|
73
75
|
|
|
74
76
|
const parseCategorizerWidget=parseWidget(constant("categorizer"),object({items:array(string),categories:array(string),randomizeItems:defaulted(boolean,()=>false),static:defaulted(boolean,()=>false),values:array(defaulted(number,()=>0)),highlightLint:optional(boolean),linterContext:optional(object({contentType:string,paths:array(string),stack:array(string)}))}));
|
|
75
77
|
|
|
@@ -147,7 +149,7 @@ const parsePythonProgramWidget=parseWidget(constant("python-program"),object({pr
|
|
|
147
149
|
|
|
148
150
|
const currentVersion$3={major:2,minor:0};function deriveNumCorrect(options){const{choices,numCorrect}=options;return numCorrect??choices.filter(c=>c.correct).length}const widgetOptionsUpgrades$2={"2":v1props=>{const upgraded={...v1props,numCorrect:deriveNumCorrect(v1props)};return upgraded},"1":v0props=>{const{noneOfTheAbove,...rest}=v0props;if(noneOfTheAbove){throw new Error("radio widget v0 no longer supports auto noneOfTheAbove")}return {...rest,hasNoneOfTheAbove:false}}};const defaultWidgetOptions$v={choices:[{},{},{},{}],displayCount:null,randomize:false,hasNoneOfTheAbove:false,multipleSelect:false,countChoices:false,deselectEnabled:false};
|
|
149
151
|
|
|
150
|
-
const parseWidgetsMapOrUndefined=defaulted((rawVal,ctx)=>parseWidgetsMap(rawVal,ctx),()=>undefined);const version2=optional(object({major:constant(2),minor:number}));const parseRadioWidgetV2=parseWidgetWithVersion(version2,constant("radio"),object({numCorrect:optional(number),choices:array(object({content:defaulted(string,()=>""),clue:optional(string),correct:optional(boolean),isNoneOfTheAbove:optional(boolean),widgets:parseWidgetsMapOrUndefined})),hasNoneOfTheAbove:optional(boolean),countChoices:optional(boolean),randomize:optional(boolean),multipleSelect:optional(boolean),deselectEnabled:optional(boolean),onePerLine:optional(boolean),displayCount:optional(any),noneOfTheAbove:optional(constant(false))}));const version1=optional(object({major:constant(1),minor:number}));const parseRadioWidgetV1=parseWidgetWithVersion(version1,constant("radio"),object({choices:array(object({content:defaulted(string,()=>""),clue:optional(string),correct:optional(boolean),isNoneOfTheAbove:optional(boolean),widgets:parseWidgetsMapOrUndefined})),hasNoneOfTheAbove:optional(boolean),countChoices:optional(boolean),randomize:optional(boolean),multipleSelect:optional(boolean),deselectEnabled:optional(boolean),onePerLine:optional(boolean),displayCount:optional(any),noneOfTheAbove:optional(constant(false))}));function migrateV1ToV2(widget){const{options}=widget;return {...widget,version:{major:2,minor:0},options:{...options,numCorrect:deriveNumCorrect(options)}}}const version0=optional(object({major:constant(0),minor:number}));const parseRadioWidgetV0=parseWidgetWithVersion(version0,constant("radio"),object({choices:array(object({content:defaulted(string,()=>""),clue:optional(string),correct:optional(boolean),isNoneOfTheAbove:optional(boolean),widgets:parseWidgetsMapOrUndefined})),hasNoneOfTheAbove:optional(boolean),countChoices:optional(boolean),randomize:optional(boolean),multipleSelect:optional(boolean),deselectEnabled:optional(boolean),onePerLine:optional(boolean),displayCount:optional(any),noneOfTheAbove:optional(constant(false))}));function migrateV0ToV1(widget){const{options}=widget;const{noneOfTheAbove:_,...rest}=options;return {...widget,version:{major:1,minor:0},options:{...rest,hasNoneOfTheAbove:false}}}const parseRadioWidget=versionedWidgetOptions(2,parseRadioWidgetV2).withMigrationFrom(1,parseRadioWidgetV1,migrateV1ToV2).withMigrationFrom(0,parseRadioWidgetV0,migrateV0ToV1).parser;
|
|
152
|
+
const parseWidgetsMapOrUndefined=defaulted((rawVal,ctx)=>parseWidgetsMap(rawVal,ctx),()=>undefined);const version2=optional(object({major:constant(2),minor:number}));const parseRadioWidgetV2=parseWidgetWithVersion(version2,constant("radio"),object({numCorrect:optional(number),choices:array(object({content:defaulted(string,()=>""),clue:optional(string),correct:optional(boolean),isNoneOfTheAbove:optional(boolean),widgets:parseWidgetsMapOrUndefined})),hasNoneOfTheAbove:optional(boolean),countChoices:optional(boolean),randomize:optional(boolean),multipleSelect:optional(boolean),deselectEnabled:optional(boolean),onePerLine:optional(boolean),displayCount:optional(any),noneOfTheAbove:optional(constant(false))}));const version1=optional(object({major:constant(1),minor:number}));const parseRadioWidgetV1=parseWidgetWithVersion(version1,constant("radio"),object({choices:array(object({content:defaulted(string,()=>""),clue:optional(string),correct:optional(boolean),isNoneOfTheAbove:optional(boolean),widgets:parseWidgetsMapOrUndefined})),hasNoneOfTheAbove:optional(boolean),countChoices:optional(boolean),randomize:optional(boolean),multipleSelect:optional(boolean),deselectEnabled:optional(boolean),onePerLine:optional(boolean),displayCount:optional(any),noneOfTheAbove:optional(constant(false))}));function migrateV1ToV2(widget){const{options}=widget;return {...widget,version:{major:2,minor:0},options:{...options,numCorrect:deriveNumCorrect(options)}}}const version0=optional(object({major:constant(0),minor:number}));const parseRadioWidgetV0=parseWidgetWithVersion(version0,constant("radio"),object({choices:array(object({content:defaulted(string,()=>""),clue:optional(string),correct:optional(boolean),isNoneOfTheAbove:optional(boolean),widgets:parseWidgetsMapOrUndefined})),hasNoneOfTheAbove:optional(boolean),countChoices:optional(boolean),randomize:optional(boolean),multipleSelect:optional(boolean),deselectEnabled:optional(boolean),onePerLine:optional(boolean),displayCount:optional(any),noneOfTheAbove:optional(constant(false))}));function migrateV0ToV1(widget){const{options}=widget;const{noneOfTheAbove:_,...rest}=options;return {...widget,version:{major:1,minor:0},options:{...rest,hasNoneOfTheAbove:false,noneOfTheAbove:undefined}}}const parseRadioWidget=versionedWidgetOptions(2,parseRadioWidgetV2).withMigrationFrom(1,parseRadioWidgetV1,migrateV1ToV2).withMigrationFrom(0,parseRadioWidgetV0,migrateV0ToV1).parser;
|
|
151
153
|
|
|
152
154
|
const parseSorterWidget=parseWidget(constant("sorter"),object({correct:array(string),padding:boolean,layout:enumeration("horizontal","vertical")}));
|
|
153
155
|
|
|
@@ -165,11 +167,11 @@ const parseHint=object({replace:defaulted(boolean,()=>undefined),content:string,
|
|
|
165
167
|
|
|
166
168
|
const parsePerseusAnswerArea=pipeParsers(defaulted(object({}),()=>({}))).then(convert(toAnswerArea)).parser;function toAnswerArea(raw){return {zTable:!!raw.zTable,calculator:!!raw.calculator,chi2Table:!!raw.chi2Table,financialCalculatorMonthlyPayment:!!raw.financialCalculatorMonthlyPayment,financialCalculatorTotalAmount:!!raw.financialCalculatorTotalAmount,financialCalculatorTimeToPayOff:!!raw.financialCalculatorTimeToPayOff,periodicTable:!!raw.periodicTable,periodicTableWithKey:!!raw.periodicTableWithKey,tTable:!!raw.tTable}}
|
|
167
169
|
|
|
168
|
-
const parsePerseusItem$1=object({question:parsePerseusRenderer,hints:defaulted(array(parseHint),()=>[]),answerArea:parsePerseusAnswerArea
|
|
170
|
+
const parsePerseusItem$1=object({question:parsePerseusRenderer,hints:defaulted(array(parseHint),()=>[]),answerArea:parsePerseusAnswerArea});
|
|
169
171
|
|
|
170
172
|
function parsePerseusItem(json){if(isRealJSONParse(JSON.parse)){return JSON.parse(json)}throw new Error("Something went wrong.")}function parseAndMigratePerseusItem(json){throwErrorIfCheatingDetected();const object=JSON.parse(json);const result=parse(object,parsePerseusItem$1);if(isFailure(result)){return failure({message:result.detail,invalidObject:object})}return result}function parseAndMigratePerseusArticle(json){throwErrorIfCheatingDetected();const object=JSON.parse(json);const result=parse(object,parsePerseusArticle);if(isFailure(result)){return failure({message:result.detail,invalidObject:object})}return result}function throwErrorIfCheatingDetected(){if(!isRealJSONParse(JSON.parse)){throw new Error("Something went wrong.")}}
|
|
171
173
|
|
|
172
|
-
const libName="@khanacademy/perseus-core";const libVersion="
|
|
174
|
+
const libName="@khanacademy/perseus-core";const libVersion="9.0.0";addLibraryVersionToPerseusDebug(libName,libVersion);
|
|
173
175
|
|
|
174
176
|
const Errors=Object.freeze({Unknown:"Unknown",Internal:"Internal",InvalidInput:"InvalidInput",NotAllowed:"NotAllowed",TransientService:"TransientService",Service:"Service"});
|
|
175
177
|
|
|
@@ -227,7 +229,7 @@ function getLabelImagePublicWidgetOptions(options){return {...options,markers:op
|
|
|
227
229
|
|
|
228
230
|
const defaultWidgetOptions$f={choices:[],imageAlt:"",imageUrl:"",imageWidth:0,imageHeight:0,markers:[],multipleAnswers:false,hideChoicesFromInstructions:false};const labelImageWidgetLogic={name:"label-image",defaultWidgetOptions: defaultWidgetOptions$f,getPublicWidgetOptions:getLabelImagePublicWidgetOptions};
|
|
229
231
|
|
|
230
|
-
const seededRNG=function(seed){let randomSeed=seed;return function(){let seed=randomSeed;seed=seed+0x7ed55d16+(seed<<12)&0xffffffff;seed=(seed^0xc761c23c^seed>>>19)&0xffffffff;seed=seed+0x165667b1+(seed<<5)&0xffffffff;seed=(seed+0xd3a2646c^seed<<9)&0xffffffff;seed=seed+0xfd7046c5+(seed<<3)&0xffffffff;seed=(seed^0xb55a4f09^seed>>>16)&0xffffffff;return (randomSeed=seed&0xfffffff)/0x10000000}};function shuffle(array,randomSeed,ensurePermuted=false){const shuffled=
|
|
232
|
+
const seededRNG=function(seed){let randomSeed=seed;return function(){let seed=randomSeed;seed=seed+0x7ed55d16+(seed<<12)&0xffffffff;seed=(seed^0xc761c23c^seed>>>19)&0xffffffff;seed=seed+0x165667b1+(seed<<5)&0xffffffff;seed=(seed+0xd3a2646c^seed<<9)&0xffffffff;seed=seed+0xfd7046c5+(seed<<3)&0xffffffff;seed=(seed^0xb55a4f09^seed>>>16)&0xffffffff;return (randomSeed=seed&0xfffffff)/0x10000000}};function shuffle(array,randomSeed,ensurePermuted=false){const shuffled=[...array];if(!shuffled.length||_.all(shuffled,function(value){return _.isEqual(value,shuffled[0])})){return shuffled}let random;if(typeof randomSeed==="function"){random=randomSeed;}else {random=seededRNG(randomSeed);}do{for(let top=shuffled.length;top>0;top--){const newEnd=Math.floor(random()*top);const temp=shuffled[newEnd];shuffled[newEnd]=shuffled[top-1];shuffled[top-1]=temp;}}while(ensurePermuted&&_.isEqual(array,shuffled))return shuffled}const random=seededRNG(new Date().getTime()&0xffffffff);
|
|
231
233
|
|
|
232
234
|
const shuffleMatcher=props=>{const rng=seededRNG(props.problemNum);let left;if(!props.orderMatters){left=props.left;}else {left=shuffle(props.left,rng,true);}const right=shuffle(props.right,rng,true);return {left,right}};function shuffleMatcherWithRandom(data){let left;if(!data.orderMatters){left=data.left;}else {left=shuffle(data.left,Math.random,true);}const right=shuffle(data.right,Math.random,true);return {left,right}}function getMatcherPublicWidgetOptions(options){const{left,right}=shuffleMatcherWithRandom(options);return {...options,left:left,right:right}}
|
|
233
235
|
|
|
@@ -298,9 +300,9 @@ var coreWidgetRegistry = /*#__PURE__*/Object.freeze({
|
|
|
298
300
|
|
|
299
301
|
const DEFAULT_STATIC=false;const upgradeWidgetInfoToLatestVersion=oldWidgetInfo=>{const type=oldWidgetInfo.type;if(!_.isString(type)){throw new PerseusError("widget type must be a string, but was: "+type,Errors.Internal)}if(!isWidgetRegistered(type)){return oldWidgetInfo}const initialVersion=oldWidgetInfo.version||{major:0,minor:0};const latestVersion=getCurrentVersion(type);if(initialVersion.major>latestVersion.major||initialVersion.major===latestVersion.major&&initialVersion.minor>latestVersion.minor){return oldWidgetInfo}let newEditorOptions=_.clone(oldWidgetInfo.options)||{};const upgradePropsMap=getWidgetOptionsUpgrades(type);if(_.keys(newEditorOptions).length!==0){for(let nextVersion=initialVersion.major+1;nextVersion<=latestVersion.major;nextVersion++){if(upgradePropsMap[String(nextVersion)]){newEditorOptions=upgradePropsMap[String(nextVersion)](newEditorOptions);}else {throw new PerseusError("No upgrade found for widget. Cannot render.",Errors.Internal,{metadata:{type,fromMajorVersion:nextVersion-1,toMajorVersion:nextVersion,oldWidgetInfo:JSON.stringify(oldWidgetInfo)}})}}}const defaultOptions=getDefaultWidgetOptions(type);newEditorOptions={...defaultOptions,...newEditorOptions};let alignment=oldWidgetInfo.alignment;if(alignment==null||alignment==="default"){alignment=getSupportedAlignments(type)?.[0];if(!alignment){throw new PerseusError("No default alignment found when upgrading widget",Errors.Internal,{metadata:{widgetType:type}})}}let widgetStatic=oldWidgetInfo.static;if(widgetStatic==null){widgetStatic=DEFAULT_STATIC;}return {...oldWidgetInfo,version:latestVersion,graded:oldWidgetInfo.graded!=null?oldWidgetInfo.graded:true,alignment:alignment,static:widgetStatic,options:newEditorOptions}};function getUpgradedWidgetOptions(oldWidgetOptions){return mapObject(oldWidgetOptions,(widgetInfo,widgetId)=>{if(!widgetInfo.type||!widgetInfo.alignment){const newValues={};if(!widgetInfo.type){newValues.type=widgetId.split(" ")[0];}if(!widgetInfo.alignment){newValues.alignment="default";}widgetInfo={...widgetInfo,...newValues};}return upgradeWidgetInfoToLatestVersion(widgetInfo)})}
|
|
300
302
|
|
|
301
|
-
function splitPerseusItem(originalItem){const item=_.clone(originalItem);const originalWidgets=item.widgets??{};const upgradedWidgets=getUpgradedWidgetOptions(originalWidgets);const splitWidgets={};for(const[id,widget]of Object.entries(upgradedWidgets)){const publicWidgetOptionsFun=getPublicWidgetOptionsFunction(widget.type);splitWidgets[id]={...widget,options:publicWidgetOptionsFun(widget.options)};}return {...item,widgets:splitWidgets}}
|
|
303
|
+
function splitPerseusItem(originalItem){const item=_.clone(originalItem);const originalWidgets=item.question.widgets??{};const upgradedWidgets=getUpgradedWidgetOptions(originalWidgets);const splitWidgets={};for(const[id,widget]of Object.entries(upgradedWidgets)){const publicWidgetOptionsFun=getPublicWidgetOptionsFunction(widget.type);splitWidgets[id]={...widget,options:publicWidgetOptionsFun(widget.options)};}return {...item,question:{...item.question,widgets:splitWidgets},hints:[]}}
|
|
302
304
|
|
|
303
305
|
const PerseusFeatureFlags=["new-radio-widget"];
|
|
304
306
|
|
|
305
|
-
export { coreWidgetRegistry as CoreWidgetRegistry, Errors, grapherUtil as GrapherUtil, ItemExtras, PerseusError, PerseusExpressionAnswerFormConsidered, PerseusFeatureFlags, addWidget, approximateDeepEqual, approximateEqual, categorizerWidgetLogic as categorizerLogic, csProgramWidgetLogic as csProgramLogic, deepClone, definitionWidgetLogic as definitionLogic, deriveExtraKeys, deriveNumCorrect, dropdownWidgetLogic as dropdownLogic, explanationWidgetLogic as explanationLogic, expressionWidgetLogic as expressionLogic, getCSProgramPublicWidgetOptions, getCategorizerPublicWidgetOptions, getDecimalSeparator, getDropdownPublicWidgetOptions, getExpressionPublicWidgetOptions, getGrapherPublicWidgetOptions, getIFramePublicWidgetOptions, getInteractiveGraphPublicWidgetOptions, getLabelImagePublicWidgetOptions, getMatcherPublicWidgetOptions, getMatrixPublicWidgetOptions, getMatrixSize, getNumberLinePublicWidgetOptions, getNumericInputPublicWidgetOptions, getOrdererPublicWidgetOptions, getPlotterPublicWidgetOptions, getRadioPublicWidgetOptions, getSorterPublicWidgetOptions, getTablePublicWidgetOptions, getUpgradedWidgetOptions, getWidgetIdsFromContent, getWidgetIdsFromContentByType, gradedGroupWidgetLogic as gradedGroupLogic, gradedGroupSetWidgetLogic as gradedGroupSetLogic, grapherWidgetLogic as grapherLogic, groupWidgetLogic as groupLogic, iframeWidgetLogic as iframeLogic, imageWidgetLogic as imageLogic, inputNumberWidgetLogic as inputNumberLogic, interactionWidgetLogic as interactionLogic, interactiveGraphWidgetLogic as interactiveGraphLogic, isFailure, isSuccess, labelImageWidgetLogic as labelImageLogic, libVersion, lockedFigureColorNames, lockedFigureColors, lockedFigureFillStyles, mapObject, matcherWidgetLogic as matcherLogic, matrixWidgetLogic as matrixLogic, measurerWidgetLogic as measurerLogic, numberLineWidgetLogic as numberLineLogic, numericInputWidgetLogic as numericInputLogic, ordererWidgetLogic as ordererLogic, parseAndMigratePerseusArticle, parseAndMigratePerseusItem, parsePerseusItem, passageWidgetLogic as passageLogic, passageRefWidgetLogic as passageRefLogic, passageRefTargetWidgetLogic as passageRefTargetLogic, phetSimulationWidgetLogic as phetSimulationLogic, plotterWidgetLogic as plotterLogic, plotterPlotTypes, pluck, pythonProgramWidgetLogic as pythonProgramLogic, radioWidgetLogic as radioLogic, random, seededRNG, shuffle, shuffleMatcher, sorterWidgetLogic as sorterLogic, splitPerseusItem, tableWidgetLogic as tableLogic, upgradeWidgetInfoToLatestVersion, usesNumCorrect, videoWidgetLogic as videoLogic };
|
|
307
|
+
export { coreWidgetRegistry as CoreWidgetRegistry, Errors, grapherUtil as GrapherUtil, ItemExtras, PerseusError, PerseusExpressionAnswerFormConsidered, PerseusFeatureFlags, addWidget, approximateDeepEqual, approximateEqual, categorizerWidgetLogic as categorizerLogic, csProgramWidgetLogic as csProgramLogic, deepClone, definitionWidgetLogic as definitionLogic, deriveExtraKeys, deriveNumCorrect, dropdownWidgetLogic as dropdownLogic, explanationWidgetLogic as explanationLogic, expressionWidgetLogic as expressionLogic, generateTestPerseusItem, getCSProgramPublicWidgetOptions, getCategorizerPublicWidgetOptions, getDecimalSeparator, getDropdownPublicWidgetOptions, getExpressionPublicWidgetOptions, getGrapherPublicWidgetOptions, getIFramePublicWidgetOptions, getInteractiveGraphPublicWidgetOptions, getLabelImagePublicWidgetOptions, getMatcherPublicWidgetOptions, getMatrixPublicWidgetOptions, getMatrixSize, getNumberLinePublicWidgetOptions, getNumericInputPublicWidgetOptions, getOrdererPublicWidgetOptions, getPlotterPublicWidgetOptions, getRadioPublicWidgetOptions, getSorterPublicWidgetOptions, getTablePublicWidgetOptions, getUpgradedWidgetOptions, getWidgetIdsFromContent, getWidgetIdsFromContentByType, gradedGroupWidgetLogic as gradedGroupLogic, gradedGroupSetWidgetLogic as gradedGroupSetLogic, grapherWidgetLogic as grapherLogic, groupWidgetLogic as groupLogic, iframeWidgetLogic as iframeLogic, imageWidgetLogic as imageLogic, inputNumberWidgetLogic as inputNumberLogic, interactionWidgetLogic as interactionLogic, interactiveGraphWidgetLogic as interactiveGraphLogic, isFailure, isSuccess, labelImageWidgetLogic as labelImageLogic, libVersion, lockedFigureColorNames, lockedFigureColors, lockedFigureFillStyles, mapObject, matcherWidgetLogic as matcherLogic, matrixWidgetLogic as matrixLogic, measurerWidgetLogic as measurerLogic, numberLineWidgetLogic as numberLineLogic, numericInputWidgetLogic as numericInputLogic, ordererWidgetLogic as ordererLogic, parseAndMigratePerseusArticle, parseAndMigratePerseusItem, parsePerseusItem, passageWidgetLogic as passageLogic, passageRefWidgetLogic as passageRefLogic, passageRefTargetWidgetLogic as passageRefTargetLogic, phetSimulationWidgetLogic as phetSimulationLogic, plotterWidgetLogic as plotterLogic, plotterPlotTypes, pluck, pythonProgramWidgetLogic as pythonProgramLogic, radioWidgetLogic as radioLogic, random, seededRNG, shuffle, shuffleMatcher, sorterWidgetLogic as sorterLogic, splitPerseusItem, tableWidgetLogic as tableLogic, upgradeWidgetInfoToLatestVersion, usesNumCorrect, videoWidgetLogic as videoLogic };
|
|
306
308
|
//# sourceMappingURL=index.js.map
|