@khanacademy/perseus 50.1.0 → 51.0.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.
Files changed (115) hide show
  1. package/dist/es/index.js +558 -2400
  2. package/dist/es/index.js.map +1 -1
  3. package/dist/es/strings.js +58 -11
  4. package/dist/es/strings.js.map +1 -1
  5. package/dist/index.d.ts +3 -8
  6. package/dist/index.js +500 -2318
  7. package/dist/index.js.map +1 -1
  8. package/dist/renderer-util.d.ts +1 -2
  9. package/dist/renderer.d.ts +2 -2
  10. package/dist/server-item-renderer.d.ts +1 -1
  11. package/dist/strings.d.ts +204 -13
  12. package/dist/strings.js +75 -10
  13. package/dist/strings.js.map +1 -1
  14. package/dist/types.d.ts +1 -14
  15. package/dist/util/scoring.d.ts +1 -2
  16. package/dist/util/test-utils.d.ts +1 -2
  17. package/dist/util.d.ts +0 -14
  18. package/dist/widget-ai-utils/categorizer/categorizer-ai-utils.d.ts +1 -1
  19. package/dist/widget-ai-utils/dropdown/dropdown-ai-utils.d.ts +1 -1
  20. package/dist/widget-ai-utils/expression/expression-ai-utils.d.ts +1 -1
  21. package/dist/widget-ai-utils/grapher/grapher-ai-utils.d.ts +1 -1
  22. package/dist/widget-ai-utils/input-number/input-number-ai-utils.d.ts +1 -1
  23. package/dist/widget-ai-utils/label-image/label-image-ai-utils.d.ts +1 -1
  24. package/dist/widget-ai-utils/matcher/matcher-ai-utils.d.ts +1 -1
  25. package/dist/widget-ai-utils/matrix/matrix-ai-utils.d.ts +1 -1
  26. package/dist/widget-ai-utils/mock-widget/prompt-utils.d.ts +1 -1
  27. package/dist/widget-ai-utils/number-line/number-line-ai-utils.d.ts +1 -1
  28. package/dist/widget-ai-utils/numeric-input/prompt-utils.d.ts +1 -1
  29. package/dist/widget-ai-utils/orderer/orderer-ai-utils.d.ts +1 -1
  30. package/dist/widget-ai-utils/radio/radio-ai-utils.d.ts +1 -1
  31. package/dist/widget-ai-utils/sorter/sorter-ai-utils.d.ts +1 -1
  32. package/dist/widgets/__shared__/score-noop.d.ts +1 -1
  33. package/dist/widgets/categorizer/categorizer.d.ts +2 -2
  34. package/dist/widgets/cs-program/cs-program.d.ts +1 -2
  35. package/dist/widgets/definition/definition.d.ts +1 -1
  36. package/dist/widgets/deprecated-standin/deprecated-standin.d.ts +1 -1
  37. package/dist/widgets/dropdown/dropdown.d.ts +2 -2
  38. package/dist/widgets/explanation/explanation.d.ts +1 -1
  39. package/dist/widgets/expression/expression.d.ts +5 -6
  40. package/dist/widgets/graded-group/graded-group.d.ts +1 -1
  41. package/dist/widgets/graded-group-set/graded-group-set.d.ts +1 -1
  42. package/dist/widgets/grapher/grapher.d.ts +1 -2
  43. package/dist/widgets/grapher/util.d.ts +5 -13
  44. package/dist/widgets/group/group.d.ts +2 -2
  45. package/dist/widgets/group/score-group.d.ts +1 -2
  46. package/dist/widgets/iframe/iframe.d.ts +1 -2
  47. package/dist/widgets/image/image.d.ts +1 -1
  48. package/dist/widgets/input-number/input-number.d.ts +1 -2
  49. package/dist/widgets/interaction/interaction.d.ts +1 -1
  50. package/dist/widgets/interactive-graph.d.ts +2 -3
  51. package/dist/widgets/interactive-graphs/graphs/linear-system.d.ts +2 -0
  52. package/dist/widgets/interactive-graphs/graphs/quadratic.d.ts +1 -3
  53. package/dist/widgets/interactive-graphs/graphs/ray.d.ts +2 -0
  54. package/dist/widgets/interactive-graphs/graphs/sinusoid.d.ts +4 -9
  55. package/dist/widgets/interactive-graphs/graphs/utils.d.ts +4 -0
  56. package/dist/widgets/interactive-graphs/math/index.d.ts +0 -1
  57. package/dist/widgets/interactive-graphs/stateful-mafs-graph.d.ts +1 -1
  58. package/dist/widgets/interactive-graphs/types.d.ts +2 -1
  59. package/dist/widgets/label-image/label-image.d.ts +2 -4
  60. package/dist/widgets/label-image/marker.d.ts +1 -2
  61. package/dist/widgets/matcher/matcher.d.ts +1 -2
  62. package/dist/widgets/matrix/matrix.d.ts +2 -4
  63. package/dist/widgets/measurer/measurer.d.ts +1 -1
  64. package/dist/widgets/mock-widgets/mock-widget.d.ts +1 -1
  65. package/dist/widgets/mock-widgets/score-mock-widget.d.ts +1 -2
  66. package/dist/widgets/molecule/molecule.d.ts +1 -1
  67. package/dist/widgets/number-line/number-line.d.ts +2 -3
  68. package/dist/widgets/numeric-input/numeric-input.d.ts +1 -2
  69. package/dist/widgets/orderer/orderer.d.ts +1 -2
  70. package/dist/widgets/passage/passage.d.ts +1 -1
  71. package/dist/widgets/passage-ref/passage-ref.d.ts +1 -1
  72. package/dist/widgets/passage-ref-target/passage-ref-target.d.ts +1 -1
  73. package/dist/widgets/plotter/plotter.d.ts +1 -2
  74. package/dist/widgets/radio/radio-component.d.ts +1 -1
  75. package/dist/widgets/radio/radio.d.ts +1 -1
  76. package/dist/widgets/sorter/sorter.d.ts +1 -2
  77. package/dist/widgets/table/table.d.ts +1 -2
  78. package/dist/widgets/video/video.d.ts +1 -1
  79. package/package.json +46 -46
  80. package/dist/tex-wrangler.d.ts +0 -7
  81. package/dist/util/geometry.d.ts +0 -28
  82. package/dist/validation.types.d.ts +0 -166
  83. package/dist/widgets/categorizer/score-categorizer.d.ts +0 -5
  84. package/dist/widgets/categorizer/validate-categorizer.d.ts +0 -13
  85. package/dist/widgets/cs-program/score-cs-program.d.ts +0 -4
  86. package/dist/widgets/dropdown/score-dropdown.d.ts +0 -4
  87. package/dist/widgets/dropdown/validate-dropdown.d.ts +0 -8
  88. package/dist/widgets/expression/get-decimal-separator.d.ts +0 -5
  89. package/dist/widgets/expression/score-expression.d.ts +0 -5
  90. package/dist/widgets/expression/validate-expression.d.ts +0 -12
  91. package/dist/widgets/grapher/grapher-types.d.ts +0 -58
  92. package/dist/widgets/grapher/score-grapher.d.ts +0 -4
  93. package/dist/widgets/iframe/score-iframe.d.ts +0 -3
  94. package/dist/widgets/input-number/score-input-number.d.ts +0 -39
  95. package/dist/widgets/interactive-graphs/math/angles.d.ts +0 -7
  96. package/dist/widgets/interactive-graphs/score-interactive-graph.d.ts +0 -4
  97. package/dist/widgets/label-image/score-label-image.d.ts +0 -10
  98. package/dist/widgets/label-image/types.d.ts +0 -11
  99. package/dist/widgets/matcher/score-matcher.d.ts +0 -4
  100. package/dist/widgets/matrix/score-matrix.d.ts +0 -5
  101. package/dist/widgets/matrix/validate-matrix.d.ts +0 -13
  102. package/dist/widgets/number-line/score-number-line.d.ts +0 -4
  103. package/dist/widgets/number-line/validate-number-line.d.ts +0 -12
  104. package/dist/widgets/numeric-input/score-numeric-input.d.ts +0 -6
  105. package/dist/widgets/orderer/score-orderer.d.ts +0 -3
  106. package/dist/widgets/orderer/validate-orderer.d.ts +0 -10
  107. package/dist/widgets/plotter/score-plotter.d.ts +0 -4
  108. package/dist/widgets/plotter/validate-plotter.d.ts +0 -10
  109. package/dist/widgets/radio/score-radio.d.ts +0 -5
  110. package/dist/widgets/radio/validate-radio.d.ts +0 -12
  111. package/dist/widgets/sorter/score-sorter.d.ts +0 -4
  112. package/dist/widgets/sorter/validate-sorter.d.ts +0 -11
  113. package/dist/widgets/table/score-table.d.ts +0 -5
  114. package/dist/widgets/table/utils.d.ts +0 -7
  115. package/dist/widgets/table/validate-table.d.ts +0 -4
@@ -1,7 +1,6 @@
1
1
  import type { PerseusStrings } from "./strings";
2
- import type { PerseusScore } from "./types";
3
- import type { UserInputMap } from "./validation.types";
4
2
  import type { PerseusRenderer, PerseusWidgetsMap } from "@khanacademy/perseus-core";
3
+ import type { PerseusScore, UserInputMap } from "@khanacademy/perseus-score";
5
4
  export declare function getUpgradedWidgetOptions(oldWidgetOptions: PerseusWidgetsMap): PerseusWidgetsMap;
6
5
  export declare function emptyWidgetsFunctional(widgets: PerseusWidgetsMap, widgetIds: Array<string>, userInputMap: UserInputMap, strings: PerseusStrings, locale: string): ReadonlyArray<string>;
7
6
  export declare function scorePerseusItem(perseusRenderData: PerseusRenderer, userInputMap: UserInputMap, strings: PerseusStrings, locale: string): PerseusScore;
@@ -5,12 +5,12 @@ import TranslationLinter from "./translation-linter";
5
5
  import WidgetContainer from "./widget-container";
6
6
  import type { DependenciesContext } from "./dependencies";
7
7
  import type { PerseusStrings } from "./strings";
8
- import type { APIOptions, APIOptionsWithDefaults, FilterCriterion, FocusPath, PerseusScore, SerializedState, Widget, WidgetProps } from "./types";
9
- import type { UserInputArray, UserInputMap } from "./validation.types";
8
+ import type { APIOptions, APIOptionsWithDefaults, FilterCriterion, FocusPath, SerializedState, Widget, WidgetProps } from "./types";
10
9
  import type { GetPromptJSONInterface, RendererPromptJSON } from "./widget-ai-utils/prompt-types";
11
10
  import type { KeypadAPI } from "@khanacademy/math-input";
12
11
  import type { PerseusRenderer, PerseusWidget, PerseusWidgetOptions, PerseusWidgetsMap, ShowSolutions } from "@khanacademy/perseus-core";
13
12
  import type { LinterContextProps } from "@khanacademy/perseus-linter";
13
+ import type { PerseusScore, UserInputArray, UserInputMap } from "@khanacademy/perseus-score";
14
14
  import "./styles/perseus-renderer.less";
15
15
  type WidgetState = {
16
16
  isMobile?: boolean;
@@ -11,10 +11,10 @@ import * as React from "react";
11
11
  import { PerseusI18nContext } from "./components/i18n-context";
12
12
  import Renderer from "./renderer";
13
13
  import type { FocusPath, PerseusDependenciesV2, SharedRendererProps } from "./types";
14
- import type { UserInputArray, UserInputMap } from "./validation.types";
15
14
  import type { GetPromptJSONInterface, RendererPromptJSON } from "./widget-ai-utils/prompt-types";
16
15
  import type { KeypadAPI } from "@khanacademy/math-input";
17
16
  import type { PerseusItem, ShowSolutions, KeypadContextRendererInterface, RendererInterface, KEScore } from "@khanacademy/perseus-core";
17
+ import type { UserInputArray, UserInputMap } from "@khanacademy/perseus-score";
18
18
  type OwnProps = {
19
19
  hintsVisible?: number;
20
20
  item: PerseusItem;
package/dist/strings.d.ts CHANGED
@@ -263,6 +263,41 @@ export type PerseusStrings = {
263
263
  endingSideX: string;
264
264
  endingSideY: string;
265
265
  }) => string;
266
+ srLinearSystemGraph: string;
267
+ srLinearSystemPoints: ({ lineNumber, point1X, point1Y, point2X, point2Y, }: {
268
+ lineNumber: number;
269
+ point1X: string;
270
+ point1Y: string;
271
+ point2X: string;
272
+ point2Y: string;
273
+ }) => string;
274
+ srLinearSystemPoint({ lineNumber, pointSequence, x, y, }: {
275
+ lineNumber: number;
276
+ pointSequence: number;
277
+ x: string;
278
+ y: string;
279
+ }): string;
280
+ srRayGraph: string;
281
+ srRayPoints: ({ point1X, point1Y, point2X, point2Y, }: {
282
+ point1X: string;
283
+ point1Y: string;
284
+ point2X: string;
285
+ point2Y: string;
286
+ }) => string;
287
+ srRayEndpoint: ({ x, y }: {
288
+ x: string;
289
+ y: string;
290
+ }) => string;
291
+ srRayTerminalPoint: ({ x, y }: {
292
+ x: string;
293
+ y: string;
294
+ }) => string;
295
+ srRayGrabHandle: ({ point1X, point1Y, point2X, point2Y, }: {
296
+ point1X: string;
297
+ point1Y: string;
298
+ point2X: string;
299
+ point2Y: string;
300
+ }) => string;
266
301
  };
267
302
  /**
268
303
  * Untranslated strings used in Perseus. To be used by an external
@@ -270,24 +305,180 @@ export type PerseusStrings = {
270
305
  * !! Note: Ensure that all escape sequences are double-escaped. (e.g. `\\text` -> `\\\\text`)
271
306
  */
272
307
  export declare const strings: {
273
- [key in keyof PerseusStrings]: string | {
274
- context?: string;
275
- message: string;
276
- } | {
277
- context?: string;
308
+ closeKeypad: string;
309
+ openKeypad: string;
310
+ mathInputBox: string;
311
+ removeHighlight: string;
312
+ addHighlight: string;
313
+ hintPos: string;
314
+ errorRendering: string;
315
+ APPROXIMATED_PI_ERROR: string;
316
+ EXTRA_SYMBOLS_ERROR: string;
317
+ NEEDS_TO_BE_SIMPLFIED_ERROR: string;
318
+ MISSING_PERCENT_ERROR: string;
319
+ MULTIPLICATION_SIGN_ERROR: string;
320
+ WRONG_CASE_ERROR: string;
321
+ WRONG_LETTER_ERROR: string;
322
+ invalidSelection: string;
323
+ ERROR_TITLE: string;
324
+ ERROR_MESSAGE: string;
325
+ hints: string;
326
+ getAnotherHint: string;
327
+ deprecatedStandin: string;
328
+ keepTrying: string;
329
+ tryAgain: string;
330
+ check: string;
331
+ correctExcited: string;
332
+ nextQuestion: string;
333
+ skipToTitle: string;
334
+ current: string;
335
+ correct: string;
336
+ correctSelected: string;
337
+ correctCrossedOut: string;
338
+ incorrect: string;
339
+ incorrectSelected: string;
340
+ hideExplanation: string;
341
+ explain: string;
342
+ INVALID_MESSAGE_PREFIX: string;
343
+ DEFAULT_INVALID_MESSAGE_1: string;
344
+ DEFAULT_INVALID_MESSAGE_2: string;
345
+ integerExample: string;
346
+ properExample: string;
347
+ simplifiedProperExample: string;
348
+ improperExample: string;
349
+ simplifiedImproperExample: string;
350
+ mixedExample: string;
351
+ decimalExample: string;
352
+ percentExample: string;
353
+ piExample: string;
354
+ yourAnswer: string;
355
+ yourAnswerLabel: string;
356
+ addPoints: string;
357
+ addVertices: string;
358
+ tapMultiple: string;
359
+ tapSingle: string;
360
+ clickMultiple: string;
361
+ clickSingle: string;
362
+ choices: string;
363
+ answers: {
364
+ one: string;
365
+ other: string;
366
+ };
367
+ hideAnswersToggleLabel: string;
368
+ moves: {
278
369
  one: string;
279
370
  other: string;
280
371
  };
372
+ clickTiles: string;
373
+ turnOffLights: string;
374
+ fillAllCells: string;
375
+ molecularDrawing: string;
376
+ switchDirection: string;
377
+ circleOpen: string;
378
+ circleFilled: string;
379
+ numDivisions: string;
380
+ divisions: string;
381
+ lineRange: string;
382
+ lineNumber: string;
383
+ symbolPassage: string;
384
+ symbolQuestion: string;
385
+ lineLabel: {
386
+ context: string;
387
+ message: string;
388
+ };
389
+ beginningPassage: string;
390
+ beginningFootnotes: string;
391
+ endPassage: string;
392
+ questionMarker: string;
393
+ circleMarker: string;
394
+ sentenceMarker: string;
395
+ dragHandles: string;
396
+ tapAddPoints: string;
397
+ false: string;
398
+ true: string;
399
+ no: string;
400
+ yes: string;
401
+ chooseCorrectNum: string;
402
+ notNoneOfTheAbove: string;
403
+ noneOfTheAbove: string;
404
+ chooseNumAnswers: string;
405
+ chooseAllAnswers: string;
406
+ chooseOneAnswer: string;
407
+ choiceCheckedCorrect: string;
408
+ choiceCrossedOutCorrect: string;
409
+ choiceCorrect: string;
410
+ choiceCheckedIncorrect: string;
411
+ choiceCrossedOutIncorrect: string;
412
+ choiceIncorrect: string;
413
+ choiceChecked: string;
414
+ choiceCrossedOut: string;
415
+ choice: string;
416
+ crossOut: string;
417
+ crossOutOption: string;
418
+ crossOutChoice: string;
419
+ bringBack: string;
420
+ openMenuForChoice: string;
421
+ letters: {
422
+ context: string;
423
+ message: string;
424
+ };
425
+ rightArrow: string;
426
+ dontUnderstandUnits: string;
427
+ checkSigFigs: string;
428
+ answerNumericallyIncorrect: string;
429
+ checkUnits: string;
430
+ dontUnderstand: string;
431
+ loading: string;
432
+ videoTranscript: string;
433
+ somethingWrong: string;
434
+ videoWrapper: string;
435
+ mathInputTitle: string;
436
+ mathInputDescription: string;
437
+ sin: string;
438
+ cos: string;
439
+ tan: string;
440
+ simulationLoadFail: string;
441
+ simulationLocaleWarning: string;
442
+ selectAnAnswer: string;
443
+ addPoint: string;
444
+ removePoint: string;
445
+ graphKeyboardPrompt: string;
446
+ closePolygon: string;
447
+ openPolygon: string;
448
+ srInteractiveElements: string;
449
+ srNoInteractiveElements: string;
450
+ srPointAtCoordinates: string;
451
+ srCircleGraph: string;
452
+ srCircleShape: string;
453
+ srCircleRadiusPoint: string;
454
+ srCircleRadius: string;
455
+ srCircleOuterPoints: string;
456
+ srLinearGraph: string;
457
+ srLinearGraphPoints: string;
458
+ srLinearGraphSlopeIncreasing: string;
459
+ srLinearGraphSlopeDecreasing: string;
460
+ srLinearGraphSlopeHorizontal: string;
461
+ srLinearGraphSlopeVertical: string;
462
+ srLinearGraphXOnlyIntercept: string;
463
+ srLinearGraphYOnlyIntercept: string;
464
+ srLinearGraphBothIntercepts: string;
465
+ srLinearGraphOriginIntercept: string;
466
+ srLinearGrabHandle: string;
467
+ srAngleSideAtCoordinates: string;
468
+ srAngleVertexAtCoordinatesWithAngleMeasure: string;
469
+ srAngleGraphAriaLabel: string;
470
+ srAngleGraphAriaDescription: string;
471
+ srLinearSystemGraph: string;
472
+ srLinearSystemPoints: string;
473
+ srLinearSystemPoint: string;
474
+ srRayGraph: string;
475
+ srRayPoints: string;
476
+ srRayGrabHandle: string;
477
+ srRayEndpoint: string;
478
+ srRayTerminalPoint: string;
281
479
  };
282
480
  /**
283
481
  * Mock strings for the Perseus package, to be used for tests and Storybook.
284
482
  */
285
483
  export declare const mockStrings: PerseusStrings;
286
- export declare function mapErrorToString(err: string | null | undefined): string | {
287
- context?: string;
288
- message: string;
289
- } | {
290
- context?: string;
291
- one: string;
292
- other: string;
293
- } | null | undefined;
484
+ export declare function mapErrorToString(err: string | null | undefined): any;
package/dist/strings.js CHANGED
@@ -2,8 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var perseusScore = require('@khanacademy/perseus-score');
6
-
7
5
  /**
8
6
  * The translated strings that are used to render Perseus.
9
7
  */
@@ -181,7 +179,15 @@ const strings = {
181
179
  srAngleSideAtCoordinates: "Point %(point)s, %(side)s at %(x)s comma %(y)s",
182
180
  srAngleVertexAtCoordinatesWithAngleMeasure: "Point 2, vertex at %(x)s comma %(y)s. Angle %(angleMeasure)s degrees",
183
181
  srAngleGraphAriaLabel: "An angle on a coordinate plane.",
184
- srAngleGraphAriaDescription: "The angle measure is %(angleMeasure)s degrees with a vertex at %(vertexX)s comma %(vertexY)s, a point on the starting side at %(startingSideX)s comma %(startingSideY)s and a point on the ending side at %(endingSideX)s comma %(endingSideY)s"
182
+ srAngleGraphAriaDescription: "The angle measure is %(angleMeasure)s degrees with a vertex at %(vertexX)s comma %(vertexY)s, a point on the starting side at %(startingSideX)s comma %(startingSideY)s and a point on the ending side at %(endingSideX)s comma %(endingSideY)s",
183
+ srLinearSystemGraph: "Two lines on a coordinate plane.",
184
+ srLinearSystemPoints: "Line %(lineNumber)s has two points, point 1 at %(point1X)s comma %(point1Y)s and point 2 at %(point2X)s comma %(point2Y)s.",
185
+ srLinearSystemPoint: "Point %(pointSequence)s on line %(lineNumber)s at %(x)s comma %(y)s.",
186
+ srRayGraph: "A ray on a coordinate plane.",
187
+ srRayPoints: "The endpoint is at %(point1X)s comma %(point1Y)s and the ray goes through point %(point2X)s comma %(point2Y)s.",
188
+ srRayGrabHandle: "Ray with endpoint %(point1X)s comma %(point1Y)s going through point %(point2X)s comma %(point2Y)s.",
189
+ srRayEndpoint: "Endpoint at %(x)s comma %(y)s.",
190
+ srRayTerminalPoint: "Through point at %(x)s comma %(y)s."
185
191
  // The above strings are used for interactive graph SR descriptions.
186
192
  };
187
193
 
@@ -570,18 +576,77 @@ const mockStrings = {
570
576
  endingSideY
571
577
  } = _ref40;
572
578
  return `The angle measure is ${angleMeasure} degrees with a vertex at ${vertexX} comma ${vertexY}, a point on the starting side at ${startingSideX} comma ${startingSideY} and a point on the ending side at ${endingSideX} comma ${endingSideY}.`;
579
+ },
580
+ srLinearSystemGraph: "Two lines on a coordinate plane.",
581
+ srLinearSystemPoints: _ref41 => {
582
+ let {
583
+ lineNumber,
584
+ point1X,
585
+ point1Y,
586
+ point2X,
587
+ point2Y
588
+ } = _ref41;
589
+ return `Line ${lineNumber} has two points, point 1 at ${point1X} comma ${point1Y} and point 2 at ${point2X} comma ${point2Y}.`;
590
+ },
591
+ srLinearSystemPoint: _ref42 => {
592
+ let {
593
+ lineNumber,
594
+ pointSequence,
595
+ x,
596
+ y
597
+ } = _ref42;
598
+ return `Point ${pointSequence} on line ${lineNumber} at ${x} comma ${y}.`;
599
+ },
600
+ srRayGraph: "A ray on a coordinate plane.",
601
+ srRayPoints: _ref43 => {
602
+ let {
603
+ point1X,
604
+ point1Y,
605
+ point2X,
606
+ point2Y
607
+ } = _ref43;
608
+ return `The endpoint is at ${point1X} comma ${point1Y} and the ray goes through point ${point2X} comma ${point2Y}.`;
609
+ },
610
+ srRayGrabHandle: _ref44 => {
611
+ let {
612
+ point1X,
613
+ point1Y,
614
+ point2X,
615
+ point2Y
616
+ } = _ref44;
617
+ return `Ray with endpoint ${point1X} comma ${point1Y} going through point ${point2X} comma ${point2Y}.`;
618
+ },
619
+ srRayEndpoint: _ref45 => {
620
+ let {
621
+ x,
622
+ y
623
+ } = _ref45;
624
+ return `Endpoint at ${x} comma ${y}.`;
625
+ },
626
+ srRayTerminalPoint: _ref46 => {
627
+ let {
628
+ x,
629
+ y
630
+ } = _ref46;
631
+ return `Through point at ${x} comma ${y}.`;
573
632
  }
574
633
  // The above strings are used for interactive graph SR descriptions.
575
634
  };
576
635
 
636
+ // This type helps us make sure all error codes are mapped to strings
637
+
577
638
  const errorToString = {
578
- [perseusScore.ErrorCodes.MISSING_PERCENT_ERROR]: strings.MISSING_PERCENT_ERROR,
579
- [perseusScore.ErrorCodes.NEEDS_TO_BE_SIMPLIFIED_ERROR]: strings.NEEDS_TO_BE_SIMPLFIED_ERROR,
580
- [perseusScore.ErrorCodes.APPROXIMATED_PI_ERROR]: strings.APPROXIMATED_PI_ERROR,
581
- [perseusScore.ErrorCodes.EXTRA_SYMBOLS_ERROR]: strings.EXTRA_SYMBOLS_ERROR,
582
- [perseusScore.ErrorCodes.WRONG_CASE_ERROR]: strings.WRONG_CASE_ERROR,
583
- [perseusScore.ErrorCodes.WRONG_LETTER_ERROR]: strings.WRONG_LETTER_ERROR,
584
- [perseusScore.ErrorCodes.MULTIPLICATION_SIGN_ERROR]: strings.MULTIPLICATION_SIGN_ERROR
639
+ MISSING_PERCENT_ERROR: strings.MISSING_PERCENT_ERROR,
640
+ NEEDS_TO_BE_SIMPLIFIED_ERROR: strings.NEEDS_TO_BE_SIMPLFIED_ERROR,
641
+ APPROXIMATED_PI_ERROR: strings.APPROXIMATED_PI_ERROR,
642
+ EXTRA_SYMBOLS_ERROR: strings.EXTRA_SYMBOLS_ERROR,
643
+ WRONG_CASE_ERROR: strings.WRONG_CASE_ERROR,
644
+ WRONG_LETTER_ERROR: strings.WRONG_LETTER_ERROR,
645
+ MULTIPLICATION_SIGN_ERROR: strings.MULTIPLICATION_SIGN_ERROR,
646
+ INVALID_SELECTION_ERROR: strings.invalidSelection,
647
+ CHOOSE_CORRECT_NUM_ERROR: strings.chooseCorrectNum,
648
+ NOT_NONE_ABOVE_ERROR: strings.notNoneOfTheAbove,
649
+ FILL_ALL_CELLS_ERROR: strings.fillAllCells
585
650
  };
586
651
  function mapErrorToString(err) {
587
652
  if (!err) {