@pie-element/multiple-choice 9.2.2-next.9 → 9.2.3
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 +28 -0
- package/configure/CHANGELOG.md +16 -0
- package/configure/package.json +2 -5
- package/controller/CHANGELOG.md +16 -0
- package/controller/package.json +2 -2
- package/lib/multiple-choice.js +9 -3
- package/lib/multiple-choice.js.map +1 -1
- package/module/configure.js +2 -2
- package/module/element.js +23 -17
- package/module/index.html +1 -1
- package/module/manifest.json +3 -3
- package/module/print.html +1 -1
- package/module/print.js +23 -17
- package/package.json +3 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,34 @@
|
|
|
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.2.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice@9.2.2...@pie-element/multiple-choice@9.2.3) (2024-10-16)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* add sanity checks for PD-4259 ([b9f8efc](https://github.com/pie-framework/pie-elements/commit/b9f8efc56d7dd4d616212a1aefdf012e6f4ada37))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [9.2.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice@9.2.1...@pie-element/multiple-choice@9.2.2) (2024-10-15)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* added complexjs as dependency [PD-4200] ([da393d5](https://github.com/pie-framework/pie-elements/commit/da393d5ae8ef52f17b47ccf32967410a9263180e))
|
|
23
|
+
* added resolutions in controller as well [PD-4200] ([020edc5](https://github.com/pie-framework/pie-elements/commit/020edc5f0bb5de6bf8f344efd0a3b9b0b16b9dc7))
|
|
24
|
+
* added resolutions to every package [PD-4200] ([480bed5](https://github.com/pie-framework/pie-elements/commit/480bed5eddfc91ec9dbc7ca7e3f6d09b2a199e7d))
|
|
25
|
+
* reverting changes since the issue is fixed in the latest complex.js [PD-4200] ([42c9f21](https://github.com/pie-framework/pie-elements/commit/42c9f216c4d29b051156489beb43fa7093667eb7))
|
|
26
|
+
* update pie toolbox ([ba98798](https://github.com/pie-framework/pie-elements/commit/ba987984ebc2f856950611874436cf148a9a3963))
|
|
27
|
+
* update pie-lib/pie-toolbox PD-4200 ([a41a620](https://github.com/pie-framework/pie-elements/commit/a41a62036afe6aa8ef70493900c08875cff8eec2))
|
|
28
|
+
* update pie-lib/pie-toolbox PD-4241 ([b24d439](https://github.com/pie-framework/pie-elements/commit/b24d43945457792d403d0da62ce3e4b5b898ca46))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
6
34
|
## [9.2.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice@9.2.0...@pie-element/multiple-choice@9.2.1) (2024-10-03)
|
|
7
35
|
|
|
8
36
|
|
package/configure/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
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.0.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-configure@7.0.3...@pie-element/multiple-choice-configure@7.0.4) (2024-10-15)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* added complexjs as dependency [PD-4200] ([da393d5](https://github.com/pie-framework/pie-elements/commit/da393d5ae8ef52f17b47ccf32967410a9263180e))
|
|
12
|
+
* added resolutions to every package [PD-4200] ([480bed5](https://github.com/pie-framework/pie-elements/commit/480bed5eddfc91ec9dbc7ca7e3f6d09b2a199e7d))
|
|
13
|
+
* reverting changes since the issue is fixed in the latest complex.js [PD-4200] ([42c9f21](https://github.com/pie-framework/pie-elements/commit/42c9f216c4d29b051156489beb43fa7093667eb7))
|
|
14
|
+
* update pie toolbox ([ba98798](https://github.com/pie-framework/pie-elements/commit/ba987984ebc2f856950611874436cf148a9a3963))
|
|
15
|
+
* update pie-lib/pie-toolbox PD-4200 ([a41a620](https://github.com/pie-framework/pie-elements/commit/a41a62036afe6aa8ef70493900c08875cff8eec2))
|
|
16
|
+
* update pie-lib/pie-toolbox PD-4241 ([b24d439](https://github.com/pie-framework/pie-elements/commit/b24d43945457792d403d0da62ce3e4b5b898ca46))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [7.0.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-configure@7.0.2...@pie-element/multiple-choice-configure@7.0.3) (2024-10-03)
|
|
7
23
|
|
|
8
24
|
|
package/configure/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/multiple-choice-configure",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.4",
|
|
4
4
|
"private": true,
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "src/index.js",
|
|
@@ -8,14 +8,11 @@
|
|
|
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.0.
|
|
11
|
+
"@pie-lib/pie-toolbox": "2.0.13",
|
|
12
12
|
"debug": "^3.1.0",
|
|
13
13
|
"lodash": "^4.17.15",
|
|
14
14
|
"prop-types": "^15.6.2",
|
|
15
15
|
"react": "^16.8.1",
|
|
16
16
|
"react-dom": "^16.8.1"
|
|
17
|
-
},
|
|
18
|
-
"resolutions": {
|
|
19
|
-
"complex.js": "2.1.1"
|
|
20
17
|
}
|
|
21
18
|
}
|
package/controller/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
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.0.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-controller@5.0.3...@pie-element/multiple-choice-controller@5.0.4) (2024-10-15)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* added complexjs as dependency [PD-4200] ([da393d5](https://github.com/pie-framework/pie-elements/commit/da393d5ae8ef52f17b47ccf32967410a9263180e))
|
|
12
|
+
* added resolutions in controller as well [PD-4200] ([020edc5](https://github.com/pie-framework/pie-elements/commit/020edc5f0bb5de6bf8f344efd0a3b9b0b16b9dc7))
|
|
13
|
+
* reverting changes since the issue is fixed in the latest complex.js [PD-4200] ([42c9f21](https://github.com/pie-framework/pie-elements/commit/42c9f216c4d29b051156489beb43fa7093667eb7))
|
|
14
|
+
* update pie toolbox ([ba98798](https://github.com/pie-framework/pie-elements/commit/ba987984ebc2f856950611874436cf148a9a3963))
|
|
15
|
+
* update pie-lib/pie-toolbox PD-4200 ([a41a620](https://github.com/pie-framework/pie-elements/commit/a41a62036afe6aa8ef70493900c08875cff8eec2))
|
|
16
|
+
* update pie-lib/pie-toolbox PD-4241 ([b24d439](https://github.com/pie-framework/pie-elements/commit/b24d43945457792d403d0da62ce3e4b5b898ca46))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [5.0.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-controller@5.0.2...@pie-element/multiple-choice-controller@5.0.3) (2024-10-03)
|
|
7
23
|
|
|
8
24
|
|
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.0.
|
|
4
|
+
"version": "5.0.4",
|
|
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.0.
|
|
11
|
+
"@pie-lib/pie-toolbox": "2.0.13",
|
|
12
12
|
"debug": "^3.1.0",
|
|
13
13
|
"lodash": "^4.17.15"
|
|
14
14
|
}
|
package/lib/multiple-choice.js
CHANGED
|
@@ -129,7 +129,9 @@ var MultipleChoice = /*#__PURE__*/function (_React$Component) {
|
|
|
129
129
|
_this.setState({
|
|
130
130
|
showCorrect: !_this.state.showCorrect
|
|
131
131
|
}, function () {
|
|
132
|
-
_this.props.onShowCorrectToggle
|
|
132
|
+
if (_this.props.onShowCorrectToggle) {
|
|
133
|
+
_this.props.onShowCorrectToggle();
|
|
134
|
+
}
|
|
133
135
|
});
|
|
134
136
|
}
|
|
135
137
|
});
|
|
@@ -186,7 +188,9 @@ var MultipleChoice = /*#__PURE__*/function (_React$Component) {
|
|
|
186
188
|
this.setState({
|
|
187
189
|
showCorrect: false
|
|
188
190
|
}, function () {
|
|
189
|
-
_this2.props.onShowCorrectToggle
|
|
191
|
+
if (_this2.props.onShowCorrectToggle) {
|
|
192
|
+
_this2.props.onShowCorrectToggle();
|
|
193
|
+
}
|
|
190
194
|
});
|
|
191
195
|
}
|
|
192
196
|
|
|
@@ -194,7 +198,9 @@ var MultipleChoice = /*#__PURE__*/function (_React$Component) {
|
|
|
194
198
|
this.setState({
|
|
195
199
|
showCorrect: true
|
|
196
200
|
}, function () {
|
|
197
|
-
_this2.props.onShowCorrectToggle
|
|
201
|
+
if (_this2.props.onShowCorrectToggle) {
|
|
202
|
+
_this2.props.onShowCorrectToggle();
|
|
203
|
+
}
|
|
198
204
|
});
|
|
199
205
|
}
|
|
200
206
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/multiple-choice.jsx"],"names":["styles","theme","main","color","text","backgroundColor","background","partLabel","display","fontSize","margin","fontWeight","paddingBottom","spacing","unit","teacherInstructions","marginBottom","horizontalLayout","flexDirection","flexWrap","gridLayout","fieldset","border","padding","minWidth","srOnly","position","left","top","width","height","overflow","MultipleChoice","props","event","target","setState","selectedValue","value","checked","prevState","selectedValues","push","filter","currentValue","mode","showCorrect","state","onShowCorrectToggle","choice","isCorrect","correct","isChecked","isSelected","undefined","alwaysShowCorrect","onToggle","bind","sessionValue","session","indexOf","nextProps","correctResponse","index","keyMode","String","fromCharCode","toUpperCase","choiceMode","includes","classes","disabled","className","choices","gridColumns","prompt","onChoiceChanged","responseCorrect","animationsDisabled","language","isEvaluateMode","showCorrectAnswerToggle","columnsStyle","gridTemplateColumns","teacherInstructionsDiv","renderHeading","hidden","visible","choicesLayout","map","length","handleChange","handleChangeCheckboxes","hideTick","getChecked","getCorrectness","indexToSymbol","React","Component","PropTypes","string","oneOf","array","object","bool","func","isRequired","defaultProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;AAAA,SAAY;AACvBC,IAAAA,IAAI,EAAE;AACFC,MAAAA,KAAK,EAAEA,gBAAMC,IAAN,EADL;AAEFC,MAAAA,eAAe,EAAEF,gBAAMG,UAAN,EAFf;AAGF,aAAO;AACH,kCAA0B;AADvB;AAHL,KADiB;AAQvBC,IAAAA,SAAS,EAAE;AACPC,MAAAA,OAAO,EAAE,OADF;AAEPC,MAAAA,QAAQ,EAAE,SAFH;AAGPC,MAAAA,MAAM,EAAE,GAHD;AAIPC,MAAAA,UAAU,EAAE,QAJL;AAKPC,MAAAA,aAAa,EAAEX,KAAK,CAACY,OAAN,CAAcC,IAAd,GAAqB;AAL7B,KAR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AnBL;AAoBfpD,EAAAA,mBAAmB,EAAEmD,sBAAUM;AApBhB,C;AA+PvBzE,cAAc,CAAC2E,YAAf,GAA8B;AAC1BhD,EAAAA,OAAO,EAAE;AACLrB,IAAAA,KAAK,EAAE;AADF;AADiB,CAA9B;;eAMe,wBAAWtC,MAAX,EAAmBgC,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 StyledChoice from './choice';\n\n// MultipleChoice\n\nconst styles = (theme) => ({\n main: {\n color: color.text(),\n backgroundColor: color.background(),\n '& *': {\n '-webkit-font-smoothing': 'antialiased',\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});\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 onShowCorrectToggle: PropTypes.func,\n };\n\n constructor(props) {\n super(props);\n\n this.state = {\n selectedValue: null,\n selectedValues: [],\n showCorrect: this.props.alwaysShowCorrect || false,\n };\n\n this.onToggle = this.onToggle.bind(this);\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 and handleChangeCheckboxes functions were added for accessibility. Please see comments and videos from PD-2441. They should only be removed if a better solution is found.\n handleChange = (event) => {\n const target = event.target;\n\n this.setState({selectedValue: target.value});\n };\n\n handleChangeCheckboxes = (event) => {\n const {value, checked} = event.target;\n\n this.setState((prevState) => {\n let selectedValues = [...prevState.selectedValues];\n\n if (checked) {\n selectedValues.push(value);\n } else {\n selectedValues = selectedValues.filter((currentValue) => currentValue !== value);\n }\n\n return {selectedValues};\n });\n };\n\n onToggle = () => {\n if (this.props.mode === 'evaluate') {\n this.setState({ showCorrect: !this.state.showCorrect }, () => {\n this.props.onShowCorrectToggle();\n });\n }\n };\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n if (!nextProps.correctResponse && this.state.showCorrect !== false) {\n this.setState({ showCorrect: false }, () => {\n this.props.onShowCorrectToggle();\n });\n }\n\n if (nextProps.alwaysShowCorrect && this.state.showCorrect !== true) {\n this.setState({ showCorrect: true }, () => {\n this.props.onShowCorrectToggle();\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 if (this.isSelected(choice.value)) {\n return true;\n }\n\n return this.props.choiceMode === 'radio'\n ? this.state.selectedValue === choice.value\n : this.state.selectedValues.includes(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 render() {\n const {\n mode,\n disabled,\n className,\n choices = [],\n choiceMode,\n gridColumns,\n partLabel,\n prompt,\n onChoiceChanged,\n responseCorrect,\n teacherInstructions,\n classes,\n alwaysShowCorrect,\n animationsDisabled,\n language\n } = this.props;\n const {showCorrect} = this.state;\n const isEvaluateMode = mode === 'evaluate';\n const showCorrectAnswerToggle = isEvaluateMode && !responseCorrect;\n const columnsStyle = gridColumns > 1 ? {gridTemplateColumns: `repeat(${gridColumns}, 1fr)`} : undefined;\n\n const teacherInstructionsDiv = (\n <PreviewPrompt\n tagName=\"div\"\n className=\"prompt\"\n defaultClassName=\"teacher-instructions\"\n prompt={teacherInstructions}\n />\n );\n\n return (\n <div 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 className={classes.fieldset}>\n <PreviewPrompt className=\"prompt\" defaultClassName=\"prompt\" prompt={prompt} tagName={'legend'}/>\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 choicesLayout={this.props.choicesLayout}\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 updateSession={onChoiceChanged}\n onChoiceChanged={this.props.choiceMode === 'radio' ? this.handleChange : this.handleChangeCheckboxes}\n hideTick={choice.hideTick}\n checked={this.getChecked(choice)}\n correctness={isEvaluateMode ? this.getCorrectness(choice) : undefined}\n displayKey={this.indexToSymbol(index)}\n />\n ))}\n </div>\n </fieldset>\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":["styles","theme","main","color","text","backgroundColor","background","partLabel","display","fontSize","margin","fontWeight","paddingBottom","spacing","unit","teacherInstructions","marginBottom","horizontalLayout","flexDirection","flexWrap","gridLayout","fieldset","border","padding","minWidth","srOnly","position","left","top","width","height","overflow","MultipleChoice","props","event","target","setState","selectedValue","value","checked","prevState","selectedValues","push","filter","currentValue","mode","showCorrect","state","onShowCorrectToggle","choice","isCorrect","correct","isChecked","isSelected","undefined","alwaysShowCorrect","onToggle","bind","sessionValue","session","indexOf","nextProps","correctResponse","index","keyMode","String","fromCharCode","toUpperCase","choiceMode","includes","classes","disabled","className","choices","gridColumns","prompt","onChoiceChanged","responseCorrect","animationsDisabled","language","isEvaluateMode","showCorrectAnswerToggle","columnsStyle","gridTemplateColumns","teacherInstructionsDiv","renderHeading","hidden","visible","choicesLayout","map","length","handleChange","handleChangeCheckboxes","hideTick","getChecked","getCorrectness","indexToSymbol","React","Component","PropTypes","string","oneOf","array","object","bool","func","isRequired","defaultProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;AAAA,SAAY;AACvBC,IAAAA,IAAI,EAAE;AACFC,MAAAA,KAAK,EAAEA,gBAAMC,IAAN,EADL;AAEFC,MAAAA,eAAe,EAAEF,gBAAMG,UAAN,EAFf;AAGF,aAAO;AACH,kCAA0B;AADvB;AAHL,KADiB;AAQvBC,IAAAA,SAAS,EAAE;AACPC,MAAAA,OAAO,EAAE,OADF;AAEPC,MAAAA,QAAQ,EAAE,SAFH;AAGPC,MAAAA,MAAM,EAAE,GAHD;AAIPC,MAAAA,UAAU,EAAE,QAJL;AAKPC,MAAAA,aAAa,EAAEX,KAAK,CAACY,OAAN,CAAcC,IAAd,GAAqB;AAL7B,KARY;AAevBC,IAAAA,mBAAmB,EAAE;AACjBC,MAAAA,YAAY,EAAEf,KAAK,CAACY,OAAN,CAAcC,IAAd,GAAqB;AADlB,KAfE;AAkBvBG,IAAAA,gBAAgB,EAAE;AACdT,MAAAA,OAAO,EAAE,MADK;AAEdU,MAAAA,aAAa,EAAE,KAFD;AAGdC,MAAAA,QAAQ,EAAE;AAHI,KAlBK;AAuBvBC,IAAAA,UAAU,EAAE;AACRZ,MAAAA,OAAO,EAAE;AADD,KAvBW;AA0BvBa,IAAAA,QAAQ,EAAE;AACNC,MAAAA,MAA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,EAAmBgC,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 StyledChoice from './choice';\n\n// MultipleChoice\n\nconst styles = (theme) => ({\n main: {\n color: color.text(),\n backgroundColor: color.background(),\n '& *': {\n '-webkit-font-smoothing': 'antialiased',\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});\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 onShowCorrectToggle: PropTypes.func,\n };\n\n constructor(props) {\n super(props);\n\n this.state = {\n selectedValue: null,\n selectedValues: [],\n showCorrect: this.props.alwaysShowCorrect || false,\n };\n\n this.onToggle = this.onToggle.bind(this);\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 and handleChangeCheckboxes functions were added for accessibility. Please see comments and videos from PD-2441. They should only be removed if a better solution is found.\n handleChange = (event) => {\n const target = event.target;\n\n this.setState({selectedValue: target.value});\n };\n\n handleChangeCheckboxes = (event) => {\n const {value, checked} = event.target;\n\n this.setState((prevState) => {\n let selectedValues = [...prevState.selectedValues];\n\n if (checked) {\n selectedValues.push(value);\n } else {\n selectedValues = selectedValues.filter((currentValue) => currentValue !== value);\n }\n\n return {selectedValues};\n });\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 if (this.isSelected(choice.value)) {\n return true;\n }\n\n return this.props.choiceMode === 'radio'\n ? this.state.selectedValue === choice.value\n : this.state.selectedValues.includes(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 render() {\n const {\n mode,\n disabled,\n className,\n choices = [],\n choiceMode,\n gridColumns,\n partLabel,\n prompt,\n onChoiceChanged,\n responseCorrect,\n teacherInstructions,\n classes,\n alwaysShowCorrect,\n animationsDisabled,\n language\n } = this.props;\n const {showCorrect} = this.state;\n const isEvaluateMode = mode === 'evaluate';\n const showCorrectAnswerToggle = isEvaluateMode && !responseCorrect;\n const columnsStyle = gridColumns > 1 ? {gridTemplateColumns: `repeat(${gridColumns}, 1fr)`} : undefined;\n\n const teacherInstructionsDiv = (\n <PreviewPrompt\n tagName=\"div\"\n className=\"prompt\"\n defaultClassName=\"teacher-instructions\"\n prompt={teacherInstructions}\n />\n );\n\n return (\n <div 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 className={classes.fieldset}>\n <PreviewPrompt className=\"prompt\" defaultClassName=\"prompt\" prompt={prompt} tagName={'legend'}/>\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 choicesLayout={this.props.choicesLayout}\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 updateSession={onChoiceChanged}\n onChoiceChanged={this.props.choiceMode === 'radio' ? this.handleChange : this.handleChangeCheckboxes}\n hideTick={choice.hideTick}\n checked={this.getChecked(choice)}\n correctness={isEvaluateMode ? this.getCorrectness(choice) : undefined}\n displayKey={this.indexToSymbol(index)}\n />\n ))}\n </div>\n </fieldset>\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@2.0.
|
|
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@5.0.
|
|
1
|
+
import {_dll_react, _dll_prop_types, _dll_react_dom, _dll_classnames, _dll_lodash, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.0.11/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@5.0.7/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_accessible} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.0.
|
|
2
|
-
import {_dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_correct_answer_toggle} from "../../../@pie-lib/pie-toolbox-module@5.0.
|
|
1
|
+
import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_debug, _dll_pie_lib__pie_toolbox_math_rendering_accessible} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.0.11/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@5.0.7/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;
|
|
@@ -9391,7 +9391,9 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
9391
9391
|
this.setState({
|
|
9392
9392
|
showCorrect: !this.state.showCorrect
|
|
9393
9393
|
}, () => {
|
|
9394
|
-
this.props.onShowCorrectToggle
|
|
9394
|
+
if (this.props.onShowCorrectToggle) {
|
|
9395
|
+
this.props.onShowCorrectToggle();
|
|
9396
|
+
}
|
|
9395
9397
|
});
|
|
9396
9398
|
}
|
|
9397
9399
|
};
|
|
@@ -9401,14 +9403,18 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
9401
9403
|
this.setState({
|
|
9402
9404
|
showCorrect: false
|
|
9403
9405
|
}, () => {
|
|
9404
|
-
this.props.onShowCorrectToggle
|
|
9406
|
+
if (this.props.onShowCorrectToggle) {
|
|
9407
|
+
this.props.onShowCorrectToggle();
|
|
9408
|
+
}
|
|
9405
9409
|
});
|
|
9406
9410
|
}
|
|
9407
9411
|
if (nextProps.alwaysShowCorrect && this.state.showCorrect !== true) {
|
|
9408
9412
|
this.setState({
|
|
9409
9413
|
showCorrect: true
|
|
9410
9414
|
}, () => {
|
|
9411
|
-
this.props.onShowCorrectToggle
|
|
9415
|
+
if (this.props.onShowCorrectToggle) {
|
|
9416
|
+
this.props.onShowCorrectToggle();
|
|
9417
|
+
}
|
|
9412
9418
|
});
|
|
9413
9419
|
}
|
|
9414
9420
|
}
|
|
@@ -9462,14 +9468,14 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
9462
9468
|
__self: this,
|
|
9463
9469
|
__source: {
|
|
9464
9470
|
fileName: _jsxFileName$1,
|
|
9465
|
-
lineNumber:
|
|
9471
|
+
lineNumber: 208
|
|
9466
9472
|
}
|
|
9467
9473
|
}, "Multiple Choice Question") : React$2.createElement('h2', {
|
|
9468
9474
|
className: classes.srOnly,
|
|
9469
9475
|
__self: this,
|
|
9470
9476
|
__source: {
|
|
9471
9477
|
fileName: _jsxFileName$1,
|
|
9472
|
-
lineNumber:
|
|
9478
|
+
lineNumber: 210
|
|
9473
9479
|
}
|
|
9474
9480
|
}, "Multiple Select Question");
|
|
9475
9481
|
}
|
|
@@ -9489,7 +9495,7 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
9489
9495
|
__self: this,
|
|
9490
9496
|
__source: {
|
|
9491
9497
|
fileName: _jsxFileName$1,
|
|
9492
|
-
lineNumber:
|
|
9498
|
+
lineNumber: 238
|
|
9493
9499
|
}
|
|
9494
9500
|
});
|
|
9495
9501
|
return React$2.createElement('div', {
|
|
@@ -9497,21 +9503,21 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
9497
9503
|
__self: this,
|
|
9498
9504
|
__source: {
|
|
9499
9505
|
fileName: _jsxFileName$1,
|
|
9500
|
-
lineNumber:
|
|
9506
|
+
lineNumber: 247
|
|
9501
9507
|
}
|
|
9502
9508
|
}, partLabel && React$2.createElement('h3', {
|
|
9503
9509
|
className: classes.partLabel,
|
|
9504
9510
|
__self: this,
|
|
9505
9511
|
__source: {
|
|
9506
9512
|
fileName: _jsxFileName$1,
|
|
9507
|
-
lineNumber:
|
|
9513
|
+
lineNumber: 248
|
|
9508
9514
|
}
|
|
9509
9515
|
}, partLabel), this.renderHeading(), teacherInstructions && React$2.createElement('div', {
|
|
9510
9516
|
className: classes.teacherInstructions,
|
|
9511
9517
|
__self: this,
|
|
9512
9518
|
__source: {
|
|
9513
9519
|
fileName: _jsxFileName$1,
|
|
9514
|
-
lineNumber:
|
|
9520
|
+
lineNumber: 253
|
|
9515
9521
|
}
|
|
9516
9522
|
}, !animationsDisabled ? React$2.createElement(Collapsible, {
|
|
9517
9523
|
labels: {
|
|
@@ -9521,14 +9527,14 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
9521
9527
|
__self: this,
|
|
9522
9528
|
__source: {
|
|
9523
9529
|
fileName: _jsxFileName$1,
|
|
9524
|
-
lineNumber:
|
|
9530
|
+
lineNumber: 255
|
|
9525
9531
|
}
|
|
9526
9532
|
}, teacherInstructionsDiv) : teacherInstructionsDiv), React$2.createElement('fieldset', {
|
|
9527
9533
|
className: classes.fieldset,
|
|
9528
9534
|
__self: this,
|
|
9529
9535
|
__source: {
|
|
9530
9536
|
fileName: _jsxFileName$1,
|
|
9531
|
-
lineNumber:
|
|
9537
|
+
lineNumber: 269
|
|
9532
9538
|
}
|
|
9533
9539
|
}, React$2.createElement(PreviewPrompt, {
|
|
9534
9540
|
className: "prompt",
|
|
@@ -9538,7 +9544,7 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
9538
9544
|
__self: this,
|
|
9539
9545
|
__source: {
|
|
9540
9546
|
fileName: _jsxFileName$1,
|
|
9541
|
-
lineNumber:
|
|
9547
|
+
lineNumber: 270
|
|
9542
9548
|
}
|
|
9543
9549
|
}), !alwaysShowCorrect && React$2.createElement(CorrectAnswerToggle, {
|
|
9544
9550
|
show: showCorrectAnswerToggle,
|
|
@@ -9548,7 +9554,7 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
9548
9554
|
__self: this,
|
|
9549
9555
|
__source: {
|
|
9550
9556
|
fileName: _jsxFileName$1,
|
|
9551
|
-
lineNumber:
|
|
9557
|
+
lineNumber: 273
|
|
9552
9558
|
}
|
|
9553
9559
|
}), React$2.createElement('div', {
|
|
9554
9560
|
className: classNames({
|
|
@@ -9559,7 +9565,7 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
9559
9565
|
__self: this,
|
|
9560
9566
|
__source: {
|
|
9561
9567
|
fileName: _jsxFileName$1,
|
|
9562
|
-
lineNumber:
|
|
9568
|
+
lineNumber: 281
|
|
9563
9569
|
}
|
|
9564
9570
|
}, choices.map((choice, index) => React$2.createElement(StyledChoice, {
|
|
9565
9571
|
choicesLayout: this.props.choicesLayout,
|
|
@@ -9581,7 +9587,7 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
9581
9587
|
__self: this,
|
|
9582
9588
|
__source: {
|
|
9583
9589
|
fileName: _jsxFileName$1,
|
|
9584
|
-
lineNumber:
|
|
9590
|
+
lineNumber: 289
|
|
9585
9591
|
}
|
|
9586
9592
|
})))));
|
|
9587
9593
|
}
|
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.2.
|
|
3
|
+
"version": "9.2.2",
|
|
4
4
|
"modules": [
|
|
5
5
|
{
|
|
6
6
|
"name": "@pie-lib/pie-toolbox-math-rendering-module",
|
|
7
|
-
"version": "2.0.
|
|
7
|
+
"version": "2.0.11"
|
|
8
8
|
},
|
|
9
9
|
{
|
|
10
10
|
"name": "@pie-lib/pie-toolbox-module",
|
|
11
|
-
"version": "5.0.
|
|
11
|
+
"version": "5.0.7"
|
|
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_accessible, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.0.
|
|
2
|
-
import {_dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_correct_answer_toggle} from "../../../@pie-lib/pie-toolbox-module@5.0.
|
|
1
|
+
import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_pie_lib__pie_toolbox_math_rendering_accessible, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.0.11/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@5.0.7/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;
|
|
@@ -9391,7 +9391,9 @@ class MultipleChoice extends React$2.Component {
|
|
|
9391
9391
|
this.setState({
|
|
9392
9392
|
showCorrect: !this.state.showCorrect
|
|
9393
9393
|
}, () => {
|
|
9394
|
-
this.props.onShowCorrectToggle
|
|
9394
|
+
if (this.props.onShowCorrectToggle) {
|
|
9395
|
+
this.props.onShowCorrectToggle();
|
|
9396
|
+
}
|
|
9395
9397
|
});
|
|
9396
9398
|
}
|
|
9397
9399
|
};
|
|
@@ -9401,14 +9403,18 @@ class MultipleChoice extends React$2.Component {
|
|
|
9401
9403
|
this.setState({
|
|
9402
9404
|
showCorrect: false
|
|
9403
9405
|
}, () => {
|
|
9404
|
-
this.props.onShowCorrectToggle
|
|
9406
|
+
if (this.props.onShowCorrectToggle) {
|
|
9407
|
+
this.props.onShowCorrectToggle();
|
|
9408
|
+
}
|
|
9405
9409
|
});
|
|
9406
9410
|
}
|
|
9407
9411
|
if (nextProps.alwaysShowCorrect && this.state.showCorrect !== true) {
|
|
9408
9412
|
this.setState({
|
|
9409
9413
|
showCorrect: true
|
|
9410
9414
|
}, () => {
|
|
9411
|
-
this.props.onShowCorrectToggle
|
|
9415
|
+
if (this.props.onShowCorrectToggle) {
|
|
9416
|
+
this.props.onShowCorrectToggle();
|
|
9417
|
+
}
|
|
9412
9418
|
});
|
|
9413
9419
|
}
|
|
9414
9420
|
}
|
|
@@ -9462,14 +9468,14 @@ class MultipleChoice extends React$2.Component {
|
|
|
9462
9468
|
__self: this,
|
|
9463
9469
|
__source: {
|
|
9464
9470
|
fileName: _jsxFileName$1,
|
|
9465
|
-
lineNumber:
|
|
9471
|
+
lineNumber: 208
|
|
9466
9472
|
}
|
|
9467
9473
|
}, "Multiple Choice Question") : React$2.createElement('h2', {
|
|
9468
9474
|
className: classes.srOnly,
|
|
9469
9475
|
__self: this,
|
|
9470
9476
|
__source: {
|
|
9471
9477
|
fileName: _jsxFileName$1,
|
|
9472
|
-
lineNumber:
|
|
9478
|
+
lineNumber: 210
|
|
9473
9479
|
}
|
|
9474
9480
|
}, "Multiple Select Question");
|
|
9475
9481
|
}
|
|
@@ -9489,7 +9495,7 @@ class MultipleChoice extends React$2.Component {
|
|
|
9489
9495
|
__self: this,
|
|
9490
9496
|
__source: {
|
|
9491
9497
|
fileName: _jsxFileName$1,
|
|
9492
|
-
lineNumber:
|
|
9498
|
+
lineNumber: 238
|
|
9493
9499
|
}
|
|
9494
9500
|
});
|
|
9495
9501
|
return React$2.createElement('div', {
|
|
@@ -9497,21 +9503,21 @@ class MultipleChoice extends React$2.Component {
|
|
|
9497
9503
|
__self: this,
|
|
9498
9504
|
__source: {
|
|
9499
9505
|
fileName: _jsxFileName$1,
|
|
9500
|
-
lineNumber:
|
|
9506
|
+
lineNumber: 247
|
|
9501
9507
|
}
|
|
9502
9508
|
}, partLabel && React$2.createElement('h3', {
|
|
9503
9509
|
className: classes.partLabel,
|
|
9504
9510
|
__self: this,
|
|
9505
9511
|
__source: {
|
|
9506
9512
|
fileName: _jsxFileName$1,
|
|
9507
|
-
lineNumber:
|
|
9513
|
+
lineNumber: 248
|
|
9508
9514
|
}
|
|
9509
9515
|
}, partLabel), this.renderHeading(), teacherInstructions && React$2.createElement('div', {
|
|
9510
9516
|
className: classes.teacherInstructions,
|
|
9511
9517
|
__self: this,
|
|
9512
9518
|
__source: {
|
|
9513
9519
|
fileName: _jsxFileName$1,
|
|
9514
|
-
lineNumber:
|
|
9520
|
+
lineNumber: 253
|
|
9515
9521
|
}
|
|
9516
9522
|
}, !animationsDisabled ? React$2.createElement(Collapsible, {
|
|
9517
9523
|
labels: {
|
|
@@ -9521,14 +9527,14 @@ class MultipleChoice extends React$2.Component {
|
|
|
9521
9527
|
__self: this,
|
|
9522
9528
|
__source: {
|
|
9523
9529
|
fileName: _jsxFileName$1,
|
|
9524
|
-
lineNumber:
|
|
9530
|
+
lineNumber: 255
|
|
9525
9531
|
}
|
|
9526
9532
|
}, teacherInstructionsDiv) : teacherInstructionsDiv), React$2.createElement('fieldset', {
|
|
9527
9533
|
className: classes.fieldset,
|
|
9528
9534
|
__self: this,
|
|
9529
9535
|
__source: {
|
|
9530
9536
|
fileName: _jsxFileName$1,
|
|
9531
|
-
lineNumber:
|
|
9537
|
+
lineNumber: 269
|
|
9532
9538
|
}
|
|
9533
9539
|
}, React$2.createElement(PreviewPrompt, {
|
|
9534
9540
|
className: "prompt",
|
|
@@ -9538,7 +9544,7 @@ class MultipleChoice extends React$2.Component {
|
|
|
9538
9544
|
__self: this,
|
|
9539
9545
|
__source: {
|
|
9540
9546
|
fileName: _jsxFileName$1,
|
|
9541
|
-
lineNumber:
|
|
9547
|
+
lineNumber: 270
|
|
9542
9548
|
}
|
|
9543
9549
|
}), !alwaysShowCorrect && React$2.createElement(CorrectAnswerToggle, {
|
|
9544
9550
|
show: showCorrectAnswerToggle,
|
|
@@ -9548,7 +9554,7 @@ class MultipleChoice extends React$2.Component {
|
|
|
9548
9554
|
__self: this,
|
|
9549
9555
|
__source: {
|
|
9550
9556
|
fileName: _jsxFileName$1,
|
|
9551
|
-
lineNumber:
|
|
9557
|
+
lineNumber: 273
|
|
9552
9558
|
}
|
|
9553
9559
|
}), React$2.createElement('div', {
|
|
9554
9560
|
className: classNames({
|
|
@@ -9559,7 +9565,7 @@ class MultipleChoice extends React$2.Component {
|
|
|
9559
9565
|
__self: this,
|
|
9560
9566
|
__source: {
|
|
9561
9567
|
fileName: _jsxFileName$1,
|
|
9562
|
-
lineNumber:
|
|
9568
|
+
lineNumber: 281
|
|
9563
9569
|
}
|
|
9564
9570
|
}, choices.map((choice, index) => React$2.createElement(StyledChoice, {
|
|
9565
9571
|
choicesLayout: this.props.choicesLayout,
|
|
@@ -9581,7 +9587,7 @@ class MultipleChoice extends React$2.Component {
|
|
|
9581
9587
|
__self: this,
|
|
9582
9588
|
__source: {
|
|
9583
9589
|
fileName: _jsxFileName$1,
|
|
9584
|
-
lineNumber:
|
|
9590
|
+
lineNumber: 289
|
|
9585
9591
|
}
|
|
9586
9592
|
})))));
|
|
9587
9593
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/multiple-choice",
|
|
3
3
|
"repository": "pie-framework/pie-elements",
|
|
4
|
-
"version": "9.2.
|
|
4
|
+
"version": "9.2.3",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@material-ui/core": "^3.9.2",
|
|
10
|
-
"@pie-lib/pie-toolbox": "2.0.
|
|
10
|
+
"@pie-lib/pie-toolbox": "2.0.13",
|
|
11
11
|
"classnames": "^2.2.5",
|
|
12
12
|
"debug": "^4.1.1",
|
|
13
13
|
"enzyme-to-json": "^3.3.3",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"react-test-renderer": "^16.3.2",
|
|
19
19
|
"react-transition-group": "^2.3.1"
|
|
20
20
|
},
|
|
21
|
-
"gitHead": "
|
|
21
|
+
"gitHead": "23bdbee2cc059e118209d5dcd770b3a7694da0c9",
|
|
22
22
|
"scripts": {
|
|
23
23
|
"postpublish": "../../scripts/postpublish"
|
|
24
24
|
},
|
|
@@ -27,8 +27,5 @@
|
|
|
27
27
|
"exports": {
|
|
28
28
|
".": "./src/index.js",
|
|
29
29
|
"./print": "./src/print.js"
|
|
30
|
-
},
|
|
31
|
-
"resolutions": {
|
|
32
|
-
"complex.js": "2.1.1"
|
|
33
30
|
}
|
|
34
31
|
}
|