@khanacademy/perseus-editor 4.4.1 → 5.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/components/widget-editor.d.ts +1 -1
- package/dist/es/index.js +207 -726
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +207 -737
- package/dist/index.js.map +1 -1
- package/dist/strings.js +0 -5
- package/package.json +2 -2
- package/dist/widgets/lights-puzzle-editor.d.ts +0 -24
- package/dist/widgets/reaction-diagram-editor.d.ts +0 -20
- package/dist/widgets/sequence-editor.d.ts +0 -56
- package/dist/widgets/simulator-editor.d.ts +0 -20
package/dist/index.js
CHANGED
|
@@ -64,7 +64,7 @@ var i18n__namespace = /*#__PURE__*/_interopNamespace(i18n$1);
|
|
|
64
64
|
|
|
65
65
|
// This file is processed by a Rollup plugin (replace) to inject the production
|
|
66
66
|
const libName = "@khanacademy/perseus-editor";
|
|
67
|
-
const libVersion = "
|
|
67
|
+
const libVersion = "5.0.0";
|
|
68
68
|
perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
69
69
|
|
|
70
70
|
function _extends() {
|
|
@@ -240,7 +240,7 @@ const JsonEditor = createReactClass__default["default"]({
|
|
|
240
240
|
});
|
|
241
241
|
|
|
242
242
|
const {
|
|
243
|
-
InlineIcon: InlineIcon$
|
|
243
|
+
InlineIcon: InlineIcon$b
|
|
244
244
|
} = perseus.components;
|
|
245
245
|
class SectionControlButton extends React__namespace.Component {
|
|
246
246
|
render() {
|
|
@@ -260,7 +260,7 @@ class SectionControlButton extends React__namespace.Component {
|
|
|
260
260
|
"aria-label": title,
|
|
261
261
|
style: styles$g.button
|
|
262
262
|
}, _ref => {
|
|
263
|
-
return /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
263
|
+
return /*#__PURE__*/React__namespace.createElement(InlineIcon$b, icon);
|
|
264
264
|
});
|
|
265
265
|
}
|
|
266
266
|
}
|
|
@@ -20587,12 +20587,12 @@ const DragTarget = createReactClass__default["default"]({
|
|
|
20587
20587
|
});
|
|
20588
20588
|
|
|
20589
20589
|
const {
|
|
20590
|
-
InlineIcon: InlineIcon$
|
|
20590
|
+
InlineIcon: InlineIcon$a
|
|
20591
20591
|
} = perseus.components;
|
|
20592
20592
|
const {
|
|
20593
20593
|
iconChevronDown: iconChevronDown$1,
|
|
20594
20594
|
iconChevronRight,
|
|
20595
|
-
iconTrash: iconTrash$
|
|
20595
|
+
iconTrash: iconTrash$7
|
|
20596
20596
|
} = perseus.icons;
|
|
20597
20597
|
const _upgradeWidgetInfo = props => {
|
|
20598
20598
|
// We can't call serialize here because this.refs.widget
|
|
@@ -20696,7 +20696,7 @@ class WidgetEditor extends React__namespace.Component {
|
|
|
20696
20696
|
className: "perseus-widget-editor-title-id",
|
|
20697
20697
|
href: "#",
|
|
20698
20698
|
onClick: this._toggleWidget
|
|
20699
|
-
}, this.props.id, this.state.showWidget ? /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
20699
|
+
}, this.props.id, this.state.showWidget ? /*#__PURE__*/React__namespace.createElement(InlineIcon$a, iconChevronDown$1) : /*#__PURE__*/React__namespace.createElement(InlineIcon$a, iconChevronRight)), supportsStaticMode && /*#__PURE__*/React__namespace.createElement("input", {
|
|
20700
20700
|
type: "button"
|
|
20701
20701
|
// @ts-expect-error - TS2322 - Type '(e: Event) => void' is not assignable to type 'MouseEventHandler<HTMLInputElement>'.
|
|
20702
20702
|
,
|
|
@@ -20710,7 +20710,7 @@ class WidgetEditor extends React__namespace.Component {
|
|
|
20710
20710
|
}, supportedAlignments.map(alignment => /*#__PURE__*/React__namespace.createElement("option", {
|
|
20711
20711
|
key: alignment
|
|
20712
20712
|
}, alignment))), /*#__PURE__*/React__namespace.createElement(SectionControlButton, {
|
|
20713
|
-
icon: iconTrash$
|
|
20713
|
+
icon: iconTrash$7,
|
|
20714
20714
|
onClick: () => {
|
|
20715
20715
|
this.props.onRemove();
|
|
20716
20716
|
},
|
|
@@ -21784,13 +21784,13 @@ class IframeContentRenderer extends React__namespace.Component {
|
|
|
21784
21784
|
|
|
21785
21785
|
const {
|
|
21786
21786
|
HUD: HUD$1,
|
|
21787
|
-
InlineIcon: InlineIcon$
|
|
21787
|
+
InlineIcon: InlineIcon$9
|
|
21788
21788
|
} = perseus.components;
|
|
21789
21789
|
const {
|
|
21790
|
-
iconCircleArrowDown: iconCircleArrowDown$
|
|
21791
|
-
iconCircleArrowUp: iconCircleArrowUp$
|
|
21792
|
-
iconPlus: iconPlus$
|
|
21793
|
-
iconTrash: iconTrash$
|
|
21790
|
+
iconCircleArrowDown: iconCircleArrowDown$1,
|
|
21791
|
+
iconCircleArrowUp: iconCircleArrowUp$1,
|
|
21792
|
+
iconPlus: iconPlus$4,
|
|
21793
|
+
iconTrash: iconTrash$6
|
|
21794
21794
|
} = perseus.icons;
|
|
21795
21795
|
class ArticleEditor extends React__namespace.Component {
|
|
21796
21796
|
static defaultProps = {
|
|
@@ -21886,25 +21886,25 @@ class ArticleEditor extends React__namespace.Component {
|
|
|
21886
21886
|
float: "right"
|
|
21887
21887
|
}
|
|
21888
21888
|
}, sectionImageUploadGenerator(i), /*#__PURE__*/React__namespace.createElement(SectionControlButton, {
|
|
21889
|
-
icon: iconPlus$
|
|
21889
|
+
icon: iconPlus$4,
|
|
21890
21890
|
onClick: () => {
|
|
21891
21891
|
this._handleAddSectionAfter(i);
|
|
21892
21892
|
},
|
|
21893
21893
|
title: "Add a new section after this one"
|
|
21894
21894
|
}), i + 1 < sections.length && /*#__PURE__*/React__namespace.createElement(SectionControlButton, {
|
|
21895
|
-
icon: iconCircleArrowDown$
|
|
21895
|
+
icon: iconCircleArrowDown$1,
|
|
21896
21896
|
onClick: () => {
|
|
21897
21897
|
this._handleMoveSectionLater(i);
|
|
21898
21898
|
},
|
|
21899
21899
|
title: "Move this section down"
|
|
21900
21900
|
}), i > 0 && /*#__PURE__*/React__namespace.createElement(SectionControlButton, {
|
|
21901
|
-
icon: iconCircleArrowUp$
|
|
21901
|
+
icon: iconCircleArrowUp$1,
|
|
21902
21902
|
onClick: () => {
|
|
21903
21903
|
this._handleMoveSectionEarlier(i);
|
|
21904
21904
|
},
|
|
21905
21905
|
title: "Move this section up"
|
|
21906
21906
|
}), /*#__PURE__*/React__namespace.createElement(SectionControlButton, {
|
|
21907
|
-
icon: iconTrash$
|
|
21907
|
+
icon: iconTrash$6,
|
|
21908
21908
|
onClick: () => {
|
|
21909
21909
|
const msg = "Are you sure you " + "want to delete section " + (i + 1) + "?";
|
|
21910
21910
|
/* eslint-disable no-alert */
|
|
@@ -21939,7 +21939,7 @@ class ArticleEditor extends React__namespace.Component {
|
|
|
21939
21939
|
onClick: () => {
|
|
21940
21940
|
this._handleAddSectionAfter(this._sections().length - 1);
|
|
21941
21941
|
}
|
|
21942
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
21942
|
+
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$9, iconPlus$4), " Add a section")));
|
|
21943
21943
|
}
|
|
21944
21944
|
_renderLinterHUD() {
|
|
21945
21945
|
return /*#__PURE__*/React__namespace.createElement(HUD$1, {
|
|
@@ -22092,7 +22092,7 @@ class ArticleEditor extends React__namespace.Component {
|
|
|
22092
22092
|
*/
|
|
22093
22093
|
const {
|
|
22094
22094
|
ButtonGroup: ButtonGroup$5,
|
|
22095
|
-
InlineIcon: InlineIcon$
|
|
22095
|
+
InlineIcon: InlineIcon$8
|
|
22096
22096
|
} = perseus.components;
|
|
22097
22097
|
const {
|
|
22098
22098
|
devices
|
|
@@ -22114,9 +22114,9 @@ class ViewportResizer extends React__namespace.Component {
|
|
|
22114
22114
|
this.props.onViewportSizeChanged(value);
|
|
22115
22115
|
};
|
|
22116
22116
|
render() {
|
|
22117
|
-
const phoneButtonContents = /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
22118
|
-
const tabletButtonContents = /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
22119
|
-
const desktopButtonContents = /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
22117
|
+
const phoneButtonContents = /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(InlineIcon$8, iconMobilePhone), " Phone");
|
|
22118
|
+
const tabletButtonContents = /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(InlineIcon$8, iconTablet), " Tablet");
|
|
22119
|
+
const desktopButtonContents = /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(InlineIcon$8, iconDesktop), " Desktop");
|
|
22120
22120
|
|
|
22121
22121
|
// TODO(david): Allow input of custom viewport sizes.
|
|
22122
22122
|
return /*#__PURE__*/React__namespace.createElement("span", {
|
|
@@ -23450,14 +23450,14 @@ class StructuredItemDiff extends React__namespace.Component {
|
|
|
23450
23450
|
|
|
23451
23451
|
/* eslint-disable @khanacademy/ts-no-error-suppressions */
|
|
23452
23452
|
const {
|
|
23453
|
-
InfoTip: InfoTip$
|
|
23454
|
-
InlineIcon: InlineIcon$
|
|
23453
|
+
InfoTip: InfoTip$l,
|
|
23454
|
+
InlineIcon: InlineIcon$7
|
|
23455
23455
|
} = perseus.components;
|
|
23456
23456
|
const {
|
|
23457
|
-
iconCircleArrowDown
|
|
23458
|
-
iconCircleArrowUp
|
|
23459
|
-
iconPlus: iconPlus$
|
|
23460
|
-
iconTrash: iconTrash$
|
|
23457
|
+
iconCircleArrowDown,
|
|
23458
|
+
iconCircleArrowUp,
|
|
23459
|
+
iconPlus: iconPlus$3,
|
|
23460
|
+
iconTrash: iconTrash$5
|
|
23461
23461
|
} = perseus.icons;
|
|
23462
23462
|
/* Renders a hint editor box
|
|
23463
23463
|
*
|
|
@@ -23520,11 +23520,11 @@ class HintEditor extends React__namespace.Component {
|
|
|
23520
23520
|
type: "button",
|
|
23521
23521
|
className: this.props.isLast ? "hidden" : "",
|
|
23522
23522
|
onClick: ___default["default"].partial(this.props.onMove, 1)
|
|
23523
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
23523
|
+
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$7, iconCircleArrowDown)), " ", /*#__PURE__*/React__namespace.createElement("button", {
|
|
23524
23524
|
type: "button",
|
|
23525
23525
|
className: this.props.isFirst ? "hidden" : "",
|
|
23526
23526
|
onClick: ___default["default"].partial(this.props.onMove, -1)
|
|
23527
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
23527
|
+
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$7, iconCircleArrowUp)), " ", this.props.isLast && /*#__PURE__*/React__namespace.createElement(InfoTip$l, null, /*#__PURE__*/React__namespace.createElement("p", null, "The last hint is automatically bolded."))), /*#__PURE__*/React__namespace.createElement("input", {
|
|
23528
23528
|
type: "checkbox"
|
|
23529
23529
|
// @ts-expect-error - TS2322 - Type 'boolean | null | undefined' is not assignable to type 'boolean | undefined'.
|
|
23530
23530
|
,
|
|
@@ -23534,7 +23534,7 @@ class HintEditor extends React__namespace.Component {
|
|
|
23534
23534
|
type: "button",
|
|
23535
23535
|
className: "remove-hint simple-button orange",
|
|
23536
23536
|
onClick: this.props.onRemove
|
|
23537
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
23537
|
+
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$7, iconTrash$5), "Remove this hint", " ")));
|
|
23538
23538
|
}
|
|
23539
23539
|
}
|
|
23540
23540
|
/* A single hint-row containing a hint editor and preview */
|
|
@@ -23753,13 +23753,13 @@ class CombinedHintsEditor extends React__namespace.Component {
|
|
|
23753
23753
|
type: "button",
|
|
23754
23754
|
className: "add-hint simple-button orange",
|
|
23755
23755
|
onClick: this.addHint
|
|
23756
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
23756
|
+
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$7, iconPlus$3), " Add a hint"))));
|
|
23757
23757
|
/* eslint-enable max-len */
|
|
23758
23758
|
}
|
|
23759
23759
|
}
|
|
23760
23760
|
|
|
23761
23761
|
const {
|
|
23762
|
-
InfoTip: InfoTip$
|
|
23762
|
+
InfoTip: InfoTip$k
|
|
23763
23763
|
} = perseus.components;
|
|
23764
23764
|
class ItemExtrasEditor extends React__namespace.Component {
|
|
23765
23765
|
static defaultProps = {
|
|
@@ -23924,7 +23924,7 @@ const ItemExtraCheckbox = props => /*#__PURE__*/React__namespace.createElement("
|
|
|
23924
23924
|
type: "checkbox",
|
|
23925
23925
|
checked: props.checked,
|
|
23926
23926
|
onChange: props.onChange
|
|
23927
|
-
})), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
23927
|
+
})), /*#__PURE__*/React__namespace.createElement(InfoTip$k, null, props.infoTip));
|
|
23928
23928
|
|
|
23929
23929
|
const ITEM_DATA_VERSION = perseus.itemDataVersion;
|
|
23930
23930
|
class ItemEditor extends React__namespace.Component {
|
|
@@ -24631,11 +24631,11 @@ const styles$e = aphrodite.StyleSheet.create({
|
|
|
24631
24631
|
});
|
|
24632
24632
|
|
|
24633
24633
|
const {
|
|
24634
|
-
InlineIcon: InlineIcon$
|
|
24634
|
+
InlineIcon: InlineIcon$6
|
|
24635
24635
|
} = perseus.components;
|
|
24636
24636
|
const {
|
|
24637
24637
|
iconChevronDown,
|
|
24638
|
-
iconTrash: iconTrash$
|
|
24638
|
+
iconTrash: iconTrash$4
|
|
24639
24639
|
} = perseus.icons;
|
|
24640
24640
|
const {
|
|
24641
24641
|
MultiRenderer
|
|
@@ -25097,21 +25097,21 @@ const ArrayNodeContent = props => {
|
|
|
25097
25097
|
onClick: () => actions.moveArrayElementUp(subpath)
|
|
25098
25098
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25099
25099
|
className: aphrodite.css(styles$d.verticalFlip)
|
|
25100
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
25100
|
+
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, iconChevronDown)))), i < data.length - 1 && /*#__PURE__*/React__namespace.createElement("div", {
|
|
25101
25101
|
key: "moveArrayElementDown",
|
|
25102
25102
|
className: aphrodite.css(styles$d.control)
|
|
25103
25103
|
}, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
|
|
25104
25104
|
color: "orange",
|
|
25105
25105
|
title: "Move down",
|
|
25106
25106
|
onClick: () => actions.moveArrayElementDown(subpath)
|
|
25107
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
25107
|
+
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, iconChevronDown))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
25108
25108
|
key: "removeArrayElement",
|
|
25109
25109
|
className: aphrodite.css(styles$d.control)
|
|
25110
25110
|
}, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
|
|
25111
25111
|
color: "orange",
|
|
25112
25112
|
title: "Delete",
|
|
25113
25113
|
onClick: () => actions.removeArrayElement(subpath)
|
|
25114
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
25114
|
+
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, iconTrash$4)))];
|
|
25115
25115
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
25116
25116
|
key: i,
|
|
25117
25117
|
className: aphrodite.css(styles$d.arrayElement, !elementIsLeaf && styles$d.arrayElementAndNotLeaf)
|
|
@@ -25583,7 +25583,7 @@ const StatefulEditorPage = createReactClass__default["default"]({
|
|
|
25583
25583
|
});
|
|
25584
25584
|
|
|
25585
25585
|
const {
|
|
25586
|
-
PropCheckBox: PropCheckBox$
|
|
25586
|
+
PropCheckBox: PropCheckBox$c,
|
|
25587
25587
|
TextListEditor: TextListEditor$4
|
|
25588
25588
|
} = perseus.components;
|
|
25589
25589
|
const Categorizer = perseus.Categorizer.widget;
|
|
@@ -25618,7 +25618,7 @@ class CategorizerEditor extends React__namespace.Component {
|
|
|
25618
25618
|
render() {
|
|
25619
25619
|
return /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25620
25620
|
className: "perseus-widget-row"
|
|
25621
|
-
}, /*#__PURE__*/React__namespace.createElement(PropCheckBox$
|
|
25621
|
+
}, /*#__PURE__*/React__namespace.createElement(PropCheckBox$c, {
|
|
25622
25622
|
label: "Randomize item order",
|
|
25623
25623
|
labelAlignment: "right",
|
|
25624
25624
|
randomizeItems: this.props.randomizeItems,
|
|
@@ -25716,8 +25716,8 @@ class BlurInput extends React__namespace.Component {
|
|
|
25716
25716
|
|
|
25717
25717
|
/* eslint-disable no-useless-escape */
|
|
25718
25718
|
const {
|
|
25719
|
-
InfoTip: InfoTip$
|
|
25720
|
-
PropCheckBox: PropCheckBox$
|
|
25719
|
+
InfoTip: InfoTip$j,
|
|
25720
|
+
PropCheckBox: PropCheckBox$b
|
|
25721
25721
|
} = perseus.components;
|
|
25722
25722
|
const DEFAULT_WIDTH = 400;
|
|
25723
25723
|
const DEFAULT_HEIGHT = 400;
|
|
@@ -25900,11 +25900,11 @@ class CSProgramEditor extends React__namespace.Component {
|
|
|
25900
25900
|
return /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Url or Program ID:", " ", /*#__PURE__*/React__namespace.createElement(BlurInput, {
|
|
25901
25901
|
value: this.props.programID,
|
|
25902
25902
|
onChange: this._handleProgramIDChange
|
|
25903
|
-
})), /*#__PURE__*/React__namespace.createElement("br", null), /*#__PURE__*/React__namespace.createElement(PropCheckBox$
|
|
25903
|
+
})), /*#__PURE__*/React__namespace.createElement("br", null), /*#__PURE__*/React__namespace.createElement(PropCheckBox$b, {
|
|
25904
25904
|
label: "Show Editor",
|
|
25905
25905
|
showEditor: this.props.showEditor,
|
|
25906
25906
|
onChange: this.props.onChange
|
|
25907
|
-
}), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
25907
|
+
}), /*#__PURE__*/React__namespace.createElement(InfoTip$j, null, "If you show the editor, you should use the \"full-width\" alignment to make room for the width of the editor."), /*#__PURE__*/React__namespace.createElement("br", null), /*#__PURE__*/React__namespace.createElement(PropCheckBox$b, {
|
|
25908
25908
|
label: "Show Buttons",
|
|
25909
25909
|
showButtons: this.props.showButtons,
|
|
25910
25910
|
onChange: this.props.onChange
|
|
@@ -25912,13 +25912,13 @@ class CSProgramEditor extends React__namespace.Component {
|
|
|
25912
25912
|
name: "settings",
|
|
25913
25913
|
pairs: this.props.settings,
|
|
25914
25914
|
onChange: this._handleSettingsChange
|
|
25915
|
-
}), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
25915
|
+
}), /*#__PURE__*/React__namespace.createElement(InfoTip$j, null, "Settings that you add here are available to the program as an object returned by ", /*#__PURE__*/React__namespace.createElement("code", null, "Program.settings()"))));
|
|
25916
25916
|
}
|
|
25917
25917
|
}
|
|
25918
25918
|
|
|
25919
25919
|
/* eslint-disable @khanacademy/ts-no-error-suppressions */
|
|
25920
25920
|
const {
|
|
25921
|
-
TextInput: TextInput$
|
|
25921
|
+
TextInput: TextInput$8
|
|
25922
25922
|
} = perseus.components;
|
|
25923
25923
|
class DefinitionEditor extends React__namespace.Component {
|
|
25924
25924
|
static propTypes = {
|
|
@@ -25952,7 +25952,7 @@ class DefinitionEditor extends React__namespace.Component {
|
|
|
25952
25952
|
target: "_blank"
|
|
25953
25953
|
}, "Definition style guide"), /*#__PURE__*/React__namespace.createElement("div", {
|
|
25954
25954
|
className: "perseus-widget-row"
|
|
25955
|
-
}, /*#__PURE__*/React__namespace.createElement("label", null, "Word to be defined:", " ", /*#__PURE__*/React__namespace.createElement(TextInput$
|
|
25955
|
+
}, /*#__PURE__*/React__namespace.createElement("label", null, "Word to be defined:", " ", /*#__PURE__*/React__namespace.createElement(TextInput$8, {
|
|
25956
25956
|
value: this.props.togglePrompt
|
|
25957
25957
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
25958
25958
|
,
|
|
@@ -25989,12 +25989,12 @@ class DeprecatedStandinEditor extends React__namespace.Component {
|
|
|
25989
25989
|
|
|
25990
25990
|
/* eslint-disable @khanacademy/ts-no-error-suppressions */
|
|
25991
25991
|
const {
|
|
25992
|
-
InfoTip: InfoTip$
|
|
25993
|
-
InlineIcon: InlineIcon$
|
|
25992
|
+
InfoTip: InfoTip$i,
|
|
25993
|
+
InlineIcon: InlineIcon$5
|
|
25994
25994
|
} = perseus.components;
|
|
25995
25995
|
const {
|
|
25996
|
-
iconPlus: iconPlus$
|
|
25997
|
-
iconTrash: iconTrash$
|
|
25996
|
+
iconPlus: iconPlus$2,
|
|
25997
|
+
iconTrash: iconTrash$3
|
|
25998
25998
|
} = perseus.icons;
|
|
25999
25999
|
class DropdownEditor extends React__namespace.Component {
|
|
26000
26000
|
static propTypes = {
|
|
@@ -26070,14 +26070,14 @@ class DropdownEditor extends React__namespace.Component {
|
|
|
26070
26070
|
className: "perseus-widget-dropdown"
|
|
26071
26071
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
26072
26072
|
className: "dropdown-info"
|
|
26073
|
-
}, "Dropdown", /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
26073
|
+
}, "Dropdown", /*#__PURE__*/React__namespace.createElement(InfoTip$i, null, /*#__PURE__*/React__namespace.createElement("p", null, "The drop down is useful for making inequalities in a custom format. We normally use the symbols ", "<", ",", " ", ">", ", \u2264, \u2265 (in that order) which you can copy into the choices. When possible, use the \"multiple choice\" answer type instead."))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
26074
26074
|
className: "dropdown-placeholder"
|
|
26075
26075
|
}, /*#__PURE__*/React__namespace.createElement("input", {
|
|
26076
26076
|
type: "text",
|
|
26077
26077
|
placeholder: "Placeholder value",
|
|
26078
26078
|
value: this.props.placeholder,
|
|
26079
26079
|
onChange: this.onPlaceholderChange
|
|
26080
|
-
}), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
26080
|
+
}), /*#__PURE__*/React__namespace.createElement(InfoTip$i, null, /*#__PURE__*/React__namespace.createElement("p", null, "This value will appear as the drop down default. It should give the user some indication of the values available in the drop down itself, e.g., Yes/No/Maybe."))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
26081
26081
|
className: "clearfix"
|
|
26082
26082
|
}), /*#__PURE__*/React__namespace.createElement("ul", {
|
|
26083
26083
|
className: "dropdown-choices"
|
|
@@ -26122,14 +26122,14 @@ class DropdownEditor extends React__namespace.Component {
|
|
|
26122
26122
|
this, i)
|
|
26123
26123
|
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
26124
26124
|
className: "remove-choice"
|
|
26125
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
26125
|
+
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$5, iconTrash$3)))));
|
|
26126
26126
|
}, this)), /*#__PURE__*/React__namespace.createElement("div", {
|
|
26127
26127
|
className: "add-choice-container"
|
|
26128
26128
|
}, /*#__PURE__*/React__namespace.createElement("a", {
|
|
26129
26129
|
href: "#",
|
|
26130
26130
|
className: "simple-button orange",
|
|
26131
26131
|
onClick: this.addChoice
|
|
26132
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
26132
|
+
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$5, iconPlus$2), " Add a choice", " ")));
|
|
26133
26133
|
}
|
|
26134
26134
|
}
|
|
26135
26135
|
|
|
@@ -26362,7 +26362,7 @@ class ExampleWidgetEditor extends React__namespace.Component {
|
|
|
26362
26362
|
|
|
26363
26363
|
/* eslint-disable @khanacademy/ts-no-error-suppressions */
|
|
26364
26364
|
const {
|
|
26365
|
-
TextInput: TextInput$
|
|
26365
|
+
TextInput: TextInput$7
|
|
26366
26366
|
} = perseus.components;
|
|
26367
26367
|
const defaultExplanationProps = {
|
|
26368
26368
|
showPrompt: "Explain",
|
|
@@ -26399,14 +26399,14 @@ class ExplanationEditor extends React__namespace.Component {
|
|
|
26399
26399
|
className: "perseus-widget-explanation-editor"
|
|
26400
26400
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
26401
26401
|
className: "perseus-widget-row"
|
|
26402
|
-
}, /*#__PURE__*/React__namespace.createElement("label", null, "Prompt to show explanation:", " ", /*#__PURE__*/React__namespace.createElement(TextInput$
|
|
26402
|
+
}, /*#__PURE__*/React__namespace.createElement("label", null, "Prompt to show explanation:", " ", /*#__PURE__*/React__namespace.createElement(TextInput$7, {
|
|
26403
26403
|
value: this.props.showPrompt
|
|
26404
26404
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
26405
26405
|
,
|
|
26406
26406
|
onChange: this.change("showPrompt")
|
|
26407
26407
|
}))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
26408
26408
|
className: "perseus-widget-row"
|
|
26409
|
-
}, /*#__PURE__*/React__namespace.createElement("label", null, "Prompt to hide explanation:", " ", /*#__PURE__*/React__namespace.createElement(TextInput$
|
|
26409
|
+
}, /*#__PURE__*/React__namespace.createElement("label", null, "Prompt to hide explanation:", " ", /*#__PURE__*/React__namespace.createElement(TextInput$7, {
|
|
26410
26410
|
value: this.props.hidePrompt
|
|
26411
26411
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
26412
26412
|
,
|
|
@@ -26611,8 +26611,8 @@ const SortableItem = createReactClass__default["default"]({
|
|
|
26611
26611
|
});
|
|
26612
26612
|
|
|
26613
26613
|
const {
|
|
26614
|
-
InfoTip: InfoTip$
|
|
26615
|
-
PropCheckBox: PropCheckBox$
|
|
26614
|
+
InfoTip: InfoTip$h,
|
|
26615
|
+
PropCheckBox: PropCheckBox$a
|
|
26616
26616
|
} = perseus.components;
|
|
26617
26617
|
|
|
26618
26618
|
// types for iterables
|
|
@@ -26731,16 +26731,16 @@ class ExpressionEditor extends React__namespace.Component {
|
|
|
26731
26731
|
className: "perseus-widget-expression-editor"
|
|
26732
26732
|
}, /*#__PURE__*/React__namespace.createElement("h3", {
|
|
26733
26733
|
className: "expression-editor-h3"
|
|
26734
|
-
}, "Global Options"), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement(PropCheckBox$
|
|
26734
|
+
}, "Global Options"), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement(PropCheckBox$a, {
|
|
26735
26735
|
times: this.props.times,
|
|
26736
26736
|
onChange: this.props.onChange,
|
|
26737
26737
|
labelAlignment: "right",
|
|
26738
26738
|
label: "Use \xD7 for rendering multiplication instead of a center dot."
|
|
26739
|
-
}), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
26739
|
+
}), /*#__PURE__*/React__namespace.createElement(InfoTip$h, null, /*#__PURE__*/React__namespace.createElement("p", null, "For pre-algebra problems this option displays multiplication as \\times instead of \\cdot in both the rendered output and the acceptable formats examples."))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Function variables: ", /*#__PURE__*/React__namespace.createElement("input", {
|
|
26740
26740
|
type: "text",
|
|
26741
26741
|
defaultValue: this.props.functions.join(" "),
|
|
26742
26742
|
onChange: this.handleFunctions
|
|
26743
|
-
})), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
26743
|
+
})), /*#__PURE__*/React__namespace.createElement(InfoTip$h, null, /*#__PURE__*/React__namespace.createElement("p", null, "Single-letter variables listed here will be interpreted as functions. This let us know that f(x) means \"f of x\" and not \"f times x\"."))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("div", null, "Button sets:"), buttonSetChoices), /*#__PURE__*/React__namespace.createElement("h3", {
|
|
26744
26744
|
className: "expression-editor-h3"
|
|
26745
26745
|
}, "Answers"), /*#__PURE__*/React__namespace.createElement("p", {
|
|
26746
26746
|
style: {
|
|
@@ -26949,19 +26949,19 @@ class AnswerOption extends React__namespace.Component {
|
|
|
26949
26949
|
className: "answer-expression"
|
|
26950
26950
|
}, /*#__PURE__*/React__namespace.createElement(perseus.Expression, this.props.expressionProps))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
26951
26951
|
className: "answer-option"
|
|
26952
|
-
}, /*#__PURE__*/React__namespace.createElement(PropCheckBox$
|
|
26952
|
+
}, /*#__PURE__*/React__namespace.createElement(PropCheckBox$a, {
|
|
26953
26953
|
form: this.props.form,
|
|
26954
26954
|
onChange: this.props.onChange,
|
|
26955
26955
|
labelAlignment: "right",
|
|
26956
26956
|
label: "Answer expression must have the same form."
|
|
26957
|
-
}), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
26957
|
+
}), /*#__PURE__*/React__namespace.createElement(InfoTip$h, null, /*#__PURE__*/React__namespace.createElement("p", null, "The student's answer must be in the same form. Commutativity and excess negative signs are ignored."))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
26958
26958
|
className: "answer-option"
|
|
26959
|
-
}, /*#__PURE__*/React__namespace.createElement(PropCheckBox$
|
|
26959
|
+
}, /*#__PURE__*/React__namespace.createElement(PropCheckBox$a, {
|
|
26960
26960
|
simplify: this.props.simplify,
|
|
26961
26961
|
onChange: this.props.onChange,
|
|
26962
26962
|
labelAlignment: "right",
|
|
26963
26963
|
label: "Answer expression must be fully expanded and simplified."
|
|
26964
|
-
}), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
26964
|
+
}), /*#__PURE__*/React__namespace.createElement(InfoTip$h, null, /*#__PURE__*/React__namespace.createElement("p", null, "The student's answer must be fully expanded and simplified. Answering this equation (x^2+2x+1) with this factored equation (x+1)^2 will render this response \"Your answer is not fully expanded and simplified.\""))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
26965
26965
|
className: "remove-container"
|
|
26966
26966
|
}, removeButton)));
|
|
26967
26967
|
}
|
|
@@ -26983,12 +26983,12 @@ class AnswerOption extends React__namespace.Component {
|
|
|
26983
26983
|
|
|
26984
26984
|
/* eslint-disable @khanacademy/ts-no-error-suppressions */
|
|
26985
26985
|
const {
|
|
26986
|
-
InlineIcon: InlineIcon$
|
|
26987
|
-
TextInput: TextInput$
|
|
26986
|
+
InlineIcon: InlineIcon$4,
|
|
26987
|
+
TextInput: TextInput$6
|
|
26988
26988
|
} = perseus.components;
|
|
26989
26989
|
const {
|
|
26990
|
-
iconPlus: iconPlus$
|
|
26991
|
-
iconTrash: iconTrash$
|
|
26990
|
+
iconPlus: iconPlus$1,
|
|
26991
|
+
iconTrash: iconTrash$2
|
|
26992
26992
|
} = perseus.icons;
|
|
26993
26993
|
class GradedGroupEditor extends React__namespace.Component {
|
|
26994
26994
|
static propTypes = {
|
|
@@ -27040,7 +27040,7 @@ class GradedGroupEditor extends React__namespace.Component {
|
|
|
27040
27040
|
className: "perseus-widget-row"
|
|
27041
27041
|
}, /*#__PURE__*/React__namespace.createElement("label", {
|
|
27042
27042
|
className: aphrodite.css(styles$b.title)
|
|
27043
|
-
}, "Title:", " ", /*#__PURE__*/React__namespace.createElement(TextInput$
|
|
27043
|
+
}, "Title:", " ", /*#__PURE__*/React__namespace.createElement(TextInput$6, {
|
|
27044
27044
|
value: this.props.title,
|
|
27045
27045
|
className: aphrodite.css(styles$b.input)
|
|
27046
27046
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
@@ -27064,7 +27064,7 @@ class GradedGroupEditor extends React__namespace.Component {
|
|
|
27064
27064
|
},
|
|
27065
27065
|
className: "add-hint simple-button orange",
|
|
27066
27066
|
onClick: this.handleAddHint
|
|
27067
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
27067
|
+
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$4, iconPlus$1), " Add a hint"), this.props.hint && /*#__PURE__*/React__namespace.createElement("div", {
|
|
27068
27068
|
className: "perseus-hint-editor"
|
|
27069
27069
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
27070
27070
|
className: aphrodite.css(styles$b.hintsTitle)
|
|
@@ -27086,7 +27086,7 @@ class GradedGroupEditor extends React__namespace.Component {
|
|
|
27086
27086
|
type: "button",
|
|
27087
27087
|
className: "remove-hint simple-button orange",
|
|
27088
27088
|
onClick: this.handleRemoveHint
|
|
27089
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
27089
|
+
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$4, iconTrash$2), " Remove this hint")));
|
|
27090
27090
|
}
|
|
27091
27091
|
getSaveWarnings = () => {
|
|
27092
27092
|
return this.editor.current?.getSaveWarnings();
|
|
@@ -27186,8 +27186,8 @@ const setArrayItem = (list, i, value) => [...list.slice(0, i), value, ...list.sl
|
|
|
27186
27186
|
/* eslint-disable react/forbid-prop-types, react/no-unsafe */
|
|
27187
27187
|
const {
|
|
27188
27188
|
ButtonGroup: ButtonGroup$4,
|
|
27189
|
-
InfoTip: InfoTip$
|
|
27190
|
-
PropCheckBox: PropCheckBox$
|
|
27189
|
+
InfoTip: InfoTip$g,
|
|
27190
|
+
PropCheckBox: PropCheckBox$9,
|
|
27191
27191
|
RangeInput: RangeInput$6
|
|
27192
27192
|
} = perseus.components;
|
|
27193
27193
|
const defaultBackgroundImage$3 = {
|
|
@@ -27621,7 +27621,7 @@ const GraphSettings = createReactClass__default["default"]({
|
|
|
27621
27621
|
onChange: this.change("markings")
|
|
27622
27622
|
})), /*#__PURE__*/React__namespace.createElement("div", {
|
|
27623
27623
|
className: "perseus-widget-left-col"
|
|
27624
|
-
}, /*#__PURE__*/React__namespace.createElement(PropCheckBox$
|
|
27624
|
+
}, /*#__PURE__*/React__namespace.createElement(PropCheckBox$9, {
|
|
27625
27625
|
label: "Show tooltips",
|
|
27626
27626
|
showTooltips: this.props.showTooltips,
|
|
27627
27627
|
onChange: this.change
|
|
@@ -27646,19 +27646,19 @@ const GraphSettings = createReactClass__default["default"]({
|
|
|
27646
27646
|
},
|
|
27647
27647
|
onKeyPress: this.changeBackgroundUrl,
|
|
27648
27648
|
onBlur: this.changeBackgroundUrl
|
|
27649
|
-
}), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
27649
|
+
}), /*#__PURE__*/React__namespace.createElement(InfoTip$g, null, /*#__PURE__*/React__namespace.createElement("p", null, "Create an image in graphie, or use the \"Add image\" function to create a background.")))), ___default["default"].contains(this.props.editableSettings, "measure") && /*#__PURE__*/React__namespace.createElement("div", {
|
|
27650
27650
|
className: "misc-settings"
|
|
27651
27651
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
27652
27652
|
className: "perseus-widget-row"
|
|
27653
27653
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
27654
27654
|
className: "perseus-widget-left-col"
|
|
27655
|
-
}, /*#__PURE__*/React__namespace.createElement(PropCheckBox$
|
|
27655
|
+
}, /*#__PURE__*/React__namespace.createElement(PropCheckBox$9, {
|
|
27656
27656
|
label: "Show ruler",
|
|
27657
27657
|
showRuler: this.props.showRuler,
|
|
27658
27658
|
onChange: this.change
|
|
27659
27659
|
})), /*#__PURE__*/React__namespace.createElement("div", {
|
|
27660
27660
|
className: "perseus-widget-right-col"
|
|
27661
|
-
}, /*#__PURE__*/React__namespace.createElement(PropCheckBox$
|
|
27661
|
+
}, /*#__PURE__*/React__namespace.createElement(PropCheckBox$9, {
|
|
27662
27662
|
label: "Show protractor",
|
|
27663
27663
|
showProtractor: this.props.showProtractor,
|
|
27664
27664
|
onChange: this.change
|
|
@@ -27683,7 +27683,7 @@ const GraphSettings = createReactClass__default["default"]({
|
|
|
27683
27683
|
});
|
|
27684
27684
|
|
|
27685
27685
|
const {
|
|
27686
|
-
InfoTip: InfoTip$
|
|
27686
|
+
InfoTip: InfoTip$f,
|
|
27687
27687
|
MultiButtonGroup: MultiButtonGroup$1
|
|
27688
27688
|
} = perseus.components;
|
|
27689
27689
|
const {
|
|
@@ -27757,7 +27757,7 @@ class GrapherEditor extends React__namespace.Component {
|
|
|
27757
27757
|
className: "perseus-error"
|
|
27758
27758
|
}, this.props.graph.valid);
|
|
27759
27759
|
}
|
|
27760
|
-
return /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("div", null, "Correct answer", " ", /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
27760
|
+
return /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("div", null, "Correct answer", " ", /*#__PURE__*/React__namespace.createElement(InfoTip$f, null, /*#__PURE__*/React__namespace.createElement("p", null, "Graph the correct answer in the graph below and ensure the equation or point coordinates displayed represent the correct answer.")), " ", ": ", equationString), /*#__PURE__*/React__namespace.createElement(GraphSettings, {
|
|
27761
27761
|
editableSettings: ["graph", "snap", "image"],
|
|
27762
27762
|
box: getInteractiveBoxFromSizeClass$1(sizeClass),
|
|
27763
27763
|
range: this.props.graph.range,
|
|
@@ -27869,7 +27869,7 @@ class GroupEditor extends React__namespace.Component {
|
|
|
27869
27869
|
|
|
27870
27870
|
/* eslint-disable @khanacademy/ts-no-error-suppressions */
|
|
27871
27871
|
const {
|
|
27872
|
-
PropCheckBox: PropCheckBox$
|
|
27872
|
+
PropCheckBox: PropCheckBox$8
|
|
27873
27873
|
} = perseus.components;
|
|
27874
27874
|
/**
|
|
27875
27875
|
* This is used for editing a name/value pair.
|
|
@@ -28009,11 +28009,11 @@ class IframeEditor extends React__namespace.Component {
|
|
|
28009
28009
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
28010
28010
|
,
|
|
28011
28011
|
onChange: this.change("height")
|
|
28012
|
-
})), /*#__PURE__*/React__namespace.createElement(PropCheckBox$
|
|
28012
|
+
})), /*#__PURE__*/React__namespace.createElement(PropCheckBox$8, {
|
|
28013
28013
|
label: "Allow full screen",
|
|
28014
28014
|
allowFullScreen: this.props.allowFullScreen,
|
|
28015
28015
|
onChange: this.props.onChange
|
|
28016
|
-
}), /*#__PURE__*/React__namespace.createElement("br", null), /*#__PURE__*/React__namespace.createElement(PropCheckBox$
|
|
28016
|
+
}), /*#__PURE__*/React__namespace.createElement("br", null), /*#__PURE__*/React__namespace.createElement(PropCheckBox$8, {
|
|
28017
28017
|
label: "Allow iframe content to redirect the page",
|
|
28018
28018
|
allowTopNavigation: this.props.allowTopNavigation,
|
|
28019
28019
|
onChange: this.props.onChange
|
|
@@ -28032,8 +28032,8 @@ class IframeEditor extends React__namespace.Component {
|
|
|
28032
28032
|
|
|
28033
28033
|
/* eslint-disable jsx-a11y/anchor-is-valid, react/sort-comp */
|
|
28034
28034
|
const {
|
|
28035
|
-
InfoTip: InfoTip$
|
|
28036
|
-
InlineIcon: InlineIcon$
|
|
28035
|
+
InfoTip: InfoTip$e,
|
|
28036
|
+
InlineIcon: InlineIcon$3,
|
|
28037
28037
|
RangeInput: RangeInput$5
|
|
28038
28038
|
} = perseus.components;
|
|
28039
28039
|
const defaultBoxSize = 400;
|
|
@@ -28089,7 +28089,7 @@ class ImageEditor extends React__namespace.Component {
|
|
|
28089
28089
|
style: {
|
|
28090
28090
|
width: "100%"
|
|
28091
28091
|
}
|
|
28092
|
-
}))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, /*#__PURE__*/React__namespace.createElement("div", null, "Dimensions:"), /*#__PURE__*/React__namespace.createElement("p", null, backgroundImage.width, "x", backgroundImage.height))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, /*#__PURE__*/React__namespace.createElement("div", null, "Alt text:", /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
28092
|
+
}))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, /*#__PURE__*/React__namespace.createElement("div", null, "Dimensions:"), /*#__PURE__*/React__namespace.createElement("p", null, backgroundImage.width, "x", backgroundImage.height))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, /*#__PURE__*/React__namespace.createElement("div", null, "Alt text:", /*#__PURE__*/React__namespace.createElement(InfoTip$e, null, "This is important for screenreaders. The content of this alt text will be formatted as markdown (tables, emphasis, etc. are supported).")), /*#__PURE__*/React__namespace.createElement(Editor, {
|
|
28093
28093
|
apiOptions: this.props.apiOptions,
|
|
28094
28094
|
content: this.props.alt,
|
|
28095
28095
|
onChange: props => {
|
|
@@ -28113,7 +28113,7 @@ class ImageEditor extends React__namespace.Component {
|
|
|
28113
28113
|
}, this.state.backgroundImageError);
|
|
28114
28114
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
28115
28115
|
className: "perseus-image-editor"
|
|
28116
|
-
}, /*#__PURE__*/React__namespace.createElement("label", null, "Image url:", /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
28116
|
+
}, /*#__PURE__*/React__namespace.createElement("label", null, "Image url:", /*#__PURE__*/React__namespace.createElement(InfoTip$e, null, "Paste an image or graphie image URL."), this.state.backgroundImageError && backgroundImageErrorText, /*#__PURE__*/React__namespace.createElement(BlurInput, {
|
|
28117
28117
|
value: backgroundImage.url || "",
|
|
28118
28118
|
style: {
|
|
28119
28119
|
width: 332
|
|
@@ -28159,7 +28159,7 @@ class ImageEditor extends React__namespace.Component {
|
|
|
28159
28159
|
// eslint-disable-next-line react/jsx-no-bind
|
|
28160
28160
|
,
|
|
28161
28161
|
onClick: this.removeLabel.bind(this, i)
|
|
28162
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
28162
|
+
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$3, perseus.icons.iconTrash))));
|
|
28163
28163
|
}
|
|
28164
28164
|
change() {
|
|
28165
28165
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
@@ -28269,7 +28269,7 @@ class ImageEditor extends React__namespace.Component {
|
|
|
28269
28269
|
|
|
28270
28270
|
/* eslint-disable react/sort-comp */
|
|
28271
28271
|
const {
|
|
28272
|
-
InfoTip: InfoTip$
|
|
28272
|
+
InfoTip: InfoTip$d
|
|
28273
28273
|
} = perseus.components;
|
|
28274
28274
|
const answerTypes = {
|
|
28275
28275
|
number: {
|
|
@@ -28348,7 +28348,7 @@ class InputNumberEditor extends React__namespace.Component {
|
|
|
28348
28348
|
value: "optional"
|
|
28349
28349
|
}, "will be accepted"), /*#__PURE__*/React__namespace.createElement("option", {
|
|
28350
28350
|
value: "enforced"
|
|
28351
|
-
}, "will be marked wrong"))), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
28351
|
+
}, "will be marked wrong"))), /*#__PURE__*/React__namespace.createElement(InfoTip$d, null, /*#__PURE__*/React__namespace.createElement("p", null, "Normally select \"will not be graded\". This will give the user a message saying the answer is correct but not simplified. The user will then have to simplify it and re-enter, but will not be penalized. (5th grade and anything after)"), /*#__PURE__*/React__namespace.createElement("p", null, "Select \"will be accepted\" only if the user is not expected to know how to simplify fractions yet. (Anything prior to 5th grade)"), /*#__PURE__*/React__namespace.createElement("p", null, "Select \"will be marked wrong\" only if we are specifically assessing the ability to simplify."))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, /*#__PURE__*/React__namespace.createElement("input", {
|
|
28352
28352
|
type: "checkbox",
|
|
28353
28353
|
checked: this.props.inexact,
|
|
28354
28354
|
onChange: e => {
|
|
@@ -28384,7 +28384,7 @@ class InputNumberEditor extends React__namespace.Component {
|
|
|
28384
28384
|
});
|
|
28385
28385
|
},
|
|
28386
28386
|
"aria-label": "Answer type"
|
|
28387
|
-
}, answerTypeOptions), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
28387
|
+
}, answerTypeOptions), /*#__PURE__*/React__namespace.createElement(InfoTip$d, null, /*#__PURE__*/React__namespace.createElement("p", null, "Use the default \"Numbers\" unless the answer must be in a specific form (e.g., question is about converting decimals to fractions)."))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Width", " ", /*#__PURE__*/React__namespace.createElement("select", {
|
|
28388
28388
|
value: this.props.size,
|
|
28389
28389
|
onChange: e => {
|
|
28390
28390
|
// @ts-expect-error - TS2322 - Type 'string' is not assignable to type '"small" | "normal" | undefined'.
|
|
@@ -28396,7 +28396,7 @@ class InputNumberEditor extends React__namespace.Component {
|
|
|
28396
28396
|
value: "normal"
|
|
28397
28397
|
}, "Normal (80px)"), /*#__PURE__*/React__namespace.createElement("option", {
|
|
28398
28398
|
value: "small"
|
|
28399
|
-
}, "Small (40px)"))), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
28399
|
+
}, "Small (40px)"))), /*#__PURE__*/React__namespace.createElement(InfoTip$d, null, /*#__PURE__*/React__namespace.createElement("p", null, "Use size \"Normal\" for all text boxes, unless there are multiple text boxes in one line and the answer area is too narrow to fit them."))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, /*#__PURE__*/React__namespace.createElement("input", {
|
|
28400
28400
|
type: "checkbox",
|
|
28401
28401
|
checked: this.props.rightAlign,
|
|
28402
28402
|
onChange: e => {
|
|
@@ -28481,7 +28481,7 @@ const styles$a = aphrodite.StyleSheet.create({
|
|
|
28481
28481
|
});
|
|
28482
28482
|
|
|
28483
28483
|
const {
|
|
28484
|
-
NumberInput: NumberInput$
|
|
28484
|
+
NumberInput: NumberInput$e
|
|
28485
28485
|
} = perseus.components;
|
|
28486
28486
|
const {
|
|
28487
28487
|
getDependencies: getDependencies$8
|
|
@@ -28541,7 +28541,7 @@ class FunctionEditor extends React__namespace.Component {
|
|
|
28541
28541
|
className: "perseus-widget-row"
|
|
28542
28542
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
28543
28543
|
className: "perseus-widget-left-col"
|
|
28544
|
-
}, "Width:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
28544
|
+
}, "Width:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$e, {
|
|
28545
28545
|
value: this.props.strokeWidth,
|
|
28546
28546
|
placeholder: 2,
|
|
28547
28547
|
onChange: this.change("strokeWidth")
|
|
@@ -28550,7 +28550,7 @@ class FunctionEditor extends React__namespace.Component {
|
|
|
28550
28550
|
}
|
|
28551
28551
|
|
|
28552
28552
|
const {
|
|
28553
|
-
TextInput: TextInput$
|
|
28553
|
+
TextInput: TextInput$5
|
|
28554
28554
|
} = perseus.components;
|
|
28555
28555
|
const {
|
|
28556
28556
|
getDependencies: getDependencies$7
|
|
@@ -28584,7 +28584,7 @@ class LabelEditor extends React__namespace.Component {
|
|
|
28584
28584
|
className: "graph-settings"
|
|
28585
28585
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
28586
28586
|
className: "perseus-widget-row"
|
|
28587
|
-
}, /*#__PURE__*/React__namespace.createElement(TextInput$
|
|
28587
|
+
}, /*#__PURE__*/React__namespace.createElement(TextInput$5, {
|
|
28588
28588
|
value: this.props.label,
|
|
28589
28589
|
onChange: this.change("label"),
|
|
28590
28590
|
style: {
|
|
@@ -28608,7 +28608,7 @@ class LabelEditor extends React__namespace.Component {
|
|
|
28608
28608
|
}
|
|
28609
28609
|
|
|
28610
28610
|
const {
|
|
28611
|
-
NumberInput: NumberInput$
|
|
28611
|
+
NumberInput: NumberInput$d
|
|
28612
28612
|
} = perseus.components;
|
|
28613
28613
|
const {
|
|
28614
28614
|
getDependencies: getDependencies$6
|
|
@@ -28676,7 +28676,7 @@ class LineEditor extends React__namespace.Component {
|
|
|
28676
28676
|
className: "perseus-widget-row"
|
|
28677
28677
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
28678
28678
|
className: "perseus-widget-left-col"
|
|
28679
|
-
}, "Width:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
28679
|
+
}, "Width:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$d, {
|
|
28680
28680
|
value: this.props.strokeWidth,
|
|
28681
28681
|
placeholder: 2,
|
|
28682
28682
|
onChange: this.change("strokeWidth")
|
|
@@ -28686,7 +28686,7 @@ class LineEditor extends React__namespace.Component {
|
|
|
28686
28686
|
|
|
28687
28687
|
const {
|
|
28688
28688
|
ButtonGroup: ButtonGroup$3,
|
|
28689
|
-
NumberInput: NumberInput$
|
|
28689
|
+
NumberInput: NumberInput$c
|
|
28690
28690
|
} = perseus.components;
|
|
28691
28691
|
class ConstraintEditor extends React__namespace.Component {
|
|
28692
28692
|
static defaultProps = {
|
|
@@ -28726,7 +28726,7 @@ class ConstraintEditor extends React__namespace.Component {
|
|
|
28726
28726
|
onChange: this.change("constraint")
|
|
28727
28727
|
})), this.props.constraint === "snap" && /*#__PURE__*/React__namespace.createElement("div", {
|
|
28728
28728
|
className: "perseus-widget-row"
|
|
28729
|
-
}, "Snap:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
28729
|
+
}, "Snap:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$c, {
|
|
28730
28730
|
value: this.props.snap,
|
|
28731
28731
|
placeholder: 0,
|
|
28732
28732
|
onChange: this.change("snap")
|
|
@@ -28769,7 +28769,7 @@ class ConstraintEditor extends React__namespace.Component {
|
|
|
28769
28769
|
}
|
|
28770
28770
|
|
|
28771
28771
|
const {
|
|
28772
|
-
NumberInput: NumberInput$
|
|
28772
|
+
NumberInput: NumberInput$b
|
|
28773
28773
|
} = perseus.components;
|
|
28774
28774
|
const {
|
|
28775
28775
|
getDependencies: getDependencies$5
|
|
@@ -28827,13 +28827,13 @@ class MovableLineEditor extends React__namespace.Component {
|
|
|
28827
28827
|
onChange: this.change("endY")
|
|
28828
28828
|
}), /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large)")), /*#__PURE__*/React__namespace.createElement("div", {
|
|
28829
28829
|
className: "perseus-widget-row"
|
|
28830
|
-
}, "Start updates ", /*#__PURE__*/React__namespace.createElement(TeX, null, "(x_n, y_n)"), " for ", /*#__PURE__*/React__namespace.createElement(TeX, null, "n ="), /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
28830
|
+
}, "Start updates ", /*#__PURE__*/React__namespace.createElement(TeX, null, "(x_n, y_n)"), " for ", /*#__PURE__*/React__namespace.createElement(TeX, null, "n ="), /*#__PURE__*/React__namespace.createElement(NumberInput$b, {
|
|
28831
28831
|
value: this.props.startSubscript,
|
|
28832
28832
|
placeholder: 0,
|
|
28833
28833
|
onChange: this.change("startSubscript")
|
|
28834
28834
|
})), /*#__PURE__*/React__namespace.createElement("div", {
|
|
28835
28835
|
className: "perseus-widget-row"
|
|
28836
|
-
}, "End updates ", /*#__PURE__*/React__namespace.createElement(TeX, null, "(x_m, y_m)"), " for ", /*#__PURE__*/React__namespace.createElement(TeX, null, "m ="), /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
28836
|
+
}, "End updates ", /*#__PURE__*/React__namespace.createElement(TeX, null, "(x_m, y_m)"), " for ", /*#__PURE__*/React__namespace.createElement(TeX, null, "m ="), /*#__PURE__*/React__namespace.createElement(NumberInput$b, {
|
|
28837
28837
|
value: this.props.endSubscript,
|
|
28838
28838
|
placeholder: 0,
|
|
28839
28839
|
onChange: this.change("endSubscript")
|
|
@@ -28844,7 +28844,7 @@ class MovableLineEditor extends React__namespace.Component {
|
|
|
28844
28844
|
}
|
|
28845
28845
|
|
|
28846
28846
|
const {
|
|
28847
|
-
NumberInput: NumberInput$
|
|
28847
|
+
NumberInput: NumberInput$a
|
|
28848
28848
|
} = perseus.components;
|
|
28849
28849
|
const {
|
|
28850
28850
|
getDependencies: getDependencies$4
|
|
@@ -28892,7 +28892,7 @@ class MovablePointEditor extends React__namespace.Component {
|
|
|
28892
28892
|
onChange: this.change("startY")
|
|
28893
28893
|
}), /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large)")), /*#__PURE__*/React__namespace.createElement("div", {
|
|
28894
28894
|
className: "perseus-widget-row"
|
|
28895
|
-
}, "Update ", /*#__PURE__*/React__namespace.createElement(TeX, null, "(x_n, y_n)"), " for ", /*#__PURE__*/React__namespace.createElement(TeX, null, "n ="), " ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
28895
|
+
}, "Update ", /*#__PURE__*/React__namespace.createElement(TeX, null, "(x_n, y_n)"), " for ", /*#__PURE__*/React__namespace.createElement(TeX, null, "n ="), " ", /*#__PURE__*/React__namespace.createElement(NumberInput$a, {
|
|
28896
28896
|
value: this.props.varSubscript,
|
|
28897
28897
|
placeholder: 0,
|
|
28898
28898
|
onChange: this.change("varSubscript")
|
|
@@ -28901,7 +28901,7 @@ class MovablePointEditor extends React__namespace.Component {
|
|
|
28901
28901
|
}
|
|
28902
28902
|
|
|
28903
28903
|
const {
|
|
28904
|
-
NumberInput: NumberInput$
|
|
28904
|
+
NumberInput: NumberInput$9
|
|
28905
28905
|
} = perseus.components;
|
|
28906
28906
|
const {
|
|
28907
28907
|
getDependencies: getDependencies$3
|
|
@@ -28967,7 +28967,7 @@ class ParametricEditor extends React__namespace.Component {
|
|
|
28967
28967
|
className: "perseus-widget-row"
|
|
28968
28968
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
28969
28969
|
className: "perseus-widget-left-col"
|
|
28970
|
-
}, "Width:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
28970
|
+
}, "Width:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$9, {
|
|
28971
28971
|
value: this.props.strokeWidth,
|
|
28972
28972
|
placeholder: 2,
|
|
28973
28973
|
onChange: this.change("strokeWidth")
|
|
@@ -29593,8 +29593,8 @@ const GraphTypeSelector = props => {
|
|
|
29593
29593
|
/* eslint-disable react/forbid-prop-types, react/no-unsafe */
|
|
29594
29594
|
const {
|
|
29595
29595
|
ButtonGroup: ButtonGroup$2,
|
|
29596
|
-
InfoTip: InfoTip$
|
|
29597
|
-
PropCheckBox: PropCheckBox$
|
|
29596
|
+
InfoTip: InfoTip$c,
|
|
29597
|
+
PropCheckBox: PropCheckBox$7,
|
|
29598
29598
|
RangeInput: RangeInput$4
|
|
29599
29599
|
} = perseus.components;
|
|
29600
29600
|
const defaultBackgroundImage$1 = {
|
|
@@ -30015,7 +30015,7 @@ class InteractiveGraphSettings extends React__namespace.Component {
|
|
|
30015
30015
|
onChange: this.change("markings")
|
|
30016
30016
|
})), /*#__PURE__*/React__namespace.createElement("div", {
|
|
30017
30017
|
className: "perseus-widget-left-col"
|
|
30018
|
-
}, /*#__PURE__*/React__namespace.createElement(PropCheckBox$
|
|
30018
|
+
}, /*#__PURE__*/React__namespace.createElement(PropCheckBox$7, {
|
|
30019
30019
|
label: "Show tooltips",
|
|
30020
30020
|
showTooltips: this.props.showTooltips,
|
|
30021
30021
|
onChange: this.change
|
|
@@ -30040,19 +30040,19 @@ class InteractiveGraphSettings extends React__namespace.Component {
|
|
|
30040
30040
|
},
|
|
30041
30041
|
onKeyPress: this.changeBackgroundUrl,
|
|
30042
30042
|
onBlur: this.changeBackgroundUrl
|
|
30043
|
-
}), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
30043
|
+
}), /*#__PURE__*/React__namespace.createElement(InfoTip$c, null, /*#__PURE__*/React__namespace.createElement("p", null, "Create an image in graphie, or use the \"Add image\" function to create a background.")))), ___default["default"].contains(this.props.editableSettings, "measure") && /*#__PURE__*/React__namespace.createElement("div", {
|
|
30044
30044
|
className: "misc-settings"
|
|
30045
30045
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
30046
30046
|
className: "perseus-widget-row"
|
|
30047
30047
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
30048
30048
|
className: "perseus-widget-left-col"
|
|
30049
|
-
}, /*#__PURE__*/React__namespace.createElement(PropCheckBox$
|
|
30049
|
+
}, /*#__PURE__*/React__namespace.createElement(PropCheckBox$7, {
|
|
30050
30050
|
label: "Show ruler",
|
|
30051
30051
|
showRuler: this.props.showRuler,
|
|
30052
30052
|
onChange: this.change
|
|
30053
30053
|
})), /*#__PURE__*/React__namespace.createElement("div", {
|
|
30054
30054
|
className: "perseus-widget-right-col"
|
|
30055
|
-
}, /*#__PURE__*/React__namespace.createElement(PropCheckBox$
|
|
30055
|
+
}, /*#__PURE__*/React__namespace.createElement(PropCheckBox$7, {
|
|
30056
30056
|
label: "Show protractor",
|
|
30057
30057
|
showProtractor: this.props.showProtractor,
|
|
30058
30058
|
onChange: this.change
|
|
@@ -30095,7 +30095,7 @@ const SegmentCountSelector = _ref => {
|
|
|
30095
30095
|
};
|
|
30096
30096
|
|
|
30097
30097
|
const {
|
|
30098
|
-
InfoTip: InfoTip$
|
|
30098
|
+
InfoTip: InfoTip$b
|
|
30099
30099
|
} = perseus.components;
|
|
30100
30100
|
const {
|
|
30101
30101
|
containerSizeClass,
|
|
@@ -30287,7 +30287,7 @@ class InteractiveGraphEditor extends React__namespace.Component {
|
|
|
30287
30287
|
value: "angles"
|
|
30288
30288
|
}, "interior angles"), /*#__PURE__*/React__namespace.createElement("option", {
|
|
30289
30289
|
value: "sides"
|
|
30290
|
-
}, "side measures"))), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
30290
|
+
}, "side measures"))), /*#__PURE__*/React__namespace.createElement(InfoTip$b, null, /*#__PURE__*/React__namespace.createElement("p", null, "These options affect the movement of the vertex points. The grid option will guide the points to the nearest half step along the grid."), /*#__PURE__*/React__namespace.createElement("p", null, "The interior angle and side measure options guide the points to the nearest whole angle or side"), " ", "measure respectively.")), /*#__PURE__*/React__namespace.createElement(Row, null, /*#__PURE__*/React__namespace.createElement(Typography__namespace.LabelSmall, {
|
|
30291
30291
|
tag: "label"
|
|
30292
30292
|
}, "Show angle measures:", " ", /*#__PURE__*/React__namespace.createElement("input", {
|
|
30293
30293
|
type: "checkbox",
|
|
@@ -30300,7 +30300,7 @@ class InteractiveGraphEditor extends React__namespace.Component {
|
|
|
30300
30300
|
}
|
|
30301
30301
|
});
|
|
30302
30302
|
}
|
|
30303
|
-
})), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
30303
|
+
})), /*#__PURE__*/React__namespace.createElement(InfoTip$b, null, /*#__PURE__*/React__namespace.createElement("p", null, "Displays the interior angle measures."))), /*#__PURE__*/React__namespace.createElement(Row, null, /*#__PURE__*/React__namespace.createElement(Typography__namespace.LabelSmall, {
|
|
30304
30304
|
tag: "label"
|
|
30305
30305
|
}, "Show side measures:", " ", /*#__PURE__*/React__namespace.createElement("input", {
|
|
30306
30306
|
type: "checkbox",
|
|
@@ -30313,7 +30313,7 @@ class InteractiveGraphEditor extends React__namespace.Component {
|
|
|
30313
30313
|
}
|
|
30314
30314
|
});
|
|
30315
30315
|
}
|
|
30316
|
-
})), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
30316
|
+
})), /*#__PURE__*/React__namespace.createElement(InfoTip$b, null, /*#__PURE__*/React__namespace.createElement("p", null, "Displays the side lengths.")))), this.props.correct?.type === "segment" && /*#__PURE__*/React__namespace.createElement(Row, null, /*#__PURE__*/React__namespace.createElement(FieldLabel, null, "Number of segments: "), /*#__PURE__*/React__namespace.createElement(SegmentCountSelector, {
|
|
30317
30317
|
numSegments: this.props.correct?.numSegments,
|
|
30318
30318
|
onChange: sides => {
|
|
30319
30319
|
this.props.onChange({
|
|
@@ -30333,7 +30333,7 @@ class InteractiveGraphEditor extends React__namespace.Component {
|
|
|
30333
30333
|
borderStyle: "solid",
|
|
30334
30334
|
borderWidth: 1
|
|
30335
30335
|
}
|
|
30336
|
-
}, equationString), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
30336
|
+
}, equationString), /*#__PURE__*/React__namespace.createElement(InfoTip$b, null, /*#__PURE__*/React__namespace.createElement("p", null, "Graph the correct answer in the graph below and ensure the equation or point coordinates displayed represent the correct answer."))), /*#__PURE__*/React__namespace.createElement(InteractiveGraphSettings, {
|
|
30337
30337
|
box: getInteractiveBoxFromSizeClass(sizeClass),
|
|
30338
30338
|
range: this.props.range,
|
|
30339
30339
|
labels: this.props.labels,
|
|
@@ -30362,7 +30362,7 @@ class InteractiveGraphEditor extends React__namespace.Component {
|
|
|
30362
30362
|
value: "approx"
|
|
30363
30363
|
}, "be approximately congruent"), /*#__PURE__*/React__namespace.createElement("option", {
|
|
30364
30364
|
value: "similar"
|
|
30365
|
-
}, "be similar"))), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
30365
|
+
}, "be similar"))), /*#__PURE__*/React__namespace.createElement(InfoTip$b, null, /*#__PURE__*/React__namespace.createElement("ul", null, /*#__PURE__*/React__namespace.createElement("li", null, /*#__PURE__*/React__namespace.createElement("p", null, /*#__PURE__*/React__namespace.createElement("b", null, "Match Exactly:"), " Match exactly in size, orientation, and location on the grid even if it is not shown in the background.")), /*#__PURE__*/React__namespace.createElement("li", null, /*#__PURE__*/React__namespace.createElement("p", null, /*#__PURE__*/React__namespace.createElement("b", null, "Be Congruent:"), " Be congruent in size and shape, but can be located anywhere on the grid.")), /*#__PURE__*/React__namespace.createElement("li", null, /*#__PURE__*/React__namespace.createElement("p", null, /*#__PURE__*/React__namespace.createElement("b", null, "Be Approximately Congruent:"), " Be exactly similar, and congruent in size and shape to within 0.1 units, but can be located anywhere on the grid.", " ", /*#__PURE__*/React__namespace.createElement("em", null, "Use this with snapping to angle measure."))), /*#__PURE__*/React__namespace.createElement("li", null, /*#__PURE__*/React__namespace.createElement("p", null, /*#__PURE__*/React__namespace.createElement("b", null, "Be Similar:"), " Be similar with matching interior angles, and side measures that are matching or a multiple of the correct side measures. The figure can be located anywhere on the grid."))))), this.props.correct.type === "angle" && /*#__PURE__*/React__namespace.createElement("div", {
|
|
30366
30366
|
className: "type-settings"
|
|
30367
30367
|
}, /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, " ", "Student answer must", " ", /*#__PURE__*/React__namespace.createElement("select", {
|
|
30368
30368
|
value: this.props.correct.match,
|
|
@@ -30371,7 +30371,7 @@ class InteractiveGraphEditor extends React__namespace.Component {
|
|
|
30371
30371
|
value: "exact"
|
|
30372
30372
|
}, "match exactly"), /*#__PURE__*/React__namespace.createElement("option", {
|
|
30373
30373
|
value: "congruent"
|
|
30374
|
-
}, "be congruent"))), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
30374
|
+
}, "be congruent"))), /*#__PURE__*/React__namespace.createElement(InfoTip$b, null, /*#__PURE__*/React__namespace.createElement("p", null, "Congruency requires only that the angle measures are the same. An exact match implies congruency, but also requires that the angles have the same orientation and that the vertices are in the same position.")))), graph);
|
|
30375
30375
|
}
|
|
30376
30376
|
changeMatchType(e) {
|
|
30377
30377
|
const correct = ___default["default"].extend({}, this.props.correct, {
|
|
@@ -31932,215 +31932,9 @@ const styles = aphrodite.StyleSheet.create({
|
|
|
31932
31932
|
}
|
|
31933
31933
|
});
|
|
31934
31934
|
|
|
31935
|
-
/* eslint-disable @khanacademy/ts-no-error-suppressions */
|
|
31936
|
-
const {
|
|
31937
|
-
InfoTip: InfoTip$c,
|
|
31938
|
-
NumberInput: NumberInput$b,
|
|
31939
|
-
PropCheckBox: PropCheckBox$7
|
|
31940
|
-
} = perseus.components;
|
|
31941
|
-
const MAX_SIZE = 8;
|
|
31942
|
-
|
|
31943
|
-
// styling
|
|
31944
|
-
const CELL_PADDING = 5;
|
|
31945
|
-
const TABLE_STYLE = {
|
|
31946
|
-
display: "table",
|
|
31947
|
-
tableLayout: "fixed"
|
|
31948
|
-
};
|
|
31949
|
-
const ROW_STYLE = {
|
|
31950
|
-
display: "table-row"
|
|
31951
|
-
};
|
|
31952
|
-
const CELL_STYLE = {
|
|
31953
|
-
display: "table-cell",
|
|
31954
|
-
padding: CELL_PADDING
|
|
31955
|
-
};
|
|
31956
|
-
const BASE_TILE_STYLE = {
|
|
31957
|
-
borderRadius: 10,
|
|
31958
|
-
cursor: "pointer"
|
|
31959
|
-
};
|
|
31960
|
-
const PATTERNS = {
|
|
31961
|
-
plus: () => [[false, true, false], [true, true, true], [false, true, false]],
|
|
31962
|
-
x: () => [[true, false, true], [false, true, false], [true, false, true]],
|
|
31963
|
-
"plus/x": iter => {
|
|
31964
|
-
return iter % 2 ? PATTERNS.x() : PATTERNS.plus();
|
|
31965
|
-
}
|
|
31966
|
-
};
|
|
31967
|
-
|
|
31968
|
-
/**
|
|
31969
|
-
* Clamps value to an integer in the range [min, max]
|
|
31970
|
-
*/
|
|
31971
|
-
const clampToInt = function (value, min, max) {
|
|
31972
|
-
value = Math.floor(value);
|
|
31973
|
-
value = Math.max(value, min);
|
|
31974
|
-
value = Math.min(value, max);
|
|
31975
|
-
return value;
|
|
31976
|
-
};
|
|
31977
|
-
|
|
31978
|
-
// Returns a copy of the tiles, with tiles flipped according to
|
|
31979
|
-
// whether or not their y, x position satisfies the predicate
|
|
31980
|
-
const flipTilesPredicate = (oldCells, predicate) => {
|
|
31981
|
-
return ___default["default"].map(oldCells, (row, y) => {
|
|
31982
|
-
return ___default["default"].map(row, (cell, x) => {
|
|
31983
|
-
return predicate(y, x) ? !cell : cell;
|
|
31984
|
-
});
|
|
31985
|
-
});
|
|
31986
|
-
};
|
|
31987
|
-
// A single glowy cell
|
|
31988
|
-
class Tile extends React__namespace.Component {
|
|
31989
|
-
static propTypes = {
|
|
31990
|
-
value: PropTypes__default["default"].bool.isRequired,
|
|
31991
|
-
size: PropTypes__default["default"].number.isRequired
|
|
31992
|
-
};
|
|
31993
|
-
render() {
|
|
31994
|
-
const color = this.props.value ? "#55dd55" : "#115511";
|
|
31995
|
-
const style = ___default["default"].extend({}, BASE_TILE_STYLE, {
|
|
31996
|
-
width: this.props.size,
|
|
31997
|
-
height: this.props.size,
|
|
31998
|
-
backgroundColor: color
|
|
31999
|
-
});
|
|
32000
|
-
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
32001
|
-
style: style,
|
|
32002
|
-
onClick: this._flip
|
|
32003
|
-
});
|
|
32004
|
-
}
|
|
32005
|
-
_flip = () => {
|
|
32006
|
-
this.props.onChange(!this.props.value);
|
|
32007
|
-
};
|
|
32008
|
-
}
|
|
32009
|
-
// A grid of glowy cells
|
|
32010
|
-
class TileGrid extends React__namespace.Component {
|
|
32011
|
-
static propTypes = {
|
|
32012
|
-
cells: PropTypes__default["default"].arrayOf(PropTypes__default["default"].arrayOf(PropTypes__default["default"].bool)).isRequired,
|
|
32013
|
-
size: PropTypes__default["default"].number.isRequired
|
|
32014
|
-
};
|
|
32015
|
-
render() {
|
|
32016
|
-
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
32017
|
-
style: TABLE_STYLE,
|
|
32018
|
-
className: "no-select"
|
|
32019
|
-
}, ___default["default"].map(this.props.cells, (row, y) => {
|
|
32020
|
-
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
32021
|
-
key: y,
|
|
32022
|
-
style: ROW_STYLE
|
|
32023
|
-
}, ___default["default"].map(row, (cell, x) => {
|
|
32024
|
-
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
32025
|
-
key: x,
|
|
32026
|
-
style: CELL_STYLE
|
|
32027
|
-
}, /*#__PURE__*/React__namespace.createElement(Tile, {
|
|
32028
|
-
value: cell,
|
|
32029
|
-
size: this.props.size,
|
|
32030
|
-
onChange: ___default["default"].partial(this.props.onChange, y, x)
|
|
32031
|
-
}));
|
|
32032
|
-
}));
|
|
32033
|
-
}));
|
|
32034
|
-
}
|
|
32035
|
-
}
|
|
32036
|
-
// The widget editor
|
|
32037
|
-
class LightsPuzzleEditor extends React__namespace.Component {
|
|
32038
|
-
static propTypes = {
|
|
32039
|
-
...perseus.Changeable.propTypes,
|
|
32040
|
-
startCells: PropTypes__default["default"].arrayOf(PropTypes__default["default"].arrayOf(PropTypes__default["default"].bool)),
|
|
32041
|
-
flipPattern: PropTypes__default["default"].string.isRequired,
|
|
32042
|
-
gradeIncompleteAsWrong: PropTypes__default["default"].bool.isRequired
|
|
32043
|
-
};
|
|
32044
|
-
static widgetName = "lights-puzzle";
|
|
32045
|
-
static defaultProps = {
|
|
32046
|
-
startCells: [[false, false, false], [false, false, false], [false, false, false]],
|
|
32047
|
-
flipPattern: "plus",
|
|
32048
|
-
gradeIncompleteAsWrong: false
|
|
32049
|
-
};
|
|
32050
|
-
_height = () => {
|
|
32051
|
-
return this.props.startCells.length;
|
|
32052
|
-
};
|
|
32053
|
-
_width = () => {
|
|
32054
|
-
if (this.props.startCells.length !== 0) {
|
|
32055
|
-
return this.props.startCells[0].length;
|
|
32056
|
-
}
|
|
32057
|
-
return 0; // default to 0
|
|
32058
|
-
};
|
|
32059
|
-
|
|
32060
|
-
change = (() => {
|
|
32061
|
-
var _this = this;
|
|
32062
|
-
return function () {
|
|
32063
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
32064
|
-
args[_key] = arguments[_key];
|
|
32065
|
-
}
|
|
32066
|
-
return perseus.Changeable.change.apply(_this, args);
|
|
32067
|
-
};
|
|
32068
|
-
})();
|
|
32069
|
-
render() {
|
|
32070
|
-
return /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("div", null, "Width:", /*#__PURE__*/React__namespace.createElement(NumberInput$b, {
|
|
32071
|
-
value: this._width(),
|
|
32072
|
-
placeholder: 5,
|
|
32073
|
-
onChange: this._changeWidth
|
|
32074
|
-
}), ", ", "Height:", /*#__PURE__*/React__namespace.createElement(NumberInput$b, {
|
|
32075
|
-
value: this._height(),
|
|
32076
|
-
placeholder: 5,
|
|
32077
|
-
onChange: this._changeHeight
|
|
32078
|
-
})), /*#__PURE__*/React__namespace.createElement("div", null, "Flip pattern:", /*#__PURE__*/React__namespace.createElement("select", {
|
|
32079
|
-
value: this.props.flipPattern
|
|
32080
|
-
// @ts-expect-error - TS2322 - Type '(arg1: ChangeEvent<HTMLInputElement>) => void' is not assignable to type 'ChangeEventHandler<HTMLSelectElement>'.
|
|
32081
|
-
,
|
|
32082
|
-
onChange: this._handlePatternChange
|
|
32083
|
-
}, ___default["default"].map(___default["default"].keys(PATTERNS), (pattern, i) => {
|
|
32084
|
-
return /*#__PURE__*/React__namespace.createElement("option", {
|
|
32085
|
-
value: pattern,
|
|
32086
|
-
key: i
|
|
32087
|
-
}, pattern);
|
|
32088
|
-
}))), /*#__PURE__*/React__namespace.createElement("div", null, "Grade incomplete puzzles as wrong:", " ", /*#__PURE__*/React__namespace.createElement(PropCheckBox$7, {
|
|
32089
|
-
gradeIncompleteAsWrong: this.props.gradeIncompleteAsWrong,
|
|
32090
|
-
onChange: this.props.onChange
|
|
32091
|
-
}), /*#__PURE__*/React__namespace.createElement(InfoTip$c, null, "By default, incomplete puzzles are graded as empty.")), /*#__PURE__*/React__namespace.createElement("div", null, "Starting configuration:"), /*#__PURE__*/React__namespace.createElement("div", {
|
|
32092
|
-
style: {
|
|
32093
|
-
overflowX: "auto"
|
|
32094
|
-
}
|
|
32095
|
-
}, /*#__PURE__*/React__namespace.createElement(TileGrid, {
|
|
32096
|
-
cells: this.props.startCells,
|
|
32097
|
-
size: 50,
|
|
32098
|
-
onChange: this._switchTile
|
|
32099
|
-
})));
|
|
32100
|
-
}
|
|
32101
|
-
_handlePatternChange = e => {
|
|
32102
|
-
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 2.
|
|
32103
|
-
this.change("flipPattern", e.target.value);
|
|
32104
|
-
};
|
|
32105
|
-
_changeWidth = newWidth => {
|
|
32106
|
-
newWidth = clampToInt(newWidth, 1, MAX_SIZE);
|
|
32107
|
-
this._truncateCells(newWidth, this._height());
|
|
32108
|
-
};
|
|
32109
|
-
_changeHeight = newHeight => {
|
|
32110
|
-
newHeight = clampToInt(newHeight, 1, MAX_SIZE);
|
|
32111
|
-
this._truncateCells(this._width(), newHeight);
|
|
32112
|
-
};
|
|
32113
|
-
_truncateCells = (newWidth, newHeight) => {
|
|
32114
|
-
const newCells = ___default["default"].times(newHeight, y => {
|
|
32115
|
-
return ___default["default"].times(newWidth, x => {
|
|
32116
|
-
// explicitly cast the result to a boolean with !!
|
|
32117
|
-
return !!(this.props.startCells[y] && this.props.startCells[y][x]);
|
|
32118
|
-
});
|
|
32119
|
-
});
|
|
32120
|
-
|
|
32121
|
-
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
32122
|
-
this.change({
|
|
32123
|
-
startCells: newCells
|
|
32124
|
-
});
|
|
32125
|
-
};
|
|
32126
|
-
_switchTile = (tileY, tileX) => {
|
|
32127
|
-
const newCells = flipTilesPredicate(this.props.startCells, (y, x) => {
|
|
32128
|
-
return y === tileY && x === tileX;
|
|
32129
|
-
});
|
|
32130
|
-
|
|
32131
|
-
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
32132
|
-
this.change({
|
|
32133
|
-
startCells: newCells
|
|
32134
|
-
});
|
|
32135
|
-
};
|
|
32136
|
-
serialize = () => {
|
|
32137
|
-
return perseus.EditorJsonify.serialize.call(this);
|
|
32138
|
-
};
|
|
32139
|
-
}
|
|
32140
|
-
|
|
32141
31935
|
/* eslint-disable react/forbid-prop-types, react/sort-comp */
|
|
32142
31936
|
const {
|
|
32143
|
-
InfoTip: InfoTip$
|
|
31937
|
+
InfoTip: InfoTip$a,
|
|
32144
31938
|
PropCheckBox: PropCheckBox$6,
|
|
32145
31939
|
TextListEditor: TextListEditor$3
|
|
32146
31940
|
} = perseus.components;
|
|
@@ -32163,7 +31957,7 @@ class MatcherEditor extends React__namespace.Component {
|
|
|
32163
31957
|
render() {
|
|
32164
31958
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
32165
31959
|
className: "perseus-matcher-editor"
|
|
32166
|
-
}, /*#__PURE__*/React__namespace.createElement("div", null, " ", "Correct answer:", " ", /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
31960
|
+
}, /*#__PURE__*/React__namespace.createElement("div", null, " ", "Correct answer:", " ", /*#__PURE__*/React__namespace.createElement(InfoTip$a, null, /*#__PURE__*/React__namespace.createElement("p", null, "Enter the correct answers here. The preview on the right will show the cards in a randomized order, which is how the student will see them."))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
32167
31961
|
className: "perseus-clearfix"
|
|
32168
31962
|
}, /*#__PURE__*/React__namespace.createElement(TextListEditor$3, {
|
|
32169
31963
|
options: this.props.left,
|
|
@@ -32181,7 +31975,7 @@ class MatcherEditor extends React__namespace.Component {
|
|
|
32181
31975
|
}, cb);
|
|
32182
31976
|
},
|
|
32183
31977
|
layout: "vertical"
|
|
32184
|
-
})), /*#__PURE__*/React__namespace.createElement("span", null, " ", "Labels:", " ", /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
31978
|
+
})), /*#__PURE__*/React__namespace.createElement("span", null, " ", "Labels:", " ", /*#__PURE__*/React__namespace.createElement(InfoTip$a, null, /*#__PURE__*/React__namespace.createElement("p", null, "These are entirely optional."))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("input", {
|
|
32185
31979
|
type: "text",
|
|
32186
31980
|
defaultValue: this.props.labels[0]
|
|
32187
31981
|
// eslint-disable-next-line react/jsx-no-bind
|
|
@@ -32197,11 +31991,11 @@ class MatcherEditor extends React__namespace.Component {
|
|
|
32197
31991
|
label: "Order of the matched pairs matters:",
|
|
32198
31992
|
orderMatters: this.props.orderMatters,
|
|
32199
31993
|
onChange: this.props.onChange
|
|
32200
|
-
}), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
31994
|
+
}), /*#__PURE__*/React__namespace.createElement(InfoTip$a, null, /*#__PURE__*/React__namespace.createElement("p", null, "With this option enabled, only the order provided above will be treated as correct. This is useful when ordering is significant, such as in the context of a proof."), /*#__PURE__*/React__namespace.createElement("p", null, "If disabled, pairwise matching is sufficient. To make this clear, the left column becomes fixed in the provided order and only the cards in the right column can be moved."))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement(PropCheckBox$6, {
|
|
32201
31995
|
label: "Padding:",
|
|
32202
31996
|
padding: this.props.padding,
|
|
32203
31997
|
onChange: this.props.onChange
|
|
32204
|
-
}), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
31998
|
+
}), /*#__PURE__*/React__namespace.createElement(InfoTip$a, null, /*#__PURE__*/React__namespace.createElement("p", null, "Padding is good for text, but not needed for images."))));
|
|
32205
31999
|
}
|
|
32206
32000
|
onLabelChange = (index, e) => {
|
|
32207
32001
|
const labels = ___default["default"].clone(this.props.labels);
|
|
@@ -32351,8 +32145,8 @@ class MatrixEditor extends React__namespace.Component {
|
|
|
32351
32145
|
|
|
32352
32146
|
/* eslint-disable @khanacademy/ts-no-error-suppressions */
|
|
32353
32147
|
const {
|
|
32354
|
-
InfoTip: InfoTip$
|
|
32355
|
-
NumberInput: NumberInput$
|
|
32148
|
+
InfoTip: InfoTip$9,
|
|
32149
|
+
NumberInput: NumberInput$8,
|
|
32356
32150
|
PropCheckBox: PropCheckBox$5,
|
|
32357
32151
|
RangeInput: RangeInput$2
|
|
32358
32152
|
} = perseus.components;
|
|
@@ -32401,18 +32195,18 @@ class MeasurerEditor extends React__namespace.Component {
|
|
|
32401
32195
|
ref: "image-url",
|
|
32402
32196
|
defaultValue: image.url,
|
|
32403
32197
|
onChange: this._changeUrl
|
|
32404
|
-
}), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
32198
|
+
}), /*#__PURE__*/React__namespace.createElement(InfoTip$9, null, /*#__PURE__*/React__namespace.createElement("p", null, "Create an image in graphie, or use the \"Add image\" function to create a background."))), image.url && /*#__PURE__*/React__namespace.createElement("div", {
|
|
32405
32199
|
className: "perseus-widget-row"
|
|
32406
32200
|
}, /*#__PURE__*/React__namespace.createElement("label", {
|
|
32407
32201
|
className: "perseus-widget-left-col"
|
|
32408
|
-
}, "Pixels from top:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
32202
|
+
}, "Pixels from top:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$8, {
|
|
32409
32203
|
placeholder: 0,
|
|
32410
32204
|
onChange: this._changeTop,
|
|
32411
32205
|
value: image.top,
|
|
32412
32206
|
useArrowKeys: true
|
|
32413
32207
|
})), /*#__PURE__*/React__namespace.createElement("label", {
|
|
32414
32208
|
className: "perseus-widget-right-col"
|
|
32415
|
-
}, "Pixels from left:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
32209
|
+
}, "Pixels from left:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$8, {
|
|
32416
32210
|
placeholder: 0,
|
|
32417
32211
|
onChange: this._changeLeft,
|
|
32418
32212
|
value: image.left,
|
|
@@ -32458,14 +32252,14 @@ class MeasurerEditor extends React__namespace.Component {
|
|
|
32458
32252
|
key: n,
|
|
32459
32253
|
value: n
|
|
32460
32254
|
}, n);
|
|
32461
|
-
})))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Ruler pixels per unit:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
32255
|
+
})))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Ruler pixels per unit:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$8, {
|
|
32462
32256
|
placeholder: 40
|
|
32463
32257
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
32464
32258
|
,
|
|
32465
32259
|
onChange: this.change("rulerPixels"),
|
|
32466
32260
|
value: this.props.rulerPixels,
|
|
32467
32261
|
useArrowKeys: true
|
|
32468
|
-
}))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Ruler length in units:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
32262
|
+
}))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Ruler length in units:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$8, {
|
|
32469
32263
|
placeholder: 10
|
|
32470
32264
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
32471
32265
|
,
|
|
@@ -32513,8 +32307,8 @@ class MeasurerEditor extends React__namespace.Component {
|
|
|
32513
32307
|
}
|
|
32514
32308
|
|
|
32515
32309
|
const {
|
|
32516
|
-
NumberInput: NumberInput$
|
|
32517
|
-
TextInput: TextInput$
|
|
32310
|
+
NumberInput: NumberInput$7,
|
|
32311
|
+
TextInput: TextInput$4
|
|
32518
32312
|
} = perseus.components;
|
|
32519
32313
|
class MoleculeWidgetEditor extends React__namespace.Component {
|
|
32520
32314
|
static propTypes = {
|
|
@@ -32548,10 +32342,10 @@ class MoleculeWidgetEditor extends React__namespace.Component {
|
|
|
32548
32342
|
return perseus.EditorJsonify.serialize.call(this);
|
|
32549
32343
|
};
|
|
32550
32344
|
render() {
|
|
32551
|
-
return /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "SMILES:\xA0", /*#__PURE__*/React__namespace.createElement(TextInput$
|
|
32345
|
+
return /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "SMILES:\xA0", /*#__PURE__*/React__namespace.createElement(TextInput$4, {
|
|
32552
32346
|
onChange: this.updateMolecule,
|
|
32553
32347
|
value: this.props.smiles
|
|
32554
|
-
}))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Rotation (deg):\xA0", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
32348
|
+
}))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Rotation (deg):\xA0", /*#__PURE__*/React__namespace.createElement(NumberInput$7, {
|
|
32555
32349
|
onChange: this.updateRotation,
|
|
32556
32350
|
value: this.props.rotationAngle
|
|
32557
32351
|
}))));
|
|
@@ -32561,8 +32355,8 @@ class MoleculeWidgetEditor extends React__namespace.Component {
|
|
|
32561
32355
|
/* eslint-disable @khanacademy/ts-no-error-suppressions */
|
|
32562
32356
|
const {
|
|
32563
32357
|
ButtonGroup: ButtonGroup$1,
|
|
32564
|
-
InfoTip: InfoTip$
|
|
32565
|
-
NumberInput: NumberInput$
|
|
32358
|
+
InfoTip: InfoTip$8,
|
|
32359
|
+
NumberInput: NumberInput$6,
|
|
32566
32360
|
PropCheckBox: PropCheckBox$4,
|
|
32567
32361
|
RangeInput: RangeInput$1
|
|
32568
32362
|
} = perseus.components;
|
|
@@ -32742,7 +32536,7 @@ class NumberLineEditor extends React__namespace.Component {
|
|
|
32742
32536
|
}, "\u2264"), /*#__PURE__*/React__namespace.createElement("option", {
|
|
32743
32537
|
value: "ge",
|
|
32744
32538
|
"aria-label": "Greater than or equal"
|
|
32745
|
-
}, "\u2265")), " ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
32539
|
+
}, "\u2265")), " ", /*#__PURE__*/React__namespace.createElement(NumberInput$6, {
|
|
32746
32540
|
value: this.props.correctX,
|
|
32747
32541
|
format: this.props.labelStyle
|
|
32748
32542
|
// eslint-disable-next-line react/jsx-no-bind
|
|
@@ -32752,9 +32546,9 @@ class NumberLineEditor extends React__namespace.Component {
|
|
|
32752
32546
|
placeholder: "answer",
|
|
32753
32547
|
size: "normal",
|
|
32754
32548
|
useArrowKeys: true
|
|
32755
|
-
}), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
32549
|
+
}), /*#__PURE__*/React__namespace.createElement(InfoTip$8, null, /*#__PURE__*/React__namespace.createElement("p", null, "This is the correct answer. The answer is validated (as right or wrong) by using only the end position of the point and the relation (=, <, >, \u2264, \u2265)."))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
32756
32550
|
className: "perseus-widget-row"
|
|
32757
|
-
}, this.props.static ? /*#__PURE__*/React__namespace.createElement("label", null, "Range:") : /*#__PURE__*/React__namespace.createElement("label", null, "Position:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
32551
|
+
}, this.props.static ? /*#__PURE__*/React__namespace.createElement("label", null, "Range:") : /*#__PURE__*/React__namespace.createElement("label", null, "Position:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$6, {
|
|
32758
32552
|
value: this.props.initialX,
|
|
32759
32553
|
format: this.props.labelStyle
|
|
32760
32554
|
// eslint-disable-next-line react/jsx-no-bind
|
|
@@ -32770,11 +32564,11 @@ class NumberLineEditor extends React__namespace.Component {
|
|
|
32770
32564
|
onChange: this.onRangeChange,
|
|
32771
32565
|
format: this.props.labelStyle,
|
|
32772
32566
|
useArrowKeys: true
|
|
32773
|
-
}), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
32567
|
+
}), /*#__PURE__*/React__namespace.createElement(InfoTip$8, null, /*#__PURE__*/React__namespace.createElement("p", null, "This controls the initial position of the point along the number line and the", /*#__PURE__*/React__namespace.createElement("strong", null, "range"), ", the position of the endpoints of the number line. Setting the range constrains the position of the answer and the labels."), /*#__PURE__*/React__namespace.createElement("p", null, "In static mode, the initial position of the point is determined by Correct x instead of position."))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
32774
32568
|
className: "perseus-widget-row"
|
|
32775
32569
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
32776
32570
|
className: "perseus-widget-left-col"
|
|
32777
|
-
}, "Labels:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
32571
|
+
}, "Labels:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$6, {
|
|
32778
32572
|
value: labelRange[0],
|
|
32779
32573
|
placeholder: range[0],
|
|
32780
32574
|
format: this.props.labelStyle,
|
|
@@ -32783,7 +32577,7 @@ class NumberLineEditor extends React__namespace.Component {
|
|
|
32783
32577
|
,
|
|
32784
32578
|
onChange: this.onLabelRangeChange.bind(this, 0),
|
|
32785
32579
|
useArrowKeys: true
|
|
32786
|
-
}), /*#__PURE__*/React__namespace.createElement("span", null, " & "), /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
32580
|
+
}), /*#__PURE__*/React__namespace.createElement("span", null, " & "), /*#__PURE__*/React__namespace.createElement(NumberInput$6, {
|
|
32787
32581
|
value: labelRange[1],
|
|
32788
32582
|
placeholder: range[1],
|
|
32789
32583
|
format: this.props.labelStyle,
|
|
@@ -32792,14 +32586,14 @@ class NumberLineEditor extends React__namespace.Component {
|
|
|
32792
32586
|
,
|
|
32793
32587
|
onChange: this.onLabelRangeChange.bind(this, 1),
|
|
32794
32588
|
useArrowKeys: true
|
|
32795
|
-
}), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
32589
|
+
}), /*#__PURE__*/React__namespace.createElement(InfoTip$8, null, /*#__PURE__*/React__namespace.createElement("p", null, "This controls the position of the left / right labels. By default, the labels are set by the range ", /*#__PURE__*/React__namespace.createElement("br", null), /*#__PURE__*/React__namespace.createElement("strong", null, "Note:"), " Ensure that the labels line up with the tick marks, or it may be confusing for users.")))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
32796
32590
|
className: "perseus-widget-row"
|
|
32797
32591
|
}, "Style:", " ", /*#__PURE__*/React__namespace.createElement(ButtonGroup$1, {
|
|
32798
32592
|
allowEmpty: false,
|
|
32799
32593
|
value: this.props.labelStyle,
|
|
32800
32594
|
buttons: labelStyleEditorButtons,
|
|
32801
32595
|
onChange: this.onLabelStyleChange
|
|
32802
|
-
}), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
32596
|
+
}), /*#__PURE__*/React__namespace.createElement(InfoTip$8, null, /*#__PURE__*/React__namespace.createElement("p", null, "This controls the styling of the labels for the two main labels as well as all the tick mark labels, if applicable. Your choices are decimal, improper fractions, mixed fractions, and non-reduced fractions."))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
32803
32597
|
className: "perseus-widget-row"
|
|
32804
32598
|
}, !this.props.static && /*#__PURE__*/React__namespace.createElement("div", {
|
|
32805
32599
|
className: "perseus-widget-left-col"
|
|
@@ -32821,7 +32615,7 @@ class NumberLineEditor extends React__namespace.Component {
|
|
|
32821
32615
|
onChange: this.props.onChange
|
|
32822
32616
|
})), /*#__PURE__*/React__namespace.createElement("div", {
|
|
32823
32617
|
className: "perseus-widget-row"
|
|
32824
|
-
}, isTickCtrl && /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement("label", null, "Start num divisions at", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
32618
|
+
}, isTickCtrl && /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement("label", null, "Start num divisions at", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$6, {
|
|
32825
32619
|
value: this.props.numDivisions || null,
|
|
32826
32620
|
format: "decimal",
|
|
32827
32621
|
onChange: this.onNumDivisionsChange,
|
|
@@ -32830,7 +32624,7 @@ class NumberLineEditor extends React__namespace.Component {
|
|
|
32830
32624
|
},
|
|
32831
32625
|
placeholder: width / this.props.tickStep,
|
|
32832
32626
|
useArrowKeys: true
|
|
32833
|
-
})), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
32627
|
+
})), /*#__PURE__*/React__namespace.createElement(InfoTip$8, null, /*#__PURE__*/React__namespace.createElement("p", null, "This controls the number (and position) of the tick marks. The number of divisions is constrained to", " " + divisionRange[0] + EN_DASH + divisionRange[1], ".", /*#__PURE__*/React__namespace.createElement("br", null), /*#__PURE__*/React__namespace.createElement("strong", null, "Note:"), " The user will be able to specify the number of divisions in a number input."))), !isTickCtrl && /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement("label", null, "Num divisions:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$6, {
|
|
32834
32628
|
value: this.props.numDivisions || null,
|
|
32835
32629
|
format: "decimal",
|
|
32836
32630
|
onChange: this.onNumDivisionsChange,
|
|
@@ -32839,7 +32633,7 @@ class NumberLineEditor extends React__namespace.Component {
|
|
|
32839
32633
|
},
|
|
32840
32634
|
placeholder: width / this.props.tickStep,
|
|
32841
32635
|
useArrowKeys: true
|
|
32842
|
-
})), " ", /*#__PURE__*/React__namespace.createElement("label", null, "or tick step:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
32636
|
+
})), " ", /*#__PURE__*/React__namespace.createElement("label", null, "or tick step:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$6, {
|
|
32843
32637
|
value: this.props.tickStep || null,
|
|
32844
32638
|
format: this.props.labelStyle,
|
|
32845
32639
|
onChange: this.onTickStepChange,
|
|
@@ -32848,9 +32642,9 @@ class NumberLineEditor extends React__namespace.Component {
|
|
|
32848
32642
|
},
|
|
32849
32643
|
placeholder: width / this.props.numDivisions,
|
|
32850
32644
|
useArrowKeys: true
|
|
32851
|
-
})), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
32645
|
+
})), /*#__PURE__*/React__namespace.createElement(InfoTip$8, null, /*#__PURE__*/React__namespace.createElement("p", null, "This controls the number (and position) of the tick marks; you can either set the number of divisions (2 divisions would split the entire range in two halves), or the tick step (the distance between ticks) and the other value will be updated accordingly.", " ", /*#__PURE__*/React__namespace.createElement("br", null), /*#__PURE__*/React__namespace.createElement("strong", null, "Note:"), " There is no check to see if labels coordinate with the tick marks, which may be confusing for users if the blue labels and black ticks are off-step.")))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
32852
32646
|
className: "perseus-widget-row"
|
|
32853
|
-
}, /*#__PURE__*/React__namespace.createElement("label", null, "Snap increments per tick:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
32647
|
+
}, /*#__PURE__*/React__namespace.createElement("label", null, "Snap increments per tick:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$6, {
|
|
32854
32648
|
value: snapDivisions,
|
|
32855
32649
|
checkValidity: val => val > 0,
|
|
32856
32650
|
format: this.props.labelStyle
|
|
@@ -32858,23 +32652,23 @@ class NumberLineEditor extends React__namespace.Component {
|
|
|
32858
32652
|
,
|
|
32859
32653
|
onChange: this.onNumChange.bind(this, "snapDivisions"),
|
|
32860
32654
|
useArrowKeys: true
|
|
32861
|
-
})), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
32655
|
+
})), /*#__PURE__*/React__namespace.createElement(InfoTip$8, null, /*#__PURE__*/React__namespace.createElement("p", null, "This determines the number of different places the point will snap between two adjacent tick marks.", " ", /*#__PURE__*/React__namespace.createElement("br", null), /*#__PURE__*/React__namespace.createElement("strong", null, "Note:"), "Ensure the required number of snap increments is provided to answer the question."))));
|
|
32862
32656
|
}
|
|
32863
32657
|
}
|
|
32864
32658
|
|
|
32865
32659
|
/* eslint-disable jsx-a11y/anchor-is-valid, react/sort-comp */
|
|
32866
32660
|
const {
|
|
32867
32661
|
ButtonGroup,
|
|
32868
|
-
InfoTip: InfoTip$
|
|
32869
|
-
InlineIcon: InlineIcon$
|
|
32662
|
+
InfoTip: InfoTip$7,
|
|
32663
|
+
InlineIcon: InlineIcon$2,
|
|
32870
32664
|
MultiButtonGroup,
|
|
32871
|
-
NumberInput: NumberInput$
|
|
32665
|
+
NumberInput: NumberInput$5,
|
|
32872
32666
|
PropCheckBox: PropCheckBox$3,
|
|
32873
|
-
TextInput: TextInput$
|
|
32667
|
+
TextInput: TextInput$3
|
|
32874
32668
|
} = perseus.components;
|
|
32875
32669
|
const {
|
|
32876
32670
|
iconGear,
|
|
32877
|
-
iconTrash: iconTrash$
|
|
32671
|
+
iconTrash: iconTrash$1
|
|
32878
32672
|
} = perseus.icons;
|
|
32879
32673
|
const {
|
|
32880
32674
|
firstNumericalParse
|
|
@@ -32956,14 +32750,14 @@ const NumericInputEditor = createReactClass__default["default"]({
|
|
|
32956
32750
|
content: "wrong"
|
|
32957
32751
|
}],
|
|
32958
32752
|
onChange: this.updateAnswer(i, "simplify")
|
|
32959
|
-
}), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
32753
|
+
}), /*#__PURE__*/React__namespace.createElement(InfoTip$7, null, /*#__PURE__*/React__namespace.createElement("p", null, "Normally select \"ungraded\". This will give the user a message saying the answer is correct but not simplified. The user will then have to simplify it and re-enter, but will not be penalized. (5th grade and after)"), /*#__PURE__*/React__namespace.createElement("p", null, "Select \"accepted\" only if the user is not expected to know how to simplify fractions yet. (Anything prior to 5th grade)"), /*#__PURE__*/React__namespace.createElement("p", null, "Select \"wrong\" ", /*#__PURE__*/React__namespace.createElement("em", null, "only"), " if we are specifically assessing the ability to simplify.")));
|
|
32960
32754
|
const suggestedAnswerTypes = i => /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("div", {
|
|
32961
32755
|
className: "perseus-widget-row"
|
|
32962
32756
|
}, /*#__PURE__*/React__namespace.createElement("label", null, "Choose the suggested answer formats"), /*#__PURE__*/React__namespace.createElement(MultiButtonGroup, {
|
|
32963
32757
|
buttons: answerFormButtons,
|
|
32964
32758
|
values: answers[i]["answerForms"],
|
|
32965
32759
|
onChange: this.updateAnswer(i, "answerForms")
|
|
32966
|
-
}), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
32760
|
+
}), /*#__PURE__*/React__namespace.createElement(InfoTip$7, null, /*#__PURE__*/React__namespace.createElement("p", null, "Formats will be autoselected for you based on the given answer; to show no suggested formats and accept all types, simply have a decimal/integer be the answer. Values with \u03C0 will have format \"pi\", and values that are fractions will have some subset (mixed will be \"mixed\" and \"proper\"; improper/proper will both be \"improper\" and \"proper\"). If you would like to specify that it is only a proper fraction (or only a mixed/improper fraction), deselect the other format. Except for specific cases, you should not need to change the autoselected formats."), /*#__PURE__*/React__namespace.createElement("p", null, "To restrict the answer to ", /*#__PURE__*/React__namespace.createElement("em", null, "only"), " an improper fraction (i.e. 7/4), select the improper fraction and toggle \"strict\" to true. This ", /*#__PURE__*/React__namespace.createElement("b", null, "will not"), " ", "accept 1.75 as an answer.", " "), /*#__PURE__*/React__namespace.createElement("p", null, "Unless you are testing that specific skill, please do not restrict the answer format."))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
32967
32761
|
className: "perseus-widget-row"
|
|
32968
32762
|
}, /*#__PURE__*/React__namespace.createElement(PropCheckBox$3, {
|
|
32969
32763
|
label: "Strictly match only these formats",
|
|
@@ -32974,7 +32768,7 @@ const NumericInputEditor = createReactClass__default["default"]({
|
|
|
32974
32768
|
})));
|
|
32975
32769
|
const maxError = i => /*#__PURE__*/React__namespace.createElement("div", {
|
|
32976
32770
|
className: "perseus-widget-row"
|
|
32977
|
-
}, /*#__PURE__*/React__namespace.createElement("label", null, "Max error", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
32771
|
+
}, /*#__PURE__*/React__namespace.createElement("label", null, "Max error", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$5, {
|
|
32978
32772
|
className: "max-error",
|
|
32979
32773
|
value: answers[i]["maxError"],
|
|
32980
32774
|
onChange: this.updateAnswer(i, "maxError"),
|
|
@@ -32993,7 +32787,7 @@ const NumericInputEditor = createReactClass__default["default"]({
|
|
|
32993
32787
|
content: "Small (40px)"
|
|
32994
32788
|
}],
|
|
32995
32789
|
onChange: this.change("size")
|
|
32996
|
-
}), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
32790
|
+
}), /*#__PURE__*/React__namespace.createElement(InfoTip$7, null, /*#__PURE__*/React__namespace.createElement("p", null, "Use size \"Normal\" for all text boxes, unless there are multiple text boxes in one line and the answer area is too narrow to fit them.")));
|
|
32997
32791
|
const rightAlign = /*#__PURE__*/React__namespace.createElement("div", {
|
|
32998
32792
|
className: "perseus-widget-row"
|
|
32999
32793
|
}, /*#__PURE__*/React__namespace.createElement(PropCheckBox$3, {
|
|
@@ -33003,17 +32797,17 @@ const NumericInputEditor = createReactClass__default["default"]({
|
|
|
33003
32797
|
}));
|
|
33004
32798
|
const labelText = /*#__PURE__*/React__namespace.createElement("div", {
|
|
33005
32799
|
className: "perseus-widget-row"
|
|
33006
|
-
}, /*#__PURE__*/React__namespace.createElement("label", null, "Label text:", " ", /*#__PURE__*/React__namespace.createElement(TextInput$
|
|
32800
|
+
}, /*#__PURE__*/React__namespace.createElement("label", null, "Label text:", " ", /*#__PURE__*/React__namespace.createElement(TextInput$3, {
|
|
33007
32801
|
value: this.props.labelText,
|
|
33008
32802
|
onChange: this.change("labelText")
|
|
33009
|
-
})), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
32803
|
+
})), /*#__PURE__*/React__namespace.createElement(InfoTip$7, null, /*#__PURE__*/React__namespace.createElement("p", null, "Text to describe this input. This will be shown to users using screenreaders.")));
|
|
33010
32804
|
const coefficientCheck = /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("div", {
|
|
33011
32805
|
className: "perseus-widget-row"
|
|
33012
32806
|
}, /*#__PURE__*/React__namespace.createElement(PropCheckBox$3, {
|
|
33013
32807
|
label: "Coefficient",
|
|
33014
32808
|
coefficient: this.props.coefficient,
|
|
33015
32809
|
onChange: this.props.onChange
|
|
33016
|
-
}), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
32810
|
+
}), /*#__PURE__*/React__namespace.createElement(InfoTip$7, null, /*#__PURE__*/React__namespace.createElement("p", null, "A coefficient style number allows the student to use - for -1 and an empty string to mean 1."))));
|
|
33017
32811
|
const addAnswerButton = /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("a", {
|
|
33018
32812
|
href: "javascript:void(0)",
|
|
33019
32813
|
className: "simple-button orange",
|
|
@@ -33044,7 +32838,7 @@ const NumericInputEditor = createReactClass__default["default"]({
|
|
|
33044
32838
|
key: i
|
|
33045
32839
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
33046
32840
|
className: "input-answer-editor-value-container" + (answer.maxError ? " with-max-error" : "")
|
|
33047
|
-
}, /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
32841
|
+
}, /*#__PURE__*/React__namespace.createElement(NumberInput$5, {
|
|
33048
32842
|
value: answer.value,
|
|
33049
32843
|
className: "numeric-input-value",
|
|
33050
32844
|
placeholder: "answer",
|
|
@@ -33091,7 +32885,7 @@ const NumericInputEditor = createReactClass__default["default"]({
|
|
|
33091
32885
|
className: "max-error-container"
|
|
33092
32886
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
33093
32887
|
className: "max-error-plusmn"
|
|
33094
|
-
}, "\xB1"), /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
32888
|
+
}, "\xB1"), /*#__PURE__*/React__namespace.createElement(NumberInput$5, {
|
|
33095
32889
|
placeholder: 0,
|
|
33096
32890
|
value: answers[i]["maxError"],
|
|
33097
32891
|
format: ___default["default"].last(answer.answerForms),
|
|
@@ -33109,13 +32903,13 @@ const NumericInputEditor = createReactClass__default["default"]({
|
|
|
33109
32903
|
"aria-label": "Delete answer",
|
|
33110
32904
|
onClick: () => this.onTrashAnswer(i),
|
|
33111
32905
|
onKeyDown: e => this.onSpace(e, this.onTrashAnswer, i)
|
|
33112
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
32906
|
+
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$2, iconTrash$1)), /*#__PURE__*/React__namespace.createElement("a", {
|
|
33113
32907
|
href: "javascript:void(0)",
|
|
33114
32908
|
className: "options-toggle",
|
|
33115
32909
|
"aria-label": "Toggle options",
|
|
33116
32910
|
onClick: () => this.onToggleOptions(i),
|
|
33117
32911
|
onKeyDown: e => this.onSpace(e, this.onToggleOptions, i)
|
|
33118
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
32912
|
+
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$2, iconGear))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
33119
32913
|
className: "input-answer-editor-message"
|
|
33120
32914
|
}, editor), this.state.showOptions[i] && /*#__PURE__*/React__namespace.createElement("div", {
|
|
33121
32915
|
className: "options-container"
|
|
@@ -33224,7 +33018,7 @@ const NumericInputEditor = createReactClass__default["default"]({
|
|
|
33224
33018
|
|
|
33225
33019
|
/* eslint-disable @khanacademy/ts-no-error-suppressions */
|
|
33226
33020
|
const {
|
|
33227
|
-
InfoTip: InfoTip$
|
|
33021
|
+
InfoTip: InfoTip$6,
|
|
33228
33022
|
TextListEditor: TextListEditor$2
|
|
33229
33023
|
} = perseus.components;
|
|
33230
33024
|
const NORMAL = "normal",
|
|
@@ -33253,13 +33047,13 @@ class OrdererEditor extends React__namespace.Component {
|
|
|
33253
33047
|
render() {
|
|
33254
33048
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
33255
33049
|
className: "perseus-widget-orderer"
|
|
33256
|
-
}, /*#__PURE__*/React__namespace.createElement("div", null, " ", "Correct answer:", " ", /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
33050
|
+
}, /*#__PURE__*/React__namespace.createElement("div", null, " ", "Correct answer:", " ", /*#__PURE__*/React__namespace.createElement(InfoTip$6, null, /*#__PURE__*/React__namespace.createElement("p", null, "Place the cards in the correct order. The same card can be used more than once in the answer but will only be displayed once at the top of a stack of identical cards."))), /*#__PURE__*/React__namespace.createElement(TextListEditor$2, {
|
|
33257
33051
|
options: ___default["default"].pluck(this.props.correctOptions, "content")
|
|
33258
33052
|
// eslint-disable-next-line react/jsx-no-bind
|
|
33259
33053
|
,
|
|
33260
33054
|
onChange: this.onOptionsChange.bind(this, "correctOptions"),
|
|
33261
33055
|
layout: this.props.layout
|
|
33262
|
-
}), /*#__PURE__*/React__namespace.createElement("div", null, " ", "Other cards:", " ", /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
33056
|
+
}), /*#__PURE__*/React__namespace.createElement("div", null, " ", "Other cards:", " ", /*#__PURE__*/React__namespace.createElement(InfoTip$6, null, /*#__PURE__*/React__namespace.createElement("p", null, "Create cards that are not part of the answer."))), /*#__PURE__*/React__namespace.createElement(TextListEditor$2, {
|
|
33263
33057
|
options: ___default["default"].pluck(this.props.otherOptions, "content")
|
|
33264
33058
|
// eslint-disable-next-line react/jsx-no-bind
|
|
33265
33059
|
,
|
|
@@ -33274,7 +33068,7 @@ class OrdererEditor extends React__namespace.Component {
|
|
|
33274
33068
|
value: HORIZONTAL$1
|
|
33275
33069
|
}, "Horizontal"), /*#__PURE__*/React__namespace.createElement("option", {
|
|
33276
33070
|
value: VERTICAL$1
|
|
33277
|
-
}, "Vertical"))), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
33071
|
+
}, "Vertical"))), /*#__PURE__*/React__namespace.createElement(InfoTip$6, null, /*#__PURE__*/React__namespace.createElement("p", null, "Use the horizontal layout for short text and small images. The vertical layout is best for longer text (e.g. proofs)."))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, " ", "Height:", " ", /*#__PURE__*/React__namespace.createElement("select", {
|
|
33278
33072
|
value: this.props.height
|
|
33279
33073
|
// @ts-expect-error - TS2322 - Type '(arg1: ChangeEvent<HTMLInputElement>) => void' is not assignable to type 'ChangeEventHandler<HTMLSelectElement>'.
|
|
33280
33074
|
,
|
|
@@ -33283,7 +33077,7 @@ class OrdererEditor extends React__namespace.Component {
|
|
|
33283
33077
|
value: NORMAL
|
|
33284
33078
|
}, "Normal"), /*#__PURE__*/React__namespace.createElement("option", {
|
|
33285
33079
|
value: AUTO
|
|
33286
|
-
}, "Automatic"))), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
33080
|
+
}, "Automatic"))), /*#__PURE__*/React__namespace.createElement(InfoTip$6, null, /*#__PURE__*/React__namespace.createElement("p", null, "Use \"Normal\" for text, \"Automatic\" for images."))));
|
|
33287
33081
|
}
|
|
33288
33082
|
onOptionsChange = (whichOptions, options, cb) => {
|
|
33289
33083
|
const props = {};
|
|
@@ -33334,7 +33128,7 @@ class OrdererEditor extends React__namespace.Component {
|
|
|
33334
33128
|
}
|
|
33335
33129
|
|
|
33336
33130
|
const {
|
|
33337
|
-
InfoTip: InfoTip$
|
|
33131
|
+
InfoTip: InfoTip$5,
|
|
33338
33132
|
PropCheckBox: PropCheckBox$2
|
|
33339
33133
|
} = perseus.components;
|
|
33340
33134
|
class PassageEditor extends React__namespace.Component {
|
|
@@ -33405,7 +33199,7 @@ class PassageEditor extends React__namespace.Component {
|
|
|
33405
33199
|
labelAlignment: "right",
|
|
33406
33200
|
showLineNumbers: this.props.showLineNumbers,
|
|
33407
33201
|
onChange: this.props.onChange
|
|
33408
|
-
})), /*#__PURE__*/React__namespace.createElement("div", null, "Passage title:", /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
33202
|
+
})), /*#__PURE__*/React__namespace.createElement("div", null, "Passage title:", /*#__PURE__*/React__namespace.createElement(InfoTip$5, null, /*#__PURE__*/React__namespace.createElement("p", null, "An optional title that will appear directly above the passage in the same font style. (E.g. Passage 1)")), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("input", {
|
|
33409
33203
|
type: "text",
|
|
33410
33204
|
defaultValue: this.props.passageTitle,
|
|
33411
33205
|
onChange: e => {
|
|
@@ -33414,15 +33208,15 @@ class PassageEditor extends React__namespace.Component {
|
|
|
33414
33208
|
passageTitle: e.target.value
|
|
33415
33209
|
});
|
|
33416
33210
|
}
|
|
33417
|
-
}))), /*#__PURE__*/React__namespace.createElement("div", null, "Passage Text:", passageEditor), /*#__PURE__*/React__namespace.createElement("div", null, "Footnotes:", /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
33211
|
+
}))), /*#__PURE__*/React__namespace.createElement("div", null, "Passage Text:", passageEditor), /*#__PURE__*/React__namespace.createElement("div", null, "Footnotes:", /*#__PURE__*/React__namespace.createElement(InfoTip$5, null, /*#__PURE__*/React__namespace.createElement("p", null, "To add footnotes, add ^ characters where they belong in the passage. Then, add ^ in the footnotes area to reference the footnotes in the passage.")), footnotesEditor));
|
|
33418
33212
|
}
|
|
33419
33213
|
}
|
|
33420
33214
|
|
|
33421
33215
|
/* eslint-disable @khanacademy/ts-no-error-suppressions */
|
|
33422
33216
|
const {
|
|
33423
|
-
InfoTip: InfoTip$
|
|
33424
|
-
NumberInput: NumberInput$
|
|
33425
|
-
TextInput: TextInput$
|
|
33217
|
+
InfoTip: InfoTip$4,
|
|
33218
|
+
NumberInput: NumberInput$4,
|
|
33219
|
+
TextInput: TextInput$2
|
|
33426
33220
|
} = perseus.components;
|
|
33427
33221
|
class PassageRefEditor extends React__namespace.Component {
|
|
33428
33222
|
static propTypes = {
|
|
@@ -33450,22 +33244,22 @@ class PassageRefEditor extends React__namespace.Component {
|
|
|
33450
33244
|
return perseus.EditorJsonify.serialize.call(this);
|
|
33451
33245
|
};
|
|
33452
33246
|
render() {
|
|
33453
|
-
return /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Passage Number: ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
33247
|
+
return /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Passage Number: ", /*#__PURE__*/React__namespace.createElement(NumberInput$4, {
|
|
33454
33248
|
value: this.props.passageNumber
|
|
33455
33249
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
33456
33250
|
,
|
|
33457
33251
|
onChange: this.change("passageNumber")
|
|
33458
|
-
}))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Reference Number: ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
33252
|
+
}))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Reference Number: ", /*#__PURE__*/React__namespace.createElement(NumberInput$4, {
|
|
33459
33253
|
value: this.props.referenceNumber
|
|
33460
33254
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
33461
33255
|
,
|
|
33462
33256
|
onChange: this.change("referenceNumber")
|
|
33463
|
-
}))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Summary Text: ", /*#__PURE__*/React__namespace.createElement(TextInput$
|
|
33257
|
+
}))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Summary Text: ", /*#__PURE__*/React__namespace.createElement(TextInput$2, {
|
|
33464
33258
|
value: this.props.summaryText
|
|
33465
33259
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
33466
33260
|
,
|
|
33467
33261
|
onChange: this.change("summaryText")
|
|
33468
|
-
}), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
33262
|
+
}), /*#__PURE__*/React__namespace.createElement(InfoTip$4, null, /*#__PURE__*/React__namespace.createElement("p", null, "Short summary of the referenced section. This will be included in parentheses and quotes automatically."), /*#__PURE__*/React__namespace.createElement("p", null, "Ex: The start ... the end")))));
|
|
33469
33263
|
}
|
|
33470
33264
|
}
|
|
33471
33265
|
|
|
@@ -33506,8 +33300,8 @@ class PassageRefTargetEditor extends React__namespace.Component {
|
|
|
33506
33300
|
}
|
|
33507
33301
|
|
|
33508
33302
|
const {
|
|
33509
|
-
InfoTip: InfoTip$
|
|
33510
|
-
NumberInput: NumberInput$
|
|
33303
|
+
InfoTip: InfoTip$3,
|
|
33304
|
+
NumberInput: NumberInput$3,
|
|
33511
33305
|
RangeInput,
|
|
33512
33306
|
TextListEditor: TextListEditor$1
|
|
33513
33307
|
} = perseus.components;
|
|
@@ -33757,27 +33551,27 @@ class PlotterEditor extends React__namespace.Component {
|
|
|
33757
33551
|
className: "set-from-scale-box"
|
|
33758
33552
|
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
33759
33553
|
className: "categories-title"
|
|
33760
|
-
}, "Set Categories From Scale"), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Tick Step:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
33554
|
+
}, "Set Categories From Scale"), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Tick Step:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$3, {
|
|
33761
33555
|
placeholder: 1,
|
|
33762
33556
|
useArrowKeys: true,
|
|
33763
33557
|
value: this.state.tickStep,
|
|
33764
33558
|
onChange: this.handleChangeTickStep
|
|
33765
|
-
})), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
33559
|
+
})), /*#__PURE__*/React__namespace.createElement(InfoTip$3, null, /*#__PURE__*/React__namespace.createElement("p", null, "The difference between adjacent ticks."))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Range:", " ", /*#__PURE__*/React__namespace.createElement(RangeInput, {
|
|
33766
33560
|
placeholder: [0, 10],
|
|
33767
33561
|
useArrowKeys: true,
|
|
33768
33562
|
value: [this.state.minX, this.state.maxX],
|
|
33769
33563
|
onChange: this.handleChangeRange
|
|
33770
33564
|
}))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("button", {
|
|
33771
33565
|
onClick: this.setCategoriesFromScale
|
|
33772
|
-
}, "Set Categories", " "))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Label Interval:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
33566
|
+
}, "Set Categories", " "))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Label Interval:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$3, {
|
|
33773
33567
|
useArrowKeys: true,
|
|
33774
33568
|
value: this.props.labelInterval,
|
|
33775
33569
|
onChange: this.changeLabelInterval
|
|
33776
|
-
})), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
33570
|
+
})), /*#__PURE__*/React__namespace.createElement(InfoTip$3, null, /*#__PURE__*/React__namespace.createElement("p", null, "Which ticks to display the labels for. For instance, setting this to \"4\" will only show every 4th label (plus the last one)"))), this.props.type === "pic" && /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Picture:", " ", /*#__PURE__*/React__namespace.createElement(BlurInput, {
|
|
33777
33571
|
className: "pic-url",
|
|
33778
33572
|
value: this.props.picUrl,
|
|
33779
33573
|
onChange: this.changePicUrl
|
|
33780
|
-
}), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
33574
|
+
}), /*#__PURE__*/React__namespace.createElement(InfoTip$3, null, /*#__PURE__*/React__namespace.createElement("p", null, "Use the default picture of Earth, or insert the URL for a different picture using the \"Add image\" function."))), this.state.pic && this.state.pic.width !== this.state.pic.height && /*#__PURE__*/React__namespace.createElement("p", {
|
|
33781
33575
|
className: "warning"
|
|
33782
33576
|
}, /*#__PURE__*/React__namespace.createElement("b", null, "Warning"), ": You are using a picture which is not square. This means the image will get distorted. You should probably crop it to be square.")), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Categories:", " ", /*#__PURE__*/React__namespace.createElement(TextListEditor$1
|
|
33783
33577
|
// eslint-disable-next-line react/no-string-refs
|
|
@@ -33801,14 +33595,14 @@ class PlotterEditor extends React__namespace.Component {
|
|
|
33801
33595
|
type: "text",
|
|
33802
33596
|
onChange: this.changeSnaps,
|
|
33803
33597
|
defaultValue: this.props.snapsPerLine
|
|
33804
|
-
})), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
33598
|
+
})), /*#__PURE__*/React__namespace.createElement(InfoTip$3, null, /*#__PURE__*/React__namespace.createElement("p", null, "Creates the specified number of divisions between the horizontal lines. Fewer snaps between lines makes the graph easier for the student to create correctly."))), /*#__PURE__*/React__namespace.createElement("div", null, "Editing values:", " ", editingStates.map(editing => /*#__PURE__*/React__namespace.createElement("label", {
|
|
33805
33599
|
key: editing
|
|
33806
33600
|
}, /*#__PURE__*/React__namespace.createElement("input", {
|
|
33807
33601
|
type: "radio",
|
|
33808
33602
|
disabled: editing === CORRECT && this.props.static,
|
|
33809
33603
|
checked: this.props.static ? editing === STARTING : this.state.editing === editing,
|
|
33810
33604
|
onChange: e => this.changeEditing(editing)
|
|
33811
|
-
}), editing)), /*#__PURE__*/React__namespace.createElement(InfoTip$
|
|
33605
|
+
}), editing)), /*#__PURE__*/React__namespace.createElement(InfoTip$3, null, /*#__PURE__*/React__namespace.createElement("p", null, "Use this toggle to switch between editing the correct answer (what the student will be graded on) and the starting values (what the student will see plotted when they start the problem). Note: These cannot be the same."), /*#__PURE__*/React__namespace.createElement("p", null, "In static mode, the starting values are rendered out to the displayed widget."))), /*#__PURE__*/React__namespace.createElement(Plotter, _extends({}, props, {
|
|
33812
33606
|
starting: this.props[this.state.editing],
|
|
33813
33607
|
onChange: this.handlePlotterChange
|
|
33814
33608
|
})));
|
|
@@ -33819,8 +33613,8 @@ class PlotterEditor extends React__namespace.Component {
|
|
|
33819
33613
|
* This editor is for embedding Khan Academy Python programs.
|
|
33820
33614
|
*/
|
|
33821
33615
|
const {
|
|
33822
|
-
NumberInput: NumberInput$
|
|
33823
|
-
TextInput: TextInput$
|
|
33616
|
+
NumberInput: NumberInput$2,
|
|
33617
|
+
TextInput: TextInput$1
|
|
33824
33618
|
} = perseus.components;
|
|
33825
33619
|
function validateOptions(height, programID) {
|
|
33826
33620
|
const errors = [];
|
|
@@ -33862,11 +33656,11 @@ class PythonProgramEditor extends React__namespace.Component {
|
|
|
33862
33656
|
return validateOptions(this.props.height, this.props.programID);
|
|
33863
33657
|
};
|
|
33864
33658
|
render() {
|
|
33865
|
-
return /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "User Program ID:", " ", /*#__PURE__*/React__namespace.createElement(TextInput$
|
|
33659
|
+
return /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "User Program ID:", " ", /*#__PURE__*/React__namespace.createElement(TextInput$1, {
|
|
33866
33660
|
value: this.props.programID,
|
|
33867
33661
|
onChange: this.change("programID"),
|
|
33868
33662
|
placeholder: "123"
|
|
33869
|
-
})), /*#__PURE__*/React__namespace.createElement("br", null), /*#__PURE__*/React__namespace.createElement("label", null, "Height:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
33663
|
+
})), /*#__PURE__*/React__namespace.createElement("br", null), /*#__PURE__*/React__namespace.createElement("label", null, "Height:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$2, {
|
|
33870
33664
|
value: this.props.height,
|
|
33871
33665
|
onChange: this.change("height"),
|
|
33872
33666
|
placeholder: "400"
|
|
@@ -33876,12 +33670,12 @@ class PythonProgramEditor extends React__namespace.Component {
|
|
|
33876
33670
|
|
|
33877
33671
|
/* eslint-disable jsx-a11y/anchor-is-valid, react/forbid-prop-types, react/sort-comp */
|
|
33878
33672
|
const {
|
|
33879
|
-
InlineIcon: InlineIcon$
|
|
33673
|
+
InlineIcon: InlineIcon$1,
|
|
33880
33674
|
PropCheckBox: PropCheckBox$1
|
|
33881
33675
|
} = perseus.components;
|
|
33882
33676
|
const {
|
|
33883
|
-
iconPlus
|
|
33884
|
-
iconTrash
|
|
33677
|
+
iconPlus,
|
|
33678
|
+
iconTrash
|
|
33885
33679
|
} = perseus.icons;
|
|
33886
33680
|
class ChoiceEditor extends React__namespace.Component {
|
|
33887
33681
|
static propTypes = {
|
|
@@ -33930,7 +33724,7 @@ class ChoiceEditor extends React__namespace.Component {
|
|
|
33930
33724
|
this.props.onDelete();
|
|
33931
33725
|
},
|
|
33932
33726
|
title: "Remove this choice"
|
|
33933
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
33727
|
+
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$1, iconTrash));
|
|
33934
33728
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
33935
33729
|
className: "choice-clue-editors"
|
|
33936
33730
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
@@ -34041,13 +33835,13 @@ class RadioEditor extends React__namespace.Component {
|
|
|
34041
33835
|
// eslint-disable-next-line react/jsx-no-bind
|
|
34042
33836
|
,
|
|
34043
33837
|
onClick: this.addChoice.bind(this, false)
|
|
34044
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
33838
|
+
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$1, iconPlus), " Add a choice", " "), !this.props.hasNoneOfTheAbove && /*#__PURE__*/React__namespace.createElement("a", {
|
|
34045
33839
|
className: "simple-button",
|
|
34046
33840
|
href: "#"
|
|
34047
33841
|
// eslint-disable-next-line react/jsx-no-bind
|
|
34048
33842
|
,
|
|
34049
33843
|
onClick: this.addChoice.bind(this, true)
|
|
34050
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
33844
|
+
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$1, iconPlus), " None of the above", " ")));
|
|
34051
33845
|
}
|
|
34052
33846
|
change = (() => {
|
|
34053
33847
|
var _this = this;
|
|
@@ -34169,253 +33963,6 @@ class RadioEditor extends React__namespace.Component {
|
|
|
34169
33963
|
};
|
|
34170
33964
|
}
|
|
34171
33965
|
|
|
34172
|
-
const {
|
|
34173
|
-
NumberInput: NumberInput$3,
|
|
34174
|
-
TextInput: TextInput$1
|
|
34175
|
-
} = perseus.components;
|
|
34176
|
-
class ReactionDiagramWidgetEditor extends React__namespace.Component {
|
|
34177
|
-
static propTypes = {
|
|
34178
|
-
...perseus.Changeable.propTypes,
|
|
34179
|
-
rotationAngle: PropTypes__default["default"].arrayOf(PropTypes__default["default"].number),
|
|
34180
|
-
// eslint-disable-next-line react/forbid-prop-types
|
|
34181
|
-
separators: PropTypes__default["default"].arrayOf(PropTypes__default["default"].object),
|
|
34182
|
-
smiles: PropTypes__default["default"].arrayOf(PropTypes__default["default"].string)
|
|
34183
|
-
};
|
|
34184
|
-
static widgetName = "reaction-diagram";
|
|
34185
|
-
static defaultProps = {
|
|
34186
|
-
smiles: ["", ""],
|
|
34187
|
-
rotationAngle: [0, 0],
|
|
34188
|
-
separators: [{
|
|
34189
|
-
type: "right",
|
|
34190
|
-
topText: "",
|
|
34191
|
-
bottomText: ""
|
|
34192
|
-
}]
|
|
34193
|
-
};
|
|
34194
|
-
change = (() => {
|
|
34195
|
-
var _this = this;
|
|
34196
|
-
return function () {
|
|
34197
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
34198
|
-
args[_key] = arguments[_key];
|
|
34199
|
-
}
|
|
34200
|
-
return perseus.Changeable.change.apply(_this, args);
|
|
34201
|
-
};
|
|
34202
|
-
})();
|
|
34203
|
-
updateMolecule = idx => {
|
|
34204
|
-
return function (newValue) {
|
|
34205
|
-
// @ts-expect-error - TS2683 - 'this' implicitly has type 'any' because it does not have a type annotation.
|
|
34206
|
-
const newSmiles = [...this.props.smiles];
|
|
34207
|
-
newSmiles[idx] = newValue;
|
|
34208
|
-
// @ts-expect-error - TS2683 - 'this' implicitly has type 'any' because it does not have a type annotation.
|
|
34209
|
-
this.change({
|
|
34210
|
-
smiles: newSmiles
|
|
34211
|
-
});
|
|
34212
|
-
}.bind(this);
|
|
34213
|
-
};
|
|
34214
|
-
updateRotation = idx => {
|
|
34215
|
-
return function (newValue) {
|
|
34216
|
-
// @ts-expect-error - TS2683 - 'this' implicitly has type 'any' because it does not have a type annotation.
|
|
34217
|
-
const newRot = [...this.props.rotationAngle];
|
|
34218
|
-
newRot[idx] = newValue;
|
|
34219
|
-
// @ts-expect-error - TS2683 - 'this' implicitly has type 'any' because it does not have a type annotation.
|
|
34220
|
-
this.change({
|
|
34221
|
-
rotationAngle: newRot
|
|
34222
|
-
});
|
|
34223
|
-
}.bind(this);
|
|
34224
|
-
};
|
|
34225
|
-
updateSeparators = (idx, propName) => {
|
|
34226
|
-
return newValue => {
|
|
34227
|
-
const newSep = this.props.separators.map(sep => {
|
|
34228
|
-
return {
|
|
34229
|
-
...sep
|
|
34230
|
-
};
|
|
34231
|
-
});
|
|
34232
|
-
newSep[idx][propName] = newValue;
|
|
34233
|
-
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
34234
|
-
this.change({
|
|
34235
|
-
separators: newSep
|
|
34236
|
-
});
|
|
34237
|
-
};
|
|
34238
|
-
};
|
|
34239
|
-
serialize = () => {
|
|
34240
|
-
return perseus.EditorJsonify.serialize.call(this);
|
|
34241
|
-
};
|
|
34242
|
-
render() {
|
|
34243
|
-
// TODO(colin): use styling instead of   hacks.
|
|
34244
|
-
return /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "LHS SMILES:\xA0", /*#__PURE__*/React__namespace.createElement(TextInput$1, {
|
|
34245
|
-
onChange: this.updateMolecule(0),
|
|
34246
|
-
value: this.props.smiles[0]
|
|
34247
|
-
}))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "LHS Rotation (deg):\xA0", /*#__PURE__*/React__namespace.createElement(NumberInput$3, {
|
|
34248
|
-
onChange: this.updateRotation(0),
|
|
34249
|
-
value: this.props.rotationAngle[0]
|
|
34250
|
-
}))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "RHS SMILES:\xA0", /*#__PURE__*/React__namespace.createElement(TextInput$1, {
|
|
34251
|
-
onChange: this.updateMolecule(1),
|
|
34252
|
-
value: this.props.smiles[1]
|
|
34253
|
-
}))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "RHS Rotation (deg):\xA0", /*#__PURE__*/React__namespace.createElement(NumberInput$3, {
|
|
34254
|
-
onChange: this.updateRotation(1),
|
|
34255
|
-
value: this.props.rotationAngle[1]
|
|
34256
|
-
}))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Top of arrow text:\xA0", /*#__PURE__*/React__namespace.createElement(TextInput$1, {
|
|
34257
|
-
onChange: this.updateSeparators(0, "topText"),
|
|
34258
|
-
value: this.props.separators[0].topText
|
|
34259
|
-
}))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Bottom of arrow text:\xA0", /*#__PURE__*/React__namespace.createElement(TextInput$1, {
|
|
34260
|
-
onChange: this.updateSeparators(0, "bottomText"),
|
|
34261
|
-
value: this.props.separators[0].bottomText
|
|
34262
|
-
}))));
|
|
34263
|
-
}
|
|
34264
|
-
}
|
|
34265
|
-
|
|
34266
|
-
/* eslint-disable jsx-a11y/anchor-is-valid, no-alert, react/sort-comp */
|
|
34267
|
-
const {
|
|
34268
|
-
InlineIcon: InlineIcon$1
|
|
34269
|
-
} = perseus.components;
|
|
34270
|
-
const {
|
|
34271
|
-
iconCircleArrowDown,
|
|
34272
|
-
iconCircleArrowUp,
|
|
34273
|
-
iconPlus,
|
|
34274
|
-
iconTrash
|
|
34275
|
-
} = perseus.icons;
|
|
34276
|
-
class StepControlButton extends React__namespace.Component {
|
|
34277
|
-
render() {
|
|
34278
|
-
return /*#__PURE__*/React__namespace.createElement("a", {
|
|
34279
|
-
href: "#",
|
|
34280
|
-
className: "step-control-button " + "simple-button " + "simple-button--small " + "orange",
|
|
34281
|
-
onClick: e => {
|
|
34282
|
-
e.preventDefault();
|
|
34283
|
-
this.props.onClick();
|
|
34284
|
-
}
|
|
34285
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$1, this.props.icon));
|
|
34286
|
-
}
|
|
34287
|
-
}
|
|
34288
|
-
class SequenceEditor extends React__namespace.Component {
|
|
34289
|
-
static propTypes = {
|
|
34290
|
-
json: PropTypes__default["default"].arrayOf(PropTypes__default["default"].shape({
|
|
34291
|
-
content: PropTypes__default["default"].string,
|
|
34292
|
-
widgets: PropTypes__default["default"].objectOf(PropTypes__default["default"].any),
|
|
34293
|
-
images: PropTypes__default["default"].objectOf(PropTypes__default["default"].any)
|
|
34294
|
-
})),
|
|
34295
|
-
apiOptions: perseus.ApiOptions.propTypes,
|
|
34296
|
-
onChange: PropTypes__default["default"].func.isRequired
|
|
34297
|
-
};
|
|
34298
|
-
static widgetName = "sequence";
|
|
34299
|
-
static defaultProps = {
|
|
34300
|
-
json: [{
|
|
34301
|
-
content: "",
|
|
34302
|
-
widgets: {},
|
|
34303
|
-
images: {}
|
|
34304
|
-
}]
|
|
34305
|
-
};
|
|
34306
|
-
render() {
|
|
34307
|
-
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
34308
|
-
className: "perseus-sequence-editor"
|
|
34309
|
-
}, ___default["default"].map(this.props.json, (json, i) => {
|
|
34310
|
-
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
34311
|
-
key: i
|
|
34312
|
-
}, "Step ", i + 1, /*#__PURE__*/React__namespace.createElement("div", {
|
|
34313
|
-
style: {
|
|
34314
|
-
display: "inline-block",
|
|
34315
|
-
float: "right"
|
|
34316
|
-
}
|
|
34317
|
-
}, i + 1 < this.props.json.length && /*#__PURE__*/React__namespace.createElement(StepControlButton, {
|
|
34318
|
-
icon: iconCircleArrowDown,
|
|
34319
|
-
onClick: () => {
|
|
34320
|
-
this._handleMoveStepLater(i);
|
|
34321
|
-
}
|
|
34322
|
-
}), i > 0 && /*#__PURE__*/React__namespace.createElement(StepControlButton, {
|
|
34323
|
-
icon: iconCircleArrowUp,
|
|
34324
|
-
onClick: () => {
|
|
34325
|
-
this._handleMoveStepEarlier(i);
|
|
34326
|
-
}
|
|
34327
|
-
}), /*#__PURE__*/React__namespace.createElement(StepControlButton, {
|
|
34328
|
-
icon: iconTrash,
|
|
34329
|
-
onClick: () => {
|
|
34330
|
-
const msg = "Are you sure you " + "want to remove step " + (i + 1) + "?";
|
|
34331
|
-
if (confirm(msg)) {
|
|
34332
|
-
this._handleRemoveStep(i);
|
|
34333
|
-
}
|
|
34334
|
-
}
|
|
34335
|
-
}), /*#__PURE__*/React__namespace.createElement(StepControlButton, {
|
|
34336
|
-
icon: iconPlus,
|
|
34337
|
-
onClick: () => {
|
|
34338
|
-
this._handleAddStepAfter(i);
|
|
34339
|
-
}
|
|
34340
|
-
})), /*#__PURE__*/React__namespace.createElement(Editor, {
|
|
34341
|
-
ref: "editor" + i,
|
|
34342
|
-
apiOptions: this.props.apiOptions,
|
|
34343
|
-
content: json.content,
|
|
34344
|
-
widgets: json.widgets,
|
|
34345
|
-
images: json.images,
|
|
34346
|
-
widgetEnabled: true,
|
|
34347
|
-
immutableWidgets: false,
|
|
34348
|
-
onChange: ___default["default"].partial(this._handleEditorChange, i)
|
|
34349
|
-
}));
|
|
34350
|
-
}));
|
|
34351
|
-
}
|
|
34352
|
-
_handleEditorChange = (i, newProps) => {
|
|
34353
|
-
const steps = ___default["default"].clone(this.props.json);
|
|
34354
|
-
steps[i] = ___default["default"].extend({}, steps[i], newProps);
|
|
34355
|
-
this.props.onChange({
|
|
34356
|
-
json: steps
|
|
34357
|
-
});
|
|
34358
|
-
};
|
|
34359
|
-
serialize = () => {
|
|
34360
|
-
return {
|
|
34361
|
-
json: ___default["default"].times(this.props.json.length, i => {
|
|
34362
|
-
// eslint-disable-next-line react/no-string-refs
|
|
34363
|
-
// @ts-expect-error - TS2339 - Property 'serialize' does not exist on type 'ReactInstance'.
|
|
34364
|
-
return this.refs["editor" + i].serialize();
|
|
34365
|
-
})
|
|
34366
|
-
};
|
|
34367
|
-
};
|
|
34368
|
-
_handleMoveStepEarlier = i => {
|
|
34369
|
-
if (i === 0) {
|
|
34370
|
-
return;
|
|
34371
|
-
}
|
|
34372
|
-
const steps = ___default["default"].clone(this.props.json);
|
|
34373
|
-
const step = steps[i];
|
|
34374
|
-
steps.splice(i, 1);
|
|
34375
|
-
steps.splice(i - 1, 0, step);
|
|
34376
|
-
this.props.onChange({
|
|
34377
|
-
json: steps
|
|
34378
|
-
});
|
|
34379
|
-
};
|
|
34380
|
-
_handleMoveStepLater = i => {
|
|
34381
|
-
const steps = ___default["default"].clone(this.props.json);
|
|
34382
|
-
if (i + 1 === steps.length) {
|
|
34383
|
-
return;
|
|
34384
|
-
}
|
|
34385
|
-
const step = steps[i];
|
|
34386
|
-
steps.splice(i, 1);
|
|
34387
|
-
steps.splice(i + 1, 0, step);
|
|
34388
|
-
this.props.onChange({
|
|
34389
|
-
json: steps
|
|
34390
|
-
});
|
|
34391
|
-
};
|
|
34392
|
-
_handleAddStepAfter = i => {
|
|
34393
|
-
// We do a full serialization here because we
|
|
34394
|
-
// might be copying widgets:
|
|
34395
|
-
const steps = ___default["default"].clone(this.props.json);
|
|
34396
|
-
// Here we do magic to allow you to copy-paste
|
|
34397
|
-
// things from the previous section into the new
|
|
34398
|
-
// section while preserving widgets.
|
|
34399
|
-
// To enable this, we preserve the widgets
|
|
34400
|
-
// object for the new section, but wipe out
|
|
34401
|
-
// the content.
|
|
34402
|
-
const newStep = i >= 0 ? {
|
|
34403
|
-
widgets: steps[i].widgets
|
|
34404
|
-
} : {};
|
|
34405
|
-
steps.splice(i + 1, 0, newStep);
|
|
34406
|
-
this.props.onChange({
|
|
34407
|
-
json: steps
|
|
34408
|
-
});
|
|
34409
|
-
};
|
|
34410
|
-
_handleRemoveStep = i => {
|
|
34411
|
-
const steps = ___default["default"].clone(this.props.json);
|
|
34412
|
-
steps.splice(i, 1);
|
|
34413
|
-
this.props.onChange({
|
|
34414
|
-
json: steps
|
|
34415
|
-
});
|
|
34416
|
-
};
|
|
34417
|
-
}
|
|
34418
|
-
|
|
34419
33966
|
/* eslint-disable @khanacademy/ts-no-error-suppressions */
|
|
34420
33967
|
class TextArea extends React__namespace.Component {
|
|
34421
33968
|
render() {
|
|
@@ -34474,83 +34021,6 @@ class SimpleMarkdownTesterEditor extends React__namespace.Component {
|
|
|
34474
34021
|
};
|
|
34475
34022
|
}
|
|
34476
34023
|
|
|
34477
|
-
/* eslint-disable react/sort-comp */
|
|
34478
|
-
const {
|
|
34479
|
-
InfoTip: InfoTip$3,
|
|
34480
|
-
NumberInput: NumberInput$2
|
|
34481
|
-
} = perseus.components;
|
|
34482
|
-
const maxTrials = 5000;
|
|
34483
|
-
class SimulatorEditor extends React__namespace.Component {
|
|
34484
|
-
static propTypes = {
|
|
34485
|
-
...perseus.Changeable.propTypes,
|
|
34486
|
-
xAxisLabel: PropTypes__default["default"].string,
|
|
34487
|
-
yAxisLabel: PropTypes__default["default"].string,
|
|
34488
|
-
numTrials: PropTypes__default["default"].number,
|
|
34489
|
-
proportionLabel: PropTypes__default["default"].string,
|
|
34490
|
-
proportionOrPercentage: PropTypes__default["default"].string
|
|
34491
|
-
};
|
|
34492
|
-
static widgetName = "simulator";
|
|
34493
|
-
static defaultProps = {
|
|
34494
|
-
xAxisLabel: "Proportion (%)",
|
|
34495
|
-
yAxisLabel: "Number of times seen",
|
|
34496
|
-
numTrials: 100,
|
|
34497
|
-
proportionLabel: "Underlying proportion",
|
|
34498
|
-
proportionOrPercentage: "proportion"
|
|
34499
|
-
};
|
|
34500
|
-
render() {
|
|
34501
|
-
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
34502
|
-
className: "perseus-widget-simulator"
|
|
34503
|
-
}, /*#__PURE__*/React__namespace.createElement("div", null, i18n__namespace._("X-Axis Label"), ":", /*#__PURE__*/React__namespace.createElement("input", {
|
|
34504
|
-
type: "text",
|
|
34505
|
-
className: "graph-settings-axis-label",
|
|
34506
|
-
value: this.props.xAxisLabel,
|
|
34507
|
-
onChange: ___default["default"].partial(this.handleTargetValueChange, "xAxisLabel")
|
|
34508
|
-
})), /*#__PURE__*/React__namespace.createElement("div", null, i18n__namespace._("Y-Axis Label"), ":", /*#__PURE__*/React__namespace.createElement("input", {
|
|
34509
|
-
type: "text",
|
|
34510
|
-
className: "graph-settings-axis-label",
|
|
34511
|
-
value: this.props.yAxisLabel,
|
|
34512
|
-
onChange: ___default["default"].partial(this.handleTargetValueChange, "yAxisLabel")
|
|
34513
|
-
})), /*#__PURE__*/React__namespace.createElement("div", null, i18n__namespace._('"True Proportion" Label'), ":", /*#__PURE__*/React__namespace.createElement("input", {
|
|
34514
|
-
type: "text",
|
|
34515
|
-
className: "graph-settings-axis-label",
|
|
34516
|
-
value: this.props.proportionLabel,
|
|
34517
|
-
onChange: ___default["default"].partial(this.handleTargetValueChange, "proportionLabel")
|
|
34518
|
-
}), /*#__PURE__*/React__namespace.createElement(InfoTip$3, null, /*#__PURE__*/React__namespace.createElement("p", null, "This text will be displayed next to the box in which the user enters the sample proportion for their simulation. For example, if your question is about surveying for approval ratings, you might want this to say \"Sample approval rating\"."))), /*#__PURE__*/React__namespace.createElement("div", null, i18n__namespace._("Proportion or Percentage"), ":", /*#__PURE__*/React__namespace.createElement("select", {
|
|
34519
|
-
className: "perseus-widget-dropdown",
|
|
34520
|
-
value: this.props.proportionOrPercentage,
|
|
34521
|
-
onChange: ___default["default"].partial(this.handleTargetValueChange, "proportionOrPercentage")
|
|
34522
|
-
}, /*#__PURE__*/React__namespace.createElement("option", {
|
|
34523
|
-
key: "proportion",
|
|
34524
|
-
value: "proportion"
|
|
34525
|
-
}, "Proportion"), /*#__PURE__*/React__namespace.createElement("option", {
|
|
34526
|
-
key: "percentage",
|
|
34527
|
-
value: "percentage"
|
|
34528
|
-
}, "Percentage")), /*#__PURE__*/React__namespace.createElement(InfoTip$3, null, /*#__PURE__*/React__namespace.createElement("p", null, "Do you want the user to describe their simulation in terms of a proportion or a percentage?"))), /*#__PURE__*/React__namespace.createElement("div", null, i18n__namespace._("Number of trials"), ":", /*#__PURE__*/React__namespace.createElement(NumberInput$2, {
|
|
34529
|
-
value: this.props.numTrials,
|
|
34530
|
-
checkValidity: val => {
|
|
34531
|
-
return val >= 0 && val <= maxTrials;
|
|
34532
|
-
},
|
|
34533
|
-
onChange: this.change("numTrials")
|
|
34534
|
-
}), /*#__PURE__*/React__namespace.createElement(InfoTip$3, null, /*#__PURE__*/React__namespace.createElement("p", null, "This controls the number of trials used in the simulation. For example, if you set this to 50, then the survey will be conducted 50 times. Warning: setting this too high (i.e., greater than 5000 or so) will freeze the page."))));
|
|
34535
|
-
}
|
|
34536
|
-
change = (() => {
|
|
34537
|
-
var _this = this;
|
|
34538
|
-
return function () {
|
|
34539
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
34540
|
-
args[_key] = arguments[_key];
|
|
34541
|
-
}
|
|
34542
|
-
// @ts-expect-error - TS2345 - Argument of type 'readonly unknown[]' is not assignable to parameter of type 'any[]'.
|
|
34543
|
-
return perseus.Changeable.change.apply(_this, args);
|
|
34544
|
-
};
|
|
34545
|
-
})();
|
|
34546
|
-
handleTargetValueChange = (propName, e) => {
|
|
34547
|
-
this.change(propName, e.target.value);
|
|
34548
|
-
};
|
|
34549
|
-
serialize = () => {
|
|
34550
|
-
return perseus.EditorJsonify.serialize.call(this);
|
|
34551
|
-
};
|
|
34552
|
-
}
|
|
34553
|
-
|
|
34554
34024
|
/* eslint-disable @khanacademy/ts-no-error-suppressions */
|
|
34555
34025
|
const {
|
|
34556
34026
|
InfoTip: InfoTip$2,
|
|
@@ -35006,7 +34476,7 @@ class VideoEditor extends React__namespace.Component {
|
|
|
35006
34476
|
}
|
|
35007
34477
|
}
|
|
35008
34478
|
|
|
35009
|
-
var AllEditors = [CategorizerEditor, CSProgramEditor, DefinitionEditor, DropdownEditor, ExampleGraphieWidgetEditor, ExampleWidgetEditor, ExplanationEditor, ExpressionEditor, GradedGroupEditor, GradedGroupSetEditor, GrapherEditor, GroupEditor, IframeEditor, ImageEditor, InputNumberEditor, InteractionEditor, InteractiveGraphEditor, LabelImageEditor,
|
|
34479
|
+
var AllEditors = [CategorizerEditor, CSProgramEditor, DefinitionEditor, DropdownEditor, ExampleGraphieWidgetEditor, ExampleWidgetEditor, ExplanationEditor, ExpressionEditor, GradedGroupEditor, GradedGroupSetEditor, GrapherEditor, GroupEditor, IframeEditor, ImageEditor, InputNumberEditor, InteractionEditor, InteractiveGraphEditor, LabelImageEditor, MatcherEditor, MatrixEditor, MeasurerEditor, MoleculeWidgetEditor, NumberLineEditor, NumericInputEditor, OrdererEditor, PassageEditor, PassageRefEditor, PassageRefTargetEditor, PlotterEditor, PythonProgramEditor, SimpleMarkdownTesterEditor, SorterEditor, TableEditor, UnitInputEditor, VideoEditor, RadioEditor, DeprecatedStandinEditor];
|
|
35010
34480
|
|
|
35011
34481
|
/* eslint-disable @khanacademy/ts-no-error-suppressions */
|
|
35012
34482
|
class TextInput extends React__namespace.Component {
|
|
@@ -35225,8 +34695,8 @@ var AllWidgets = [...perseus.widgets, ...testingWidgets];
|
|
|
35225
34695
|
|
|
35226
34696
|
perseus.Widgets.registerEditors(AllEditors);
|
|
35227
34697
|
perseus.Widgets.registerWidgets(AllWidgets);
|
|
35228
|
-
perseus.Widgets.
|
|
35229
|
-
perseus.Widgets.
|
|
34698
|
+
perseus.Widgets.replaceDeprecatedWidgets();
|
|
34699
|
+
perseus.Widgets.replaceDeprecatedEditors();
|
|
35230
34700
|
|
|
35231
34701
|
exports.AllEditors = AllEditors;
|
|
35232
34702
|
exports.AllWidgets = AllWidgets;
|