@khanacademy/perseus-core 19.2.0 → 19.4.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.
Files changed (88) hide show
  1. package/dist/data-schema.d.ts +1 -0
  2. package/dist/es/index.item-splitting.js +1 -1
  3. package/dist/es/index.item-splitting.js.map +1 -1
  4. package/dist/es/index.js +5 -3
  5. package/dist/es/index.js.map +1 -1
  6. package/dist/index.d.ts +2 -0
  7. package/dist/index.item-splitting.js +1 -1
  8. package/dist/index.item-splitting.js.map +1 -1
  9. package/dist/index.js +6 -2
  10. package/dist/index.js.map +1 -1
  11. package/dist/parse-perseus-json/perseus-parsers/image-widget.d.ts +1 -0
  12. package/dist/parse-perseus-json/regression-tests/article-data/image-with-id-0.d.ts +201 -0
  13. package/dist/parse-perseus-json/regression-tests/item-data/categorizer-missing-randomizeItems.d.ts +36 -0
  14. package/dist/parse-perseus-json/regression-tests/item-data/categorizer-missing-static.d.ts +37 -0
  15. package/dist/parse-perseus-json/regression-tests/item-data/categorizer-with-null-value.d.ts +44 -0
  16. package/dist/parse-perseus-json/regression-tests/item-data/cs-program-missing-static.d.ts +71 -0
  17. package/dist/parse-perseus-json/regression-tests/item-data/cs-program-with-null-width.d.ts +21 -0
  18. package/dist/parse-perseus-json/regression-tests/item-data/definition-missing-static.d.ts +55 -0
  19. package/dist/parse-perseus-json/regression-tests/item-data/dropdown-missing-placeholder.d.ts +38 -0
  20. package/dist/parse-perseus-json/regression-tests/item-data/dropdown-missing-version.d.ts +34 -0
  21. package/dist/parse-perseus-json/regression-tests/item-data/explanation-missing-widgets-map.d.ts +69 -0
  22. package/dist/parse-perseus-json/regression-tests/item-data/expression-answerForm-missing-form.d.ts +41 -0
  23. package/dist/parse-perseus-json/regression-tests/item-data/expression-missing-buttonSets.d.ts +35 -0
  24. package/dist/parse-perseus-json/regression-tests/item-data/expression-option-missing-value.d.ts +44 -0
  25. package/dist/parse-perseus-json/regression-tests/item-data/expression-with-null-answer-key.d.ts +124 -0
  26. package/dist/parse-perseus-json/regression-tests/item-data/expression-with-scientific-notation.d.ts +115 -0
  27. package/dist/parse-perseus-json/regression-tests/item-data/graded-group-with-false-hint.d.ts +133 -0
  28. package/dist/parse-perseus-json/regression-tests/item-data/grapher-with-empty-coords.d.ts +111 -0
  29. package/dist/parse-perseus-json/regression-tests/item-data/grapher-with-null-coords.d.ts +59 -0
  30. package/dist/parse-perseus-json/regression-tests/item-data/hint-missing-images.d.ts +175 -0
  31. package/dist/parse-perseus-json/regression-tests/item-data/hint-with-null-replace.d.ts +72 -0
  32. package/dist/parse-perseus-json/regression-tests/item-data/iframe-missing-allowFullScreen.d.ts +63 -0
  33. package/dist/parse-perseus-json/regression-tests/item-data/iframe-missing-settings.d.ts +18 -0
  34. package/dist/parse-perseus-json/regression-tests/item-data/iframe-missing-static.d.ts +46 -0
  35. package/dist/parse-perseus-json/regression-tests/item-data/image-with-null-dimensions.d.ts +181 -0
  36. package/dist/parse-perseus-json/regression-tests/item-data/input-number-with-boolean-value.d.ts +84 -0
  37. package/dist/parse-perseus-json/regression-tests/item-data/interaction-element-missing-constraints.d.ts +115 -0
  38. package/dist/parse-perseus-json/regression-tests/item-data/interaction-element-missing-key.d.ts +353 -0
  39. package/dist/parse-perseus-json/regression-tests/item-data/interactive-graph-backgroundImage-with-empty-string-coordinates.d.ts +77 -0
  40. package/dist/parse-perseus-json/regression-tests/item-data/interactive-graph-locked-figures-missing-weights.d.ts +213 -0
  41. package/dist/parse-perseus-json/regression-tests/item-data/interactive-graph-locked-function-with-null-domain-element.d.ts +62 -0
  42. package/dist/parse-perseus-json/regression-tests/item-data/interactive-graph-locked-line-missing-showPoint1.d.ts +294 -0
  43. package/dist/parse-perseus-json/regression-tests/item-data/interactive-graph-missing-graph.d.ts +167 -0
  44. package/dist/parse-perseus-json/regression-tests/item-data/interactive-graph-missing-gridStep.d.ts +121 -0
  45. package/dist/parse-perseus-json/regression-tests/item-data/interactive-graph-missing-labels.d.ts +49 -0
  46. package/dist/parse-perseus-json/regression-tests/item-data/interactive-graph-polygon-with-exact-match.d.ts +96 -0
  47. package/dist/parse-perseus-json/regression-tests/item-data/interactive-graph-with-string-backgroundImage-left.d.ts +86 -0
  48. package/dist/parse-perseus-json/regression-tests/item-data/item-with-null-itemDataVersion.d.ts +100 -0
  49. package/dist/parse-perseus-json/regression-tests/item-data/label-image-missing-static.d.ts +110 -0
  50. package/dist/parse-perseus-json/regression-tests/item-data/lights-puzzle.d.ts +27 -0
  51. package/dist/parse-perseus-json/regression-tests/item-data/matcher-with-null-options.d.ts +14 -0
  52. package/dist/parse-perseus-json/regression-tests/item-data/matrix-missing-version.d.ts +24 -0
  53. package/dist/parse-perseus-json/regression-tests/item-data/matrix-with-nulls-in-answer.d.ts +39 -0
  54. package/dist/parse-perseus-json/regression-tests/item-data/matrix-with-string-answer-element.d.ts +69 -0
  55. package/dist/parse-perseus-json/regression-tests/item-data/measurer-missing-image.d.ts +49 -0
  56. package/dist/parse-perseus-json/regression-tests/item-data/measurer-missing-static.d.ts +41 -0
  57. package/dist/parse-perseus-json/regression-tests/item-data/number-line-missing-snapDivisions.d.ts +133 -0
  58. package/dist/parse-perseus-json/regression-tests/item-data/number-line-missing-static.d.ts +46 -0
  59. package/dist/parse-perseus-json/regression-tests/item-data/number-line-with-empty-strings-in-label-range.d.ts +92 -0
  60. package/dist/parse-perseus-json/regression-tests/item-data/number-line-with-null-correctX.d.ts +68 -0
  61. package/dist/parse-perseus-json/regression-tests/item-data/numeric-input-answer-with-null-value.d.ts +44 -0
  62. package/dist/parse-perseus-json/regression-tests/item-data/numeric-input-answer-with-simplify-true.d.ts +40 -0
  63. package/dist/parse-perseus-json/regression-tests/item-data/numeric-input-answer-without-value.d.ts +89 -0
  64. package/dist/parse-perseus-json/regression-tests/item-data/numeric-input-missing-coefficient.d.ts +43 -0
  65. package/dist/parse-perseus-json/regression-tests/item-data/numeric-input-missing-labelText.d.ts +210 -0
  66. package/dist/parse-perseus-json/regression-tests/item-data/numeric-input-with-null-answerForms.d.ts +228 -0
  67. package/dist/parse-perseus-json/regression-tests/item-data/numeric-input-with-simplify-accepted.d.ts +108 -0
  68. package/dist/parse-perseus-json/regression-tests/item-data/numeric-input-with-simplify-false.d.ts +52 -0
  69. package/dist/parse-perseus-json/regression-tests/item-data/numeric-input-with-simplify-true-string.d.ts +75 -0
  70. package/dist/parse-perseus-json/regression-tests/item-data/orderer-option-missing-images.d.ts +539 -0
  71. package/dist/parse-perseus-json/regression-tests/item-data/orderer-option-missing-widgets.d.ts +80 -0
  72. package/dist/parse-perseus-json/regression-tests/item-data/orderer-with-invalid-height.d.ts +33 -0
  73. package/dist/parse-perseus-json/regression-tests/item-data/orderer-with-undefined-options.d.ts +135 -0
  74. package/dist/parse-perseus-json/regression-tests/item-data/passage-missing-footnotes-and-title.d.ts +47 -0
  75. package/dist/parse-perseus-json/regression-tests/item-data/passage-ref-missing-summaryText.d.ts +147 -0
  76. package/dist/parse-perseus-json/regression-tests/item-data/plotter-missing-scaleY-and-snapsPerLine.d.ts +64 -0
  77. package/dist/parse-perseus-json/regression-tests/item-data/plotter-with-undefined-plotDimensions.d.ts +76 -0
  78. package/dist/parse-perseus-json/regression-tests/item-data/question-missing-content.d.ts +8 -0
  79. package/dist/parse-perseus-json/regression-tests/item-data/radio-choice-ids-set-to-empty-string.d.ts +49 -0
  80. package/dist/parse-perseus-json/regression-tests/item-data/radio-choice-missing-content.d.ts +147 -0
  81. package/dist/parse-perseus-json/regression-tests/item-data/radio-missing-noneOfTheAbove.d.ts +43 -0
  82. package/dist/parse-perseus-json/regression-tests/item-data/radio-with-extra-fields-from-go-schema.d.ts +169 -0
  83. package/dist/parse-perseus-json/regression-tests/item-data/radio-with-null-options.d.ts +78 -0
  84. package/dist/parse-perseus-json/regression-tests/item-data/radio-with-null-widgets.d.ts +115 -0
  85. package/dist/parse-perseus-json/regression-tests/item-data/simulator-widget.d.ts +51 -0
  86. package/dist/parse-perseus-json/regression-tests/item-data/transformer-widget.d.ts +99 -0
  87. package/dist/utils/get-divide-symbol.d.ts +8 -0
  88. package/package.json +2 -2
@@ -0,0 +1,68 @@
1
+ declare const _default: {
2
+ question: {
3
+ content: string;
4
+ images: {};
5
+ widgets: {
6
+ "numeric-input 1": {
7
+ type: string;
8
+ graded: boolean;
9
+ options: {
10
+ answers: {
11
+ value: number;
12
+ status: string;
13
+ message: string;
14
+ simplify: string;
15
+ strict: boolean;
16
+ maxError: null;
17
+ }[];
18
+ size: string;
19
+ coefficient: boolean;
20
+ };
21
+ version: {
22
+ major: number;
23
+ minor: number;
24
+ };
25
+ };
26
+ "number-line 1": {
27
+ type: string;
28
+ graded: boolean;
29
+ options: {
30
+ range: number[];
31
+ labelRange: null[];
32
+ divisionRange: number[];
33
+ labelStyle: string;
34
+ labelTicks: boolean;
35
+ numDivisions: number;
36
+ tickStep: null;
37
+ snapDivisions: number;
38
+ correctRel: string;
39
+ correctX: null;
40
+ initialX: null;
41
+ };
42
+ version: {
43
+ major: number;
44
+ minor: number;
45
+ };
46
+ };
47
+ };
48
+ };
49
+ answerArea: {
50
+ type: string;
51
+ options: {
52
+ content: string;
53
+ images: {};
54
+ widgets: {};
55
+ };
56
+ calculator: boolean;
57
+ };
58
+ itemDataVersion: {
59
+ major: number;
60
+ minor: number;
61
+ };
62
+ hints: {
63
+ content: string;
64
+ images: {};
65
+ widgets: {};
66
+ }[];
67
+ };
68
+ export default _default;
@@ -0,0 +1,44 @@
1
+ declare const _default: {
2
+ answerArea: {
3
+ calculator: boolean;
4
+ options: {
5
+ content: string;
6
+ images: {};
7
+ widgets: {};
8
+ };
9
+ type: string;
10
+ };
11
+ hints: never[];
12
+ itemDataVersion: {
13
+ major: number;
14
+ minor: number;
15
+ };
16
+ question: {
17
+ content: string;
18
+ images: {};
19
+ widgets: {
20
+ "numeric-input 1": {
21
+ graded: boolean;
22
+ options: {
23
+ answers: {
24
+ answerForms: never[];
25
+ maxError: null;
26
+ message: string;
27
+ simplify: string;
28
+ status: string;
29
+ strict: boolean;
30
+ value: null;
31
+ }[];
32
+ coefficient: boolean;
33
+ size: string;
34
+ };
35
+ type: string;
36
+ version: {
37
+ major: number;
38
+ minor: number;
39
+ };
40
+ };
41
+ };
42
+ };
43
+ };
44
+ export default _default;
@@ -0,0 +1,40 @@
1
+ declare const _default: {
2
+ answerArea: {
3
+ calculator: boolean;
4
+ };
5
+ hints: {
6
+ content: string;
7
+ }[];
8
+ itemDataVersion: {
9
+ major: number;
10
+ minor: number;
11
+ };
12
+ question: {
13
+ content: string;
14
+ widgets: {
15
+ "numeric-input 1": {
16
+ alignment: string;
17
+ graded: boolean;
18
+ options: {
19
+ answers: {
20
+ maxError: number;
21
+ message: string;
22
+ simplify: boolean;
23
+ status: string;
24
+ strict: boolean;
25
+ value: number;
26
+ }[];
27
+ coefficient: boolean;
28
+ labelText: string;
29
+ size: string;
30
+ };
31
+ type: string;
32
+ version: {
33
+ major: number;
34
+ minor: number;
35
+ };
36
+ };
37
+ };
38
+ };
39
+ };
40
+ export default _default;
@@ -0,0 +1,89 @@
1
+ declare const _default: {
2
+ question: {
3
+ content: string;
4
+ images: {};
5
+ widgets: {
6
+ "numeric-input 1": {
7
+ type: string;
8
+ alignment: string;
9
+ static: boolean;
10
+ graded: boolean;
11
+ options: {
12
+ answers: {
13
+ status: string;
14
+ message: string;
15
+ simplify: string;
16
+ strict: boolean;
17
+ maxError: null;
18
+ answerForms: string[];
19
+ }[];
20
+ size: string;
21
+ coefficient: boolean;
22
+ labelText: string;
23
+ rightAlign: boolean;
24
+ static: boolean;
25
+ multipleNumberInput: boolean;
26
+ };
27
+ version: {
28
+ major: number;
29
+ minor: number;
30
+ };
31
+ };
32
+ "expression 1": {
33
+ options: {
34
+ answerForms: {
35
+ considered: string;
36
+ form: boolean;
37
+ key: number;
38
+ simplify: boolean;
39
+ value: string;
40
+ times: boolean;
41
+ functions: string[];
42
+ buttonSets: string[];
43
+ buttonsVisible: string;
44
+ linterContext: {
45
+ contentType: string;
46
+ highlightLint: boolean;
47
+ paths: never[];
48
+ stack: never[];
49
+ };
50
+ }[];
51
+ times: boolean;
52
+ buttonSets: string[];
53
+ functions: string[];
54
+ static: boolean;
55
+ };
56
+ type: string;
57
+ version: {
58
+ major: number;
59
+ minor: number;
60
+ };
61
+ graded: boolean;
62
+ alignment: string;
63
+ static: boolean;
64
+ };
65
+ };
66
+ };
67
+ answerArea: {
68
+ calculator: boolean;
69
+ chi2Table: boolean;
70
+ financialCalculatorMonthlyPayment: boolean;
71
+ financialCalculatorTotalAmount: boolean;
72
+ financialCalculatorTimeToPayOff: boolean;
73
+ periodicTable: boolean;
74
+ periodicTableWithKey: boolean;
75
+ tTable: boolean;
76
+ zTable: boolean;
77
+ };
78
+ itemDataVersion: {
79
+ major: number;
80
+ minor: number;
81
+ };
82
+ hints: {
83
+ replace: boolean;
84
+ content: string;
85
+ images: {};
86
+ widgets: {};
87
+ }[];
88
+ };
89
+ export default _default;
@@ -0,0 +1,43 @@
1
+ declare const _default: {
2
+ answerArea: {
3
+ calculator: boolean;
4
+ options: {
5
+ content: string;
6
+ images: {};
7
+ widgets: {};
8
+ };
9
+ type: string;
10
+ };
11
+ hints: never[];
12
+ itemDataVersion: {
13
+ major: number;
14
+ minor: number;
15
+ };
16
+ question: {
17
+ content: string;
18
+ images: {};
19
+ widgets: {
20
+ "numeric-input 1": {
21
+ graded: boolean;
22
+ options: {
23
+ answers: {
24
+ answerForms: never[];
25
+ maxError: null;
26
+ message: string;
27
+ simplify: string;
28
+ status: string;
29
+ strict: boolean;
30
+ value: null;
31
+ }[];
32
+ size: string;
33
+ };
34
+ type: string;
35
+ version: {
36
+ major: number;
37
+ minor: number;
38
+ };
39
+ };
40
+ };
41
+ };
42
+ };
43
+ export default _default;
@@ -0,0 +1,210 @@
1
+ declare const _default: {
2
+ question: {
3
+ content: string;
4
+ images: {
5
+ "https://ka-perseus-images.s3.amazonaws.com/ec3199bd52c57bcdb3ab16d727a172def834d4fe.jpg": {
6
+ width: number;
7
+ height: number;
8
+ };
9
+ "https://ka-perseus-images.s3.amazonaws.com/810a87bbf09a2c41bbe02b1611cd91b047f69412.png": {
10
+ width: number;
11
+ height: number;
12
+ };
13
+ };
14
+ widgets: {
15
+ "numeric-input 1": {
16
+ type: string;
17
+ graded: boolean;
18
+ options: {
19
+ answers: {
20
+ value: number;
21
+ status: string;
22
+ message: string;
23
+ simplify: string;
24
+ strict: boolean;
25
+ maxError: null;
26
+ }[];
27
+ size: string;
28
+ coefficient: boolean;
29
+ };
30
+ version: {
31
+ major: number;
32
+ minor: number;
33
+ };
34
+ };
35
+ "expression 1": {
36
+ type: string;
37
+ graded: boolean;
38
+ options: {
39
+ value: string;
40
+ form: boolean;
41
+ simplify: boolean;
42
+ times: boolean;
43
+ buttonSets: string[];
44
+ functions: string[];
45
+ buttonsVisible: string;
46
+ };
47
+ version: {
48
+ major: number;
49
+ minor: number;
50
+ };
51
+ };
52
+ "sequence 1": {
53
+ type: string;
54
+ graded: boolean;
55
+ options: {
56
+ json: {
57
+ content: string;
58
+ images: {};
59
+ widgets: {};
60
+ }[];
61
+ };
62
+ version: {
63
+ major: number;
64
+ minor: number;
65
+ };
66
+ };
67
+ };
68
+ };
69
+ answerArea: {
70
+ type: string;
71
+ options: {
72
+ content: string;
73
+ images: {};
74
+ widgets: {};
75
+ };
76
+ calculator: boolean;
77
+ };
78
+ itemDataVersion: {
79
+ major: number;
80
+ minor: number;
81
+ };
82
+ hints: ({
83
+ content: string;
84
+ images: {
85
+ "https://ka-perseus-images.s3.amazonaws.com/810a87bbf09a2c41bbe02b1611cd91b047f69412.png"?: undefined;
86
+ };
87
+ widgets: {
88
+ "input-number 1": {
89
+ type: string;
90
+ graded: boolean;
91
+ options: {
92
+ value: number;
93
+ simplify: string;
94
+ size: string;
95
+ inexact: boolean;
96
+ maxError: number;
97
+ answerType: string;
98
+ };
99
+ version: {
100
+ major: number;
101
+ minor: number;
102
+ };
103
+ };
104
+ "passage 1": {
105
+ type: string;
106
+ graded: boolean;
107
+ options: {
108
+ passageTitle: string;
109
+ passageText: string;
110
+ footnotes: string;
111
+ showLineNumbers: boolean;
112
+ };
113
+ version: {
114
+ major: number;
115
+ minor: number;
116
+ };
117
+ };
118
+ "expression 1": {
119
+ type: string;
120
+ graded: boolean;
121
+ options: {
122
+ value: string;
123
+ form: boolean;
124
+ simplify: boolean;
125
+ times: boolean;
126
+ buttonSets: string[];
127
+ functions: string[];
128
+ buttonsVisible: string;
129
+ };
130
+ version: {
131
+ major: number;
132
+ minor: number;
133
+ };
134
+ };
135
+ "image 1"?: undefined;
136
+ };
137
+ } | {
138
+ content: string;
139
+ images: {
140
+ "https://ka-perseus-images.s3.amazonaws.com/810a87bbf09a2c41bbe02b1611cd91b047f69412.png"?: undefined;
141
+ };
142
+ widgets: {
143
+ "image 1": {
144
+ type: string;
145
+ graded: boolean;
146
+ options: {
147
+ title: string;
148
+ range: number[][];
149
+ box: number[];
150
+ backgroundImage: {
151
+ url: null;
152
+ width: number;
153
+ height: number;
154
+ };
155
+ labels: never[];
156
+ caption: string;
157
+ };
158
+ version: {
159
+ major: number;
160
+ minor: number;
161
+ };
162
+ };
163
+ "expression 1": {
164
+ type: string;
165
+ graded: boolean;
166
+ options: {
167
+ value: string;
168
+ form: boolean;
169
+ simplify: boolean;
170
+ times: boolean;
171
+ buttonSets: string[];
172
+ functions: string[];
173
+ buttonsVisible?: undefined;
174
+ };
175
+ version: {
176
+ major: number;
177
+ minor: number;
178
+ };
179
+ };
180
+ "input-number 1"?: undefined;
181
+ "passage 1"?: undefined;
182
+ };
183
+ } | {
184
+ content: string;
185
+ images: {
186
+ "https://ka-perseus-images.s3.amazonaws.com/810a87bbf09a2c41bbe02b1611cd91b047f69412.png": {
187
+ width: number;
188
+ height: number;
189
+ };
190
+ };
191
+ widgets: {
192
+ "input-number 1"?: undefined;
193
+ "passage 1"?: undefined;
194
+ "expression 1"?: undefined;
195
+ "image 1"?: undefined;
196
+ };
197
+ } | {
198
+ content: string;
199
+ images: {
200
+ "https://ka-perseus-images.s3.amazonaws.com/810a87bbf09a2c41bbe02b1611cd91b047f69412.png"?: undefined;
201
+ };
202
+ widgets: {
203
+ "input-number 1"?: undefined;
204
+ "passage 1"?: undefined;
205
+ "expression 1"?: undefined;
206
+ "image 1"?: undefined;
207
+ };
208
+ })[];
209
+ };
210
+ export default _default;