@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/es/index.js
CHANGED
|
@@ -25,7 +25,7 @@ import * as i18n$1 from '@khanacademy/wonder-blocks-i18n';
|
|
|
25
25
|
|
|
26
26
|
// This file is processed by a Rollup plugin (replace) to inject the production
|
|
27
27
|
const libName = "@khanacademy/perseus-editor";
|
|
28
|
-
const libVersion = "
|
|
28
|
+
const libVersion = "5.0.0";
|
|
29
29
|
addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
30
30
|
|
|
31
31
|
function _extends() {
|
|
@@ -201,7 +201,7 @@ const JsonEditor = createReactClass({
|
|
|
201
201
|
});
|
|
202
202
|
|
|
203
203
|
const {
|
|
204
|
-
InlineIcon: InlineIcon$
|
|
204
|
+
InlineIcon: InlineIcon$b
|
|
205
205
|
} = components;
|
|
206
206
|
class SectionControlButton extends React.Component {
|
|
207
207
|
render() {
|
|
@@ -224,7 +224,7 @@ class SectionControlButton extends React.Component {
|
|
|
224
224
|
hovered,
|
|
225
225
|
focused,
|
|
226
226
|
pressed
|
|
227
|
-
}) => /*#__PURE__*/React.createElement(InlineIcon$
|
|
227
|
+
}) => /*#__PURE__*/React.createElement(InlineIcon$b, icon));
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
230
|
const styles$g = StyleSheet.create({
|
|
@@ -20550,12 +20550,12 @@ const DragTarget = createReactClass({
|
|
|
20550
20550
|
});
|
|
20551
20551
|
|
|
20552
20552
|
const {
|
|
20553
|
-
InlineIcon: InlineIcon$
|
|
20553
|
+
InlineIcon: InlineIcon$a
|
|
20554
20554
|
} = components;
|
|
20555
20555
|
const {
|
|
20556
20556
|
iconChevronDown: iconChevronDown$1,
|
|
20557
20557
|
iconChevronRight,
|
|
20558
|
-
iconTrash: iconTrash$
|
|
20558
|
+
iconTrash: iconTrash$7
|
|
20559
20559
|
} = icons;
|
|
20560
20560
|
const _upgradeWidgetInfo = props => {
|
|
20561
20561
|
// We can't call serialize here because this.refs.widget
|
|
@@ -20657,7 +20657,7 @@ class WidgetEditor extends React.Component {
|
|
|
20657
20657
|
className: "perseus-widget-editor-title-id",
|
|
20658
20658
|
href: "#",
|
|
20659
20659
|
onClick: this._toggleWidget
|
|
20660
|
-
}, this.props.id, this.state.showWidget ? /*#__PURE__*/React.createElement(InlineIcon$
|
|
20660
|
+
}, this.props.id, this.state.showWidget ? /*#__PURE__*/React.createElement(InlineIcon$a, iconChevronDown$1) : /*#__PURE__*/React.createElement(InlineIcon$a, iconChevronRight)), supportsStaticMode && /*#__PURE__*/React.createElement("input", {
|
|
20661
20661
|
type: "button"
|
|
20662
20662
|
// @ts-expect-error - TS2322 - Type '(e: Event) => void' is not assignable to type 'MouseEventHandler<HTMLInputElement>'.
|
|
20663
20663
|
,
|
|
@@ -20671,7 +20671,7 @@ class WidgetEditor extends React.Component {
|
|
|
20671
20671
|
}, supportedAlignments.map(alignment => /*#__PURE__*/React.createElement("option", {
|
|
20672
20672
|
key: alignment
|
|
20673
20673
|
}, alignment))), /*#__PURE__*/React.createElement(SectionControlButton, {
|
|
20674
|
-
icon: iconTrash$
|
|
20674
|
+
icon: iconTrash$7,
|
|
20675
20675
|
onClick: () => {
|
|
20676
20676
|
this.props.onRemove();
|
|
20677
20677
|
},
|
|
@@ -21762,13 +21762,13 @@ class IframeContentRenderer extends React.Component {
|
|
|
21762
21762
|
|
|
21763
21763
|
const {
|
|
21764
21764
|
HUD: HUD$1,
|
|
21765
|
-
InlineIcon: InlineIcon$
|
|
21765
|
+
InlineIcon: InlineIcon$9
|
|
21766
21766
|
} = components;
|
|
21767
21767
|
const {
|
|
21768
|
-
iconCircleArrowDown: iconCircleArrowDown$
|
|
21769
|
-
iconCircleArrowUp: iconCircleArrowUp$
|
|
21770
|
-
iconPlus: iconPlus$
|
|
21771
|
-
iconTrash: iconTrash$
|
|
21768
|
+
iconCircleArrowDown: iconCircleArrowDown$1,
|
|
21769
|
+
iconCircleArrowUp: iconCircleArrowUp$1,
|
|
21770
|
+
iconPlus: iconPlus$4,
|
|
21771
|
+
iconTrash: iconTrash$6
|
|
21772
21772
|
} = icons;
|
|
21773
21773
|
class ArticleEditor extends React.Component {
|
|
21774
21774
|
constructor(...args) {
|
|
@@ -21868,25 +21868,25 @@ class ArticleEditor extends React.Component {
|
|
|
21868
21868
|
float: "right"
|
|
21869
21869
|
}
|
|
21870
21870
|
}, sectionImageUploadGenerator(i), /*#__PURE__*/React.createElement(SectionControlButton, {
|
|
21871
|
-
icon: iconPlus$
|
|
21871
|
+
icon: iconPlus$4,
|
|
21872
21872
|
onClick: () => {
|
|
21873
21873
|
this._handleAddSectionAfter(i);
|
|
21874
21874
|
},
|
|
21875
21875
|
title: "Add a new section after this one"
|
|
21876
21876
|
}), i + 1 < sections.length && /*#__PURE__*/React.createElement(SectionControlButton, {
|
|
21877
|
-
icon: iconCircleArrowDown$
|
|
21877
|
+
icon: iconCircleArrowDown$1,
|
|
21878
21878
|
onClick: () => {
|
|
21879
21879
|
this._handleMoveSectionLater(i);
|
|
21880
21880
|
},
|
|
21881
21881
|
title: "Move this section down"
|
|
21882
21882
|
}), i > 0 && /*#__PURE__*/React.createElement(SectionControlButton, {
|
|
21883
|
-
icon: iconCircleArrowUp$
|
|
21883
|
+
icon: iconCircleArrowUp$1,
|
|
21884
21884
|
onClick: () => {
|
|
21885
21885
|
this._handleMoveSectionEarlier(i);
|
|
21886
21886
|
},
|
|
21887
21887
|
title: "Move this section up"
|
|
21888
21888
|
}), /*#__PURE__*/React.createElement(SectionControlButton, {
|
|
21889
|
-
icon: iconTrash$
|
|
21889
|
+
icon: iconTrash$6,
|
|
21890
21890
|
onClick: () => {
|
|
21891
21891
|
const msg = "Are you sure you " + "want to delete section " + (i + 1) + "?";
|
|
21892
21892
|
/* eslint-disable no-alert */
|
|
@@ -21921,7 +21921,7 @@ class ArticleEditor extends React.Component {
|
|
|
21921
21921
|
onClick: () => {
|
|
21922
21922
|
this._handleAddSectionAfter(this._sections().length - 1);
|
|
21923
21923
|
}
|
|
21924
|
-
}, /*#__PURE__*/React.createElement(InlineIcon$
|
|
21924
|
+
}, /*#__PURE__*/React.createElement(InlineIcon$9, iconPlus$4), " Add a section")));
|
|
21925
21925
|
}
|
|
21926
21926
|
_renderLinterHUD() {
|
|
21927
21927
|
return /*#__PURE__*/React.createElement(HUD$1, {
|
|
@@ -22069,7 +22069,7 @@ ArticleEditor.defaultProps = {
|
|
|
22069
22069
|
*/
|
|
22070
22070
|
const {
|
|
22071
22071
|
ButtonGroup: ButtonGroup$5,
|
|
22072
|
-
InlineIcon: InlineIcon$
|
|
22072
|
+
InlineIcon: InlineIcon$8
|
|
22073
22073
|
} = components;
|
|
22074
22074
|
const {
|
|
22075
22075
|
devices
|
|
@@ -22087,9 +22087,9 @@ class ViewportResizer extends React.Component {
|
|
|
22087
22087
|
};
|
|
22088
22088
|
}
|
|
22089
22089
|
render() {
|
|
22090
|
-
const phoneButtonContents = /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(InlineIcon$
|
|
22091
|
-
const tabletButtonContents = /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(InlineIcon$
|
|
22092
|
-
const desktopButtonContents = /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(InlineIcon$
|
|
22090
|
+
const phoneButtonContents = /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(InlineIcon$8, iconMobilePhone), " Phone");
|
|
22091
|
+
const tabletButtonContents = /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(InlineIcon$8, iconTablet), " Tablet");
|
|
22092
|
+
const desktopButtonContents = /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(InlineIcon$8, iconDesktop), " Desktop");
|
|
22093
22093
|
|
|
22094
22094
|
// TODO(david): Allow input of custom viewport sizes.
|
|
22095
22095
|
return /*#__PURE__*/React.createElement("span", {
|
|
@@ -23444,14 +23444,14 @@ class StructuredItemDiff extends React.Component {
|
|
|
23444
23444
|
|
|
23445
23445
|
/* eslint-disable @khanacademy/ts-no-error-suppressions */
|
|
23446
23446
|
const {
|
|
23447
|
-
InfoTip: InfoTip$
|
|
23448
|
-
InlineIcon: InlineIcon$
|
|
23447
|
+
InfoTip: InfoTip$l,
|
|
23448
|
+
InlineIcon: InlineIcon$7
|
|
23449
23449
|
} = components;
|
|
23450
23450
|
const {
|
|
23451
|
-
iconCircleArrowDown
|
|
23452
|
-
iconCircleArrowUp
|
|
23453
|
-
iconPlus: iconPlus$
|
|
23454
|
-
iconTrash: iconTrash$
|
|
23451
|
+
iconCircleArrowDown,
|
|
23452
|
+
iconCircleArrowUp,
|
|
23453
|
+
iconPlus: iconPlus$3,
|
|
23454
|
+
iconTrash: iconTrash$5
|
|
23455
23455
|
} = icons;
|
|
23456
23456
|
/* Renders a hint editor box
|
|
23457
23457
|
*
|
|
@@ -23512,11 +23512,11 @@ class HintEditor extends React.Component {
|
|
|
23512
23512
|
type: "button",
|
|
23513
23513
|
className: this.props.isLast ? "hidden" : "",
|
|
23514
23514
|
onClick: _.partial(this.props.onMove, 1)
|
|
23515
|
-
}, /*#__PURE__*/React.createElement(InlineIcon$
|
|
23515
|
+
}, /*#__PURE__*/React.createElement(InlineIcon$7, iconCircleArrowDown)), " ", /*#__PURE__*/React.createElement("button", {
|
|
23516
23516
|
type: "button",
|
|
23517
23517
|
className: this.props.isFirst ? "hidden" : "",
|
|
23518
23518
|
onClick: _.partial(this.props.onMove, -1)
|
|
23519
|
-
}, /*#__PURE__*/React.createElement(InlineIcon$
|
|
23519
|
+
}, /*#__PURE__*/React.createElement(InlineIcon$7, iconCircleArrowUp)), " ", this.props.isLast && /*#__PURE__*/React.createElement(InfoTip$l, null, /*#__PURE__*/React.createElement("p", null, "The last hint is automatically bolded."))), /*#__PURE__*/React.createElement("input", {
|
|
23520
23520
|
type: "checkbox"
|
|
23521
23521
|
// @ts-expect-error - TS2322 - Type 'boolean | null | undefined' is not assignable to type 'boolean | undefined'.
|
|
23522
23522
|
,
|
|
@@ -23526,7 +23526,7 @@ class HintEditor extends React.Component {
|
|
|
23526
23526
|
type: "button",
|
|
23527
23527
|
className: "remove-hint simple-button orange",
|
|
23528
23528
|
onClick: this.props.onRemove
|
|
23529
|
-
}, /*#__PURE__*/React.createElement(InlineIcon$
|
|
23529
|
+
}, /*#__PURE__*/React.createElement(InlineIcon$7, iconTrash$5), "Remove this hint", " ")));
|
|
23530
23530
|
}
|
|
23531
23531
|
}
|
|
23532
23532
|
HintEditor.defaultProps = {
|
|
@@ -23757,7 +23757,7 @@ class CombinedHintsEditor extends React.Component {
|
|
|
23757
23757
|
type: "button",
|
|
23758
23758
|
className: "add-hint simple-button orange",
|
|
23759
23759
|
onClick: this.addHint
|
|
23760
|
-
}, /*#__PURE__*/React.createElement(InlineIcon$
|
|
23760
|
+
}, /*#__PURE__*/React.createElement(InlineIcon$7, iconPlus$3), " Add a hint"))));
|
|
23761
23761
|
/* eslint-enable max-len */
|
|
23762
23762
|
}
|
|
23763
23763
|
}
|
|
@@ -23769,7 +23769,7 @@ CombinedHintsEditor.defaultProps = {
|
|
|
23769
23769
|
};
|
|
23770
23770
|
|
|
23771
23771
|
const {
|
|
23772
|
-
InfoTip: InfoTip$
|
|
23772
|
+
InfoTip: InfoTip$k
|
|
23773
23773
|
} = components;
|
|
23774
23774
|
class ItemExtrasEditor extends React.Component {
|
|
23775
23775
|
constructor(props) {
|
|
@@ -23932,7 +23932,7 @@ const ItemExtraCheckbox = props => /*#__PURE__*/React.createElement("div", {
|
|
|
23932
23932
|
type: "checkbox",
|
|
23933
23933
|
checked: props.checked,
|
|
23934
23934
|
onChange: props.onChange
|
|
23935
|
-
})), /*#__PURE__*/React.createElement(InfoTip$
|
|
23935
|
+
})), /*#__PURE__*/React.createElement(InfoTip$k, null, props.infoTip));
|
|
23936
23936
|
|
|
23937
23937
|
const ITEM_DATA_VERSION = itemDataVersion;
|
|
23938
23938
|
class ItemEditor extends React.Component {
|
|
@@ -24664,11 +24664,11 @@ const _excluded$2 = ["depth"],
|
|
|
24664
24664
|
_excluded4 = ["shape", "data", "path", "actions"],
|
|
24665
24665
|
_excluded5 = ["shape", "data", "path"];
|
|
24666
24666
|
const {
|
|
24667
|
-
InlineIcon: InlineIcon$
|
|
24667
|
+
InlineIcon: InlineIcon$6
|
|
24668
24668
|
} = components;
|
|
24669
24669
|
const {
|
|
24670
24670
|
iconChevronDown,
|
|
24671
|
-
iconTrash: iconTrash$
|
|
24671
|
+
iconTrash: iconTrash$4
|
|
24672
24672
|
} = icons;
|
|
24673
24673
|
const {
|
|
24674
24674
|
MultiRenderer
|
|
@@ -25134,21 +25134,21 @@ const ArrayNodeContent = props => {
|
|
|
25134
25134
|
onClick: () => actions.moveArrayElementUp(subpath)
|
|
25135
25135
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25136
25136
|
className: css(styles$d.verticalFlip)
|
|
25137
|
-
}, /*#__PURE__*/React.createElement(InlineIcon$
|
|
25137
|
+
}, /*#__PURE__*/React.createElement(InlineIcon$6, iconChevronDown)))), i < data.length - 1 && /*#__PURE__*/React.createElement("div", {
|
|
25138
25138
|
key: "moveArrayElementDown",
|
|
25139
25139
|
className: css(styles$d.control)
|
|
25140
25140
|
}, /*#__PURE__*/React.createElement(SimpleButton, {
|
|
25141
25141
|
color: "orange",
|
|
25142
25142
|
title: "Move down",
|
|
25143
25143
|
onClick: () => actions.moveArrayElementDown(subpath)
|
|
25144
|
-
}, /*#__PURE__*/React.createElement(InlineIcon$
|
|
25144
|
+
}, /*#__PURE__*/React.createElement(InlineIcon$6, iconChevronDown))), /*#__PURE__*/React.createElement("div", {
|
|
25145
25145
|
key: "removeArrayElement",
|
|
25146
25146
|
className: css(styles$d.control)
|
|
25147
25147
|
}, /*#__PURE__*/React.createElement(SimpleButton, {
|
|
25148
25148
|
color: "orange",
|
|
25149
25149
|
title: "Delete",
|
|
25150
25150
|
onClick: () => actions.removeArrayElement(subpath)
|
|
25151
|
-
}, /*#__PURE__*/React.createElement(InlineIcon$
|
|
25151
|
+
}, /*#__PURE__*/React.createElement(InlineIcon$6, iconTrash$4)))];
|
|
25152
25152
|
return /*#__PURE__*/React.createElement("div", {
|
|
25153
25153
|
key: i,
|
|
25154
25154
|
className: css(styles$d.arrayElement, !elementIsLeaf && styles$d.arrayElementAndNotLeaf)
|
|
@@ -25618,7 +25618,7 @@ const StatefulEditorPage = createReactClass({
|
|
|
25618
25618
|
});
|
|
25619
25619
|
|
|
25620
25620
|
const {
|
|
25621
|
-
PropCheckBox: PropCheckBox$
|
|
25621
|
+
PropCheckBox: PropCheckBox$c,
|
|
25622
25622
|
TextListEditor: TextListEditor$4
|
|
25623
25623
|
} = components;
|
|
25624
25624
|
const Categorizer = Categorizer$1.widget;
|
|
@@ -25635,7 +25635,7 @@ class CategorizerEditor extends React.Component {
|
|
|
25635
25635
|
render() {
|
|
25636
25636
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
25637
25637
|
className: "perseus-widget-row"
|
|
25638
|
-
}, /*#__PURE__*/React.createElement(PropCheckBox$
|
|
25638
|
+
}, /*#__PURE__*/React.createElement(PropCheckBox$c, {
|
|
25639
25639
|
label: "Randomize item order",
|
|
25640
25640
|
labelAlignment: "right",
|
|
25641
25641
|
randomizeItems: this.props.randomizeItems,
|
|
@@ -25747,8 +25747,8 @@ class BlurInput extends React.Component {
|
|
|
25747
25747
|
}
|
|
25748
25748
|
|
|
25749
25749
|
const {
|
|
25750
|
-
InfoTip: InfoTip$
|
|
25751
|
-
PropCheckBox: PropCheckBox$
|
|
25750
|
+
InfoTip: InfoTip$j,
|
|
25751
|
+
PropCheckBox: PropCheckBox$b
|
|
25752
25752
|
} = components;
|
|
25753
25753
|
const DEFAULT_WIDTH = 400;
|
|
25754
25754
|
const DEFAULT_HEIGHT = 400;
|
|
@@ -25904,11 +25904,11 @@ class CSProgramEditor extends React.Component {
|
|
|
25904
25904
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Url or Program ID:", " ", /*#__PURE__*/React.createElement(BlurInput, {
|
|
25905
25905
|
value: this.props.programID,
|
|
25906
25906
|
onChange: this._handleProgramIDChange
|
|
25907
|
-
})), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(PropCheckBox$
|
|
25907
|
+
})), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(PropCheckBox$b, {
|
|
25908
25908
|
label: "Show Editor",
|
|
25909
25909
|
showEditor: this.props.showEditor,
|
|
25910
25910
|
onChange: this.props.onChange
|
|
25911
|
-
}), /*#__PURE__*/React.createElement(InfoTip$
|
|
25911
|
+
}), /*#__PURE__*/React.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.createElement("br", null), /*#__PURE__*/React.createElement(PropCheckBox$b, {
|
|
25912
25912
|
label: "Show Buttons",
|
|
25913
25913
|
showButtons: this.props.showButtons,
|
|
25914
25914
|
onChange: this.props.onChange
|
|
@@ -25916,7 +25916,7 @@ class CSProgramEditor extends React.Component {
|
|
|
25916
25916
|
name: "settings",
|
|
25917
25917
|
pairs: this.props.settings,
|
|
25918
25918
|
onChange: this._handleSettingsChange
|
|
25919
|
-
}), /*#__PURE__*/React.createElement(InfoTip$
|
|
25919
|
+
}), /*#__PURE__*/React.createElement(InfoTip$j, null, "Settings that you add here are available to the program as an object returned by ", /*#__PURE__*/React.createElement("code", null, "Program.settings()"))));
|
|
25920
25920
|
}
|
|
25921
25921
|
}
|
|
25922
25922
|
CSProgramEditor.propTypes = _extends({}, Changeable.propTypes);
|
|
@@ -25935,7 +25935,7 @@ CSProgramEditor.defaultProps = {
|
|
|
25935
25935
|
};
|
|
25936
25936
|
|
|
25937
25937
|
const {
|
|
25938
|
-
TextInput: TextInput$
|
|
25938
|
+
TextInput: TextInput$8
|
|
25939
25939
|
} = components;
|
|
25940
25940
|
class DefinitionEditor extends React.Component {
|
|
25941
25941
|
constructor(..._args) {
|
|
@@ -25955,7 +25955,7 @@ class DefinitionEditor extends React.Component {
|
|
|
25955
25955
|
target: "_blank"
|
|
25956
25956
|
}, "Definition style guide"), /*#__PURE__*/React.createElement("div", {
|
|
25957
25957
|
className: "perseus-widget-row"
|
|
25958
|
-
}, /*#__PURE__*/React.createElement("label", null, "Word to be defined:", " ", /*#__PURE__*/React.createElement(TextInput$
|
|
25958
|
+
}, /*#__PURE__*/React.createElement("label", null, "Word to be defined:", " ", /*#__PURE__*/React.createElement(TextInput$8, {
|
|
25959
25959
|
value: this.props.togglePrompt
|
|
25960
25960
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
25961
25961
|
,
|
|
@@ -26002,12 +26002,12 @@ DeprecatedStandinEditor.widgetName = "deprecated-standin";
|
|
|
26002
26002
|
|
|
26003
26003
|
/* eslint-disable @khanacademy/ts-no-error-suppressions */
|
|
26004
26004
|
const {
|
|
26005
|
-
InfoTip: InfoTip$
|
|
26006
|
-
InlineIcon: InlineIcon$
|
|
26005
|
+
InfoTip: InfoTip$i,
|
|
26006
|
+
InlineIcon: InlineIcon$5
|
|
26007
26007
|
} = components;
|
|
26008
26008
|
const {
|
|
26009
|
-
iconPlus: iconPlus$
|
|
26010
|
-
iconTrash: iconTrash$
|
|
26009
|
+
iconPlus: iconPlus$2,
|
|
26010
|
+
iconTrash: iconTrash$3
|
|
26011
26011
|
} = icons;
|
|
26012
26012
|
class DropdownEditor extends React.Component {
|
|
26013
26013
|
constructor(...args) {
|
|
@@ -26071,14 +26071,14 @@ class DropdownEditor extends React.Component {
|
|
|
26071
26071
|
className: "perseus-widget-dropdown"
|
|
26072
26072
|
}, /*#__PURE__*/React.createElement("div", {
|
|
26073
26073
|
className: "dropdown-info"
|
|
26074
|
-
}, "Dropdown", /*#__PURE__*/React.createElement(InfoTip$
|
|
26074
|
+
}, "Dropdown", /*#__PURE__*/React.createElement(InfoTip$i, null, /*#__PURE__*/React.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.createElement("div", {
|
|
26075
26075
|
className: "dropdown-placeholder"
|
|
26076
26076
|
}, /*#__PURE__*/React.createElement("input", {
|
|
26077
26077
|
type: "text",
|
|
26078
26078
|
placeholder: "Placeholder value",
|
|
26079
26079
|
value: this.props.placeholder,
|
|
26080
26080
|
onChange: this.onPlaceholderChange
|
|
26081
|
-
}), /*#__PURE__*/React.createElement(InfoTip$
|
|
26081
|
+
}), /*#__PURE__*/React.createElement(InfoTip$i, null, /*#__PURE__*/React.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.createElement("div", {
|
|
26082
26082
|
className: "clearfix"
|
|
26083
26083
|
}), /*#__PURE__*/React.createElement("ul", {
|
|
26084
26084
|
className: "dropdown-choices"
|
|
@@ -26123,14 +26123,14 @@ class DropdownEditor extends React.Component {
|
|
|
26123
26123
|
this, i)
|
|
26124
26124
|
}, /*#__PURE__*/React.createElement("span", {
|
|
26125
26125
|
className: "remove-choice"
|
|
26126
|
-
}, /*#__PURE__*/React.createElement(InlineIcon$
|
|
26126
|
+
}, /*#__PURE__*/React.createElement(InlineIcon$5, iconTrash$3)))));
|
|
26127
26127
|
}, this)), /*#__PURE__*/React.createElement("div", {
|
|
26128
26128
|
className: "add-choice-container"
|
|
26129
26129
|
}, /*#__PURE__*/React.createElement("a", {
|
|
26130
26130
|
href: "#",
|
|
26131
26131
|
className: "simple-button orange",
|
|
26132
26132
|
onClick: this.addChoice
|
|
26133
|
-
}, /*#__PURE__*/React.createElement(InlineIcon$
|
|
26133
|
+
}, /*#__PURE__*/React.createElement(InlineIcon$5, iconPlus$2), " Add a choice", " ")));
|
|
26134
26134
|
}
|
|
26135
26135
|
}
|
|
26136
26136
|
DropdownEditor.propTypes = {
|
|
@@ -26364,7 +26364,7 @@ ExampleWidgetEditor.defaultProps = {
|
|
|
26364
26364
|
};
|
|
26365
26365
|
|
|
26366
26366
|
const {
|
|
26367
|
-
TextInput: TextInput$
|
|
26367
|
+
TextInput: TextInput$7
|
|
26368
26368
|
} = components;
|
|
26369
26369
|
const defaultExplanationProps = {
|
|
26370
26370
|
showPrompt: "Explain",
|
|
@@ -26388,14 +26388,14 @@ class ExplanationEditor extends React.Component {
|
|
|
26388
26388
|
className: "perseus-widget-explanation-editor"
|
|
26389
26389
|
}, /*#__PURE__*/React.createElement("div", {
|
|
26390
26390
|
className: "perseus-widget-row"
|
|
26391
|
-
}, /*#__PURE__*/React.createElement("label", null, "Prompt to show explanation:", " ", /*#__PURE__*/React.createElement(TextInput$
|
|
26391
|
+
}, /*#__PURE__*/React.createElement("label", null, "Prompt to show explanation:", " ", /*#__PURE__*/React.createElement(TextInput$7, {
|
|
26392
26392
|
value: this.props.showPrompt
|
|
26393
26393
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
26394
26394
|
,
|
|
26395
26395
|
onChange: this.change("showPrompt")
|
|
26396
26396
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
26397
26397
|
className: "perseus-widget-row"
|
|
26398
|
-
}, /*#__PURE__*/React.createElement("label", null, "Prompt to hide explanation:", " ", /*#__PURE__*/React.createElement(TextInput$
|
|
26398
|
+
}, /*#__PURE__*/React.createElement("label", null, "Prompt to hide explanation:", " ", /*#__PURE__*/React.createElement(TextInput$7, {
|
|
26399
26399
|
value: this.props.hidePrompt
|
|
26400
26400
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
26401
26401
|
,
|
|
@@ -26609,8 +26609,8 @@ const SortableItem = createReactClass({
|
|
|
26609
26609
|
});
|
|
26610
26610
|
|
|
26611
26611
|
const {
|
|
26612
|
-
InfoTip: InfoTip$
|
|
26613
|
-
PropCheckBox: PropCheckBox$
|
|
26612
|
+
InfoTip: InfoTip$h,
|
|
26613
|
+
PropCheckBox: PropCheckBox$a
|
|
26614
26614
|
} = components;
|
|
26615
26615
|
|
|
26616
26616
|
// types for iterables
|
|
@@ -26857,16 +26857,16 @@ class ExpressionEditor extends React.Component {
|
|
|
26857
26857
|
className: "perseus-widget-expression-editor"
|
|
26858
26858
|
}, /*#__PURE__*/React.createElement("h3", {
|
|
26859
26859
|
className: "expression-editor-h3"
|
|
26860
|
-
}, "Global Options"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(PropCheckBox$
|
|
26860
|
+
}, "Global Options"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(PropCheckBox$a, {
|
|
26861
26861
|
times: this.props.times,
|
|
26862
26862
|
onChange: this.props.onChange,
|
|
26863
26863
|
labelAlignment: "right",
|
|
26864
26864
|
label: "Use \xD7 for rendering multiplication instead of a center dot."
|
|
26865
|
-
}), /*#__PURE__*/React.createElement(InfoTip$
|
|
26865
|
+
}), /*#__PURE__*/React.createElement(InfoTip$h, null, /*#__PURE__*/React.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.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Function variables: ", /*#__PURE__*/React.createElement("input", {
|
|
26866
26866
|
type: "text",
|
|
26867
26867
|
defaultValue: this.props.functions.join(" "),
|
|
26868
26868
|
onChange: this.handleFunctions
|
|
26869
|
-
})), /*#__PURE__*/React.createElement(InfoTip$
|
|
26869
|
+
})), /*#__PURE__*/React.createElement(InfoTip$h, null, /*#__PURE__*/React.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.createElement("div", null, /*#__PURE__*/React.createElement("div", null, "Button sets:"), buttonSetChoices), /*#__PURE__*/React.createElement("h3", {
|
|
26870
26870
|
className: "expression-editor-h3"
|
|
26871
26871
|
}, "Answers"), /*#__PURE__*/React.createElement("p", {
|
|
26872
26872
|
style: {
|
|
@@ -26956,31 +26956,31 @@ class AnswerOption extends React.Component {
|
|
|
26956
26956
|
className: "answer-expression"
|
|
26957
26957
|
}, /*#__PURE__*/React.createElement(Expression, this.props.expressionProps))), /*#__PURE__*/React.createElement("div", {
|
|
26958
26958
|
className: "answer-option"
|
|
26959
|
-
}, /*#__PURE__*/React.createElement(PropCheckBox$
|
|
26959
|
+
}, /*#__PURE__*/React.createElement(PropCheckBox$a, {
|
|
26960
26960
|
form: this.props.form,
|
|
26961
26961
|
onChange: this.props.onChange,
|
|
26962
26962
|
labelAlignment: "right",
|
|
26963
26963
|
label: "Answer expression must have the same form."
|
|
26964
|
-
}), /*#__PURE__*/React.createElement(InfoTip$
|
|
26964
|
+
}), /*#__PURE__*/React.createElement(InfoTip$h, null, /*#__PURE__*/React.createElement("p", null, "The student's answer must be in the same form. Commutativity and excess negative signs are ignored."))), /*#__PURE__*/React.createElement("div", {
|
|
26965
26965
|
className: "answer-option"
|
|
26966
|
-
}, /*#__PURE__*/React.createElement(PropCheckBox$
|
|
26966
|
+
}, /*#__PURE__*/React.createElement(PropCheckBox$a, {
|
|
26967
26967
|
simplify: this.props.simplify,
|
|
26968
26968
|
onChange: this.props.onChange,
|
|
26969
26969
|
labelAlignment: "right",
|
|
26970
26970
|
label: "Answer expression must be fully expanded and simplified."
|
|
26971
|
-
}), /*#__PURE__*/React.createElement(InfoTip$
|
|
26971
|
+
}), /*#__PURE__*/React.createElement(InfoTip$h, null, /*#__PURE__*/React.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.createElement("div", {
|
|
26972
26972
|
className: "remove-container"
|
|
26973
26973
|
}, removeButton)));
|
|
26974
26974
|
}
|
|
26975
26975
|
}
|
|
26976
26976
|
|
|
26977
26977
|
const {
|
|
26978
|
-
InlineIcon: InlineIcon$
|
|
26979
|
-
TextInput: TextInput$
|
|
26978
|
+
InlineIcon: InlineIcon$4,
|
|
26979
|
+
TextInput: TextInput$6
|
|
26980
26980
|
} = components;
|
|
26981
26981
|
const {
|
|
26982
|
-
iconPlus: iconPlus$
|
|
26983
|
-
iconTrash: iconTrash$
|
|
26982
|
+
iconPlus: iconPlus$1,
|
|
26983
|
+
iconTrash: iconTrash$2
|
|
26984
26984
|
} = icons;
|
|
26985
26985
|
class GradedGroupEditor extends React.Component {
|
|
26986
26986
|
constructor(..._args) {
|
|
@@ -27026,7 +27026,7 @@ class GradedGroupEditor extends React.Component {
|
|
|
27026
27026
|
className: "perseus-widget-row"
|
|
27027
27027
|
}, /*#__PURE__*/React.createElement("label", {
|
|
27028
27028
|
className: css(styles$b.title)
|
|
27029
|
-
}, "Title:", " ", /*#__PURE__*/React.createElement(TextInput$
|
|
27029
|
+
}, "Title:", " ", /*#__PURE__*/React.createElement(TextInput$6, {
|
|
27030
27030
|
value: this.props.title,
|
|
27031
27031
|
className: css(styles$b.input)
|
|
27032
27032
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
@@ -27050,7 +27050,7 @@ class GradedGroupEditor extends React.Component {
|
|
|
27050
27050
|
},
|
|
27051
27051
|
className: "add-hint simple-button orange",
|
|
27052
27052
|
onClick: this.handleAddHint
|
|
27053
|
-
}, /*#__PURE__*/React.createElement(InlineIcon$
|
|
27053
|
+
}, /*#__PURE__*/React.createElement(InlineIcon$4, iconPlus$1), " Add a hint"), this.props.hint && /*#__PURE__*/React.createElement("div", {
|
|
27054
27054
|
className: "perseus-hint-editor"
|
|
27055
27055
|
}, /*#__PURE__*/React.createElement("div", {
|
|
27056
27056
|
className: css(styles$b.hintsTitle)
|
|
@@ -27072,7 +27072,7 @@ class GradedGroupEditor extends React.Component {
|
|
|
27072
27072
|
type: "button",
|
|
27073
27073
|
className: "remove-hint simple-button orange",
|
|
27074
27074
|
onClick: this.handleRemoveHint
|
|
27075
|
-
}, /*#__PURE__*/React.createElement(InlineIcon$
|
|
27075
|
+
}, /*#__PURE__*/React.createElement(InlineIcon$4, iconTrash$2), " Remove this hint")));
|
|
27076
27076
|
}
|
|
27077
27077
|
}
|
|
27078
27078
|
GradedGroupEditor.propTypes = _extends({}, Changeable.propTypes, {
|
|
@@ -27168,8 +27168,8 @@ const setArrayItem = (list, i, value) => [...list.slice(0, i), value, ...list.sl
|
|
|
27168
27168
|
|
|
27169
27169
|
const {
|
|
27170
27170
|
ButtonGroup: ButtonGroup$4,
|
|
27171
|
-
InfoTip: InfoTip$
|
|
27172
|
-
PropCheckBox: PropCheckBox$
|
|
27171
|
+
InfoTip: InfoTip$g,
|
|
27172
|
+
PropCheckBox: PropCheckBox$9,
|
|
27173
27173
|
RangeInput: RangeInput$6
|
|
27174
27174
|
} = components;
|
|
27175
27175
|
const defaultBackgroundImage$3 = {
|
|
@@ -27599,7 +27599,7 @@ const GraphSettings = createReactClass({
|
|
|
27599
27599
|
onChange: this.change("markings")
|
|
27600
27600
|
})), /*#__PURE__*/React.createElement("div", {
|
|
27601
27601
|
className: "perseus-widget-left-col"
|
|
27602
|
-
}, /*#__PURE__*/React.createElement(PropCheckBox$
|
|
27602
|
+
}, /*#__PURE__*/React.createElement(PropCheckBox$9, {
|
|
27603
27603
|
label: "Show tooltips",
|
|
27604
27604
|
showTooltips: this.props.showTooltips,
|
|
27605
27605
|
onChange: this.change
|
|
@@ -27624,19 +27624,19 @@ const GraphSettings = createReactClass({
|
|
|
27624
27624
|
},
|
|
27625
27625
|
onKeyPress: this.changeBackgroundUrl,
|
|
27626
27626
|
onBlur: this.changeBackgroundUrl
|
|
27627
|
-
}), /*#__PURE__*/React.createElement(InfoTip$
|
|
27627
|
+
}), /*#__PURE__*/React.createElement(InfoTip$g, null, /*#__PURE__*/React.createElement("p", null, "Create an image in graphie, or use the \"Add image\" function to create a background.")))), _.contains(this.props.editableSettings, "measure") && /*#__PURE__*/React.createElement("div", {
|
|
27628
27628
|
className: "misc-settings"
|
|
27629
27629
|
}, /*#__PURE__*/React.createElement("div", {
|
|
27630
27630
|
className: "perseus-widget-row"
|
|
27631
27631
|
}, /*#__PURE__*/React.createElement("div", {
|
|
27632
27632
|
className: "perseus-widget-left-col"
|
|
27633
|
-
}, /*#__PURE__*/React.createElement(PropCheckBox$
|
|
27633
|
+
}, /*#__PURE__*/React.createElement(PropCheckBox$9, {
|
|
27634
27634
|
label: "Show ruler",
|
|
27635
27635
|
showRuler: this.props.showRuler,
|
|
27636
27636
|
onChange: this.change
|
|
27637
27637
|
})), /*#__PURE__*/React.createElement("div", {
|
|
27638
27638
|
className: "perseus-widget-right-col"
|
|
27639
|
-
}, /*#__PURE__*/React.createElement(PropCheckBox$
|
|
27639
|
+
}, /*#__PURE__*/React.createElement(PropCheckBox$9, {
|
|
27640
27640
|
label: "Show protractor",
|
|
27641
27641
|
showProtractor: this.props.showProtractor,
|
|
27642
27642
|
onChange: this.change
|
|
@@ -27661,7 +27661,7 @@ const GraphSettings = createReactClass({
|
|
|
27661
27661
|
});
|
|
27662
27662
|
|
|
27663
27663
|
const {
|
|
27664
|
-
InfoTip: InfoTip$
|
|
27664
|
+
InfoTip: InfoTip$f,
|
|
27665
27665
|
MultiButtonGroup: MultiButtonGroup$1
|
|
27666
27666
|
} = components;
|
|
27667
27667
|
const {
|
|
@@ -27744,7 +27744,7 @@ class GrapherEditor extends React.Component {
|
|
|
27744
27744
|
className: "perseus-error"
|
|
27745
27745
|
}, this.props.graph.valid);
|
|
27746
27746
|
}
|
|
27747
|
-
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, "Correct answer", " ", /*#__PURE__*/React.createElement(InfoTip$
|
|
27747
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, "Correct answer", " ", /*#__PURE__*/React.createElement(InfoTip$f, null, /*#__PURE__*/React.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.createElement(GraphSettings, {
|
|
27748
27748
|
editableSettings: ["graph", "snap", "image"],
|
|
27749
27749
|
box: getInteractiveBoxFromSizeClass$1(sizeClass),
|
|
27750
27750
|
range: this.props.graph.range,
|
|
@@ -27839,7 +27839,7 @@ GroupEditor.defaultProps = {
|
|
|
27839
27839
|
};
|
|
27840
27840
|
|
|
27841
27841
|
const {
|
|
27842
|
-
PropCheckBox: PropCheckBox$
|
|
27842
|
+
PropCheckBox: PropCheckBox$8
|
|
27843
27843
|
} = components;
|
|
27844
27844
|
/**
|
|
27845
27845
|
* This is used for editing a name/value pair.
|
|
@@ -27962,11 +27962,11 @@ class IframeEditor extends React.Component {
|
|
|
27962
27962
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
27963
27963
|
,
|
|
27964
27964
|
onChange: this.change("height")
|
|
27965
|
-
})), /*#__PURE__*/React.createElement(PropCheckBox$
|
|
27965
|
+
})), /*#__PURE__*/React.createElement(PropCheckBox$8, {
|
|
27966
27966
|
label: "Allow full screen",
|
|
27967
27967
|
allowFullScreen: this.props.allowFullScreen,
|
|
27968
27968
|
onChange: this.props.onChange
|
|
27969
|
-
}), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(PropCheckBox$
|
|
27969
|
+
}), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(PropCheckBox$8, {
|
|
27970
27970
|
label: "Allow iframe content to redirect the page",
|
|
27971
27971
|
allowTopNavigation: this.props.allowTopNavigation,
|
|
27972
27972
|
onChange: this.props.onChange
|
|
@@ -27989,8 +27989,8 @@ IframeEditor.defaultProps = {
|
|
|
27989
27989
|
|
|
27990
27990
|
/* eslint-disable jsx-a11y/anchor-is-valid, react/sort-comp */
|
|
27991
27991
|
const {
|
|
27992
|
-
InfoTip: InfoTip$
|
|
27993
|
-
InlineIcon: InlineIcon$
|
|
27992
|
+
InfoTip: InfoTip$e,
|
|
27993
|
+
InlineIcon: InlineIcon$3,
|
|
27994
27994
|
RangeInput: RangeInput$5
|
|
27995
27995
|
} = components;
|
|
27996
27996
|
const defaultBoxSize = 400;
|
|
@@ -28038,7 +28038,7 @@ class ImageEditor extends React.Component {
|
|
|
28038
28038
|
style: {
|
|
28039
28039
|
width: "100%"
|
|
28040
28040
|
}
|
|
28041
|
-
}))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("div", null, "Dimensions:"), /*#__PURE__*/React.createElement("p", null, backgroundImage.width, "x", backgroundImage.height))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("div", null, "Alt text:", /*#__PURE__*/React.createElement(InfoTip$
|
|
28041
|
+
}))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("div", null, "Dimensions:"), /*#__PURE__*/React.createElement("p", null, backgroundImage.width, "x", backgroundImage.height))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("div", null, "Alt text:", /*#__PURE__*/React.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.createElement(Editor, {
|
|
28042
28042
|
apiOptions: this.props.apiOptions,
|
|
28043
28043
|
content: this.props.alt,
|
|
28044
28044
|
onChange: props => {
|
|
@@ -28062,7 +28062,7 @@ class ImageEditor extends React.Component {
|
|
|
28062
28062
|
}, this.state.backgroundImageError);
|
|
28063
28063
|
return /*#__PURE__*/React.createElement("div", {
|
|
28064
28064
|
className: "perseus-image-editor"
|
|
28065
|
-
}, /*#__PURE__*/React.createElement("label", null, "Image url:", /*#__PURE__*/React.createElement(InfoTip$
|
|
28065
|
+
}, /*#__PURE__*/React.createElement("label", null, "Image url:", /*#__PURE__*/React.createElement(InfoTip$e, null, "Paste an image or graphie image URL."), this.state.backgroundImageError && backgroundImageErrorText, /*#__PURE__*/React.createElement(BlurInput, {
|
|
28066
28066
|
value: backgroundImage.url || "",
|
|
28067
28067
|
style: {
|
|
28068
28068
|
width: 332
|
|
@@ -28108,7 +28108,7 @@ class ImageEditor extends React.Component {
|
|
|
28108
28108
|
// eslint-disable-next-line react/jsx-no-bind
|
|
28109
28109
|
,
|
|
28110
28110
|
onClick: this.removeLabel.bind(this, i)
|
|
28111
|
-
}, /*#__PURE__*/React.createElement(InlineIcon$
|
|
28111
|
+
}, /*#__PURE__*/React.createElement(InlineIcon$3, icons.iconTrash))));
|
|
28112
28112
|
}
|
|
28113
28113
|
change(...args) {
|
|
28114
28114
|
return Changeable.change.apply(this, args);
|
|
@@ -28226,7 +28226,7 @@ ImageEditor.defaultProps = {
|
|
|
28226
28226
|
|
|
28227
28227
|
/* eslint-disable react/sort-comp */
|
|
28228
28228
|
const {
|
|
28229
|
-
InfoTip: InfoTip$
|
|
28229
|
+
InfoTip: InfoTip$d
|
|
28230
28230
|
} = components;
|
|
28231
28231
|
const answerTypes = {
|
|
28232
28232
|
number: {
|
|
@@ -28312,7 +28312,7 @@ class InputNumberEditor extends React.Component {
|
|
|
28312
28312
|
value: "optional"
|
|
28313
28313
|
}, "will be accepted"), /*#__PURE__*/React.createElement("option", {
|
|
28314
28314
|
value: "enforced"
|
|
28315
|
-
}, "will be marked wrong"))), /*#__PURE__*/React.createElement(InfoTip$
|
|
28315
|
+
}, "will be marked wrong"))), /*#__PURE__*/React.createElement(InfoTip$d, null, /*#__PURE__*/React.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.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.createElement("p", null, "Select \"will be marked wrong\" only if we are specifically assessing the ability to simplify."))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("input", {
|
|
28316
28316
|
type: "checkbox",
|
|
28317
28317
|
checked: this.props.inexact,
|
|
28318
28318
|
onChange: e => {
|
|
@@ -28348,7 +28348,7 @@ class InputNumberEditor extends React.Component {
|
|
|
28348
28348
|
});
|
|
28349
28349
|
},
|
|
28350
28350
|
"aria-label": "Answer type"
|
|
28351
|
-
}, answerTypeOptions), /*#__PURE__*/React.createElement(InfoTip$
|
|
28351
|
+
}, answerTypeOptions), /*#__PURE__*/React.createElement(InfoTip$d, null, /*#__PURE__*/React.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.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Width", " ", /*#__PURE__*/React.createElement("select", {
|
|
28352
28352
|
value: this.props.size,
|
|
28353
28353
|
onChange: e => {
|
|
28354
28354
|
// @ts-expect-error - TS2322 - Type 'string' is not assignable to type '"small" | "normal" | undefined'.
|
|
@@ -28360,7 +28360,7 @@ class InputNumberEditor extends React.Component {
|
|
|
28360
28360
|
value: "normal"
|
|
28361
28361
|
}, "Normal (80px)"), /*#__PURE__*/React.createElement("option", {
|
|
28362
28362
|
value: "small"
|
|
28363
|
-
}, "Small (40px)"))), /*#__PURE__*/React.createElement(InfoTip$
|
|
28363
|
+
}, "Small (40px)"))), /*#__PURE__*/React.createElement(InfoTip$d, null, /*#__PURE__*/React.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.createElement("div", null, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("input", {
|
|
28364
28364
|
type: "checkbox",
|
|
28365
28365
|
checked: this.props.rightAlign,
|
|
28366
28366
|
onChange: e => {
|
|
@@ -28441,7 +28441,7 @@ const styles$a = StyleSheet.create({
|
|
|
28441
28441
|
});
|
|
28442
28442
|
|
|
28443
28443
|
const {
|
|
28444
|
-
NumberInput: NumberInput$
|
|
28444
|
+
NumberInput: NumberInput$e
|
|
28445
28445
|
} = components;
|
|
28446
28446
|
const {
|
|
28447
28447
|
getDependencies: getDependencies$8
|
|
@@ -28490,7 +28490,7 @@ class FunctionEditor extends React.Component {
|
|
|
28490
28490
|
className: "perseus-widget-row"
|
|
28491
28491
|
}, /*#__PURE__*/React.createElement("div", {
|
|
28492
28492
|
className: "perseus-widget-left-col"
|
|
28493
|
-
}, "Width:", " ", /*#__PURE__*/React.createElement(NumberInput$
|
|
28493
|
+
}, "Width:", " ", /*#__PURE__*/React.createElement(NumberInput$e, {
|
|
28494
28494
|
value: this.props.strokeWidth,
|
|
28495
28495
|
placeholder: 2,
|
|
28496
28496
|
onChange: this.change("strokeWidth")
|
|
@@ -28507,7 +28507,7 @@ FunctionEditor.defaultProps = {
|
|
|
28507
28507
|
};
|
|
28508
28508
|
|
|
28509
28509
|
const {
|
|
28510
|
-
TextInput: TextInput$
|
|
28510
|
+
TextInput: TextInput$5
|
|
28511
28511
|
} = components;
|
|
28512
28512
|
const {
|
|
28513
28513
|
getDependencies: getDependencies$7
|
|
@@ -28532,7 +28532,7 @@ class LabelEditor extends React.Component {
|
|
|
28532
28532
|
className: "graph-settings"
|
|
28533
28533
|
}, /*#__PURE__*/React.createElement("div", {
|
|
28534
28534
|
className: "perseus-widget-row"
|
|
28535
|
-
}, /*#__PURE__*/React.createElement(TextInput$
|
|
28535
|
+
}, /*#__PURE__*/React.createElement(TextInput$5, {
|
|
28536
28536
|
value: this.props.label,
|
|
28537
28537
|
onChange: this.change("label"),
|
|
28538
28538
|
style: {
|
|
@@ -28562,7 +28562,7 @@ LabelEditor.defaultProps = {
|
|
|
28562
28562
|
};
|
|
28563
28563
|
|
|
28564
28564
|
const {
|
|
28565
|
-
NumberInput: NumberInput$
|
|
28565
|
+
NumberInput: NumberInput$d
|
|
28566
28566
|
} = components;
|
|
28567
28567
|
const {
|
|
28568
28568
|
getDependencies: getDependencies$6
|
|
@@ -28617,7 +28617,7 @@ class LineEditor extends React.Component {
|
|
|
28617
28617
|
className: "perseus-widget-row"
|
|
28618
28618
|
}, /*#__PURE__*/React.createElement("div", {
|
|
28619
28619
|
className: "perseus-widget-left-col"
|
|
28620
|
-
}, "Width:", " ", /*#__PURE__*/React.createElement(NumberInput$
|
|
28620
|
+
}, "Width:", " ", /*#__PURE__*/React.createElement(NumberInput$d, {
|
|
28621
28621
|
value: this.props.strokeWidth,
|
|
28622
28622
|
placeholder: 2,
|
|
28623
28623
|
onChange: this.change("strokeWidth")
|
|
@@ -28637,7 +28637,7 @@ LineEditor.defaultProps = {
|
|
|
28637
28637
|
|
|
28638
28638
|
const {
|
|
28639
28639
|
ButtonGroup: ButtonGroup$3,
|
|
28640
|
-
NumberInput: NumberInput$
|
|
28640
|
+
NumberInput: NumberInput$c
|
|
28641
28641
|
} = components;
|
|
28642
28642
|
class ConstraintEditor extends React.Component {
|
|
28643
28643
|
constructor(...args) {
|
|
@@ -28671,7 +28671,7 @@ class ConstraintEditor extends React.Component {
|
|
|
28671
28671
|
onChange: this.change("constraint")
|
|
28672
28672
|
})), this.props.constraint === "snap" && /*#__PURE__*/React.createElement("div", {
|
|
28673
28673
|
className: "perseus-widget-row"
|
|
28674
|
-
}, "Snap:", " ", /*#__PURE__*/React.createElement(NumberInput$
|
|
28674
|
+
}, "Snap:", " ", /*#__PURE__*/React.createElement(NumberInput$c, {
|
|
28675
28675
|
value: this.props.snap,
|
|
28676
28676
|
placeholder: 0,
|
|
28677
28677
|
onChange: this.change("snap")
|
|
@@ -28723,7 +28723,7 @@ ConstraintEditor.defaultProps = {
|
|
|
28723
28723
|
};
|
|
28724
28724
|
|
|
28725
28725
|
const {
|
|
28726
|
-
NumberInput: NumberInput$
|
|
28726
|
+
NumberInput: NumberInput$b
|
|
28727
28727
|
} = components;
|
|
28728
28728
|
const {
|
|
28729
28729
|
getDependencies: getDependencies$5
|
|
@@ -28764,13 +28764,13 @@ class MovableLineEditor extends React.Component {
|
|
|
28764
28764
|
onChange: this.change("endY")
|
|
28765
28765
|
}), /*#__PURE__*/React.createElement(TeX, null, "\\Large)")), /*#__PURE__*/React.createElement("div", {
|
|
28766
28766
|
className: "perseus-widget-row"
|
|
28767
|
-
}, "Start updates ", /*#__PURE__*/React.createElement(TeX, null, "(x_n, y_n)"), " for ", /*#__PURE__*/React.createElement(TeX, null, "n ="), /*#__PURE__*/React.createElement(NumberInput$
|
|
28767
|
+
}, "Start updates ", /*#__PURE__*/React.createElement(TeX, null, "(x_n, y_n)"), " for ", /*#__PURE__*/React.createElement(TeX, null, "n ="), /*#__PURE__*/React.createElement(NumberInput$b, {
|
|
28768
28768
|
value: this.props.startSubscript,
|
|
28769
28769
|
placeholder: 0,
|
|
28770
28770
|
onChange: this.change("startSubscript")
|
|
28771
28771
|
})), /*#__PURE__*/React.createElement("div", {
|
|
28772
28772
|
className: "perseus-widget-row"
|
|
28773
|
-
}, "End updates ", /*#__PURE__*/React.createElement(TeX, null, "(x_m, y_m)"), " for ", /*#__PURE__*/React.createElement(TeX, null, "m ="), /*#__PURE__*/React.createElement(NumberInput$
|
|
28773
|
+
}, "End updates ", /*#__PURE__*/React.createElement(TeX, null, "(x_m, y_m)"), " for ", /*#__PURE__*/React.createElement(TeX, null, "m ="), /*#__PURE__*/React.createElement(NumberInput$b, {
|
|
28774
28774
|
value: this.props.endSubscript,
|
|
28775
28775
|
placeholder: 0,
|
|
28776
28776
|
onChange: this.change("endSubscript")
|
|
@@ -28795,7 +28795,7 @@ MovableLineEditor.defaultProps = {
|
|
|
28795
28795
|
};
|
|
28796
28796
|
|
|
28797
28797
|
const {
|
|
28798
|
-
NumberInput: NumberInput$
|
|
28798
|
+
NumberInput: NumberInput$a
|
|
28799
28799
|
} = components;
|
|
28800
28800
|
const {
|
|
28801
28801
|
getDependencies: getDependencies$4
|
|
@@ -28828,7 +28828,7 @@ class MovablePointEditor extends React.Component {
|
|
|
28828
28828
|
onChange: this.change("startY")
|
|
28829
28829
|
}), /*#__PURE__*/React.createElement(TeX, null, "\\Large)")), /*#__PURE__*/React.createElement("div", {
|
|
28830
28830
|
className: "perseus-widget-row"
|
|
28831
|
-
}, "Update ", /*#__PURE__*/React.createElement(TeX, null, "(x_n, y_n)"), " for ", /*#__PURE__*/React.createElement(TeX, null, "n ="), " ", /*#__PURE__*/React.createElement(NumberInput$
|
|
28831
|
+
}, "Update ", /*#__PURE__*/React.createElement(TeX, null, "(x_n, y_n)"), " for ", /*#__PURE__*/React.createElement(TeX, null, "n ="), " ", /*#__PURE__*/React.createElement(NumberInput$a, {
|
|
28832
28832
|
value: this.props.varSubscript,
|
|
28833
28833
|
placeholder: 0,
|
|
28834
28834
|
onChange: this.change("varSubscript")
|
|
@@ -28849,7 +28849,7 @@ MovablePointEditor.defaultProps = {
|
|
|
28849
28849
|
};
|
|
28850
28850
|
|
|
28851
28851
|
const {
|
|
28852
|
-
NumberInput: NumberInput$
|
|
28852
|
+
NumberInput: NumberInput$9
|
|
28853
28853
|
} = components;
|
|
28854
28854
|
const {
|
|
28855
28855
|
getDependencies: getDependencies$3
|
|
@@ -28903,7 +28903,7 @@ class ParametricEditor extends React.Component {
|
|
|
28903
28903
|
className: "perseus-widget-row"
|
|
28904
28904
|
}, /*#__PURE__*/React.createElement("div", {
|
|
28905
28905
|
className: "perseus-widget-left-col"
|
|
28906
|
-
}, "Width:", " ", /*#__PURE__*/React.createElement(NumberInput$
|
|
28906
|
+
}, "Width:", " ", /*#__PURE__*/React.createElement(NumberInput$9, {
|
|
28907
28907
|
value: this.props.strokeWidth,
|
|
28908
28908
|
placeholder: 2,
|
|
28909
28909
|
onChange: this.change("strokeWidth")
|
|
@@ -29528,8 +29528,8 @@ const GraphTypeSelector = props => {
|
|
|
29528
29528
|
/* eslint-disable react/forbid-prop-types, react/no-unsafe */
|
|
29529
29529
|
const {
|
|
29530
29530
|
ButtonGroup: ButtonGroup$2,
|
|
29531
|
-
InfoTip: InfoTip$
|
|
29532
|
-
PropCheckBox: PropCheckBox$
|
|
29531
|
+
InfoTip: InfoTip$c,
|
|
29532
|
+
PropCheckBox: PropCheckBox$7,
|
|
29533
29533
|
RangeInput: RangeInput$4
|
|
29534
29534
|
} = components;
|
|
29535
29535
|
const defaultBackgroundImage$1 = {
|
|
@@ -29925,7 +29925,7 @@ class InteractiveGraphSettings extends React.Component {
|
|
|
29925
29925
|
onChange: this.change("markings")
|
|
29926
29926
|
})), /*#__PURE__*/React.createElement("div", {
|
|
29927
29927
|
className: "perseus-widget-left-col"
|
|
29928
|
-
}, /*#__PURE__*/React.createElement(PropCheckBox$
|
|
29928
|
+
}, /*#__PURE__*/React.createElement(PropCheckBox$7, {
|
|
29929
29929
|
label: "Show tooltips",
|
|
29930
29930
|
showTooltips: this.props.showTooltips,
|
|
29931
29931
|
onChange: this.change
|
|
@@ -29950,19 +29950,19 @@ class InteractiveGraphSettings extends React.Component {
|
|
|
29950
29950
|
},
|
|
29951
29951
|
onKeyPress: this.changeBackgroundUrl,
|
|
29952
29952
|
onBlur: this.changeBackgroundUrl
|
|
29953
|
-
}), /*#__PURE__*/React.createElement(InfoTip$
|
|
29953
|
+
}), /*#__PURE__*/React.createElement(InfoTip$c, null, /*#__PURE__*/React.createElement("p", null, "Create an image in graphie, or use the \"Add image\" function to create a background.")))), _.contains(this.props.editableSettings, "measure") && /*#__PURE__*/React.createElement("div", {
|
|
29954
29954
|
className: "misc-settings"
|
|
29955
29955
|
}, /*#__PURE__*/React.createElement("div", {
|
|
29956
29956
|
className: "perseus-widget-row"
|
|
29957
29957
|
}, /*#__PURE__*/React.createElement("div", {
|
|
29958
29958
|
className: "perseus-widget-left-col"
|
|
29959
|
-
}, /*#__PURE__*/React.createElement(PropCheckBox$
|
|
29959
|
+
}, /*#__PURE__*/React.createElement(PropCheckBox$7, {
|
|
29960
29960
|
label: "Show ruler",
|
|
29961
29961
|
showRuler: this.props.showRuler,
|
|
29962
29962
|
onChange: this.change
|
|
29963
29963
|
})), /*#__PURE__*/React.createElement("div", {
|
|
29964
29964
|
className: "perseus-widget-right-col"
|
|
29965
|
-
}, /*#__PURE__*/React.createElement(PropCheckBox$
|
|
29965
|
+
}, /*#__PURE__*/React.createElement(PropCheckBox$7, {
|
|
29966
29966
|
label: "Show protractor",
|
|
29967
29967
|
showProtractor: this.props.showProtractor,
|
|
29968
29968
|
onChange: this.change
|
|
@@ -30019,7 +30019,7 @@ const SegmentCountSelector = ({
|
|
|
30019
30019
|
}, `${n} segment${n > 1 ? "s" : ""}`)));
|
|
30020
30020
|
|
|
30021
30021
|
const {
|
|
30022
|
-
InfoTip: InfoTip$
|
|
30022
|
+
InfoTip: InfoTip$b
|
|
30023
30023
|
} = components;
|
|
30024
30024
|
const {
|
|
30025
30025
|
containerSizeClass,
|
|
@@ -30198,7 +30198,7 @@ class InteractiveGraphEditor extends React.Component {
|
|
|
30198
30198
|
value: "angles"
|
|
30199
30199
|
}, "interior angles"), /*#__PURE__*/React.createElement("option", {
|
|
30200
30200
|
value: "sides"
|
|
30201
|
-
}, "side measures"))), /*#__PURE__*/React.createElement(InfoTip$
|
|
30201
|
+
}, "side measures"))), /*#__PURE__*/React.createElement(InfoTip$b, null, /*#__PURE__*/React.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.createElement("p", null, "The interior angle and side measure options guide the points to the nearest whole angle or side"), " ", "measure respectively.")), /*#__PURE__*/React.createElement(Row, null, /*#__PURE__*/React.createElement(Typography.LabelSmall, {
|
|
30202
30202
|
tag: "label"
|
|
30203
30203
|
}, "Show angle measures:", " ", /*#__PURE__*/React.createElement("input", {
|
|
30204
30204
|
type: "checkbox",
|
|
@@ -30210,7 +30210,7 @@ class InteractiveGraphEditor extends React.Component {
|
|
|
30210
30210
|
})
|
|
30211
30211
|
});
|
|
30212
30212
|
}
|
|
30213
|
-
})), /*#__PURE__*/React.createElement(InfoTip$
|
|
30213
|
+
})), /*#__PURE__*/React.createElement(InfoTip$b, null, /*#__PURE__*/React.createElement("p", null, "Displays the interior angle measures."))), /*#__PURE__*/React.createElement(Row, null, /*#__PURE__*/React.createElement(Typography.LabelSmall, {
|
|
30214
30214
|
tag: "label"
|
|
30215
30215
|
}, "Show side measures:", " ", /*#__PURE__*/React.createElement("input", {
|
|
30216
30216
|
type: "checkbox",
|
|
@@ -30222,7 +30222,7 @@ class InteractiveGraphEditor extends React.Component {
|
|
|
30222
30222
|
})
|
|
30223
30223
|
});
|
|
30224
30224
|
}
|
|
30225
|
-
})), /*#__PURE__*/React.createElement(InfoTip$
|
|
30225
|
+
})), /*#__PURE__*/React.createElement(InfoTip$b, null, /*#__PURE__*/React.createElement("p", null, "Displays the side lengths.")))), ((_this$props$correct9 = this.props.correct) == null ? void 0 : _this$props$correct9.type) === "segment" && /*#__PURE__*/React.createElement(Row, null, /*#__PURE__*/React.createElement(FieldLabel, null, "Number of segments: "), /*#__PURE__*/React.createElement(SegmentCountSelector, {
|
|
30226
30226
|
numSegments: (_this$props$correct10 = this.props.correct) == null ? void 0 : _this$props$correct10.numSegments,
|
|
30227
30227
|
onChange: sides => {
|
|
30228
30228
|
this.props.onChange({
|
|
@@ -30242,7 +30242,7 @@ class InteractiveGraphEditor extends React.Component {
|
|
|
30242
30242
|
borderStyle: "solid",
|
|
30243
30243
|
borderWidth: 1
|
|
30244
30244
|
}
|
|
30245
|
-
}, equationString), /*#__PURE__*/React.createElement(InfoTip$
|
|
30245
|
+
}, equationString), /*#__PURE__*/React.createElement(InfoTip$b, null, /*#__PURE__*/React.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.createElement(InteractiveGraphSettings, {
|
|
30246
30246
|
box: getInteractiveBoxFromSizeClass(sizeClass),
|
|
30247
30247
|
range: this.props.range,
|
|
30248
30248
|
labels: this.props.labels,
|
|
@@ -30271,7 +30271,7 @@ class InteractiveGraphEditor extends React.Component {
|
|
|
30271
30271
|
value: "approx"
|
|
30272
30272
|
}, "be approximately congruent"), /*#__PURE__*/React.createElement("option", {
|
|
30273
30273
|
value: "similar"
|
|
30274
|
-
}, "be similar"))), /*#__PURE__*/React.createElement(InfoTip$
|
|
30274
|
+
}, "be similar"))), /*#__PURE__*/React.createElement(InfoTip$b, null, /*#__PURE__*/React.createElement("ul", null, /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.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.createElement("li", null, /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("b", null, "Be Congruent:"), " Be congruent in size and shape, but can be located anywhere on the grid.")), /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.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.createElement("em", null, "Use this with snapping to angle measure."))), /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.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.createElement("div", {
|
|
30275
30275
|
className: "type-settings"
|
|
30276
30276
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, " ", "Student answer must", " ", /*#__PURE__*/React.createElement("select", {
|
|
30277
30277
|
value: this.props.correct.match,
|
|
@@ -30280,7 +30280,7 @@ class InteractiveGraphEditor extends React.Component {
|
|
|
30280
30280
|
value: "exact"
|
|
30281
30281
|
}, "match exactly"), /*#__PURE__*/React.createElement("option", {
|
|
30282
30282
|
value: "congruent"
|
|
30283
|
-
}, "be congruent"))), /*#__PURE__*/React.createElement(InfoTip$
|
|
30283
|
+
}, "be congruent"))), /*#__PURE__*/React.createElement(InfoTip$b, null, /*#__PURE__*/React.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);
|
|
30284
30284
|
}
|
|
30285
30285
|
changeMatchType(e) {
|
|
30286
30286
|
const correct = _.extend({}, this.props.correct, {
|
|
@@ -31824,212 +31824,9 @@ const styles = StyleSheet.create({
|
|
|
31824
31824
|
}
|
|
31825
31825
|
});
|
|
31826
31826
|
|
|
31827
|
-
const {
|
|
31828
|
-
InfoTip: InfoTip$c,
|
|
31829
|
-
NumberInput: NumberInput$b,
|
|
31830
|
-
PropCheckBox: PropCheckBox$7
|
|
31831
|
-
} = components;
|
|
31832
|
-
const MAX_SIZE = 8;
|
|
31833
|
-
|
|
31834
|
-
// styling
|
|
31835
|
-
const CELL_PADDING = 5;
|
|
31836
|
-
const TABLE_STYLE = {
|
|
31837
|
-
display: "table",
|
|
31838
|
-
tableLayout: "fixed"
|
|
31839
|
-
};
|
|
31840
|
-
const ROW_STYLE = {
|
|
31841
|
-
display: "table-row"
|
|
31842
|
-
};
|
|
31843
|
-
const CELL_STYLE = {
|
|
31844
|
-
display: "table-cell",
|
|
31845
|
-
padding: CELL_PADDING
|
|
31846
|
-
};
|
|
31847
|
-
const BASE_TILE_STYLE = {
|
|
31848
|
-
borderRadius: 10,
|
|
31849
|
-
cursor: "pointer"
|
|
31850
|
-
};
|
|
31851
|
-
const PATTERNS = {
|
|
31852
|
-
plus: () => [[false, true, false], [true, true, true], [false, true, false]],
|
|
31853
|
-
x: () => [[true, false, true], [false, true, false], [true, false, true]],
|
|
31854
|
-
"plus/x": iter => {
|
|
31855
|
-
return iter % 2 ? PATTERNS.x() : PATTERNS.plus();
|
|
31856
|
-
}
|
|
31857
|
-
};
|
|
31858
|
-
|
|
31859
|
-
/**
|
|
31860
|
-
* Clamps value to an integer in the range [min, max]
|
|
31861
|
-
*/
|
|
31862
|
-
const clampToInt = function clampToInt(value, min, max) {
|
|
31863
|
-
value = Math.floor(value);
|
|
31864
|
-
value = Math.max(value, min);
|
|
31865
|
-
value = Math.min(value, max);
|
|
31866
|
-
return value;
|
|
31867
|
-
};
|
|
31868
|
-
|
|
31869
|
-
// Returns a copy of the tiles, with tiles flipped according to
|
|
31870
|
-
// whether or not their y, x position satisfies the predicate
|
|
31871
|
-
const flipTilesPredicate = (oldCells, predicate) => {
|
|
31872
|
-
return _.map(oldCells, (row, y) => {
|
|
31873
|
-
return _.map(row, (cell, x) => {
|
|
31874
|
-
return predicate(y, x) ? !cell : cell;
|
|
31875
|
-
});
|
|
31876
|
-
});
|
|
31877
|
-
};
|
|
31878
|
-
// A single glowy cell
|
|
31879
|
-
class Tile extends React.Component {
|
|
31880
|
-
constructor(...args) {
|
|
31881
|
-
super(...args);
|
|
31882
|
-
this._flip = () => {
|
|
31883
|
-
this.props.onChange(!this.props.value);
|
|
31884
|
-
};
|
|
31885
|
-
}
|
|
31886
|
-
render() {
|
|
31887
|
-
const color = this.props.value ? "#55dd55" : "#115511";
|
|
31888
|
-
const style = _.extend({}, BASE_TILE_STYLE, {
|
|
31889
|
-
width: this.props.size,
|
|
31890
|
-
height: this.props.size,
|
|
31891
|
-
backgroundColor: color
|
|
31892
|
-
});
|
|
31893
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
31894
|
-
style: style,
|
|
31895
|
-
onClick: this._flip
|
|
31896
|
-
});
|
|
31897
|
-
}
|
|
31898
|
-
}
|
|
31899
|
-
Tile.propTypes = {
|
|
31900
|
-
value: PropTypes.bool.isRequired,
|
|
31901
|
-
size: PropTypes.number.isRequired
|
|
31902
|
-
};
|
|
31903
|
-
// A grid of glowy cells
|
|
31904
|
-
class TileGrid extends React.Component {
|
|
31905
|
-
render() {
|
|
31906
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
31907
|
-
style: TABLE_STYLE,
|
|
31908
|
-
className: "no-select"
|
|
31909
|
-
}, _.map(this.props.cells, (row, y) => {
|
|
31910
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
31911
|
-
key: y,
|
|
31912
|
-
style: ROW_STYLE
|
|
31913
|
-
}, _.map(row, (cell, x) => {
|
|
31914
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
31915
|
-
key: x,
|
|
31916
|
-
style: CELL_STYLE
|
|
31917
|
-
}, /*#__PURE__*/React.createElement(Tile, {
|
|
31918
|
-
value: cell,
|
|
31919
|
-
size: this.props.size,
|
|
31920
|
-
onChange: _.partial(this.props.onChange, y, x)
|
|
31921
|
-
}));
|
|
31922
|
-
}));
|
|
31923
|
-
}));
|
|
31924
|
-
}
|
|
31925
|
-
}
|
|
31926
|
-
TileGrid.propTypes = {
|
|
31927
|
-
cells: PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.bool)).isRequired,
|
|
31928
|
-
size: PropTypes.number.isRequired
|
|
31929
|
-
};
|
|
31930
|
-
// The widget editor
|
|
31931
|
-
class LightsPuzzleEditor extends React.Component {
|
|
31932
|
-
constructor(..._args) {
|
|
31933
|
-
super(..._args);
|
|
31934
|
-
this._height = () => {
|
|
31935
|
-
return this.props.startCells.length;
|
|
31936
|
-
};
|
|
31937
|
-
this._width = () => {
|
|
31938
|
-
if (this.props.startCells.length !== 0) {
|
|
31939
|
-
return this.props.startCells[0].length;
|
|
31940
|
-
}
|
|
31941
|
-
return 0; // default to 0
|
|
31942
|
-
};
|
|
31943
|
-
this.change = (...args) => {
|
|
31944
|
-
return Changeable.change.apply(this, args);
|
|
31945
|
-
};
|
|
31946
|
-
this._handlePatternChange = e => {
|
|
31947
|
-
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 2.
|
|
31948
|
-
this.change("flipPattern", e.target.value);
|
|
31949
|
-
};
|
|
31950
|
-
this._changeWidth = newWidth => {
|
|
31951
|
-
newWidth = clampToInt(newWidth, 1, MAX_SIZE);
|
|
31952
|
-
this._truncateCells(newWidth, this._height());
|
|
31953
|
-
};
|
|
31954
|
-
this._changeHeight = newHeight => {
|
|
31955
|
-
newHeight = clampToInt(newHeight, 1, MAX_SIZE);
|
|
31956
|
-
this._truncateCells(this._width(), newHeight);
|
|
31957
|
-
};
|
|
31958
|
-
this._truncateCells = (newWidth, newHeight) => {
|
|
31959
|
-
const newCells = _.times(newHeight, y => {
|
|
31960
|
-
return _.times(newWidth, x => {
|
|
31961
|
-
// explicitly cast the result to a boolean with !!
|
|
31962
|
-
return !!(this.props.startCells[y] && this.props.startCells[y][x]);
|
|
31963
|
-
});
|
|
31964
|
-
});
|
|
31965
|
-
|
|
31966
|
-
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
31967
|
-
this.change({
|
|
31968
|
-
startCells: newCells
|
|
31969
|
-
});
|
|
31970
|
-
};
|
|
31971
|
-
this._switchTile = (tileY, tileX) => {
|
|
31972
|
-
const newCells = flipTilesPredicate(this.props.startCells, (y, x) => {
|
|
31973
|
-
return y === tileY && x === tileX;
|
|
31974
|
-
});
|
|
31975
|
-
|
|
31976
|
-
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
31977
|
-
this.change({
|
|
31978
|
-
startCells: newCells
|
|
31979
|
-
});
|
|
31980
|
-
};
|
|
31981
|
-
this.serialize = () => {
|
|
31982
|
-
return EditorJsonify.serialize.call(this);
|
|
31983
|
-
};
|
|
31984
|
-
}
|
|
31985
|
-
render() {
|
|
31986
|
-
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, "Width:", /*#__PURE__*/React.createElement(NumberInput$b, {
|
|
31987
|
-
value: this._width(),
|
|
31988
|
-
placeholder: 5,
|
|
31989
|
-
onChange: this._changeWidth
|
|
31990
|
-
}), ", ", "Height:", /*#__PURE__*/React.createElement(NumberInput$b, {
|
|
31991
|
-
value: this._height(),
|
|
31992
|
-
placeholder: 5,
|
|
31993
|
-
onChange: this._changeHeight
|
|
31994
|
-
})), /*#__PURE__*/React.createElement("div", null, "Flip pattern:", /*#__PURE__*/React.createElement("select", {
|
|
31995
|
-
value: this.props.flipPattern
|
|
31996
|
-
// @ts-expect-error - TS2322 - Type '(arg1: ChangeEvent<HTMLInputElement>) => void' is not assignable to type 'ChangeEventHandler<HTMLSelectElement>'.
|
|
31997
|
-
,
|
|
31998
|
-
onChange: this._handlePatternChange
|
|
31999
|
-
}, _.map(_.keys(PATTERNS), (pattern, i) => {
|
|
32000
|
-
return /*#__PURE__*/React.createElement("option", {
|
|
32001
|
-
value: pattern,
|
|
32002
|
-
key: i
|
|
32003
|
-
}, pattern);
|
|
32004
|
-
}))), /*#__PURE__*/React.createElement("div", null, "Grade incomplete puzzles as wrong:", " ", /*#__PURE__*/React.createElement(PropCheckBox$7, {
|
|
32005
|
-
gradeIncompleteAsWrong: this.props.gradeIncompleteAsWrong,
|
|
32006
|
-
onChange: this.props.onChange
|
|
32007
|
-
}), /*#__PURE__*/React.createElement(InfoTip$c, null, "By default, incomplete puzzles are graded as empty.")), /*#__PURE__*/React.createElement("div", null, "Starting configuration:"), /*#__PURE__*/React.createElement("div", {
|
|
32008
|
-
style: {
|
|
32009
|
-
overflowX: "auto"
|
|
32010
|
-
}
|
|
32011
|
-
}, /*#__PURE__*/React.createElement(TileGrid, {
|
|
32012
|
-
cells: this.props.startCells,
|
|
32013
|
-
size: 50,
|
|
32014
|
-
onChange: this._switchTile
|
|
32015
|
-
})));
|
|
32016
|
-
}
|
|
32017
|
-
}
|
|
32018
|
-
LightsPuzzleEditor.propTypes = _extends({}, Changeable.propTypes, {
|
|
32019
|
-
startCells: PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.bool)),
|
|
32020
|
-
flipPattern: PropTypes.string.isRequired,
|
|
32021
|
-
gradeIncompleteAsWrong: PropTypes.bool.isRequired
|
|
32022
|
-
});
|
|
32023
|
-
LightsPuzzleEditor.widgetName = "lights-puzzle";
|
|
32024
|
-
LightsPuzzleEditor.defaultProps = {
|
|
32025
|
-
startCells: [[false, false, false], [false, false, false], [false, false, false]],
|
|
32026
|
-
flipPattern: "plus",
|
|
32027
|
-
gradeIncompleteAsWrong: false
|
|
32028
|
-
};
|
|
32029
|
-
|
|
32030
31827
|
/* eslint-disable react/forbid-prop-types, react/sort-comp */
|
|
32031
31828
|
const {
|
|
32032
|
-
InfoTip: InfoTip$
|
|
31829
|
+
InfoTip: InfoTip$a,
|
|
32033
31830
|
PropCheckBox: PropCheckBox$6,
|
|
32034
31831
|
TextListEditor: TextListEditor$3
|
|
32035
31832
|
} = components;
|
|
@@ -32056,7 +31853,7 @@ class MatcherEditor extends React.Component {
|
|
|
32056
31853
|
render() {
|
|
32057
31854
|
return /*#__PURE__*/React.createElement("div", {
|
|
32058
31855
|
className: "perseus-matcher-editor"
|
|
32059
|
-
}, /*#__PURE__*/React.createElement("div", null, " ", "Correct answer:", " ", /*#__PURE__*/React.createElement(InfoTip$
|
|
31856
|
+
}, /*#__PURE__*/React.createElement("div", null, " ", "Correct answer:", " ", /*#__PURE__*/React.createElement(InfoTip$a, null, /*#__PURE__*/React.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.createElement("div", {
|
|
32060
31857
|
className: "perseus-clearfix"
|
|
32061
31858
|
}, /*#__PURE__*/React.createElement(TextListEditor$3, {
|
|
32062
31859
|
options: this.props.left,
|
|
@@ -32074,7 +31871,7 @@ class MatcherEditor extends React.Component {
|
|
|
32074
31871
|
}, cb);
|
|
32075
31872
|
},
|
|
32076
31873
|
layout: "vertical"
|
|
32077
|
-
})), /*#__PURE__*/React.createElement("span", null, " ", "Labels:", " ", /*#__PURE__*/React.createElement(InfoTip$
|
|
31874
|
+
})), /*#__PURE__*/React.createElement("span", null, " ", "Labels:", " ", /*#__PURE__*/React.createElement(InfoTip$a, null, /*#__PURE__*/React.createElement("p", null, "These are entirely optional."))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("input", {
|
|
32078
31875
|
type: "text",
|
|
32079
31876
|
defaultValue: this.props.labels[0]
|
|
32080
31877
|
// eslint-disable-next-line react/jsx-no-bind
|
|
@@ -32090,11 +31887,11 @@ class MatcherEditor extends React.Component {
|
|
|
32090
31887
|
label: "Order of the matched pairs matters:",
|
|
32091
31888
|
orderMatters: this.props.orderMatters,
|
|
32092
31889
|
onChange: this.props.onChange
|
|
32093
|
-
}), /*#__PURE__*/React.createElement(InfoTip$
|
|
31890
|
+
}), /*#__PURE__*/React.createElement(InfoTip$a, null, /*#__PURE__*/React.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.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.createElement("div", null, /*#__PURE__*/React.createElement(PropCheckBox$6, {
|
|
32094
31891
|
label: "Padding:",
|
|
32095
31892
|
padding: this.props.padding,
|
|
32096
31893
|
onChange: this.props.onChange
|
|
32097
|
-
}), /*#__PURE__*/React.createElement(InfoTip$
|
|
31894
|
+
}), /*#__PURE__*/React.createElement(InfoTip$a, null, /*#__PURE__*/React.createElement("p", null, "Padding is good for text, but not needed for images."))));
|
|
32098
31895
|
}
|
|
32099
31896
|
}
|
|
32100
31897
|
MatcherEditor.propTypes = {
|
|
@@ -32237,8 +32034,8 @@ MatrixEditor.defaultProps = {
|
|
|
32237
32034
|
};
|
|
32238
32035
|
|
|
32239
32036
|
const {
|
|
32240
|
-
InfoTip: InfoTip$
|
|
32241
|
-
NumberInput: NumberInput$
|
|
32037
|
+
InfoTip: InfoTip$9,
|
|
32038
|
+
NumberInput: NumberInput$8,
|
|
32242
32039
|
PropCheckBox: PropCheckBox$5,
|
|
32243
32040
|
RangeInput: RangeInput$2
|
|
32244
32041
|
} = components;
|
|
@@ -32294,18 +32091,18 @@ class MeasurerEditor extends React.Component {
|
|
|
32294
32091
|
ref: "image-url",
|
|
32295
32092
|
defaultValue: image.url,
|
|
32296
32093
|
onChange: this._changeUrl
|
|
32297
|
-
}), /*#__PURE__*/React.createElement(InfoTip$
|
|
32094
|
+
}), /*#__PURE__*/React.createElement(InfoTip$9, null, /*#__PURE__*/React.createElement("p", null, "Create an image in graphie, or use the \"Add image\" function to create a background."))), image.url && /*#__PURE__*/React.createElement("div", {
|
|
32298
32095
|
className: "perseus-widget-row"
|
|
32299
32096
|
}, /*#__PURE__*/React.createElement("label", {
|
|
32300
32097
|
className: "perseus-widget-left-col"
|
|
32301
|
-
}, "Pixels from top:", " ", /*#__PURE__*/React.createElement(NumberInput$
|
|
32098
|
+
}, "Pixels from top:", " ", /*#__PURE__*/React.createElement(NumberInput$8, {
|
|
32302
32099
|
placeholder: 0,
|
|
32303
32100
|
onChange: this._changeTop,
|
|
32304
32101
|
value: image.top,
|
|
32305
32102
|
useArrowKeys: true
|
|
32306
32103
|
})), /*#__PURE__*/React.createElement("label", {
|
|
32307
32104
|
className: "perseus-widget-right-col"
|
|
32308
|
-
}, "Pixels from left:", " ", /*#__PURE__*/React.createElement(NumberInput$
|
|
32105
|
+
}, "Pixels from left:", " ", /*#__PURE__*/React.createElement(NumberInput$8, {
|
|
32309
32106
|
placeholder: 0,
|
|
32310
32107
|
onChange: this._changeLeft,
|
|
32311
32108
|
value: image.left,
|
|
@@ -32351,14 +32148,14 @@ class MeasurerEditor extends React.Component {
|
|
|
32351
32148
|
key: n,
|
|
32352
32149
|
value: n
|
|
32353
32150
|
}, n);
|
|
32354
|
-
})))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Ruler pixels per unit:", " ", /*#__PURE__*/React.createElement(NumberInput$
|
|
32151
|
+
})))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Ruler pixels per unit:", " ", /*#__PURE__*/React.createElement(NumberInput$8, {
|
|
32355
32152
|
placeholder: 40
|
|
32356
32153
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
32357
32154
|
,
|
|
32358
32155
|
onChange: this.change("rulerPixels"),
|
|
32359
32156
|
value: this.props.rulerPixels,
|
|
32360
32157
|
useArrowKeys: true
|
|
32361
|
-
}))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Ruler length in units:", " ", /*#__PURE__*/React.createElement(NumberInput$
|
|
32158
|
+
}))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Ruler length in units:", " ", /*#__PURE__*/React.createElement(NumberInput$8, {
|
|
32362
32159
|
placeholder: 10
|
|
32363
32160
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
32364
32161
|
,
|
|
@@ -32395,8 +32192,8 @@ MeasurerEditor.defaultProps = {
|
|
|
32395
32192
|
};
|
|
32396
32193
|
|
|
32397
32194
|
const {
|
|
32398
|
-
NumberInput: NumberInput$
|
|
32399
|
-
TextInput: TextInput$
|
|
32195
|
+
NumberInput: NumberInput$7,
|
|
32196
|
+
TextInput: TextInput$4
|
|
32400
32197
|
} = components;
|
|
32401
32198
|
class MoleculeWidgetEditor extends React.Component {
|
|
32402
32199
|
constructor(..._args) {
|
|
@@ -32421,10 +32218,10 @@ class MoleculeWidgetEditor extends React.Component {
|
|
|
32421
32218
|
};
|
|
32422
32219
|
}
|
|
32423
32220
|
render() {
|
|
32424
|
-
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "SMILES:\xA0", /*#__PURE__*/React.createElement(TextInput$
|
|
32221
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "SMILES:\xA0", /*#__PURE__*/React.createElement(TextInput$4, {
|
|
32425
32222
|
onChange: this.updateMolecule,
|
|
32426
32223
|
value: this.props.smiles
|
|
32427
|
-
}))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Rotation (deg):\xA0", /*#__PURE__*/React.createElement(NumberInput$
|
|
32224
|
+
}))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Rotation (deg):\xA0", /*#__PURE__*/React.createElement(NumberInput$7, {
|
|
32428
32225
|
onChange: this.updateRotation,
|
|
32429
32226
|
value: this.props.rotationAngle
|
|
32430
32227
|
}))));
|
|
@@ -32439,8 +32236,8 @@ MoleculeWidgetEditor.widgetName = "molecule-renderer";
|
|
|
32439
32236
|
/* eslint-disable @khanacademy/ts-no-error-suppressions */
|
|
32440
32237
|
const {
|
|
32441
32238
|
ButtonGroup: ButtonGroup$1,
|
|
32442
|
-
InfoTip: InfoTip$
|
|
32443
|
-
NumberInput: NumberInput$
|
|
32239
|
+
InfoTip: InfoTip$8,
|
|
32240
|
+
NumberInput: NumberInput$6,
|
|
32444
32241
|
PropCheckBox: PropCheckBox$4,
|
|
32445
32242
|
RangeInput: RangeInput$1
|
|
32446
32243
|
} = components;
|
|
@@ -32591,7 +32388,7 @@ class NumberLineEditor extends React.Component {
|
|
|
32591
32388
|
}, "\u2264"), /*#__PURE__*/React.createElement("option", {
|
|
32592
32389
|
value: "ge",
|
|
32593
32390
|
"aria-label": "Greater than or equal"
|
|
32594
|
-
}, "\u2265")), " ", /*#__PURE__*/React.createElement(NumberInput$
|
|
32391
|
+
}, "\u2265")), " ", /*#__PURE__*/React.createElement(NumberInput$6, {
|
|
32595
32392
|
value: this.props.correctX,
|
|
32596
32393
|
format: this.props.labelStyle
|
|
32597
32394
|
// eslint-disable-next-line react/jsx-no-bind
|
|
@@ -32601,9 +32398,9 @@ class NumberLineEditor extends React.Component {
|
|
|
32601
32398
|
placeholder: "answer",
|
|
32602
32399
|
size: "normal",
|
|
32603
32400
|
useArrowKeys: true
|
|
32604
|
-
}), /*#__PURE__*/React.createElement(InfoTip$
|
|
32401
|
+
}), /*#__PURE__*/React.createElement(InfoTip$8, null, /*#__PURE__*/React.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.createElement("div", {
|
|
32605
32402
|
className: "perseus-widget-row"
|
|
32606
|
-
}, this.props.static ? /*#__PURE__*/React.createElement("label", null, "Range:") : /*#__PURE__*/React.createElement("label", null, "Position:", " ", /*#__PURE__*/React.createElement(NumberInput$
|
|
32403
|
+
}, this.props.static ? /*#__PURE__*/React.createElement("label", null, "Range:") : /*#__PURE__*/React.createElement("label", null, "Position:", " ", /*#__PURE__*/React.createElement(NumberInput$6, {
|
|
32607
32404
|
value: this.props.initialX,
|
|
32608
32405
|
format: this.props.labelStyle
|
|
32609
32406
|
// eslint-disable-next-line react/jsx-no-bind
|
|
@@ -32619,11 +32416,11 @@ class NumberLineEditor extends React.Component {
|
|
|
32619
32416
|
onChange: this.onRangeChange,
|
|
32620
32417
|
format: this.props.labelStyle,
|
|
32621
32418
|
useArrowKeys: true
|
|
32622
|
-
}), /*#__PURE__*/React.createElement(InfoTip$
|
|
32419
|
+
}), /*#__PURE__*/React.createElement(InfoTip$8, null, /*#__PURE__*/React.createElement("p", null, "This controls the initial position of the point along the number line and the", /*#__PURE__*/React.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.createElement("p", null, "In static mode, the initial position of the point is determined by Correct x instead of position."))), /*#__PURE__*/React.createElement("div", {
|
|
32623
32420
|
className: "perseus-widget-row"
|
|
32624
32421
|
}, /*#__PURE__*/React.createElement("div", {
|
|
32625
32422
|
className: "perseus-widget-left-col"
|
|
32626
|
-
}, "Labels:", " ", /*#__PURE__*/React.createElement(NumberInput$
|
|
32423
|
+
}, "Labels:", " ", /*#__PURE__*/React.createElement(NumberInput$6, {
|
|
32627
32424
|
value: labelRange[0],
|
|
32628
32425
|
placeholder: range[0],
|
|
32629
32426
|
format: this.props.labelStyle,
|
|
@@ -32632,7 +32429,7 @@ class NumberLineEditor extends React.Component {
|
|
|
32632
32429
|
,
|
|
32633
32430
|
onChange: this.onLabelRangeChange.bind(this, 0),
|
|
32634
32431
|
useArrowKeys: true
|
|
32635
|
-
}), /*#__PURE__*/React.createElement("span", null, " & "), /*#__PURE__*/React.createElement(NumberInput$
|
|
32432
|
+
}), /*#__PURE__*/React.createElement("span", null, " & "), /*#__PURE__*/React.createElement(NumberInput$6, {
|
|
32636
32433
|
value: labelRange[1],
|
|
32637
32434
|
placeholder: range[1],
|
|
32638
32435
|
format: this.props.labelStyle,
|
|
@@ -32641,14 +32438,14 @@ class NumberLineEditor extends React.Component {
|
|
|
32641
32438
|
,
|
|
32642
32439
|
onChange: this.onLabelRangeChange.bind(this, 1),
|
|
32643
32440
|
useArrowKeys: true
|
|
32644
|
-
}), /*#__PURE__*/React.createElement(InfoTip$
|
|
32441
|
+
}), /*#__PURE__*/React.createElement(InfoTip$8, null, /*#__PURE__*/React.createElement("p", null, "This controls the position of the left / right labels. By default, the labels are set by the range ", /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("strong", null, "Note:"), " Ensure that the labels line up with the tick marks, or it may be confusing for users.")))), /*#__PURE__*/React.createElement("div", {
|
|
32645
32442
|
className: "perseus-widget-row"
|
|
32646
32443
|
}, "Style:", " ", /*#__PURE__*/React.createElement(ButtonGroup$1, {
|
|
32647
32444
|
allowEmpty: false,
|
|
32648
32445
|
value: this.props.labelStyle,
|
|
32649
32446
|
buttons: labelStyleEditorButtons,
|
|
32650
32447
|
onChange: this.onLabelStyleChange
|
|
32651
|
-
}), /*#__PURE__*/React.createElement(InfoTip$
|
|
32448
|
+
}), /*#__PURE__*/React.createElement(InfoTip$8, null, /*#__PURE__*/React.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.createElement("div", {
|
|
32652
32449
|
className: "perseus-widget-row"
|
|
32653
32450
|
}, !this.props.static && /*#__PURE__*/React.createElement("div", {
|
|
32654
32451
|
className: "perseus-widget-left-col"
|
|
@@ -32670,7 +32467,7 @@ class NumberLineEditor extends React.Component {
|
|
|
32670
32467
|
onChange: this.props.onChange
|
|
32671
32468
|
})), /*#__PURE__*/React.createElement("div", {
|
|
32672
32469
|
className: "perseus-widget-row"
|
|
32673
|
-
}, isTickCtrl && /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("label", null, "Start num divisions at", " ", /*#__PURE__*/React.createElement(NumberInput$
|
|
32470
|
+
}, isTickCtrl && /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("label", null, "Start num divisions at", " ", /*#__PURE__*/React.createElement(NumberInput$6, {
|
|
32674
32471
|
value: this.props.numDivisions || null,
|
|
32675
32472
|
format: "decimal",
|
|
32676
32473
|
onChange: this.onNumDivisionsChange,
|
|
@@ -32679,7 +32476,7 @@ class NumberLineEditor extends React.Component {
|
|
|
32679
32476
|
},
|
|
32680
32477
|
placeholder: width / this.props.tickStep,
|
|
32681
32478
|
useArrowKeys: true
|
|
32682
|
-
})), /*#__PURE__*/React.createElement(InfoTip$
|
|
32479
|
+
})), /*#__PURE__*/React.createElement(InfoTip$8, null, /*#__PURE__*/React.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.createElement("br", null), /*#__PURE__*/React.createElement("strong", null, "Note:"), " The user will be able to specify the number of divisions in a number input."))), !isTickCtrl && /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("label", null, "Num divisions:", " ", /*#__PURE__*/React.createElement(NumberInput$6, {
|
|
32683
32480
|
value: this.props.numDivisions || null,
|
|
32684
32481
|
format: "decimal",
|
|
32685
32482
|
onChange: this.onNumDivisionsChange,
|
|
@@ -32688,7 +32485,7 @@ class NumberLineEditor extends React.Component {
|
|
|
32688
32485
|
},
|
|
32689
32486
|
placeholder: width / this.props.tickStep,
|
|
32690
32487
|
useArrowKeys: true
|
|
32691
|
-
})), " ", /*#__PURE__*/React.createElement("label", null, "or tick step:", " ", /*#__PURE__*/React.createElement(NumberInput$
|
|
32488
|
+
})), " ", /*#__PURE__*/React.createElement("label", null, "or tick step:", " ", /*#__PURE__*/React.createElement(NumberInput$6, {
|
|
32692
32489
|
value: this.props.tickStep || null,
|
|
32693
32490
|
format: this.props.labelStyle,
|
|
32694
32491
|
onChange: this.onTickStepChange,
|
|
@@ -32697,9 +32494,9 @@ class NumberLineEditor extends React.Component {
|
|
|
32697
32494
|
},
|
|
32698
32495
|
placeholder: width / this.props.numDivisions,
|
|
32699
32496
|
useArrowKeys: true
|
|
32700
|
-
})), /*#__PURE__*/React.createElement(InfoTip$
|
|
32497
|
+
})), /*#__PURE__*/React.createElement(InfoTip$8, null, /*#__PURE__*/React.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.createElement("br", null), /*#__PURE__*/React.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.createElement("div", {
|
|
32701
32498
|
className: "perseus-widget-row"
|
|
32702
|
-
}, /*#__PURE__*/React.createElement("label", null, "Snap increments per tick:", " ", /*#__PURE__*/React.createElement(NumberInput$
|
|
32499
|
+
}, /*#__PURE__*/React.createElement("label", null, "Snap increments per tick:", " ", /*#__PURE__*/React.createElement(NumberInput$6, {
|
|
32703
32500
|
value: snapDivisions,
|
|
32704
32501
|
checkValidity: val => val > 0,
|
|
32705
32502
|
format: this.props.labelStyle
|
|
@@ -32707,7 +32504,7 @@ class NumberLineEditor extends React.Component {
|
|
|
32707
32504
|
,
|
|
32708
32505
|
onChange: this.onNumChange.bind(this, "snapDivisions"),
|
|
32709
32506
|
useArrowKeys: true
|
|
32710
|
-
})), /*#__PURE__*/React.createElement(InfoTip$
|
|
32507
|
+
})), /*#__PURE__*/React.createElement(InfoTip$8, null, /*#__PURE__*/React.createElement("p", null, "This determines the number of different places the point will snap between two adjacent tick marks.", " ", /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("strong", null, "Note:"), "Ensure the required number of snap increments is provided to answer the question."))));
|
|
32711
32508
|
}
|
|
32712
32509
|
}
|
|
32713
32510
|
NumberLineEditor.propTypes = {
|
|
@@ -32745,16 +32542,16 @@ NumberLineEditor.defaultProps = {
|
|
|
32745
32542
|
|
|
32746
32543
|
const {
|
|
32747
32544
|
ButtonGroup,
|
|
32748
|
-
InfoTip: InfoTip$
|
|
32749
|
-
InlineIcon: InlineIcon$
|
|
32545
|
+
InfoTip: InfoTip$7,
|
|
32546
|
+
InlineIcon: InlineIcon$2,
|
|
32750
32547
|
MultiButtonGroup,
|
|
32751
|
-
NumberInput: NumberInput$
|
|
32548
|
+
NumberInput: NumberInput$5,
|
|
32752
32549
|
PropCheckBox: PropCheckBox$3,
|
|
32753
|
-
TextInput: TextInput$
|
|
32550
|
+
TextInput: TextInput$3
|
|
32754
32551
|
} = components;
|
|
32755
32552
|
const {
|
|
32756
32553
|
iconGear,
|
|
32757
|
-
iconTrash: iconTrash$
|
|
32554
|
+
iconTrash: iconTrash$1
|
|
32758
32555
|
} = icons;
|
|
32759
32556
|
const {
|
|
32760
32557
|
firstNumericalParse
|
|
@@ -32834,14 +32631,14 @@ const NumericInputEditor = createReactClass({
|
|
|
32834
32631
|
content: "wrong"
|
|
32835
32632
|
}],
|
|
32836
32633
|
onChange: this.updateAnswer(i, "simplify")
|
|
32837
|
-
}), /*#__PURE__*/React.createElement(InfoTip$
|
|
32634
|
+
}), /*#__PURE__*/React.createElement(InfoTip$7, null, /*#__PURE__*/React.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.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.createElement("p", null, "Select \"wrong\" ", /*#__PURE__*/React.createElement("em", null, "only"), " if we are specifically assessing the ability to simplify.")));
|
|
32838
32635
|
const suggestedAnswerTypes = i => /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
32839
32636
|
className: "perseus-widget-row"
|
|
32840
32637
|
}, /*#__PURE__*/React.createElement("label", null, "Choose the suggested answer formats"), /*#__PURE__*/React.createElement(MultiButtonGroup, {
|
|
32841
32638
|
buttons: answerFormButtons,
|
|
32842
32639
|
values: answers[i]["answerForms"],
|
|
32843
32640
|
onChange: this.updateAnswer(i, "answerForms")
|
|
32844
|
-
}), /*#__PURE__*/React.createElement(InfoTip$
|
|
32641
|
+
}), /*#__PURE__*/React.createElement(InfoTip$7, null, /*#__PURE__*/React.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.createElement("p", null, "To restrict the answer to ", /*#__PURE__*/React.createElement("em", null, "only"), " an improper fraction (i.e. 7/4), select the improper fraction and toggle \"strict\" to true. This ", /*#__PURE__*/React.createElement("b", null, "will not"), " ", "accept 1.75 as an answer.", " "), /*#__PURE__*/React.createElement("p", null, "Unless you are testing that specific skill, please do not restrict the answer format."))), /*#__PURE__*/React.createElement("div", {
|
|
32845
32642
|
className: "perseus-widget-row"
|
|
32846
32643
|
}, /*#__PURE__*/React.createElement(PropCheckBox$3, {
|
|
32847
32644
|
label: "Strictly match only these formats",
|
|
@@ -32852,7 +32649,7 @@ const NumericInputEditor = createReactClass({
|
|
|
32852
32649
|
})));
|
|
32853
32650
|
const maxError = i => /*#__PURE__*/React.createElement("div", {
|
|
32854
32651
|
className: "perseus-widget-row"
|
|
32855
|
-
}, /*#__PURE__*/React.createElement("label", null, "Max error", " ", /*#__PURE__*/React.createElement(NumberInput$
|
|
32652
|
+
}, /*#__PURE__*/React.createElement("label", null, "Max error", " ", /*#__PURE__*/React.createElement(NumberInput$5, {
|
|
32856
32653
|
className: "max-error",
|
|
32857
32654
|
value: answers[i]["maxError"],
|
|
32858
32655
|
onChange: this.updateAnswer(i, "maxError"),
|
|
@@ -32871,7 +32668,7 @@ const NumericInputEditor = createReactClass({
|
|
|
32871
32668
|
content: "Small (40px)"
|
|
32872
32669
|
}],
|
|
32873
32670
|
onChange: this.change("size")
|
|
32874
|
-
}), /*#__PURE__*/React.createElement(InfoTip$
|
|
32671
|
+
}), /*#__PURE__*/React.createElement(InfoTip$7, null, /*#__PURE__*/React.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.")));
|
|
32875
32672
|
const rightAlign = /*#__PURE__*/React.createElement("div", {
|
|
32876
32673
|
className: "perseus-widget-row"
|
|
32877
32674
|
}, /*#__PURE__*/React.createElement(PropCheckBox$3, {
|
|
@@ -32881,17 +32678,17 @@ const NumericInputEditor = createReactClass({
|
|
|
32881
32678
|
}));
|
|
32882
32679
|
const labelText = /*#__PURE__*/React.createElement("div", {
|
|
32883
32680
|
className: "perseus-widget-row"
|
|
32884
|
-
}, /*#__PURE__*/React.createElement("label", null, "Label text:", " ", /*#__PURE__*/React.createElement(TextInput$
|
|
32681
|
+
}, /*#__PURE__*/React.createElement("label", null, "Label text:", " ", /*#__PURE__*/React.createElement(TextInput$3, {
|
|
32885
32682
|
value: this.props.labelText,
|
|
32886
32683
|
onChange: this.change("labelText")
|
|
32887
|
-
})), /*#__PURE__*/React.createElement(InfoTip$
|
|
32684
|
+
})), /*#__PURE__*/React.createElement(InfoTip$7, null, /*#__PURE__*/React.createElement("p", null, "Text to describe this input. This will be shown to users using screenreaders.")));
|
|
32888
32685
|
const coefficientCheck = /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
32889
32686
|
className: "perseus-widget-row"
|
|
32890
32687
|
}, /*#__PURE__*/React.createElement(PropCheckBox$3, {
|
|
32891
32688
|
label: "Coefficient",
|
|
32892
32689
|
coefficient: this.props.coefficient,
|
|
32893
32690
|
onChange: this.props.onChange
|
|
32894
|
-
}), /*#__PURE__*/React.createElement(InfoTip$
|
|
32691
|
+
}), /*#__PURE__*/React.createElement(InfoTip$7, null, /*#__PURE__*/React.createElement("p", null, "A coefficient style number allows the student to use - for -1 and an empty string to mean 1."))));
|
|
32895
32692
|
const addAnswerButton = /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("a", {
|
|
32896
32693
|
href: "javascript:void(0)",
|
|
32897
32694
|
className: "simple-button orange",
|
|
@@ -32922,7 +32719,7 @@ const NumericInputEditor = createReactClass({
|
|
|
32922
32719
|
key: i
|
|
32923
32720
|
}, /*#__PURE__*/React.createElement("div", {
|
|
32924
32721
|
className: "input-answer-editor-value-container" + (answer.maxError ? " with-max-error" : "")
|
|
32925
|
-
}, /*#__PURE__*/React.createElement(NumberInput$
|
|
32722
|
+
}, /*#__PURE__*/React.createElement(NumberInput$5, {
|
|
32926
32723
|
value: answer.value,
|
|
32927
32724
|
className: "numeric-input-value",
|
|
32928
32725
|
placeholder: "answer",
|
|
@@ -32969,7 +32766,7 @@ const NumericInputEditor = createReactClass({
|
|
|
32969
32766
|
className: "max-error-container"
|
|
32970
32767
|
}, /*#__PURE__*/React.createElement("div", {
|
|
32971
32768
|
className: "max-error-plusmn"
|
|
32972
|
-
}, "\xB1"), /*#__PURE__*/React.createElement(NumberInput$
|
|
32769
|
+
}, "\xB1"), /*#__PURE__*/React.createElement(NumberInput$5, {
|
|
32973
32770
|
placeholder: 0,
|
|
32974
32771
|
value: answers[i]["maxError"],
|
|
32975
32772
|
format: _.last(answer.answerForms),
|
|
@@ -32987,13 +32784,13 @@ const NumericInputEditor = createReactClass({
|
|
|
32987
32784
|
"aria-label": "Delete answer",
|
|
32988
32785
|
onClick: () => this.onTrashAnswer(i),
|
|
32989
32786
|
onKeyDown: e => this.onSpace(e, this.onTrashAnswer, i)
|
|
32990
|
-
}, /*#__PURE__*/React.createElement(InlineIcon$
|
|
32787
|
+
}, /*#__PURE__*/React.createElement(InlineIcon$2, iconTrash$1)), /*#__PURE__*/React.createElement("a", {
|
|
32991
32788
|
href: "javascript:void(0)",
|
|
32992
32789
|
className: "options-toggle",
|
|
32993
32790
|
"aria-label": "Toggle options",
|
|
32994
32791
|
onClick: () => this.onToggleOptions(i),
|
|
32995
32792
|
onKeyDown: e => this.onSpace(e, this.onToggleOptions, i)
|
|
32996
|
-
}, /*#__PURE__*/React.createElement(InlineIcon$
|
|
32793
|
+
}, /*#__PURE__*/React.createElement(InlineIcon$2, iconGear))), /*#__PURE__*/React.createElement("div", {
|
|
32997
32794
|
className: "input-answer-editor-message"
|
|
32998
32795
|
}, editor), this.state.showOptions[i] && /*#__PURE__*/React.createElement("div", {
|
|
32999
32796
|
className: "options-container"
|
|
@@ -33099,7 +32896,7 @@ const NumericInputEditor = createReactClass({
|
|
|
33099
32896
|
|
|
33100
32897
|
/* eslint-disable @khanacademy/ts-no-error-suppressions */
|
|
33101
32898
|
const {
|
|
33102
|
-
InfoTip: InfoTip$
|
|
32899
|
+
InfoTip: InfoTip$6,
|
|
33103
32900
|
TextListEditor: TextListEditor$2
|
|
33104
32901
|
} = components;
|
|
33105
32902
|
const NORMAL = "normal",
|
|
@@ -33159,13 +32956,13 @@ class OrdererEditor extends React.Component {
|
|
|
33159
32956
|
render() {
|
|
33160
32957
|
return /*#__PURE__*/React.createElement("div", {
|
|
33161
32958
|
className: "perseus-widget-orderer"
|
|
33162
|
-
}, /*#__PURE__*/React.createElement("div", null, " ", "Correct answer:", " ", /*#__PURE__*/React.createElement(InfoTip$
|
|
32959
|
+
}, /*#__PURE__*/React.createElement("div", null, " ", "Correct answer:", " ", /*#__PURE__*/React.createElement(InfoTip$6, null, /*#__PURE__*/React.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.createElement(TextListEditor$2, {
|
|
33163
32960
|
options: _.pluck(this.props.correctOptions, "content")
|
|
33164
32961
|
// eslint-disable-next-line react/jsx-no-bind
|
|
33165
32962
|
,
|
|
33166
32963
|
onChange: this.onOptionsChange.bind(this, "correctOptions"),
|
|
33167
32964
|
layout: this.props.layout
|
|
33168
|
-
}), /*#__PURE__*/React.createElement("div", null, " ", "Other cards:", " ", /*#__PURE__*/React.createElement(InfoTip$
|
|
32965
|
+
}), /*#__PURE__*/React.createElement("div", null, " ", "Other cards:", " ", /*#__PURE__*/React.createElement(InfoTip$6, null, /*#__PURE__*/React.createElement("p", null, "Create cards that are not part of the answer."))), /*#__PURE__*/React.createElement(TextListEditor$2, {
|
|
33169
32966
|
options: _.pluck(this.props.otherOptions, "content")
|
|
33170
32967
|
// eslint-disable-next-line react/jsx-no-bind
|
|
33171
32968
|
,
|
|
@@ -33180,7 +32977,7 @@ class OrdererEditor extends React.Component {
|
|
|
33180
32977
|
value: HORIZONTAL$1
|
|
33181
32978
|
}, "Horizontal"), /*#__PURE__*/React.createElement("option", {
|
|
33182
32979
|
value: VERTICAL$1
|
|
33183
|
-
}, "Vertical"))), /*#__PURE__*/React.createElement(InfoTip$
|
|
32980
|
+
}, "Vertical"))), /*#__PURE__*/React.createElement(InfoTip$6, null, /*#__PURE__*/React.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.createElement("div", null, /*#__PURE__*/React.createElement("label", null, " ", "Height:", " ", /*#__PURE__*/React.createElement("select", {
|
|
33184
32981
|
value: this.props.height
|
|
33185
32982
|
// @ts-expect-error - TS2322 - Type '(arg1: ChangeEvent<HTMLInputElement>) => void' is not assignable to type 'ChangeEventHandler<HTMLSelectElement>'.
|
|
33186
32983
|
,
|
|
@@ -33189,7 +32986,7 @@ class OrdererEditor extends React.Component {
|
|
|
33189
32986
|
value: NORMAL
|
|
33190
32987
|
}, "Normal"), /*#__PURE__*/React.createElement("option", {
|
|
33191
32988
|
value: AUTO
|
|
33192
|
-
}, "Automatic"))), /*#__PURE__*/React.createElement(InfoTip$
|
|
32989
|
+
}, "Automatic"))), /*#__PURE__*/React.createElement(InfoTip$6, null, /*#__PURE__*/React.createElement("p", null, "Use \"Normal\" for text, \"Automatic\" for images."))));
|
|
33193
32990
|
}
|
|
33194
32991
|
}
|
|
33195
32992
|
OrdererEditor.propTypes = {
|
|
@@ -33212,7 +33009,7 @@ OrdererEditor.defaultProps = {
|
|
|
33212
33009
|
};
|
|
33213
33010
|
|
|
33214
33011
|
const {
|
|
33215
|
-
InfoTip: InfoTip$
|
|
33012
|
+
InfoTip: InfoTip$5,
|
|
33216
33013
|
PropCheckBox: PropCheckBox$2
|
|
33217
33014
|
} = components;
|
|
33218
33015
|
class PassageEditor extends React.Component {
|
|
@@ -33266,7 +33063,7 @@ class PassageEditor extends React.Component {
|
|
|
33266
33063
|
labelAlignment: "right",
|
|
33267
33064
|
showLineNumbers: this.props.showLineNumbers,
|
|
33268
33065
|
onChange: this.props.onChange
|
|
33269
|
-
})), /*#__PURE__*/React.createElement("div", null, "Passage title:", /*#__PURE__*/React.createElement(InfoTip$
|
|
33066
|
+
})), /*#__PURE__*/React.createElement("div", null, "Passage title:", /*#__PURE__*/React.createElement(InfoTip$5, null, /*#__PURE__*/React.createElement("p", null, "An optional title that will appear directly above the passage in the same font style. (E.g. Passage 1)")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("input", {
|
|
33270
33067
|
type: "text",
|
|
33271
33068
|
defaultValue: this.props.passageTitle,
|
|
33272
33069
|
onChange: e => {
|
|
@@ -33275,7 +33072,7 @@ class PassageEditor extends React.Component {
|
|
|
33275
33072
|
passageTitle: e.target.value
|
|
33276
33073
|
});
|
|
33277
33074
|
}
|
|
33278
|
-
}))), /*#__PURE__*/React.createElement("div", null, "Passage Text:", passageEditor), /*#__PURE__*/React.createElement("div", null, "Footnotes:", /*#__PURE__*/React.createElement(InfoTip$
|
|
33075
|
+
}))), /*#__PURE__*/React.createElement("div", null, "Passage Text:", passageEditor), /*#__PURE__*/React.createElement("div", null, "Footnotes:", /*#__PURE__*/React.createElement(InfoTip$5, null, /*#__PURE__*/React.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));
|
|
33279
33076
|
}
|
|
33280
33077
|
}
|
|
33281
33078
|
PassageEditor.propTypes = _extends({}, Changeable.propTypes, {
|
|
@@ -33293,9 +33090,9 @@ PassageEditor.defaultProps = {
|
|
|
33293
33090
|
};
|
|
33294
33091
|
|
|
33295
33092
|
const {
|
|
33296
|
-
InfoTip: InfoTip$
|
|
33297
|
-
NumberInput: NumberInput$
|
|
33298
|
-
TextInput: TextInput$
|
|
33093
|
+
InfoTip: InfoTip$4,
|
|
33094
|
+
NumberInput: NumberInput$4,
|
|
33095
|
+
TextInput: TextInput$2
|
|
33299
33096
|
} = components;
|
|
33300
33097
|
class PassageRefEditor extends React.Component {
|
|
33301
33098
|
constructor(..._args) {
|
|
@@ -33308,22 +33105,22 @@ class PassageRefEditor extends React.Component {
|
|
|
33308
33105
|
};
|
|
33309
33106
|
}
|
|
33310
33107
|
render() {
|
|
33311
|
-
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Passage Number: ", /*#__PURE__*/React.createElement(NumberInput$
|
|
33108
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Passage Number: ", /*#__PURE__*/React.createElement(NumberInput$4, {
|
|
33312
33109
|
value: this.props.passageNumber
|
|
33313
33110
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
33314
33111
|
,
|
|
33315
33112
|
onChange: this.change("passageNumber")
|
|
33316
|
-
}))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Reference Number: ", /*#__PURE__*/React.createElement(NumberInput$
|
|
33113
|
+
}))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Reference Number: ", /*#__PURE__*/React.createElement(NumberInput$4, {
|
|
33317
33114
|
value: this.props.referenceNumber
|
|
33318
33115
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
33319
33116
|
,
|
|
33320
33117
|
onChange: this.change("referenceNumber")
|
|
33321
|
-
}))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Summary Text: ", /*#__PURE__*/React.createElement(TextInput$
|
|
33118
|
+
}))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Summary Text: ", /*#__PURE__*/React.createElement(TextInput$2, {
|
|
33322
33119
|
value: this.props.summaryText
|
|
33323
33120
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
33324
33121
|
,
|
|
33325
33122
|
onChange: this.change("summaryText")
|
|
33326
|
-
}), /*#__PURE__*/React.createElement(InfoTip$
|
|
33123
|
+
}), /*#__PURE__*/React.createElement(InfoTip$4, null, /*#__PURE__*/React.createElement("p", null, "Short summary of the referenced section. This will be included in parentheses and quotes automatically."), /*#__PURE__*/React.createElement("p", null, "Ex: The start ... the end")))));
|
|
33327
33124
|
}
|
|
33328
33125
|
}
|
|
33329
33126
|
PassageRefEditor.propTypes = _extends({}, Changeable.propTypes, {
|
|
@@ -33371,8 +33168,8 @@ PassageRefTargetEditor.defaultProps = {
|
|
|
33371
33168
|
};
|
|
33372
33169
|
|
|
33373
33170
|
const {
|
|
33374
|
-
InfoTip: InfoTip$
|
|
33375
|
-
NumberInput: NumberInput$
|
|
33171
|
+
InfoTip: InfoTip$3,
|
|
33172
|
+
NumberInput: NumberInput$3,
|
|
33376
33173
|
RangeInput,
|
|
33377
33174
|
TextListEditor: TextListEditor$1
|
|
33378
33175
|
} = components;
|
|
@@ -33601,27 +33398,27 @@ class PlotterEditor extends React.Component {
|
|
|
33601
33398
|
className: "set-from-scale-box"
|
|
33602
33399
|
}, /*#__PURE__*/React.createElement("span", {
|
|
33603
33400
|
className: "categories-title"
|
|
33604
|
-
}, "Set Categories From Scale"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Tick Step:", " ", /*#__PURE__*/React.createElement(NumberInput$
|
|
33401
|
+
}, "Set Categories From Scale"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Tick Step:", " ", /*#__PURE__*/React.createElement(NumberInput$3, {
|
|
33605
33402
|
placeholder: 1,
|
|
33606
33403
|
useArrowKeys: true,
|
|
33607
33404
|
value: this.state.tickStep,
|
|
33608
33405
|
onChange: this.handleChangeTickStep
|
|
33609
|
-
})), /*#__PURE__*/React.createElement(InfoTip$
|
|
33406
|
+
})), /*#__PURE__*/React.createElement(InfoTip$3, null, /*#__PURE__*/React.createElement("p", null, "The difference between adjacent ticks."))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Range:", " ", /*#__PURE__*/React.createElement(RangeInput, {
|
|
33610
33407
|
placeholder: [0, 10],
|
|
33611
33408
|
useArrowKeys: true,
|
|
33612
33409
|
value: [this.state.minX, this.state.maxX],
|
|
33613
33410
|
onChange: this.handleChangeRange
|
|
33614
33411
|
}))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("button", {
|
|
33615
33412
|
onClick: this.setCategoriesFromScale
|
|
33616
|
-
}, "Set Categories", " "))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Label Interval:", " ", /*#__PURE__*/React.createElement(NumberInput$
|
|
33413
|
+
}, "Set Categories", " "))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Label Interval:", " ", /*#__PURE__*/React.createElement(NumberInput$3, {
|
|
33617
33414
|
useArrowKeys: true,
|
|
33618
33415
|
value: this.props.labelInterval,
|
|
33619
33416
|
onChange: this.changeLabelInterval
|
|
33620
|
-
})), /*#__PURE__*/React.createElement(InfoTip$
|
|
33417
|
+
})), /*#__PURE__*/React.createElement(InfoTip$3, null, /*#__PURE__*/React.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.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Picture:", " ", /*#__PURE__*/React.createElement(BlurInput, {
|
|
33621
33418
|
className: "pic-url",
|
|
33622
33419
|
value: this.props.picUrl,
|
|
33623
33420
|
onChange: this.changePicUrl
|
|
33624
|
-
}), /*#__PURE__*/React.createElement(InfoTip$
|
|
33421
|
+
}), /*#__PURE__*/React.createElement(InfoTip$3, null, /*#__PURE__*/React.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.createElement("p", {
|
|
33625
33422
|
className: "warning"
|
|
33626
33423
|
}, /*#__PURE__*/React.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.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Categories:", " ", /*#__PURE__*/React.createElement(TextListEditor$1
|
|
33627
33424
|
// eslint-disable-next-line react/no-string-refs
|
|
@@ -33645,14 +33442,14 @@ class PlotterEditor extends React.Component {
|
|
|
33645
33442
|
type: "text",
|
|
33646
33443
|
onChange: this.changeSnaps,
|
|
33647
33444
|
defaultValue: this.props.snapsPerLine
|
|
33648
|
-
})), /*#__PURE__*/React.createElement(InfoTip$
|
|
33445
|
+
})), /*#__PURE__*/React.createElement(InfoTip$3, null, /*#__PURE__*/React.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.createElement("div", null, "Editing values:", " ", editingStates.map(editing => /*#__PURE__*/React.createElement("label", {
|
|
33649
33446
|
key: editing
|
|
33650
33447
|
}, /*#__PURE__*/React.createElement("input", {
|
|
33651
33448
|
type: "radio",
|
|
33652
33449
|
disabled: editing === CORRECT && this.props.static,
|
|
33653
33450
|
checked: this.props.static ? editing === STARTING : this.state.editing === editing,
|
|
33654
33451
|
onChange: e => this.changeEditing(editing)
|
|
33655
|
-
}), editing)), /*#__PURE__*/React.createElement(InfoTip$
|
|
33452
|
+
}), editing)), /*#__PURE__*/React.createElement(InfoTip$3, null, /*#__PURE__*/React.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.createElement("p", null, "In static mode, the starting values are rendered out to the displayed widget."))), /*#__PURE__*/React.createElement(Plotter, _extends({}, props, {
|
|
33656
33453
|
starting: this.props[this.state.editing],
|
|
33657
33454
|
onChange: this.handlePlotterChange
|
|
33658
33455
|
})));
|
|
@@ -33683,8 +33480,8 @@ PlotterEditor.defaultProps = _extends({}, editorDefaults, {
|
|
|
33683
33480
|
* This editor is for embedding Khan Academy Python programs.
|
|
33684
33481
|
*/
|
|
33685
33482
|
const {
|
|
33686
|
-
NumberInput: NumberInput$
|
|
33687
|
-
TextInput: TextInput$
|
|
33483
|
+
NumberInput: NumberInput$2,
|
|
33484
|
+
TextInput: TextInput$1
|
|
33688
33485
|
} = components;
|
|
33689
33486
|
function validateOptions(height, programID) {
|
|
33690
33487
|
const errors = [];
|
|
@@ -33718,11 +33515,11 @@ class PythonProgramEditor extends React.Component {
|
|
|
33718
33515
|
};
|
|
33719
33516
|
}
|
|
33720
33517
|
render() {
|
|
33721
|
-
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "User Program ID:", " ", /*#__PURE__*/React.createElement(TextInput$
|
|
33518
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "User Program ID:", " ", /*#__PURE__*/React.createElement(TextInput$1, {
|
|
33722
33519
|
value: this.props.programID,
|
|
33723
33520
|
onChange: this.change("programID"),
|
|
33724
33521
|
placeholder: "123"
|
|
33725
|
-
})), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("label", null, "Height:", " ", /*#__PURE__*/React.createElement(NumberInput$
|
|
33522
|
+
})), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("label", null, "Height:", " ", /*#__PURE__*/React.createElement(NumberInput$2, {
|
|
33726
33523
|
value: this.props.height,
|
|
33727
33524
|
onChange: this.change("height"),
|
|
33728
33525
|
placeholder: "400"
|
|
@@ -33736,12 +33533,12 @@ PythonProgramEditor.defaultProps = {
|
|
|
33736
33533
|
};
|
|
33737
33534
|
|
|
33738
33535
|
const {
|
|
33739
|
-
InlineIcon: InlineIcon$
|
|
33536
|
+
InlineIcon: InlineIcon$1,
|
|
33740
33537
|
PropCheckBox: PropCheckBox$1
|
|
33741
33538
|
} = components;
|
|
33742
33539
|
const {
|
|
33743
|
-
iconPlus
|
|
33744
|
-
iconTrash
|
|
33540
|
+
iconPlus,
|
|
33541
|
+
iconTrash
|
|
33745
33542
|
} = icons;
|
|
33746
33543
|
class ChoiceEditor extends React.Component {
|
|
33747
33544
|
render() {
|
|
@@ -33782,7 +33579,7 @@ class ChoiceEditor extends React.Component {
|
|
|
33782
33579
|
this.props.onDelete();
|
|
33783
33580
|
},
|
|
33784
33581
|
title: "Remove this choice"
|
|
33785
|
-
}, /*#__PURE__*/React.createElement(InlineIcon$
|
|
33582
|
+
}, /*#__PURE__*/React.createElement(InlineIcon$1, iconTrash));
|
|
33786
33583
|
return /*#__PURE__*/React.createElement("div", {
|
|
33787
33584
|
className: "choice-clue-editors"
|
|
33788
33585
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -33986,13 +33783,13 @@ class RadioEditor extends React.Component {
|
|
|
33986
33783
|
// eslint-disable-next-line react/jsx-no-bind
|
|
33987
33784
|
,
|
|
33988
33785
|
onClick: this.addChoice.bind(this, false)
|
|
33989
|
-
}, /*#__PURE__*/React.createElement(InlineIcon$
|
|
33786
|
+
}, /*#__PURE__*/React.createElement(InlineIcon$1, iconPlus), " Add a choice", " "), !this.props.hasNoneOfTheAbove && /*#__PURE__*/React.createElement("a", {
|
|
33990
33787
|
className: "simple-button",
|
|
33991
33788
|
href: "#"
|
|
33992
33789
|
// eslint-disable-next-line react/jsx-no-bind
|
|
33993
33790
|
,
|
|
33994
33791
|
onClick: this.addChoice.bind(this, true)
|
|
33995
|
-
}, /*#__PURE__*/React.createElement(InlineIcon$
|
|
33792
|
+
}, /*#__PURE__*/React.createElement(InlineIcon$1, iconPlus), " None of the above", " ")));
|
|
33996
33793
|
}
|
|
33997
33794
|
}
|
|
33998
33795
|
RadioEditor.propTypes = _extends({}, Changeable.propTypes, {
|
|
@@ -34024,250 +33821,6 @@ RadioEditor.defaultProps = {
|
|
|
34024
33821
|
deselectEnabled: false
|
|
34025
33822
|
};
|
|
34026
33823
|
|
|
34027
|
-
const {
|
|
34028
|
-
NumberInput: NumberInput$3,
|
|
34029
|
-
TextInput: TextInput$1
|
|
34030
|
-
} = components;
|
|
34031
|
-
class ReactionDiagramWidgetEditor extends React.Component {
|
|
34032
|
-
constructor(..._args) {
|
|
34033
|
-
super(..._args);
|
|
34034
|
-
this.change = (...args) => {
|
|
34035
|
-
return Changeable.change.apply(this, args);
|
|
34036
|
-
};
|
|
34037
|
-
this.updateMolecule = idx => {
|
|
34038
|
-
return function (newValue) {
|
|
34039
|
-
// @ts-expect-error - TS2683 - 'this' implicitly has type 'any' because it does not have a type annotation.
|
|
34040
|
-
const newSmiles = [...this.props.smiles];
|
|
34041
|
-
newSmiles[idx] = newValue;
|
|
34042
|
-
// @ts-expect-error - TS2683 - 'this' implicitly has type 'any' because it does not have a type annotation.
|
|
34043
|
-
this.change({
|
|
34044
|
-
smiles: newSmiles
|
|
34045
|
-
});
|
|
34046
|
-
}.bind(this);
|
|
34047
|
-
};
|
|
34048
|
-
this.updateRotation = idx => {
|
|
34049
|
-
return function (newValue) {
|
|
34050
|
-
// @ts-expect-error - TS2683 - 'this' implicitly has type 'any' because it does not have a type annotation.
|
|
34051
|
-
const newRot = [...this.props.rotationAngle];
|
|
34052
|
-
newRot[idx] = newValue;
|
|
34053
|
-
// @ts-expect-error - TS2683 - 'this' implicitly has type 'any' because it does not have a type annotation.
|
|
34054
|
-
this.change({
|
|
34055
|
-
rotationAngle: newRot
|
|
34056
|
-
});
|
|
34057
|
-
}.bind(this);
|
|
34058
|
-
};
|
|
34059
|
-
this.updateSeparators = (idx, propName) => {
|
|
34060
|
-
return newValue => {
|
|
34061
|
-
const newSep = this.props.separators.map(sep => {
|
|
34062
|
-
return _extends({}, sep);
|
|
34063
|
-
});
|
|
34064
|
-
newSep[idx][propName] = newValue;
|
|
34065
|
-
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
34066
|
-
this.change({
|
|
34067
|
-
separators: newSep
|
|
34068
|
-
});
|
|
34069
|
-
};
|
|
34070
|
-
};
|
|
34071
|
-
this.serialize = () => {
|
|
34072
|
-
return EditorJsonify.serialize.call(this);
|
|
34073
|
-
};
|
|
34074
|
-
}
|
|
34075
|
-
render() {
|
|
34076
|
-
// TODO(colin): use styling instead of   hacks.
|
|
34077
|
-
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "LHS SMILES:\xA0", /*#__PURE__*/React.createElement(TextInput$1, {
|
|
34078
|
-
onChange: this.updateMolecule(0),
|
|
34079
|
-
value: this.props.smiles[0]
|
|
34080
|
-
}))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "LHS Rotation (deg):\xA0", /*#__PURE__*/React.createElement(NumberInput$3, {
|
|
34081
|
-
onChange: this.updateRotation(0),
|
|
34082
|
-
value: this.props.rotationAngle[0]
|
|
34083
|
-
}))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "RHS SMILES:\xA0", /*#__PURE__*/React.createElement(TextInput$1, {
|
|
34084
|
-
onChange: this.updateMolecule(1),
|
|
34085
|
-
value: this.props.smiles[1]
|
|
34086
|
-
}))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "RHS Rotation (deg):\xA0", /*#__PURE__*/React.createElement(NumberInput$3, {
|
|
34087
|
-
onChange: this.updateRotation(1),
|
|
34088
|
-
value: this.props.rotationAngle[1]
|
|
34089
|
-
}))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Top of arrow text:\xA0", /*#__PURE__*/React.createElement(TextInput$1, {
|
|
34090
|
-
onChange: this.updateSeparators(0, "topText"),
|
|
34091
|
-
value: this.props.separators[0].topText
|
|
34092
|
-
}))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Bottom of arrow text:\xA0", /*#__PURE__*/React.createElement(TextInput$1, {
|
|
34093
|
-
onChange: this.updateSeparators(0, "bottomText"),
|
|
34094
|
-
value: this.props.separators[0].bottomText
|
|
34095
|
-
}))));
|
|
34096
|
-
}
|
|
34097
|
-
}
|
|
34098
|
-
ReactionDiagramWidgetEditor.propTypes = _extends({}, Changeable.propTypes, {
|
|
34099
|
-
rotationAngle: PropTypes.arrayOf(PropTypes.number),
|
|
34100
|
-
// eslint-disable-next-line react/forbid-prop-types
|
|
34101
|
-
separators: PropTypes.arrayOf(PropTypes.object),
|
|
34102
|
-
smiles: PropTypes.arrayOf(PropTypes.string)
|
|
34103
|
-
});
|
|
34104
|
-
ReactionDiagramWidgetEditor.widgetName = "reaction-diagram";
|
|
34105
|
-
ReactionDiagramWidgetEditor.defaultProps = {
|
|
34106
|
-
smiles: ["", ""],
|
|
34107
|
-
rotationAngle: [0, 0],
|
|
34108
|
-
separators: [{
|
|
34109
|
-
type: "right",
|
|
34110
|
-
topText: "",
|
|
34111
|
-
bottomText: ""
|
|
34112
|
-
}]
|
|
34113
|
-
};
|
|
34114
|
-
|
|
34115
|
-
/* eslint-disable jsx-a11y/anchor-is-valid, no-alert, react/sort-comp */
|
|
34116
|
-
const {
|
|
34117
|
-
InlineIcon: InlineIcon$1
|
|
34118
|
-
} = components;
|
|
34119
|
-
const {
|
|
34120
|
-
iconCircleArrowDown,
|
|
34121
|
-
iconCircleArrowUp,
|
|
34122
|
-
iconPlus,
|
|
34123
|
-
iconTrash
|
|
34124
|
-
} = icons;
|
|
34125
|
-
class StepControlButton extends React.Component {
|
|
34126
|
-
render() {
|
|
34127
|
-
return /*#__PURE__*/React.createElement("a", {
|
|
34128
|
-
href: "#",
|
|
34129
|
-
className: "step-control-button " + "simple-button " + "simple-button--small " + "orange",
|
|
34130
|
-
onClick: e => {
|
|
34131
|
-
e.preventDefault();
|
|
34132
|
-
this.props.onClick();
|
|
34133
|
-
}
|
|
34134
|
-
}, /*#__PURE__*/React.createElement(InlineIcon$1, this.props.icon));
|
|
34135
|
-
}
|
|
34136
|
-
}
|
|
34137
|
-
class SequenceEditor extends React.Component {
|
|
34138
|
-
constructor(...args) {
|
|
34139
|
-
super(...args);
|
|
34140
|
-
this._handleEditorChange = (i, newProps) => {
|
|
34141
|
-
const steps = _.clone(this.props.json);
|
|
34142
|
-
steps[i] = _.extend({}, steps[i], newProps);
|
|
34143
|
-
this.props.onChange({
|
|
34144
|
-
json: steps
|
|
34145
|
-
});
|
|
34146
|
-
};
|
|
34147
|
-
this.serialize = () => {
|
|
34148
|
-
return {
|
|
34149
|
-
json: _.times(this.props.json.length, i => {
|
|
34150
|
-
// eslint-disable-next-line react/no-string-refs
|
|
34151
|
-
// @ts-expect-error - TS2339 - Property 'serialize' does not exist on type 'ReactInstance'.
|
|
34152
|
-
return this.refs["editor" + i].serialize();
|
|
34153
|
-
})
|
|
34154
|
-
};
|
|
34155
|
-
};
|
|
34156
|
-
this._handleMoveStepEarlier = i => {
|
|
34157
|
-
if (i === 0) {
|
|
34158
|
-
return;
|
|
34159
|
-
}
|
|
34160
|
-
const steps = _.clone(this.props.json);
|
|
34161
|
-
const step = steps[i];
|
|
34162
|
-
steps.splice(i, 1);
|
|
34163
|
-
steps.splice(i - 1, 0, step);
|
|
34164
|
-
this.props.onChange({
|
|
34165
|
-
json: steps
|
|
34166
|
-
});
|
|
34167
|
-
};
|
|
34168
|
-
this._handleMoveStepLater = i => {
|
|
34169
|
-
const steps = _.clone(this.props.json);
|
|
34170
|
-
if (i + 1 === steps.length) {
|
|
34171
|
-
return;
|
|
34172
|
-
}
|
|
34173
|
-
const step = steps[i];
|
|
34174
|
-
steps.splice(i, 1);
|
|
34175
|
-
steps.splice(i + 1, 0, step);
|
|
34176
|
-
this.props.onChange({
|
|
34177
|
-
json: steps
|
|
34178
|
-
});
|
|
34179
|
-
};
|
|
34180
|
-
this._handleAddStepAfter = i => {
|
|
34181
|
-
// We do a full serialization here because we
|
|
34182
|
-
// might be copying widgets:
|
|
34183
|
-
const steps = _.clone(this.props.json);
|
|
34184
|
-
// Here we do magic to allow you to copy-paste
|
|
34185
|
-
// things from the previous section into the new
|
|
34186
|
-
// section while preserving widgets.
|
|
34187
|
-
// To enable this, we preserve the widgets
|
|
34188
|
-
// object for the new section, but wipe out
|
|
34189
|
-
// the content.
|
|
34190
|
-
const newStep = i >= 0 ? {
|
|
34191
|
-
widgets: steps[i].widgets
|
|
34192
|
-
} : {};
|
|
34193
|
-
steps.splice(i + 1, 0, newStep);
|
|
34194
|
-
this.props.onChange({
|
|
34195
|
-
json: steps
|
|
34196
|
-
});
|
|
34197
|
-
};
|
|
34198
|
-
this._handleRemoveStep = i => {
|
|
34199
|
-
const steps = _.clone(this.props.json);
|
|
34200
|
-
steps.splice(i, 1);
|
|
34201
|
-
this.props.onChange({
|
|
34202
|
-
json: steps
|
|
34203
|
-
});
|
|
34204
|
-
};
|
|
34205
|
-
}
|
|
34206
|
-
render() {
|
|
34207
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
34208
|
-
className: "perseus-sequence-editor"
|
|
34209
|
-
}, _.map(this.props.json, (json, i) => {
|
|
34210
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
34211
|
-
key: i
|
|
34212
|
-
}, "Step ", i + 1, /*#__PURE__*/React.createElement("div", {
|
|
34213
|
-
style: {
|
|
34214
|
-
display: "inline-block",
|
|
34215
|
-
float: "right"
|
|
34216
|
-
}
|
|
34217
|
-
}, i + 1 < this.props.json.length && /*#__PURE__*/React.createElement(StepControlButton, {
|
|
34218
|
-
icon: iconCircleArrowDown,
|
|
34219
|
-
onClick: () => {
|
|
34220
|
-
this._handleMoveStepLater(i);
|
|
34221
|
-
}
|
|
34222
|
-
}), i > 0 && /*#__PURE__*/React.createElement(StepControlButton, {
|
|
34223
|
-
icon: iconCircleArrowUp,
|
|
34224
|
-
onClick: () => {
|
|
34225
|
-
this._handleMoveStepEarlier(i);
|
|
34226
|
-
}
|
|
34227
|
-
}), /*#__PURE__*/React.createElement(StepControlButton, {
|
|
34228
|
-
icon: iconTrash,
|
|
34229
|
-
onClick: () => {
|
|
34230
|
-
const msg = "Are you sure you " + "want to remove step " + (i + 1) + "?";
|
|
34231
|
-
if (confirm(msg)) {
|
|
34232
|
-
this._handleRemoveStep(i);
|
|
34233
|
-
}
|
|
34234
|
-
}
|
|
34235
|
-
}), /*#__PURE__*/React.createElement(StepControlButton, {
|
|
34236
|
-
icon: iconPlus,
|
|
34237
|
-
onClick: () => {
|
|
34238
|
-
this._handleAddStepAfter(i);
|
|
34239
|
-
}
|
|
34240
|
-
})), /*#__PURE__*/React.createElement(Editor, {
|
|
34241
|
-
ref: "editor" + i,
|
|
34242
|
-
apiOptions: this.props.apiOptions,
|
|
34243
|
-
content: json.content,
|
|
34244
|
-
widgets: json.widgets,
|
|
34245
|
-
images: json.images,
|
|
34246
|
-
widgetEnabled: true,
|
|
34247
|
-
immutableWidgets: false,
|
|
34248
|
-
onChange: _.partial(this._handleEditorChange, i)
|
|
34249
|
-
}));
|
|
34250
|
-
}));
|
|
34251
|
-
}
|
|
34252
|
-
}
|
|
34253
|
-
SequenceEditor.propTypes = {
|
|
34254
|
-
json: PropTypes.arrayOf(PropTypes.shape({
|
|
34255
|
-
content: PropTypes.string,
|
|
34256
|
-
widgets: PropTypes.objectOf(PropTypes.any),
|
|
34257
|
-
images: PropTypes.objectOf(PropTypes.any)
|
|
34258
|
-
})),
|
|
34259
|
-
apiOptions: ApiOptions.propTypes,
|
|
34260
|
-
onChange: PropTypes.func.isRequired
|
|
34261
|
-
};
|
|
34262
|
-
SequenceEditor.widgetName = "sequence";
|
|
34263
|
-
SequenceEditor.defaultProps = {
|
|
34264
|
-
json: [{
|
|
34265
|
-
content: "",
|
|
34266
|
-
widgets: {},
|
|
34267
|
-
images: {}
|
|
34268
|
-
}]
|
|
34269
|
-
};
|
|
34270
|
-
|
|
34271
33824
|
class TextArea extends React.Component {
|
|
34272
33825
|
constructor(...args) {
|
|
34273
33826
|
super(...args);
|
|
@@ -34324,78 +33877,6 @@ SimpleMarkdownTesterEditor.defaultProps = {
|
|
|
34324
33877
|
value: ""
|
|
34325
33878
|
};
|
|
34326
33879
|
|
|
34327
|
-
const {
|
|
34328
|
-
InfoTip: InfoTip$3,
|
|
34329
|
-
NumberInput: NumberInput$2
|
|
34330
|
-
} = components;
|
|
34331
|
-
const maxTrials = 5000;
|
|
34332
|
-
class SimulatorEditor extends React.Component {
|
|
34333
|
-
constructor(..._args) {
|
|
34334
|
-
super(..._args);
|
|
34335
|
-
this.change = (...args) => {
|
|
34336
|
-
// @ts-expect-error - TS2345 - Argument of type 'readonly unknown[]' is not assignable to parameter of type 'any[]'.
|
|
34337
|
-
return Changeable.change.apply(this, args);
|
|
34338
|
-
};
|
|
34339
|
-
this.handleTargetValueChange = (propName, e) => {
|
|
34340
|
-
this.change(propName, e.target.value);
|
|
34341
|
-
};
|
|
34342
|
-
this.serialize = () => {
|
|
34343
|
-
return EditorJsonify.serialize.call(this);
|
|
34344
|
-
};
|
|
34345
|
-
}
|
|
34346
|
-
render() {
|
|
34347
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
34348
|
-
className: "perseus-widget-simulator"
|
|
34349
|
-
}, /*#__PURE__*/React.createElement("div", null, i18n$1._("X-Axis Label"), ":", /*#__PURE__*/React.createElement("input", {
|
|
34350
|
-
type: "text",
|
|
34351
|
-
className: "graph-settings-axis-label",
|
|
34352
|
-
value: this.props.xAxisLabel,
|
|
34353
|
-
onChange: _.partial(this.handleTargetValueChange, "xAxisLabel")
|
|
34354
|
-
})), /*#__PURE__*/React.createElement("div", null, i18n$1._("Y-Axis Label"), ":", /*#__PURE__*/React.createElement("input", {
|
|
34355
|
-
type: "text",
|
|
34356
|
-
className: "graph-settings-axis-label",
|
|
34357
|
-
value: this.props.yAxisLabel,
|
|
34358
|
-
onChange: _.partial(this.handleTargetValueChange, "yAxisLabel")
|
|
34359
|
-
})), /*#__PURE__*/React.createElement("div", null, i18n$1._('"True Proportion" Label'), ":", /*#__PURE__*/React.createElement("input", {
|
|
34360
|
-
type: "text",
|
|
34361
|
-
className: "graph-settings-axis-label",
|
|
34362
|
-
value: this.props.proportionLabel,
|
|
34363
|
-
onChange: _.partial(this.handleTargetValueChange, "proportionLabel")
|
|
34364
|
-
}), /*#__PURE__*/React.createElement(InfoTip$3, null, /*#__PURE__*/React.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.createElement("div", null, i18n$1._("Proportion or Percentage"), ":", /*#__PURE__*/React.createElement("select", {
|
|
34365
|
-
className: "perseus-widget-dropdown",
|
|
34366
|
-
value: this.props.proportionOrPercentage,
|
|
34367
|
-
onChange: _.partial(this.handleTargetValueChange, "proportionOrPercentage")
|
|
34368
|
-
}, /*#__PURE__*/React.createElement("option", {
|
|
34369
|
-
key: "proportion",
|
|
34370
|
-
value: "proportion"
|
|
34371
|
-
}, "Proportion"), /*#__PURE__*/React.createElement("option", {
|
|
34372
|
-
key: "percentage",
|
|
34373
|
-
value: "percentage"
|
|
34374
|
-
}, "Percentage")), /*#__PURE__*/React.createElement(InfoTip$3, null, /*#__PURE__*/React.createElement("p", null, "Do you want the user to describe their simulation in terms of a proportion or a percentage?"))), /*#__PURE__*/React.createElement("div", null, i18n$1._("Number of trials"), ":", /*#__PURE__*/React.createElement(NumberInput$2, {
|
|
34375
|
-
value: this.props.numTrials,
|
|
34376
|
-
checkValidity: val => {
|
|
34377
|
-
return val >= 0 && val <= maxTrials;
|
|
34378
|
-
},
|
|
34379
|
-
onChange: this.change("numTrials")
|
|
34380
|
-
}), /*#__PURE__*/React.createElement(InfoTip$3, null, /*#__PURE__*/React.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."))));
|
|
34381
|
-
}
|
|
34382
|
-
}
|
|
34383
|
-
SimulatorEditor.propTypes = _extends({}, Changeable.propTypes, {
|
|
34384
|
-
xAxisLabel: PropTypes.string,
|
|
34385
|
-
yAxisLabel: PropTypes.string,
|
|
34386
|
-
numTrials: PropTypes.number,
|
|
34387
|
-
proportionLabel: PropTypes.string,
|
|
34388
|
-
proportionOrPercentage: PropTypes.string
|
|
34389
|
-
});
|
|
34390
|
-
SimulatorEditor.widgetName = "simulator";
|
|
34391
|
-
SimulatorEditor.defaultProps = {
|
|
34392
|
-
xAxisLabel: "Proportion (%)",
|
|
34393
|
-
yAxisLabel: "Number of times seen",
|
|
34394
|
-
numTrials: 100,
|
|
34395
|
-
proportionLabel: "Underlying proportion",
|
|
34396
|
-
proportionOrPercentage: "proportion"
|
|
34397
|
-
};
|
|
34398
|
-
|
|
34399
33880
|
/* eslint-disable @khanacademy/ts-no-error-suppressions */
|
|
34400
33881
|
const {
|
|
34401
33882
|
InfoTip: InfoTip$2,
|
|
@@ -34851,7 +34332,7 @@ VideoEditor.defaultProps = {
|
|
|
34851
34332
|
location: ""
|
|
34852
34333
|
};
|
|
34853
34334
|
|
|
34854
|
-
var AllEditors = [CategorizerEditor, CSProgramEditor, DefinitionEditor, DropdownEditor, ExampleGraphieWidgetEditor, ExampleWidgetEditor, ExplanationEditor, ExpressionEditor, GradedGroupEditor, GradedGroupSetEditor, GrapherEditor, GroupEditor, IframeEditor, ImageEditor, InputNumberEditor, InteractionEditor, InteractiveGraphEditor, LabelImageEditor,
|
|
34335
|
+
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];
|
|
34855
34336
|
|
|
34856
34337
|
/* eslint-disable @khanacademy/ts-no-error-suppressions */
|
|
34857
34338
|
class TextInput extends React.Component {
|
|
@@ -35062,8 +34543,8 @@ var AllWidgets = [...widgets, ...testingWidgets];
|
|
|
35062
34543
|
|
|
35063
34544
|
Widgets.registerEditors(AllEditors);
|
|
35064
34545
|
Widgets.registerWidgets(AllWidgets);
|
|
35065
|
-
Widgets.
|
|
35066
|
-
Widgets.
|
|
34546
|
+
Widgets.replaceDeprecatedWidgets();
|
|
34547
|
+
Widgets.replaceDeprecatedEditors();
|
|
35067
34548
|
|
|
35068
34549
|
export { AllEditors, AllWidgets, ArticleDiff, ArticleEditor, DeviceFramer, Editor, EditorPage, IframeContentRenderer, ItemDiff, MultiRendererEditor, StatefulArticleEditor, StatefulEditorPage, StructuredItemDiff, ViewportResizer, i18n, libVersion };
|
|
35069
34550
|
//# sourceMappingURL=index.js.map
|