@pie-element/multiple-choice 9.17.1-next.7 → 9.18.1-next.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/CHANGELOG.md +19 -0
- package/configure/CHANGELOG.md +17 -0
- package/configure/package.json +2 -2
- package/controller/CHANGELOG.md +17 -0
- package/controller/package.json +2 -2
- package/lib/multiple-choice.js +11 -8
- package/lib/multiple-choice.js.map +1 -1
- package/module/configure.js +2 -2
- package/module/element.js +47 -27
- package/module/index.html +1 -1
- package/module/manifest.json +3 -3
- package/module/print.html +1 -1
- package/module/print.js +47 -27
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [9.18.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice@9.17.0...@pie-element/multiple-choice@9.18.0) (2025-07-18)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* update pie-lib/pie-toolbox PD-363 ([10ce402](https://github.com/pie-framework/pie-elements/commit/10ce402bcb1c0c9c24dfc9ecff2e13c4de14a753))
|
|
12
|
+
* **ebsr:** prevent focus override on shift+tab by checking tab direction into group PD-4562 ([eebe9a9](https://github.com/pie-framework/pie-elements/commit/eebe9a924fa509a04c0c2618411d42eb376345a5))
|
|
13
|
+
* **ebsr:** update heading levels for accessibility PD-5112 ([2c42145](https://github.com/pie-framework/pie-elements/commit/2c421458e3c987277127c59fa216a85bc335cf89))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* update pie-lib/pie toolbox PD-5082, PD-5081, PD-3797, PD-5083, revert PD-363, PD-653 ([9214466](https://github.com/pie-framework/pie-elements/commit/92144667464f18c213c7ab1d769595e43b553dab))
|
|
19
|
+
* update pie-lib/pie-toolbox PD-5082, PD-5081, PD-3797, PD-5083, PD-4885, PD-5097, PD-5100, PD-5131, PD-5080 ([dc67b1c](https://github.com/pie-framework/pie-elements/commit/dc67b1c735b2adb60943e5d145e739ce4e39a428))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
# [9.17.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice@9.16.4...@pie-element/multiple-choice@9.17.0) (2025-07-03)
|
|
7
26
|
|
|
8
27
|
|
package/configure/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,23 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [7.7.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-configure@7.6.10...@pie-element/multiple-choice-configure@7.7.0) (2025-07-18)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* update pie-lib/pie-toolbox PD-363 ([10ce402](https://github.com/pie-framework/pie-elements/commit/10ce402bcb1c0c9c24dfc9ecff2e13c4de14a753))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* update pie-lib/pie toolbox PD-5082, PD-5081, PD-3797, PD-5083, revert PD-363, PD-653 ([9214466](https://github.com/pie-framework/pie-elements/commit/92144667464f18c213c7ab1d769595e43b553dab))
|
|
17
|
+
* update pie-lib/pie-toolbox PD-5082, PD-5081, PD-3797, PD-5083, PD-4885, PD-5097, PD-5100, PD-5131, PD-5080 ([dc67b1c](https://github.com/pie-framework/pie-elements/commit/dc67b1c735b2adb60943e5d145e739ce4e39a428))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
6
23
|
## [7.6.10](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-configure@7.6.9...@pie-element/multiple-choice-configure@7.6.10) (2025-06-27)
|
|
7
24
|
|
|
8
25
|
|
package/configure/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/multiple-choice-configure",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.7.0",
|
|
4
4
|
"private": true,
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "src/index.js",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"@material-ui/core": "^3.9.2",
|
|
9
9
|
"@material-ui/icons": "^3.0.1",
|
|
10
10
|
"@pie-framework/pie-configure-events": "^1.3.0",
|
|
11
|
-
"@pie-lib/pie-toolbox": "2.
|
|
11
|
+
"@pie-lib/pie-toolbox": "2.22.0",
|
|
12
12
|
"debug": "^3.1.0",
|
|
13
13
|
"lodash": "^4.17.15",
|
|
14
14
|
"prop-types": "^15.6.2",
|
package/controller/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,23 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [5.10.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-controller@5.9.10...@pie-element/multiple-choice-controller@5.10.0) (2025-07-18)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* update pie-lib/pie-toolbox PD-363 ([10ce402](https://github.com/pie-framework/pie-elements/commit/10ce402bcb1c0c9c24dfc9ecff2e13c4de14a753))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* update pie-lib/pie toolbox PD-5082, PD-5081, PD-3797, PD-5083, revert PD-363, PD-653 ([9214466](https://github.com/pie-framework/pie-elements/commit/92144667464f18c213c7ab1d769595e43b553dab))
|
|
17
|
+
* update pie-lib/pie-toolbox PD-5082, PD-5081, PD-3797, PD-5083, PD-4885, PD-5097, PD-5100, PD-5131, PD-5080 ([dc67b1c](https://github.com/pie-framework/pie-elements/commit/dc67b1c735b2adb60943e5d145e739ce4e39a428))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
6
23
|
## [5.9.10](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-controller@5.9.9...@pie-element/multiple-choice-controller@5.9.10) (2025-06-27)
|
|
7
24
|
|
|
8
25
|
|
package/controller/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/multiple-choice-controller",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.10.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "src/index.js",
|
|
8
8
|
"author": "",
|
|
9
9
|
"license": "ISC",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@pie-lib/pie-toolbox": "2.
|
|
11
|
+
"@pie-lib/pie-toolbox": "2.22.0",
|
|
12
12
|
"debug": "^3.1.0",
|
|
13
13
|
"lodash": "^4.17.15"
|
|
14
14
|
}
|
package/lib/multiple-choice.js
CHANGED
|
@@ -175,17 +175,20 @@ var MultipleChoice = /*#__PURE__*/function (_React$Component) {
|
|
|
175
175
|
}
|
|
176
176
|
});
|
|
177
177
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleGroupFocus", function (e) {
|
|
178
|
-
var _this$firstInputRef;
|
|
179
|
-
|
|
180
178
|
var fieldset = e.currentTarget;
|
|
181
179
|
var activeEl = document.activeElement;
|
|
182
180
|
|
|
183
181
|
if (fieldset.contains(activeEl) && activeEl !== fieldset) {
|
|
184
182
|
return;
|
|
185
|
-
}
|
|
183
|
+
} // Only focus the first input if user is tabbing forward
|
|
184
|
+
|
|
186
185
|
|
|
187
|
-
if (
|
|
188
|
-
_this
|
|
186
|
+
if (!e.relatedTarget || fieldset.compareDocumentPosition(e.relatedTarget) & Node.DOCUMENT_POSITION_PRECEDING) {
|
|
187
|
+
var _this$firstInputRef;
|
|
188
|
+
|
|
189
|
+
if ((_this$firstInputRef = _this.firstInputRef) !== null && _this$firstInputRef !== void 0 && _this$firstInputRef.current) {
|
|
190
|
+
_this.firstInputRef.current.focus();
|
|
191
|
+
}
|
|
189
192
|
}
|
|
190
193
|
});
|
|
191
194
|
_this.state = {
|
|
@@ -264,9 +267,9 @@ var MultipleChoice = /*#__PURE__*/function (_React$Component) {
|
|
|
264
267
|
return null;
|
|
265
268
|
}
|
|
266
269
|
|
|
267
|
-
return choiceMode === 'radio' ? /*#__PURE__*/_react["default"].createElement("
|
|
270
|
+
return choiceMode === 'radio' ? /*#__PURE__*/_react["default"].createElement("h3", {
|
|
268
271
|
className: classes.srOnly
|
|
269
|
-
}, "Multiple Choice Question") : /*#__PURE__*/_react["default"].createElement("
|
|
272
|
+
}, "Multiple Choice Question") : /*#__PURE__*/_react["default"].createElement("h3", {
|
|
270
273
|
className: classes.srOnly
|
|
271
274
|
}, "Multiple Select Question");
|
|
272
275
|
}
|
|
@@ -340,7 +343,7 @@ var MultipleChoice = /*#__PURE__*/function (_React$Component) {
|
|
|
340
343
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
341
344
|
id: 'main-container',
|
|
342
345
|
className: (0, _classnames["default"])(classes.main, className, 'multiple-choice')
|
|
343
|
-
}, partLabel && /*#__PURE__*/_react["default"].createElement("
|
|
346
|
+
}, partLabel && /*#__PURE__*/_react["default"].createElement("h2", {
|
|
344
347
|
className: classes.partLabel
|
|
345
348
|
}, partLabel), this.renderHeading(), teacherInstructions && /*#__PURE__*/_react["default"].createElement("div", {
|
|
346
349
|
className: classes.teacherInstructions
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/multiple-choice.jsx"],"names":["translator","Translator","styles","theme","main","color","text","backgroundColor","background","position","border","partLabel","display","fontSize","margin","fontWeight","paddingBottom","spacing","unit","teacherInstructions","marginBottom","horizontalLayout","flexDirection","flexWrap","gridLayout","fieldset","padding","minWidth","srOnly","left","top","width","height","overflow","errorText","typography","palette","error","paddingTop","MultipleChoice","props","event","target","value","checked","maxSelections","onChoiceChanged","session","length","setState","maxSelectionsErrorState","selected","selector","mode","showCorrect","state","onShowCorrectToggle","choice","isCorrect","correct","isChecked","isSelected","undefined","e","currentTarget","activeEl","document","activeElement","contains","firstInputRef","current","focus","alwaysShowCorrect","onToggle","bind","React","createRef","sessionValue","indexOf","nextProps","correctResponse","index","keyMode","String","fromCharCode","toUpperCase","choiceMode","classes","disabled","className","choices","gridColumns","prompt","responseCorrect","animationsDisabled","language","isSelectionButtonBelow","minSelections","autoplayAudioEnabled","customAudioButton","isEvaluateMode","showCorrectAnswerToggle","columnsStyle","gridTemplateColumns","selections","teacherInstructionsDiv","getMultipleChoiceMinSelectionErrorMessage","t","lng","renderHeading","hidden","visible","handleGroupFocus","choicesLayout","map","selectedAnswerBackgroundColor","handleChange","hideTick","getChecked","getCorrectness","indexToSymbol","Component","PropTypes","string","oneOf","array","object","bool","func","isRequired","number","playImage","pauseImage","defaultProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;AAEA;AAEA,IAAQA,UAAR,GAAuBC,sBAAvB,CAAQD,UAAR;;AAEA,IAAME,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;AAAA,SAAY;AACzBC,IAAAA,IAAI,EAAE;AACJC,MAAAA,KAAK,EAAEA,gBAAMC,IAAN,EADH;AAEJC,MAAAA,eAAe,EAAEF,gBAAMG,UAAN,EAFb;AAGJ,aAAO;AACL,kCAA0B;AADrB,OAHH;AAMJC,MAAAA,QAAQ,EAAE,UANN;AAOJ;AACA,kBAAY;AACVC,QAAAA,MAAM,EAAE;AADE;AARR,KADmB;AAazBC,IAAAA,SAAS,E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jBZ;AAkBjBjC,EAAAA,kBAAkB,EAAE4B,sBAAUK,IAlBb;AAmBjBhC,EAAAA,QAAQ,EAAE2B,sBAAUC,MAnBH;AAoBjBR,EAAAA,6BAA6B,EAAEO,sBAAUC,MApBxB;AAqBjBnE,EAAAA,mBAAmB,EAAEkE,sBAAUM,IArBd;AAsBjBhC,EAAAA,sBAAsB,EAAE0B,sBAAUK,IAtBjB;AAuBjB9B,EAAAA,aAAa,EAAEyB,sBAAUQ,MAvBR;AAwBjBrF,EAAAA,aAAa,EAAE6E,sBAAUQ,MAxBR;AAyBjBhC,EAAAA,oBAAoB,EAAEwB,sBAAUK,IAzBf;AA0BjB5B,EAAAA,iBAAiB,EAAE;AACjBgC,IAAAA,SAAS,EAAET,sBAAUC,MADJ;AAEjBS,IAAAA,UAAU,EAAEV,sBAAUC;AAFL;AA1BF,C;AAmUrBpF,cAAc,CAAC8F,YAAf,GAA8B;AAC5BtF,EAAAA,OAAO,EAAE;AACPJ,IAAAA,KAAK,EAAE;AADA;AADmB,CAA9B;;eAMe,wBAAWzC,MAAX,EAAmBqC,cAAnB,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { CorrectAnswerToggle } from '@pie-lib/pie-toolbox/correct-answer-toggle';\nimport classNames from 'classnames';\nimport { withStyles } from '@material-ui/core/styles';\nimport { color, Collapsible, PreviewPrompt } from '@pie-lib/pie-toolbox/render-ui';\nimport Translator from '@pie-lib/pie-toolbox/translator';\n\nimport StyledChoice from './choice';\n\n// MultipleChoice\n\nconst { translator } = Translator;\n\nconst styles = (theme) => ({\n main: {\n color: color.text(),\n backgroundColor: color.background(),\n '& *': {\n '-webkit-font-smoothing': 'antialiased',\n },\n position: 'relative',\n // remove border from legend tags inside main to override the OT default styles\n '& legend': {\n border: 'none !important',\n },\n },\n partLabel: {\n display: 'block',\n fontSize: 'inherit',\n margin: '0',\n fontWeight: 'normal',\n paddingBottom: theme.spacing.unit * 2,\n },\n teacherInstructions: {\n marginBottom: theme.spacing.unit * 2,\n },\n horizontalLayout: {\n display: 'flex',\n flexDirection: 'row',\n flexWrap: 'wrap',\n },\n gridLayout: {\n display: 'grid',\n },\n fieldset: {\n border: '0px',\n padding: '0.01em 0 0 0',\n margin: '0px',\n minWidth: '0px',\n },\n srOnly: {\n position: 'absolute',\n left: '-10000px',\n top: 'auto',\n width: '1px',\n height: '1px',\n overflow: 'hidden',\n },\n errorText: {\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingTop: theme.spacing.unit,\n },\n});\n\nexport class MultipleChoice extends React.Component {\n static propTypes = {\n className: PropTypes.string,\n mode: PropTypes.oneOf(['gather', 'view', 'evaluate']),\n choiceMode: PropTypes.oneOf(['radio', 'checkbox']),\n keyMode: PropTypes.oneOf(['numbers', 'letters', 'none']),\n choices: PropTypes.array,\n partLabel: PropTypes.string,\n prompt: PropTypes.string,\n teacherInstructions: PropTypes.string,\n session: PropTypes.object,\n disabled: PropTypes.bool,\n onChoiceChanged: PropTypes.func,\n responseCorrect: PropTypes.bool,\n classes: PropTypes.object.isRequired,\n correctResponse: PropTypes.array,\n choicesLayout: PropTypes.oneOf(['vertical', 'grid', 'horizontal']),\n gridColumns: PropTypes.string,\n alwaysShowCorrect: PropTypes.bool,\n animationsDisabled: PropTypes.bool,\n language: PropTypes.string,\n selectedAnswerBackgroundColor: PropTypes.string,\n onShowCorrectToggle: PropTypes.func,\n isSelectionButtonBelow: PropTypes.bool,\n minSelections: PropTypes.number,\n maxSelections: PropTypes.number,\n autoplayAudioEnabled: PropTypes.bool,\n customAudioButton: {\n playImage: PropTypes.string,\n pauseImage: PropTypes.string,\n },\n };\n\n constructor(props) {\n super(props);\n\n this.state = {\n showCorrect: this.props.alwaysShowCorrect || false,\n maxSelectionsErrorState: false,\n };\n\n this.onToggle = this.onToggle.bind(this);\n this.firstInputRef = React.createRef();\n }\n\n isSelected(value) {\n const sessionValue = this.props.session && this.props.session.value;\n\n return sessionValue && sessionValue.indexOf && sessionValue.indexOf(value) >= 0;\n }\n\n // handleChange was added for accessibility. Please see comments and videos from PD-2441.\n handleChange = (event) => {\n const { value, checked } = event.target;\n const { maxSelections, onChoiceChanged, session } = this.props;\n\n if (session.value && session.value.length >= maxSelections) {\n // show/hide max selections error when user select/deselect an answer\n this.setState({ maxSelectionsErrorState: checked });\n\n if (checked) {\n // prevent selecting more answers\n return;\n }\n }\n\n onChoiceChanged({ value, selected: checked, selector: 'Mouse' });\n };\n\n onToggle = () => {\n if (this.props.mode === 'evaluate') {\n this.setState({ showCorrect: !this.state.showCorrect }, () => {\n if (this.props.onShowCorrectToggle) {\n this.props.onShowCorrectToggle();\n }\n });\n }\n };\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n if (!nextProps.correctResponse && this.state.showCorrect !== false) {\n this.setState({ showCorrect: false }, () => {\n if (this.props.onShowCorrectToggle) {\n this.props.onShowCorrectToggle();\n }\n });\n }\n\n if (nextProps.alwaysShowCorrect && this.state.showCorrect !== true) {\n this.setState({ showCorrect: true }, () => {\n if (this.props.onShowCorrectToggle) {\n this.props.onShowCorrectToggle();\n }\n });\n }\n }\n\n indexToSymbol(index) {\n if (this.props.keyMode === 'numbers') {\n return `${index + 1}`;\n }\n\n if (this.props.keyMode === 'letters') {\n return String.fromCharCode(97 + index).toUpperCase();\n }\n\n return '';\n }\n\n getCorrectness = (choice = {}) => {\n const isCorrect = choice.correct;\n const isChecked = this.isSelected(choice.value);\n\n if (this.state.showCorrect) {\n return isCorrect ? 'correct' : undefined;\n }\n\n if (isCorrect) {\n if (isChecked) {\n // A correct answer is selected: marked with a green checkmark\n return 'correct';\n } else {\n // A correct answer is NOT selected: marked with an orange X\n return 'incorrect';\n }\n } else {\n if (isChecked) {\n // An incorrect answer is selected: marked with an orange X\n return 'incorrect';\n } else {\n // An incorrect answer is NOT selected: not marked\n return undefined;\n }\n }\n };\n\n getChecked(choice) {\n if (this.state.showCorrect) {\n return choice.correct || false;\n }\n\n return this.isSelected(choice.value);\n }\n\n // renderHeading function was added for accessibility.\n renderHeading() {\n const { mode, choiceMode, classes } = this.props;\n\n if (mode !== 'gather') {\n return null;\n }\n\n return choiceMode === 'radio' ? (\n <h2 className={classes.srOnly}>Multiple Choice Question</h2>\n ) : (\n <h2 className={classes.srOnly}>Multiple Select Question</h2>\n );\n }\n\n handleGroupFocus = (e) => {\n const fieldset = e.currentTarget;\n const activeEl = document.activeElement;\n\n if (fieldset.contains(activeEl) && activeEl !== fieldset) {\n return;\n }\n\n if (this.firstInputRef?.current) {\n this.firstInputRef.current.focus();\n }\n };\n\n render() {\n const {\n mode,\n disabled,\n className,\n choices = [],\n choiceMode,\n gridColumns,\n partLabel,\n prompt,\n responseCorrect,\n teacherInstructions,\n classes,\n alwaysShowCorrect,\n animationsDisabled,\n language,\n isSelectionButtonBelow,\n minSelections,\n maxSelections,\n autoplayAudioEnabled,\n session,\n customAudioButton,\n } = this.props;\n const { showCorrect, maxSelectionsErrorState } = this.state;\n const isEvaluateMode = mode === 'evaluate';\n const showCorrectAnswerToggle = isEvaluateMode && !responseCorrect;\n const columnsStyle = gridColumns > 1 ? { gridTemplateColumns: `repeat(${gridColumns}, 1fr)` } : undefined;\n const selections = (session.value && session.value.length) || 0;\n\n const teacherInstructionsDiv = (\n <PreviewPrompt\n tagName=\"div\"\n className=\"prompt\"\n defaultClassName=\"teacher-instructions\"\n prompt={teacherInstructions}\n />\n );\n\n const getMultipleChoiceMinSelectionErrorMessage = () => {\n if (minSelections && maxSelections) {\n return minSelections === maxSelections\n ? translator.t('translation:multipleChoice:minmaxSelections_equal', { lng: language, minSelections })\n : translator.t('translation:multipleChoice:minmaxSelections_range', {\n lng: language,\n minSelections,\n maxSelections,\n });\n }\n\n if (minSelections) {\n return translator.t('translation:multipleChoice:minSelections', { lng: language, minSelections });\n }\n\n return '';\n };\n\n return (\n <div id={'main-container'} className={classNames(classes.main, className, 'multiple-choice')}>\n {partLabel && <h3 className={classes.partLabel}>{partLabel}</h3>}\n\n {this.renderHeading()}\n\n {teacherInstructions && (\n <div className={classes.teacherInstructions}>\n {!animationsDisabled ? (\n <Collapsible\n labels={{\n hidden: 'Show Teacher Instructions',\n visible: 'Hide Teacher Instructions',\n }}\n >\n {teacherInstructionsDiv}\n </Collapsible>\n ) : (\n teacherInstructionsDiv\n )}\n </div>\n )}\n\n <fieldset\n tabIndex={0}\n className={classes.fieldset}\n onFocus={this.handleGroupFocus}\n role={choiceMode === 'radio' ? 'radiogroup' : 'group'}\n >\n <PreviewPrompt\n className=\"prompt\"\n defaultClassName=\"prompt\"\n prompt={prompt}\n tagName={'legend'}\n autoplayAudioEnabled={autoplayAudioEnabled}\n customAudioButton={customAudioButton}\n />\n\n {!alwaysShowCorrect && (\n <CorrectAnswerToggle\n show={showCorrectAnswerToggle}\n toggled={showCorrect}\n onToggle={this.onToggle.bind(this)}\n language={language}\n />\n )}\n\n <div\n className={classNames({\n [classes.gridLayout]: this.props.choicesLayout === 'grid',\n [classes.horizontalLayout]: this.props.choicesLayout === 'horizontal',\n })}\n style={columnsStyle}\n >\n {choices.map((choice, index) => (\n <StyledChoice\n autoFocusRef={index === 0 ? this.firstInputRef : null}\n choicesLayout={this.props.choicesLayout}\n selectedAnswerBackgroundColor={this.props.selectedAnswerBackgroundColor}\n gridColumns={gridColumns}\n key={`choice-${index}`}\n choice={choice}\n index={index}\n choicesLength={choices.length}\n showCorrect={showCorrect}\n isEvaluateMode={isEvaluateMode}\n choiceMode={choiceMode}\n disabled={disabled}\n tagName={partLabel ? `group-${partLabel}` : 'group'}\n onChoiceChanged={this.handleChange}\n hideTick={choice.hideTick}\n checked={this.getChecked(choice)}\n correctness={isEvaluateMode ? this.getCorrectness(choice) : undefined}\n displayKey={this.indexToSymbol(index)}\n isSelectionButtonBelow={isSelectionButtonBelow}\n />\n ))}\n </div>\n </fieldset>\n\n {choiceMode === 'checkbox' && selections < minSelections && (\n <div className={classes.errorText}>{getMultipleChoiceMinSelectionErrorMessage()}</div>\n )}\n {choiceMode === 'checkbox' && maxSelectionsErrorState && (\n <div className={classes.errorText}>\n {translator.t(`translation:multipleChoice:maxSelections_${maxSelections === 1 ? 'one' : 'other'}`, {\n lng: language,\n maxSelections,\n })}\n </div>\n )}\n </div>\n );\n }\n}\n\nMultipleChoice.defaultProps = {\n session: {\n value: [],\n },\n};\n\nexport default withStyles(styles)(MultipleChoice);\n"],"file":"multiple-choice.js"}
|
|
1
|
+
{"version":3,"sources":["../src/multiple-choice.jsx"],"names":["translator","Translator","styles","theme","main","color","text","backgroundColor","background","position","border","partLabel","display","fontSize","margin","fontWeight","paddingBottom","spacing","unit","teacherInstructions","marginBottom","horizontalLayout","flexDirection","flexWrap","gridLayout","fieldset","padding","minWidth","srOnly","left","top","width","height","overflow","errorText","typography","palette","error","paddingTop","MultipleChoice","props","event","target","value","checked","maxSelections","onChoiceChanged","session","length","setState","maxSelectionsErrorState","selected","selector","mode","showCorrect","state","onShowCorrectToggle","choice","isCorrect","correct","isChecked","isSelected","undefined","e","currentTarget","activeEl","document","activeElement","contains","relatedTarget","compareDocumentPosition","Node","DOCUMENT_POSITION_PRECEDING","firstInputRef","current","focus","alwaysShowCorrect","onToggle","bind","React","createRef","sessionValue","indexOf","nextProps","correctResponse","index","keyMode","String","fromCharCode","toUpperCase","choiceMode","classes","disabled","className","choices","gridColumns","prompt","responseCorrect","animationsDisabled","language","isSelectionButtonBelow","minSelections","autoplayAudioEnabled","customAudioButton","isEvaluateMode","showCorrectAnswerToggle","columnsStyle","gridTemplateColumns","selections","teacherInstructionsDiv","getMultipleChoiceMinSelectionErrorMessage","t","lng","renderHeading","hidden","visible","handleGroupFocus","choicesLayout","map","selectedAnswerBackgroundColor","handleChange","hideTick","getChecked","getCorrectness","indexToSymbol","Component","PropTypes","string","oneOf","array","object","bool","func","isRequired","number","playImage","pauseImage","defaultProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;AAEA;AAEA,IAAQA,UAAR,GAAu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';\nimport { CorrectAnswerToggle } from '@pie-lib/pie-toolbox/correct-answer-toggle';\nimport classNames from 'classnames';\nimport { withStyles } from '@material-ui/core/styles';\nimport { color, Collapsible, PreviewPrompt } from '@pie-lib/pie-toolbox/render-ui';\nimport Translator from '@pie-lib/pie-toolbox/translator';\n\nimport StyledChoice from './choice';\n\n// MultipleChoice\n\nconst { translator } = Translator;\n\nconst styles = (theme) => ({\n main: {\n color: color.text(),\n backgroundColor: color.background(),\n '& *': {\n '-webkit-font-smoothing': 'antialiased',\n },\n position: 'relative',\n // remove border from legend tags inside main to override the OT default styles\n '& legend': {\n border: 'none !important',\n },\n },\n partLabel: {\n display: 'block',\n fontSize: 'inherit',\n margin: '0',\n fontWeight: 'normal',\n paddingBottom: theme.spacing.unit * 2,\n },\n teacherInstructions: {\n marginBottom: theme.spacing.unit * 2,\n },\n horizontalLayout: {\n display: 'flex',\n flexDirection: 'row',\n flexWrap: 'wrap',\n },\n gridLayout: {\n display: 'grid',\n },\n fieldset: {\n border: '0px',\n padding: '0.01em 0 0 0',\n margin: '0px',\n minWidth: '0px',\n },\n srOnly: {\n position: 'absolute',\n left: '-10000px',\n top: 'auto',\n width: '1px',\n height: '1px',\n overflow: 'hidden',\n },\n errorText: {\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingTop: theme.spacing.unit,\n },\n});\n\nexport class MultipleChoice extends React.Component {\n static propTypes = {\n className: PropTypes.string,\n mode: PropTypes.oneOf(['gather', 'view', 'evaluate']),\n choiceMode: PropTypes.oneOf(['radio', 'checkbox']),\n keyMode: PropTypes.oneOf(['numbers', 'letters', 'none']),\n choices: PropTypes.array,\n partLabel: PropTypes.string,\n prompt: PropTypes.string,\n teacherInstructions: PropTypes.string,\n session: PropTypes.object,\n disabled: PropTypes.bool,\n onChoiceChanged: PropTypes.func,\n responseCorrect: PropTypes.bool,\n classes: PropTypes.object.isRequired,\n correctResponse: PropTypes.array,\n choicesLayout: PropTypes.oneOf(['vertical', 'grid', 'horizontal']),\n gridColumns: PropTypes.string,\n alwaysShowCorrect: PropTypes.bool,\n animationsDisabled: PropTypes.bool,\n language: PropTypes.string,\n selectedAnswerBackgroundColor: PropTypes.string,\n onShowCorrectToggle: PropTypes.func,\n isSelectionButtonBelow: PropTypes.bool,\n minSelections: PropTypes.number,\n maxSelections: PropTypes.number,\n autoplayAudioEnabled: PropTypes.bool,\n customAudioButton: {\n playImage: PropTypes.string,\n pauseImage: PropTypes.string,\n },\n };\n\n constructor(props) {\n super(props);\n\n this.state = {\n showCorrect: this.props.alwaysShowCorrect || false,\n maxSelectionsErrorState: false,\n };\n\n this.onToggle = this.onToggle.bind(this);\n this.firstInputRef = React.createRef();\n }\n\n isSelected(value) {\n const sessionValue = this.props.session && this.props.session.value;\n\n return sessionValue && sessionValue.indexOf && sessionValue.indexOf(value) >= 0;\n }\n\n // handleChange was added for accessibility. Please see comments and videos from PD-2441.\n handleChange = (event) => {\n const { value, checked } = event.target;\n const { maxSelections, onChoiceChanged, session } = this.props;\n\n if (session.value && session.value.length >= maxSelections) {\n // show/hide max selections error when user select/deselect an answer\n this.setState({ maxSelectionsErrorState: checked });\n\n if (checked) {\n // prevent selecting more answers\n return;\n }\n }\n\n onChoiceChanged({ value, selected: checked, selector: 'Mouse' });\n };\n\n onToggle = () => {\n if (this.props.mode === 'evaluate') {\n this.setState({ showCorrect: !this.state.showCorrect }, () => {\n if (this.props.onShowCorrectToggle) {\n this.props.onShowCorrectToggle();\n }\n });\n }\n };\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n if (!nextProps.correctResponse && this.state.showCorrect !== false) {\n this.setState({ showCorrect: false }, () => {\n if (this.props.onShowCorrectToggle) {\n this.props.onShowCorrectToggle();\n }\n });\n }\n\n if (nextProps.alwaysShowCorrect && this.state.showCorrect !== true) {\n this.setState({ showCorrect: true }, () => {\n if (this.props.onShowCorrectToggle) {\n this.props.onShowCorrectToggle();\n }\n });\n }\n }\n\n indexToSymbol(index) {\n if (this.props.keyMode === 'numbers') {\n return `${index + 1}`;\n }\n\n if (this.props.keyMode === 'letters') {\n return String.fromCharCode(97 + index).toUpperCase();\n }\n\n return '';\n }\n\n getCorrectness = (choice = {}) => {\n const isCorrect = choice.correct;\n const isChecked = this.isSelected(choice.value);\n\n if (this.state.showCorrect) {\n return isCorrect ? 'correct' : undefined;\n }\n\n if (isCorrect) {\n if (isChecked) {\n // A correct answer is selected: marked with a green checkmark\n return 'correct';\n } else {\n // A correct answer is NOT selected: marked with an orange X\n return 'incorrect';\n }\n } else {\n if (isChecked) {\n // An incorrect answer is selected: marked with an orange X\n return 'incorrect';\n } else {\n // An incorrect answer is NOT selected: not marked\n return undefined;\n }\n }\n };\n\n getChecked(choice) {\n if (this.state.showCorrect) {\n return choice.correct || false;\n }\n\n return this.isSelected(choice.value);\n }\n\n // renderHeading function was added for accessibility.\n renderHeading() {\n const { mode, choiceMode, classes } = this.props;\n\n if (mode !== 'gather') {\n return null;\n }\n\n return choiceMode === 'radio' ? (\n <h3 className={classes.srOnly}>Multiple Choice Question</h3>\n ) : (\n <h3 className={classes.srOnly}>Multiple Select Question</h3>\n );\n }\n\n handleGroupFocus = (e) => {\n const fieldset = e.currentTarget;\n const activeEl = document.activeElement;\n\n if (fieldset.contains(activeEl) && activeEl !== fieldset) {\n return;\n }\n\n // Only focus the first input if user is tabbing forward\n if (!e.relatedTarget || fieldset.compareDocumentPosition(e.relatedTarget) & Node.DOCUMENT_POSITION_PRECEDING) {\n if (this.firstInputRef?.current) {\n this.firstInputRef.current.focus();\n }\n }\n };\n\n render() {\n const {\n mode,\n disabled,\n className,\n choices = [],\n choiceMode,\n gridColumns,\n partLabel,\n prompt,\n responseCorrect,\n teacherInstructions,\n classes,\n alwaysShowCorrect,\n animationsDisabled,\n language,\n isSelectionButtonBelow,\n minSelections,\n maxSelections,\n autoplayAudioEnabled,\n session,\n customAudioButton,\n } = this.props;\n const { showCorrect, maxSelectionsErrorState } = this.state;\n const isEvaluateMode = mode === 'evaluate';\n const showCorrectAnswerToggle = isEvaluateMode && !responseCorrect;\n const columnsStyle = gridColumns > 1 ? { gridTemplateColumns: `repeat(${gridColumns}, 1fr)` } : undefined;\n const selections = (session.value && session.value.length) || 0;\n\n const teacherInstructionsDiv = (\n <PreviewPrompt\n tagName=\"div\"\n className=\"prompt\"\n defaultClassName=\"teacher-instructions\"\n prompt={teacherInstructions}\n />\n );\n\n const getMultipleChoiceMinSelectionErrorMessage = () => {\n if (minSelections && maxSelections) {\n return minSelections === maxSelections\n ? translator.t('translation:multipleChoice:minmaxSelections_equal', { lng: language, minSelections })\n : translator.t('translation:multipleChoice:minmaxSelections_range', {\n lng: language,\n minSelections,\n maxSelections,\n });\n }\n\n if (minSelections) {\n return translator.t('translation:multipleChoice:minSelections', { lng: language, minSelections });\n }\n\n return '';\n };\n\n return (\n <div id={'main-container'} className={classNames(classes.main, className, 'multiple-choice')}>\n {partLabel && <h2 className={classes.partLabel}>{partLabel}</h2>}\n\n {this.renderHeading()}\n\n {teacherInstructions && (\n <div className={classes.teacherInstructions}>\n {!animationsDisabled ? (\n <Collapsible\n labels={{\n hidden: 'Show Teacher Instructions',\n visible: 'Hide Teacher Instructions',\n }}\n >\n {teacherInstructionsDiv}\n </Collapsible>\n ) : (\n teacherInstructionsDiv\n )}\n </div>\n )}\n\n <fieldset\n tabIndex={0}\n className={classes.fieldset}\n onFocus={this.handleGroupFocus}\n role={choiceMode === 'radio' ? 'radiogroup' : 'group'}\n >\n <PreviewPrompt\n className=\"prompt\"\n defaultClassName=\"prompt\"\n prompt={prompt}\n tagName={'legend'}\n autoplayAudioEnabled={autoplayAudioEnabled}\n customAudioButton={customAudioButton}\n />\n\n {!alwaysShowCorrect && (\n <CorrectAnswerToggle\n show={showCorrectAnswerToggle}\n toggled={showCorrect}\n onToggle={this.onToggle.bind(this)}\n language={language}\n />\n )}\n\n <div\n className={classNames({\n [classes.gridLayout]: this.props.choicesLayout === 'grid',\n [classes.horizontalLayout]: this.props.choicesLayout === 'horizontal',\n })}\n style={columnsStyle}\n >\n {choices.map((choice, index) => (\n <StyledChoice\n autoFocusRef={index === 0 ? this.firstInputRef : null}\n choicesLayout={this.props.choicesLayout}\n selectedAnswerBackgroundColor={this.props.selectedAnswerBackgroundColor}\n gridColumns={gridColumns}\n key={`choice-${index}`}\n choice={choice}\n index={index}\n choicesLength={choices.length}\n showCorrect={showCorrect}\n isEvaluateMode={isEvaluateMode}\n choiceMode={choiceMode}\n disabled={disabled}\n tagName={partLabel ? `group-${partLabel}` : 'group'}\n onChoiceChanged={this.handleChange}\n hideTick={choice.hideTick}\n checked={this.getChecked(choice)}\n correctness={isEvaluateMode ? this.getCorrectness(choice) : undefined}\n displayKey={this.indexToSymbol(index)}\n isSelectionButtonBelow={isSelectionButtonBelow}\n />\n ))}\n </div>\n </fieldset>\n\n {choiceMode === 'checkbox' && selections < minSelections && (\n <div className={classes.errorText}>{getMultipleChoiceMinSelectionErrorMessage()}</div>\n )}\n {choiceMode === 'checkbox' && maxSelectionsErrorState && (\n <div className={classes.errorText}>\n {translator.t(`translation:multipleChoice:maxSelections_${maxSelections === 1 ? 'one' : 'other'}`, {\n lng: language,\n maxSelections,\n })}\n </div>\n )}\n </div>\n );\n }\n}\n\nMultipleChoice.defaultProps = {\n session: {\n value: [],\n },\n};\n\nexport default withStyles(styles)(MultipleChoice);\n"],"file":"multiple-choice.js"}
|
package/module/configure.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {_dll_react, _dll_prop_types, _dll_react_dom, _dll_classnames, _dll_lodash, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@5.
|
|
2
|
-
import {_dll_pie_lib__pie_toolbox_editable_html, _dll_pie_lib__pie_toolbox_config_ui, _dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@8.
|
|
1
|
+
import {_dll_react, _dll_prop_types, _dll_react_dom, _dll_classnames, _dll_lodash, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@5.3.0/module/index.js";
|
|
2
|
+
import {_dll_pie_lib__pie_toolbox_editable_html, _dll_pie_lib__pie_toolbox_config_ui, _dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@8.3.0/module/index.js";
|
|
3
3
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
4
4
|
function getDefaultExportFromCjs(x) {
|
|
5
5
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
package/module/element.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_debug, _dll_pie_lib__pie_toolbox_math_rendering} from "../../../@pie-lib/pie-toolbox-math-rendering-module@5.
|
|
2
|
-
import {_dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_correct_answer_toggle} from "../../../@pie-lib/pie-toolbox-module@8.
|
|
1
|
+
import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_debug, _dll_pie_lib__pie_toolbox_math_rendering} from "../../../@pie-lib/pie-toolbox-math-rendering-module@5.3.0/module/index.js";
|
|
2
|
+
import {_dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_correct_answer_toggle} from "../../../@pie-lib/pie-toolbox-module@8.3.0/module/index.js";
|
|
3
3
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
4
4
|
function getDefaultExportFromCjs(x) {
|
|
5
5
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
@@ -8434,8 +8434,16 @@ var en = {};
|
|
|
8434
8434
|
},
|
|
8435
8435
|
charting: {
|
|
8436
8436
|
addCategory: 'Add category',
|
|
8437
|
+
actions: 'Actions',
|
|
8438
|
+
add: 'Add',
|
|
8439
|
+
"delete": 'Delete',
|
|
8437
8440
|
newLabel: 'New label',
|
|
8438
|
-
reachedLimit_other: "There can't be more than {{count}} categories."
|
|
8441
|
+
reachedLimit_other: "There can't be more than {{count}} categories.",
|
|
8442
|
+
keyLegend: {
|
|
8443
|
+
incorrectAnswer: 'Student incorrect answer',
|
|
8444
|
+
correctAnswer: 'Student correct answer',
|
|
8445
|
+
correctKeyAnswer: 'Answer key correct'
|
|
8446
|
+
}
|
|
8439
8447
|
},
|
|
8440
8448
|
graphing: {
|
|
8441
8449
|
point: 'Point',
|
|
@@ -8464,9 +8472,10 @@ var en = {};
|
|
|
8464
8472
|
minmaxSelections_range: 'Select between {{minSelections}} and {{maxSelections}}.'
|
|
8465
8473
|
},
|
|
8466
8474
|
selectText: {
|
|
8467
|
-
correctAnswerSelected: 'Correct
|
|
8468
|
-
correctAnswerNotSelected: 'Correct
|
|
8469
|
-
incorrectSelection: 'Incorrect
|
|
8475
|
+
correctAnswerSelected: 'Correct',
|
|
8476
|
+
correctAnswerNotSelected: 'Correct Answer Not Selected',
|
|
8477
|
+
incorrectSelection: 'Incorrect Selection',
|
|
8478
|
+
key: 'Key'
|
|
8470
8479
|
}
|
|
8471
8480
|
},
|
|
8472
8481
|
common: {
|
|
@@ -8528,8 +8537,16 @@ var es = {};
|
|
|
8528
8537
|
},
|
|
8529
8538
|
charting: {
|
|
8530
8539
|
addCategory: 'Añadir categoría',
|
|
8540
|
+
actions: 'Acciones',
|
|
8541
|
+
add: 'Añadir',
|
|
8542
|
+
"delete": 'Eliminar',
|
|
8531
8543
|
newLabel: 'Nueva etiqueta',
|
|
8532
|
-
reachedLimit_other: 'No puede haber más de {{count}} categorías.'
|
|
8544
|
+
reachedLimit_other: 'No puede haber más de {{count}} categorías.',
|
|
8545
|
+
keyLegend: {
|
|
8546
|
+
incorrectAnswer: 'Respuesta incorrecta del estudiante',
|
|
8547
|
+
correctAnswer: 'Respuesta correcta del estudiante',
|
|
8548
|
+
correctKeyAnswer: 'Clave de respuesta correcta'
|
|
8549
|
+
}
|
|
8533
8550
|
},
|
|
8534
8551
|
graphing: {
|
|
8535
8552
|
point: 'Punto',
|
|
@@ -8558,9 +8575,10 @@ var es = {};
|
|
|
8558
8575
|
minmaxSelections_range: 'Seleccione entre {{minSelections}} y {{maxSelections}}.'
|
|
8559
8576
|
},
|
|
8560
8577
|
selectText: {
|
|
8561
|
-
correctAnswerSelected: 'Respuesta
|
|
8562
|
-
correctAnswerNotSelected: 'Respuesta
|
|
8563
|
-
incorrectSelection: 'Selección
|
|
8578
|
+
correctAnswerSelected: 'Respuesta Correcta',
|
|
8579
|
+
correctAnswerNotSelected: 'Respuesta Correcta No Seleccionada',
|
|
8580
|
+
incorrectSelection: 'Selección Incorrecta',
|
|
8581
|
+
key: 'Clave'
|
|
8564
8582
|
}
|
|
8565
8583
|
},
|
|
8566
8584
|
common: {
|
|
@@ -12848,14 +12866,14 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12848
12866
|
if (mode !== 'gather') {
|
|
12849
12867
|
return null;
|
|
12850
12868
|
}
|
|
12851
|
-
return choiceMode === 'radio' ? React$2.createElement('
|
|
12869
|
+
return choiceMode === 'radio' ? React$2.createElement('h3', {
|
|
12852
12870
|
className: classes.srOnly,
|
|
12853
12871
|
__self: this,
|
|
12854
12872
|
__source: {
|
|
12855
12873
|
fileName: _jsxFileName$1,
|
|
12856
12874
|
lineNumber: 220
|
|
12857
12875
|
}
|
|
12858
|
-
}, "Multiple Choice Question") : React$2.createElement('
|
|
12876
|
+
}, "Multiple Choice Question") : React$2.createElement('h3', {
|
|
12859
12877
|
className: classes.srOnly,
|
|
12860
12878
|
__self: this,
|
|
12861
12879
|
__source: {
|
|
@@ -12871,8 +12889,10 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12871
12889
|
if (fieldset.contains(activeEl) && activeEl !== fieldset) {
|
|
12872
12890
|
return;
|
|
12873
12891
|
}
|
|
12874
|
-
if (
|
|
12875
|
-
this.firstInputRef.current
|
|
12892
|
+
if (!e.relatedTarget || fieldset.compareDocumentPosition(e.relatedTarget) & Node.DOCUMENT_POSITION_PRECEDING) {
|
|
12893
|
+
if (_optionalChain$1([this, 'access', _3 => _3.firstInputRef, 'optionalAccess', _4 => _4.current])) {
|
|
12894
|
+
this.firstInputRef.current.focus();
|
|
12895
|
+
}
|
|
12876
12896
|
}
|
|
12877
12897
|
};
|
|
12878
12898
|
}
|
|
@@ -12893,7 +12913,7 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12893
12913
|
__self: this,
|
|
12894
12914
|
__source: {
|
|
12895
12915
|
fileName: _jsxFileName$1,
|
|
12896
|
-
lineNumber:
|
|
12916
|
+
lineNumber: 272
|
|
12897
12917
|
}
|
|
12898
12918
|
});
|
|
12899
12919
|
const getMultipleChoiceMinSelectionErrorMessage = () => {
|
|
@@ -12921,21 +12941,21 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12921
12941
|
__self: this,
|
|
12922
12942
|
__source: {
|
|
12923
12943
|
fileName: _jsxFileName$1,
|
|
12924
|
-
lineNumber:
|
|
12944
|
+
lineNumber: 299
|
|
12925
12945
|
}
|
|
12926
|
-
}, partLabel && React$2.createElement('
|
|
12946
|
+
}, partLabel && React$2.createElement('h2', {
|
|
12927
12947
|
className: classes.partLabel,
|
|
12928
12948
|
__self: this,
|
|
12929
12949
|
__source: {
|
|
12930
12950
|
fileName: _jsxFileName$1,
|
|
12931
|
-
lineNumber:
|
|
12951
|
+
lineNumber: 300
|
|
12932
12952
|
}
|
|
12933
12953
|
}, partLabel), this.renderHeading(), teacherInstructions && React$2.createElement('div', {
|
|
12934
12954
|
className: classes.teacherInstructions,
|
|
12935
12955
|
__self: this,
|
|
12936
12956
|
__source: {
|
|
12937
12957
|
fileName: _jsxFileName$1,
|
|
12938
|
-
lineNumber:
|
|
12958
|
+
lineNumber: 305
|
|
12939
12959
|
}
|
|
12940
12960
|
}, !animationsDisabled ? React$2.createElement(Collapsible, {
|
|
12941
12961
|
labels: {
|
|
@@ -12945,7 +12965,7 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12945
12965
|
__self: this,
|
|
12946
12966
|
__source: {
|
|
12947
12967
|
fileName: _jsxFileName$1,
|
|
12948
|
-
lineNumber:
|
|
12968
|
+
lineNumber: 307
|
|
12949
12969
|
}
|
|
12950
12970
|
}, teacherInstructionsDiv) : teacherInstructionsDiv), React$2.createElement('fieldset', {
|
|
12951
12971
|
tabIndex: 0,
|
|
@@ -12955,7 +12975,7 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12955
12975
|
__self: this,
|
|
12956
12976
|
__source: {
|
|
12957
12977
|
fileName: _jsxFileName$1,
|
|
12958
|
-
lineNumber:
|
|
12978
|
+
lineNumber: 321
|
|
12959
12979
|
}
|
|
12960
12980
|
}, React$2.createElement(PreviewPrompt, {
|
|
12961
12981
|
className: "prompt",
|
|
@@ -12967,7 +12987,7 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12967
12987
|
__self: this,
|
|
12968
12988
|
__source: {
|
|
12969
12989
|
fileName: _jsxFileName$1,
|
|
12970
|
-
lineNumber:
|
|
12990
|
+
lineNumber: 327
|
|
12971
12991
|
}
|
|
12972
12992
|
}), !alwaysShowCorrect && React$2.createElement(CorrectAnswerToggle, {
|
|
12973
12993
|
show: showCorrectAnswerToggle,
|
|
@@ -12977,7 +12997,7 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12977
12997
|
__self: this,
|
|
12978
12998
|
__source: {
|
|
12979
12999
|
fileName: _jsxFileName$1,
|
|
12980
|
-
lineNumber:
|
|
13000
|
+
lineNumber: 337
|
|
12981
13001
|
}
|
|
12982
13002
|
}), React$2.createElement('div', {
|
|
12983
13003
|
className: classNames({
|
|
@@ -12988,7 +13008,7 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12988
13008
|
__self: this,
|
|
12989
13009
|
__source: {
|
|
12990
13010
|
fileName: _jsxFileName$1,
|
|
12991
|
-
lineNumber:
|
|
13011
|
+
lineNumber: 345
|
|
12992
13012
|
}
|
|
12993
13013
|
}, choices.map((choice, index) => React$2.createElement(StyledChoice, {
|
|
12994
13014
|
autoFocusRef: index === 0 ? this.firstInputRef : null,
|
|
@@ -13013,21 +13033,21 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
13013
13033
|
__self: this,
|
|
13014
13034
|
__source: {
|
|
13015
13035
|
fileName: _jsxFileName$1,
|
|
13016
|
-
lineNumber:
|
|
13036
|
+
lineNumber: 353
|
|
13017
13037
|
}
|
|
13018
13038
|
})))), choiceMode === 'checkbox' && selections < minSelections && React$2.createElement('div', {
|
|
13019
13039
|
className: classes.errorText,
|
|
13020
13040
|
__self: this,
|
|
13021
13041
|
__source: {
|
|
13022
13042
|
fileName: _jsxFileName$1,
|
|
13023
|
-
lineNumber:
|
|
13043
|
+
lineNumber: 379
|
|
13024
13044
|
}
|
|
13025
13045
|
}, getMultipleChoiceMinSelectionErrorMessage()), choiceMode === 'checkbox' && maxSelectionsErrorState && React$2.createElement('div', {
|
|
13026
13046
|
className: classes.errorText,
|
|
13027
13047
|
__self: this,
|
|
13028
13048
|
__source: {
|
|
13029
13049
|
fileName: _jsxFileName$1,
|
|
13030
|
-
lineNumber:
|
|
13050
|
+
lineNumber: 382
|
|
13031
13051
|
}
|
|
13032
13052
|
}, translator.t(`translation:multipleChoice:maxSelections_${maxSelections === 1 ? 'one' : 'other'}`, {
|
|
13033
13053
|
lng: language,
|
package/module/index.html
CHANGED
package/module/manifest.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/multiple-choice",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.18.0",
|
|
4
4
|
"modules": [
|
|
5
5
|
{
|
|
6
6
|
"name": "@pie-lib/pie-toolbox-math-rendering-module",
|
|
7
|
-
"version": "5.
|
|
7
|
+
"version": "5.3.0"
|
|
8
8
|
},
|
|
9
9
|
{
|
|
10
10
|
"name": "@pie-lib/pie-toolbox-module",
|
|
11
|
-
"version": "8.
|
|
11
|
+
"version": "8.3.0"
|
|
12
12
|
}
|
|
13
13
|
]
|
|
14
14
|
}
|
package/module/print.html
CHANGED
package/module/print.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_pie_lib__pie_toolbox_math_rendering, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@5.
|
|
2
|
-
import {_dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_correct_answer_toggle} from "../../../@pie-lib/pie-toolbox-module@8.
|
|
1
|
+
import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_pie_lib__pie_toolbox_math_rendering, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@5.3.0/module/index.js";
|
|
2
|
+
import {_dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_correct_answer_toggle} from "../../../@pie-lib/pie-toolbox-module@8.3.0/module/index.js";
|
|
3
3
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
4
4
|
function getDefaultExportFromCjs(x) {
|
|
5
5
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
@@ -8434,8 +8434,16 @@ var en = {};
|
|
|
8434
8434
|
},
|
|
8435
8435
|
charting: {
|
|
8436
8436
|
addCategory: 'Add category',
|
|
8437
|
+
actions: 'Actions',
|
|
8438
|
+
add: 'Add',
|
|
8439
|
+
"delete": 'Delete',
|
|
8437
8440
|
newLabel: 'New label',
|
|
8438
|
-
reachedLimit_other: "There can't be more than {{count}} categories."
|
|
8441
|
+
reachedLimit_other: "There can't be more than {{count}} categories.",
|
|
8442
|
+
keyLegend: {
|
|
8443
|
+
incorrectAnswer: 'Student incorrect answer',
|
|
8444
|
+
correctAnswer: 'Student correct answer',
|
|
8445
|
+
correctKeyAnswer: 'Answer key correct'
|
|
8446
|
+
}
|
|
8439
8447
|
},
|
|
8440
8448
|
graphing: {
|
|
8441
8449
|
point: 'Point',
|
|
@@ -8464,9 +8472,10 @@ var en = {};
|
|
|
8464
8472
|
minmaxSelections_range: 'Select between {{minSelections}} and {{maxSelections}}.'
|
|
8465
8473
|
},
|
|
8466
8474
|
selectText: {
|
|
8467
|
-
correctAnswerSelected: 'Correct
|
|
8468
|
-
correctAnswerNotSelected: 'Correct
|
|
8469
|
-
incorrectSelection: 'Incorrect
|
|
8475
|
+
correctAnswerSelected: 'Correct',
|
|
8476
|
+
correctAnswerNotSelected: 'Correct Answer Not Selected',
|
|
8477
|
+
incorrectSelection: 'Incorrect Selection',
|
|
8478
|
+
key: 'Key'
|
|
8470
8479
|
}
|
|
8471
8480
|
},
|
|
8472
8481
|
common: {
|
|
@@ -8528,8 +8537,16 @@ var es = {};
|
|
|
8528
8537
|
},
|
|
8529
8538
|
charting: {
|
|
8530
8539
|
addCategory: 'Añadir categoría',
|
|
8540
|
+
actions: 'Acciones',
|
|
8541
|
+
add: 'Añadir',
|
|
8542
|
+
"delete": 'Eliminar',
|
|
8531
8543
|
newLabel: 'Nueva etiqueta',
|
|
8532
|
-
reachedLimit_other: 'No puede haber más de {{count}} categorías.'
|
|
8544
|
+
reachedLimit_other: 'No puede haber más de {{count}} categorías.',
|
|
8545
|
+
keyLegend: {
|
|
8546
|
+
incorrectAnswer: 'Respuesta incorrecta del estudiante',
|
|
8547
|
+
correctAnswer: 'Respuesta correcta del estudiante',
|
|
8548
|
+
correctKeyAnswer: 'Clave de respuesta correcta'
|
|
8549
|
+
}
|
|
8533
8550
|
},
|
|
8534
8551
|
graphing: {
|
|
8535
8552
|
point: 'Punto',
|
|
@@ -8558,9 +8575,10 @@ var es = {};
|
|
|
8558
8575
|
minmaxSelections_range: 'Seleccione entre {{minSelections}} y {{maxSelections}}.'
|
|
8559
8576
|
},
|
|
8560
8577
|
selectText: {
|
|
8561
|
-
correctAnswerSelected: 'Respuesta
|
|
8562
|
-
correctAnswerNotSelected: 'Respuesta
|
|
8563
|
-
incorrectSelection: 'Selección
|
|
8578
|
+
correctAnswerSelected: 'Respuesta Correcta',
|
|
8579
|
+
correctAnswerNotSelected: 'Respuesta Correcta No Seleccionada',
|
|
8580
|
+
incorrectSelection: 'Selección Incorrecta',
|
|
8581
|
+
key: 'Clave'
|
|
8564
8582
|
}
|
|
8565
8583
|
},
|
|
8566
8584
|
common: {
|
|
@@ -12848,14 +12866,14 @@ class MultipleChoice extends React$2.Component {
|
|
|
12848
12866
|
if (mode !== 'gather') {
|
|
12849
12867
|
return null;
|
|
12850
12868
|
}
|
|
12851
|
-
return choiceMode === 'radio' ? React$2.createElement('
|
|
12869
|
+
return choiceMode === 'radio' ? React$2.createElement('h3', {
|
|
12852
12870
|
className: classes.srOnly,
|
|
12853
12871
|
__self: this,
|
|
12854
12872
|
__source: {
|
|
12855
12873
|
fileName: _jsxFileName$1,
|
|
12856
12874
|
lineNumber: 220
|
|
12857
12875
|
}
|
|
12858
|
-
}, "Multiple Choice Question") : React$2.createElement('
|
|
12876
|
+
}, "Multiple Choice Question") : React$2.createElement('h3', {
|
|
12859
12877
|
className: classes.srOnly,
|
|
12860
12878
|
__self: this,
|
|
12861
12879
|
__source: {
|
|
@@ -12871,8 +12889,10 @@ class MultipleChoice extends React$2.Component {
|
|
|
12871
12889
|
if (fieldset.contains(activeEl) && activeEl !== fieldset) {
|
|
12872
12890
|
return;
|
|
12873
12891
|
}
|
|
12874
|
-
if (
|
|
12875
|
-
this.firstInputRef.current
|
|
12892
|
+
if (!e.relatedTarget || fieldset.compareDocumentPosition(e.relatedTarget) & Node.DOCUMENT_POSITION_PRECEDING) {
|
|
12893
|
+
if (_optionalChain([this, 'access', _3 => _3.firstInputRef, 'optionalAccess', _4 => _4.current])) {
|
|
12894
|
+
this.firstInputRef.current.focus();
|
|
12895
|
+
}
|
|
12876
12896
|
}
|
|
12877
12897
|
};
|
|
12878
12898
|
}
|
|
@@ -12893,7 +12913,7 @@ class MultipleChoice extends React$2.Component {
|
|
|
12893
12913
|
__self: this,
|
|
12894
12914
|
__source: {
|
|
12895
12915
|
fileName: _jsxFileName$1,
|
|
12896
|
-
lineNumber:
|
|
12916
|
+
lineNumber: 272
|
|
12897
12917
|
}
|
|
12898
12918
|
});
|
|
12899
12919
|
const getMultipleChoiceMinSelectionErrorMessage = () => {
|
|
@@ -12921,21 +12941,21 @@ class MultipleChoice extends React$2.Component {
|
|
|
12921
12941
|
__self: this,
|
|
12922
12942
|
__source: {
|
|
12923
12943
|
fileName: _jsxFileName$1,
|
|
12924
|
-
lineNumber:
|
|
12944
|
+
lineNumber: 299
|
|
12925
12945
|
}
|
|
12926
|
-
}, partLabel && React$2.createElement('
|
|
12946
|
+
}, partLabel && React$2.createElement('h2', {
|
|
12927
12947
|
className: classes.partLabel,
|
|
12928
12948
|
__self: this,
|
|
12929
12949
|
__source: {
|
|
12930
12950
|
fileName: _jsxFileName$1,
|
|
12931
|
-
lineNumber:
|
|
12951
|
+
lineNumber: 300
|
|
12932
12952
|
}
|
|
12933
12953
|
}, partLabel), this.renderHeading(), teacherInstructions && React$2.createElement('div', {
|
|
12934
12954
|
className: classes.teacherInstructions,
|
|
12935
12955
|
__self: this,
|
|
12936
12956
|
__source: {
|
|
12937
12957
|
fileName: _jsxFileName$1,
|
|
12938
|
-
lineNumber:
|
|
12958
|
+
lineNumber: 305
|
|
12939
12959
|
}
|
|
12940
12960
|
}, !animationsDisabled ? React$2.createElement(Collapsible, {
|
|
12941
12961
|
labels: {
|
|
@@ -12945,7 +12965,7 @@ class MultipleChoice extends React$2.Component {
|
|
|
12945
12965
|
__self: this,
|
|
12946
12966
|
__source: {
|
|
12947
12967
|
fileName: _jsxFileName$1,
|
|
12948
|
-
lineNumber:
|
|
12968
|
+
lineNumber: 307
|
|
12949
12969
|
}
|
|
12950
12970
|
}, teacherInstructionsDiv) : teacherInstructionsDiv), React$2.createElement('fieldset', {
|
|
12951
12971
|
tabIndex: 0,
|
|
@@ -12955,7 +12975,7 @@ class MultipleChoice extends React$2.Component {
|
|
|
12955
12975
|
__self: this,
|
|
12956
12976
|
__source: {
|
|
12957
12977
|
fileName: _jsxFileName$1,
|
|
12958
|
-
lineNumber:
|
|
12978
|
+
lineNumber: 321
|
|
12959
12979
|
}
|
|
12960
12980
|
}, React$2.createElement(PreviewPrompt, {
|
|
12961
12981
|
className: "prompt",
|
|
@@ -12967,7 +12987,7 @@ class MultipleChoice extends React$2.Component {
|
|
|
12967
12987
|
__self: this,
|
|
12968
12988
|
__source: {
|
|
12969
12989
|
fileName: _jsxFileName$1,
|
|
12970
|
-
lineNumber:
|
|
12990
|
+
lineNumber: 327
|
|
12971
12991
|
}
|
|
12972
12992
|
}), !alwaysShowCorrect && React$2.createElement(CorrectAnswerToggle, {
|
|
12973
12993
|
show: showCorrectAnswerToggle,
|
|
@@ -12977,7 +12997,7 @@ class MultipleChoice extends React$2.Component {
|
|
|
12977
12997
|
__self: this,
|
|
12978
12998
|
__source: {
|
|
12979
12999
|
fileName: _jsxFileName$1,
|
|
12980
|
-
lineNumber:
|
|
13000
|
+
lineNumber: 337
|
|
12981
13001
|
}
|
|
12982
13002
|
}), React$2.createElement('div', {
|
|
12983
13003
|
className: classNames({
|
|
@@ -12988,7 +13008,7 @@ class MultipleChoice extends React$2.Component {
|
|
|
12988
13008
|
__self: this,
|
|
12989
13009
|
__source: {
|
|
12990
13010
|
fileName: _jsxFileName$1,
|
|
12991
|
-
lineNumber:
|
|
13011
|
+
lineNumber: 345
|
|
12992
13012
|
}
|
|
12993
13013
|
}, choices.map((choice, index) => React$2.createElement(StyledChoice, {
|
|
12994
13014
|
autoFocusRef: index === 0 ? this.firstInputRef : null,
|
|
@@ -13013,21 +13033,21 @@ class MultipleChoice extends React$2.Component {
|
|
|
13013
13033
|
__self: this,
|
|
13014
13034
|
__source: {
|
|
13015
13035
|
fileName: _jsxFileName$1,
|
|
13016
|
-
lineNumber:
|
|
13036
|
+
lineNumber: 353
|
|
13017
13037
|
}
|
|
13018
13038
|
})))), choiceMode === 'checkbox' && selections < minSelections && React$2.createElement('div', {
|
|
13019
13039
|
className: classes.errorText,
|
|
13020
13040
|
__self: this,
|
|
13021
13041
|
__source: {
|
|
13022
13042
|
fileName: _jsxFileName$1,
|
|
13023
|
-
lineNumber:
|
|
13043
|
+
lineNumber: 379
|
|
13024
13044
|
}
|
|
13025
13045
|
}, getMultipleChoiceMinSelectionErrorMessage()), choiceMode === 'checkbox' && maxSelectionsErrorState && React$2.createElement('div', {
|
|
13026
13046
|
className: classes.errorText,
|
|
13027
13047
|
__self: this,
|
|
13028
13048
|
__source: {
|
|
13029
13049
|
fileName: _jsxFileName$1,
|
|
13030
|
-
lineNumber:
|
|
13050
|
+
lineNumber: 382
|
|
13031
13051
|
}
|
|
13032
13052
|
}, translator.t(`translation:multipleChoice:maxSelections_${maxSelections === 1 ? 'one' : 'other'}`, {
|
|
13033
13053
|
lng: language,
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/multiple-choice",
|
|
3
3
|
"repository": "pie-framework/pie-elements",
|
|
4
|
-
"version": "9.
|
|
4
|
+
"version": "9.18.1-next.0+0ec7c6b8d",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@material-ui/core": "^3.9.2",
|
|
10
10
|
"@pie-framework/pie-player-events": "^0.1.0",
|
|
11
|
-
"@pie-lib/pie-toolbox": "2.
|
|
11
|
+
"@pie-lib/pie-toolbox": "2.22.0",
|
|
12
12
|
"classnames": "^2.2.5",
|
|
13
13
|
"debug": "^4.1.1",
|
|
14
14
|
"enzyme-to-json": "^3.3.3",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"react-test-renderer": "^16.3.2",
|
|
20
20
|
"react-transition-group": "^2.3.1"
|
|
21
21
|
},
|
|
22
|
-
"gitHead": "
|
|
22
|
+
"gitHead": "0ec7c6b8d1c811b20dbf32671d032f1e5bee1fb6",
|
|
23
23
|
"scripts": {
|
|
24
24
|
"postpublish": "../../scripts/postpublish"
|
|
25
25
|
},
|