@pie-element/multiple-choice 9.19.2 → 9.19.4

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 CHANGED
@@ -3,6 +3,28 @@
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.19.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice@9.19.3...@pie-element/multiple-choice@9.19.4) (2025-09-18)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **multiple-choice:** handle evaluate and print modes correctly PD-5200 ([6f6397e](https://github.com/pie-framework/pie-elements/commit/6f6397ee2de584da70c789c8e1ec1529ec609727))
12
+
13
+
14
+
15
+
16
+
17
+ ## [9.19.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice@9.19.2...@pie-element/multiple-choice@9.19.3) (2025-09-11)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * update pie-lib/pie-toolbox PD-5198, PD-5187 ([f04a94c](https://github.com/pie-framework/pie-elements/commit/f04a94c62a29d77fcb17b473b7de1022ad65eeb4))
23
+
24
+
25
+
26
+
27
+
6
28
  ## [9.19.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice@9.19.1...@pie-element/multiple-choice@9.19.2) (2025-09-09)
7
29
 
8
30
 
@@ -3,6 +3,17 @@
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.9](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-configure@7.7.8...@pie-element/multiple-choice-configure@7.7.9) (2025-09-11)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * update pie-lib/pie-toolbox PD-5198, PD-5187 ([f04a94c](https://github.com/pie-framework/pie-elements/commit/f04a94c62a29d77fcb17b473b7de1022ad65eeb4))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [7.7.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-configure@7.7.7...@pie-element/multiple-choice-configure@7.7.8) (2025-09-09)
7
18
 
8
19
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-element/multiple-choice-configure",
3
- "version": "7.7.8",
3
+ "version": "7.7.9",
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.25.1",
11
+ "@pie-lib/pie-toolbox": "2.25.2",
12
12
  "debug": "^3.1.0",
13
13
  "lodash": "^4.17.15",
14
14
  "prop-types": "^15.6.2",
@@ -3,6 +3,17 @@
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.9](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-controller@5.10.8...@pie-element/multiple-choice-controller@5.10.9) (2025-09-11)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * update pie-lib/pie-toolbox PD-5198, PD-5187 ([f04a94c](https://github.com/pie-framework/pie-elements/commit/f04a94c62a29d77fcb17b473b7de1022ad65eeb4))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [5.10.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-controller@5.10.7...@pie-element/multiple-choice-controller@5.10.8) (2025-09-09)
7
18
 
8
19
 
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@pie-element/multiple-choice-controller",
3
3
  "private": true,
4
- "version": "5.10.8",
4
+ "version": "5.10.9",
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.25.1",
11
+ "@pie-lib/pie-toolbox": "2.25.2",
12
12
  "debug": "^3.1.0",
13
13
  "lodash": "^4.17.15"
14
14
  }
@@ -251,7 +251,12 @@ var MultipleChoice = /*#__PURE__*/function (_React$Component) {
251
251
  }, {
252
252
  key: "getChecked",
253
253
  value: function getChecked(choice) {
254
- if (this.state.showCorrect) {
254
+ // to determine if we are in evaluate mode or print mode
255
+ // since both modes have showCorrect but it interferes with "browse mode" in IBX if the print props are set
256
+ var isEvaluateMode = this.state.showCorrect && this.props.mode === 'evaluate';
257
+ var isPrintMode = this.props.alwaysShowCorrect && (!this.props.session || !this.props.session.value || this.props.session.value.length === 0);
258
+
259
+ if (isEvaluateMode || isPrintMode) {
255
260
  return choice.correct || false;
256
261
  }
257
262
 
@@ -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","outline","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,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,EAAE;AACTC,MAAAA,OAAO,EAAE,OADA;AAETC,MAAAA,QAAQ,EAAE,SAFD;AAGTC,MAAAA,MAAM,EAAE,GAHC;AAITC,MAAAA,UAAU,EAAE,QAJH;AAKTC,MAAAA,aAAa,EAAEb,KAAK,CAACc,OAAN,CAAcC,IAAd,GAAqB;AAL3B,KAbc;AAoBzBC,IAAAA,mBAAmB,EAAE;AACnBC,MAAAA,YAAY,EAAEjB,KAAK,CAACc,OAAN,CAAcC,IAAd,GAAqB;AADhB,KApBI;AAuBzBG,IAAAA,gBAAgB,EAAE;AAChBT,MAAAA,OAAO,EAAE,MADO;AAEhBU,MAAAA,aAAa,EAAE,KAFC;AAGhBC,MAAAA,QAAQ,EAAE;AAHM,KAvBO;AA4BzBC,IAAAA,UAAU,EAAE;AACVZ,MAAAA,OAAO,EAAE;AADC,KA5Ba;AA+BzBa,IAAAA,QAAQ,EAAE;AACRf,MAAAA,MAAM,EAAE,KADA;AAERgB,MAAAA,OAAO,EAAE,cAFD;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EAAE;AACjBgC,IAAAA,SAAS,EAAET,sBAAUC,MADJ;AAEjBS,IAAAA,UAAU,EAAEV,sBAAUC;AAFL;AA1BF,C;AAsUrBxF,cAAc,CAACkG,YAAf,GAA8B;AAC5B1F,EAAAA,OAAO,EAAE;AACPJ,IAAAA,KAAK,EAAE;AADA;AADmB,CAA9B;;eAMe,wBAAW1C,MAAX,EAAmBsC,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 '&:focus': {\n outline: 'none',\n },\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"}
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","outline","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","isEvaluateMode","isPrintMode","choiceMode","classes","disabled","className","choices","gridColumns","prompt","responseCorrect","animationsDisabled","language","isSelectionButtonBelow","minSelections","autoplayAudioEnabled","customAudioButton","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;AAC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AK,EAAE;AADA;AADmB,CAA9B;;eAMe,wBAAW1C,MAAX,EAAmBsC,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 '&:focus': {\n outline: 'none',\n },\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 // to determine if we are in evaluate mode or print mode\n // since both modes have showCorrect but it interferes with \"browse mode\" in IBX if the print props are set\n const isEvaluateMode = this.state.showCorrect && this.props.mode === 'evaluate';\n const isPrintMode = this.props.alwaysShowCorrect && (!this.props.session || !this.props.session.value || this.props.session.value.length === 0);\n\n if (isEvaluateMode || isPrintMode) {\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"}
@@ -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.7.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.5.2/module/index.js";
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.7.1/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.7.1/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.7.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.5.2/module/index.js";
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.7.1/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.7.1/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;
@@ -12859,7 +12859,9 @@ class MultipleChoice$1 extends React$2.Component {
12859
12859
  };
12860
12860
  }
12861
12861
  getChecked(choice) {
12862
- if (this.state.showCorrect) {
12862
+ const isEvaluateMode = this.state.showCorrect && this.props.mode === 'evaluate';
12863
+ const isPrintMode = this.props.alwaysShowCorrect && (!this.props.session || !this.props.session.value || this.props.session.value.length === 0);
12864
+ if (isEvaluateMode || isPrintMode) {
12863
12865
  return choice.correct || false;
12864
12866
  }
12865
12867
  return this.isSelected(choice.value);
@@ -12874,14 +12876,14 @@ class MultipleChoice$1 extends React$2.Component {
12874
12876
  __self: this,
12875
12877
  __source: {
12876
12878
  fileName: _jsxFileName$1,
12877
- lineNumber: 223
12879
+ lineNumber: 228
12878
12880
  }
12879
12881
  }, "Multiple Choice Question") : React$2.createElement('h3', {
12880
12882
  className: classes.srOnly,
12881
12883
  __self: this,
12882
12884
  __source: {
12883
12885
  fileName: _jsxFileName$1,
12884
- lineNumber: 225
12886
+ lineNumber: 230
12885
12887
  }
12886
12888
  }, "Multiple Select Question");
12887
12889
  }
@@ -12916,7 +12918,7 @@ class MultipleChoice$1 extends React$2.Component {
12916
12918
  __self: this,
12917
12919
  __source: {
12918
12920
  fileName: _jsxFileName$1,
12919
- lineNumber: 275
12921
+ lineNumber: 280
12920
12922
  }
12921
12923
  });
12922
12924
  const getMultipleChoiceMinSelectionErrorMessage = () => {
@@ -12944,21 +12946,21 @@ class MultipleChoice$1 extends React$2.Component {
12944
12946
  __self: this,
12945
12947
  __source: {
12946
12948
  fileName: _jsxFileName$1,
12947
- lineNumber: 302
12949
+ lineNumber: 307
12948
12950
  }
12949
12951
  }, partLabel && React$2.createElement('h2', {
12950
12952
  className: classes.partLabel,
12951
12953
  __self: this,
12952
12954
  __source: {
12953
12955
  fileName: _jsxFileName$1,
12954
- lineNumber: 303
12956
+ lineNumber: 308
12955
12957
  }
12956
12958
  }, partLabel), this.renderHeading(), teacherInstructions && React$2.createElement('div', {
12957
12959
  className: classes.teacherInstructions,
12958
12960
  __self: this,
12959
12961
  __source: {
12960
12962
  fileName: _jsxFileName$1,
12961
- lineNumber: 308
12963
+ lineNumber: 313
12962
12964
  }
12963
12965
  }, !animationsDisabled ? React$2.createElement(Collapsible, {
12964
12966
  labels: {
@@ -12968,7 +12970,7 @@ class MultipleChoice$1 extends React$2.Component {
12968
12970
  __self: this,
12969
12971
  __source: {
12970
12972
  fileName: _jsxFileName$1,
12971
- lineNumber: 310
12973
+ lineNumber: 315
12972
12974
  }
12973
12975
  }, teacherInstructionsDiv) : teacherInstructionsDiv), React$2.createElement('fieldset', {
12974
12976
  tabIndex: 0,
@@ -12978,7 +12980,7 @@ class MultipleChoice$1 extends React$2.Component {
12978
12980
  __self: this,
12979
12981
  __source: {
12980
12982
  fileName: _jsxFileName$1,
12981
- lineNumber: 324
12983
+ lineNumber: 329
12982
12984
  }
12983
12985
  }, React$2.createElement(PreviewPrompt, {
12984
12986
  className: "prompt",
@@ -12990,7 +12992,7 @@ class MultipleChoice$1 extends React$2.Component {
12990
12992
  __self: this,
12991
12993
  __source: {
12992
12994
  fileName: _jsxFileName$1,
12993
- lineNumber: 330
12995
+ lineNumber: 335
12994
12996
  }
12995
12997
  }), !alwaysShowCorrect && React$2.createElement(CorrectAnswerToggle, {
12996
12998
  show: showCorrectAnswerToggle,
@@ -13000,7 +13002,7 @@ class MultipleChoice$1 extends React$2.Component {
13000
13002
  __self: this,
13001
13003
  __source: {
13002
13004
  fileName: _jsxFileName$1,
13003
- lineNumber: 340
13005
+ lineNumber: 345
13004
13006
  }
13005
13007
  }), React$2.createElement('div', {
13006
13008
  className: classNames({
@@ -13011,7 +13013,7 @@ class MultipleChoice$1 extends React$2.Component {
13011
13013
  __self: this,
13012
13014
  __source: {
13013
13015
  fileName: _jsxFileName$1,
13014
- lineNumber: 348
13016
+ lineNumber: 353
13015
13017
  }
13016
13018
  }, choices.map((choice, index) => React$2.createElement(StyledChoice, {
13017
13019
  autoFocusRef: index === 0 ? this.firstInputRef : null,
@@ -13036,21 +13038,21 @@ class MultipleChoice$1 extends React$2.Component {
13036
13038
  __self: this,
13037
13039
  __source: {
13038
13040
  fileName: _jsxFileName$1,
13039
- lineNumber: 356
13041
+ lineNumber: 361
13040
13042
  }
13041
13043
  })))), choiceMode === 'checkbox' && selections < minSelections && React$2.createElement('div', {
13042
13044
  className: classes.errorText,
13043
13045
  __self: this,
13044
13046
  __source: {
13045
13047
  fileName: _jsxFileName$1,
13046
- lineNumber: 382
13048
+ lineNumber: 387
13047
13049
  }
13048
13050
  }, getMultipleChoiceMinSelectionErrorMessage()), choiceMode === 'checkbox' && maxSelectionsErrorState && React$2.createElement('div', {
13049
13051
  className: classes.errorText,
13050
13052
  __self: this,
13051
13053
  __source: {
13052
13054
  fileName: _jsxFileName$1,
13053
- lineNumber: 385
13055
+ lineNumber: 390
13054
13056
  }
13055
13057
  }, translator.t(`translation:multipleChoice:maxSelections_${maxSelections === 1 ? 'one' : 'other'}`, {
13056
13058
  lng: language,
package/module/index.html CHANGED
@@ -2,7 +2,7 @@
2
2
  <!doctype html>
3
3
  <html>
4
4
  <head>
5
- <title>@pie-element/multiple-choice@9.19.1</title>
5
+ <title>@pie-element/multiple-choice@9.19.3</title>
6
6
  <script
7
7
  type="module"
8
8
  src="https://cdn.jsdelivr.net/npm/@pslb/demo-el@^1.0.0/dist/demo-el/demo-el.esm.js"></script>
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@pie-element/multiple-choice",
3
- "version": "9.19.1",
3
+ "version": "9.19.3",
4
4
  "modules": [
5
5
  {
6
6
  "name": "@pie-lib/pie-toolbox-math-rendering-module",
7
- "version": "5.7.0"
7
+ "version": "5.7.1"
8
8
  },
9
9
  {
10
10
  "name": "@pie-lib/pie-toolbox-module",
11
- "version": "8.5.2"
11
+ "version": "8.7.1"
12
12
  }
13
13
  ]
14
14
  }
package/module/print.html CHANGED
@@ -2,7 +2,7 @@
2
2
  <!doctype html>
3
3
  <html>
4
4
  <head>
5
- <title>@pie-element/multiple-choice@9.19.1</title>
5
+ <title>@pie-element/multiple-choice@9.19.3</title>
6
6
  <link
7
7
  href="https://fonts.googleapis.com/css?family=Roboto&display=swap"
8
8
  rel="stylesheet"
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.7.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.5.2/module/index.js";
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.7.1/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.7.1/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;
@@ -12859,7 +12859,9 @@ class MultipleChoice extends React$2.Component {
12859
12859
  };
12860
12860
  }
12861
12861
  getChecked(choice) {
12862
- if (this.state.showCorrect) {
12862
+ const isEvaluateMode = this.state.showCorrect && this.props.mode === 'evaluate';
12863
+ const isPrintMode = this.props.alwaysShowCorrect && (!this.props.session || !this.props.session.value || this.props.session.value.length === 0);
12864
+ if (isEvaluateMode || isPrintMode) {
12863
12865
  return choice.correct || false;
12864
12866
  }
12865
12867
  return this.isSelected(choice.value);
@@ -12874,14 +12876,14 @@ class MultipleChoice extends React$2.Component {
12874
12876
  __self: this,
12875
12877
  __source: {
12876
12878
  fileName: _jsxFileName$1,
12877
- lineNumber: 223
12879
+ lineNumber: 228
12878
12880
  }
12879
12881
  }, "Multiple Choice Question") : React$2.createElement('h3', {
12880
12882
  className: classes.srOnly,
12881
12883
  __self: this,
12882
12884
  __source: {
12883
12885
  fileName: _jsxFileName$1,
12884
- lineNumber: 225
12886
+ lineNumber: 230
12885
12887
  }
12886
12888
  }, "Multiple Select Question");
12887
12889
  }
@@ -12916,7 +12918,7 @@ class MultipleChoice extends React$2.Component {
12916
12918
  __self: this,
12917
12919
  __source: {
12918
12920
  fileName: _jsxFileName$1,
12919
- lineNumber: 275
12921
+ lineNumber: 280
12920
12922
  }
12921
12923
  });
12922
12924
  const getMultipleChoiceMinSelectionErrorMessage = () => {
@@ -12944,21 +12946,21 @@ class MultipleChoice extends React$2.Component {
12944
12946
  __self: this,
12945
12947
  __source: {
12946
12948
  fileName: _jsxFileName$1,
12947
- lineNumber: 302
12949
+ lineNumber: 307
12948
12950
  }
12949
12951
  }, partLabel && React$2.createElement('h2', {
12950
12952
  className: classes.partLabel,
12951
12953
  __self: this,
12952
12954
  __source: {
12953
12955
  fileName: _jsxFileName$1,
12954
- lineNumber: 303
12956
+ lineNumber: 308
12955
12957
  }
12956
12958
  }, partLabel), this.renderHeading(), teacherInstructions && React$2.createElement('div', {
12957
12959
  className: classes.teacherInstructions,
12958
12960
  __self: this,
12959
12961
  __source: {
12960
12962
  fileName: _jsxFileName$1,
12961
- lineNumber: 308
12963
+ lineNumber: 313
12962
12964
  }
12963
12965
  }, !animationsDisabled ? React$2.createElement(Collapsible, {
12964
12966
  labels: {
@@ -12968,7 +12970,7 @@ class MultipleChoice extends React$2.Component {
12968
12970
  __self: this,
12969
12971
  __source: {
12970
12972
  fileName: _jsxFileName$1,
12971
- lineNumber: 310
12973
+ lineNumber: 315
12972
12974
  }
12973
12975
  }, teacherInstructionsDiv) : teacherInstructionsDiv), React$2.createElement('fieldset', {
12974
12976
  tabIndex: 0,
@@ -12978,7 +12980,7 @@ class MultipleChoice extends React$2.Component {
12978
12980
  __self: this,
12979
12981
  __source: {
12980
12982
  fileName: _jsxFileName$1,
12981
- lineNumber: 324
12983
+ lineNumber: 329
12982
12984
  }
12983
12985
  }, React$2.createElement(PreviewPrompt, {
12984
12986
  className: "prompt",
@@ -12990,7 +12992,7 @@ class MultipleChoice extends React$2.Component {
12990
12992
  __self: this,
12991
12993
  __source: {
12992
12994
  fileName: _jsxFileName$1,
12993
- lineNumber: 330
12995
+ lineNumber: 335
12994
12996
  }
12995
12997
  }), !alwaysShowCorrect && React$2.createElement(CorrectAnswerToggle, {
12996
12998
  show: showCorrectAnswerToggle,
@@ -13000,7 +13002,7 @@ class MultipleChoice extends React$2.Component {
13000
13002
  __self: this,
13001
13003
  __source: {
13002
13004
  fileName: _jsxFileName$1,
13003
- lineNumber: 340
13005
+ lineNumber: 345
13004
13006
  }
13005
13007
  }), React$2.createElement('div', {
13006
13008
  className: classNames({
@@ -13011,7 +13013,7 @@ class MultipleChoice extends React$2.Component {
13011
13013
  __self: this,
13012
13014
  __source: {
13013
13015
  fileName: _jsxFileName$1,
13014
- lineNumber: 348
13016
+ lineNumber: 353
13015
13017
  }
13016
13018
  }, choices.map((choice, index) => React$2.createElement(StyledChoice, {
13017
13019
  autoFocusRef: index === 0 ? this.firstInputRef : null,
@@ -13036,21 +13038,21 @@ class MultipleChoice extends React$2.Component {
13036
13038
  __self: this,
13037
13039
  __source: {
13038
13040
  fileName: _jsxFileName$1,
13039
- lineNumber: 356
13041
+ lineNumber: 361
13040
13042
  }
13041
13043
  })))), choiceMode === 'checkbox' && selections < minSelections && React$2.createElement('div', {
13042
13044
  className: classes.errorText,
13043
13045
  __self: this,
13044
13046
  __source: {
13045
13047
  fileName: _jsxFileName$1,
13046
- lineNumber: 382
13048
+ lineNumber: 387
13047
13049
  }
13048
13050
  }, getMultipleChoiceMinSelectionErrorMessage()), choiceMode === 'checkbox' && maxSelectionsErrorState && React$2.createElement('div', {
13049
13051
  className: classes.errorText,
13050
13052
  __self: this,
13051
13053
  __source: {
13052
13054
  fileName: _jsxFileName$1,
13053
- lineNumber: 385
13055
+ lineNumber: 390
13054
13056
  }
13055
13057
  }, translator.t(`translation:multipleChoice:maxSelections_${maxSelections === 1 ? 'one' : 'other'}`, {
13056
13058
  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.19.2",
4
+ "version": "9.19.4",
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.25.1",
11
+ "@pie-lib/pie-toolbox": "2.25.2",
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": "f80de41c9acc8412b3bc5fcf8d95681e76c105d0",
22
+ "gitHead": "2fbd9065ebb09e10f21d43369168aa65124d335a",
23
23
  "scripts": {
24
24
  "postpublish": "../../scripts/postpublish"
25
25
  },