@pie-element/explicit-constructed-response 7.3.4 → 7.3.5-next.10

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/lib/main.js CHANGED
@@ -67,8 +67,7 @@ var Main = /*#__PURE__*/function (_React$Component) {
67
67
 
68
68
  _this = _super.call.apply(_super, [this].concat(args));
69
69
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "state", {
70
- showCorrectAnswer: _this.props.alwaysShowCorrect || false,
71
- value: _this.props.value
70
+ showCorrectAnswer: _this.props.alwaysShowCorrect || false
72
71
  });
73
72
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getChangeSession", function (maxLengthPerChoice) {
74
73
  return maxLengthPerChoice && maxLengthPerChoice.every(function (val, i, arr) {
@@ -84,10 +83,6 @@ var Main = /*#__PURE__*/function (_React$Component) {
84
83
  });
85
84
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "changeSession", _this.getChangeSession(_this.props.maxLengthPerChoice));
86
85
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onChange", function (value) {
87
- _this.setState({
88
- value: value
89
- });
90
-
91
86
  _this.changeSession(value);
92
87
  });
93
88
  return _this;
@@ -131,9 +126,7 @@ var Main = /*#__PURE__*/function (_React$Component) {
131
126
  }, {
132
127
  key: "render",
133
128
  value: function render() {
134
- var _this$state = this.state,
135
- showCorrectAnswer = _this$state.showCorrectAnswer,
136
- value = _this$state.value;
129
+ var showCorrectAnswer = this.state.showCorrectAnswer;
137
130
  var _this$props2 = this.props,
138
131
  alwaysShowCorrect = _this$props2.alwaysShowCorrect,
139
132
  animationsDisabled = _this$props2.animationsDisabled,
@@ -151,7 +144,8 @@ var Main = /*#__PURE__*/function (_React$Component) {
151
144
  showNote = _this$props2.showNote,
152
145
  teacherInstructions = _this$props2.teacherInstructions,
153
146
  responseAreaInputConfiguration = _this$props2.responseAreaInputConfiguration,
154
- model = _this$props2.model;
147
+ model = _this$props2.model,
148
+ value = _this$props2.value;
155
149
 
156
150
  var _ref = model || {},
157
151
  extraCSSRules = _ref.extraCSSRules;
package/lib/main.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/main.js"],"names":["translator","Translator","Main","showCorrectAnswer","props","alwaysShowCorrect","value","maxLengthPerChoice","every","val","i","arr","onChange","maxWait","setState","state","getChangeSession","changeSession","nextProps","language","note","feedback","t","lng","animationsDisabled","classes","mode","displayType","role","maxLengthPerChoiceEnabled","playerSpellCheckEnabled","prompt","rationale","showNote","teacherInstructions","responseAreaInputConfiguration","model","extraCSSRules","displayNote","mainClasses","mainContainer","noBorderColor","teacherInstructionsDiv","rationaleDiv","display","srOnly","collapsible","hidden","visible","toggleShowCorrect","__html","React","Component","PropTypes","bool","object","isRequired","disabled","string","markup","array","func","styles","theme","color","text","backgroundColor","background","inlineDisplay","blockDisplay","marginBottom","spacing","unit","borderColor","position","left","top","width","height","overflow"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,IAAQA,UAAR,GAAuBC,sBAAvB,CAAQD,UAAR;;IAEaE,I;;;;;;;;;;;;;;;8FA8BH;AACNC,MAAAA,iBAAiB,EAAE,MAAKC,KAAL,CAAWC,iBAAX,IAAgC,KAD7C;AAENC,MAAAA,KAAK,EAAE,MAAKF,KAAL,CAAWE;AAFZ,K;yGAMW,UAACC,kBAAD;AAAA,aACjBA,kBAAkB,IAAIA,kBAAkB,CAACC,KAAnB,CAAyB,UAACC,GAAD,EAAMC,CAAN,EAASC,GAAT;AAAA,eAAiBF,GAAG,KAAKE,GAAG,CAAC,CAAD,CAAX,IAAkBF,GAAG,KAAK,CAA3C;AAAA,OAAzB,CAAtB,GACI,MAAKL,KAAL,CAAWQ,QADf,GAEI,0BAAS,MAAKR,KAAL,CAAWQ,QAApB,EAA8B,IAA9B,EA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,CAAf;;eAgCe,wBAAWjB,MAAX,EAAmB5D,IAAnB,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport debounce from 'lodash/debounce';\nimport isEmpty from 'lodash/isEmpty';\nimport isEqual from 'lodash/isEqual';\nimport { CorrectAnswerToggle } from '@pie-lib/pie-toolbox/correct-answer-toggle';\nimport { ConstructedResponse } from '@pie-lib/pie-toolbox/mask-markup';\nimport { color, Collapsible, hasText, PreviewPrompt, UiLayout } from '@pie-lib/pie-toolbox/render-ui';\nimport { withStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\nimport Translator from '@pie-lib/pie-toolbox/translator';\n\nconst { translator } = Translator;\n\nexport class Main extends React.Component {\n static propTypes = {\n alwaysShowCorrect: PropTypes.bool,\n animationsDisabled: PropTypes.bool,\n classes: PropTypes.object.isRequired,\n disabled: PropTypes.bool,\n displayType: PropTypes.string,\n feedback: PropTypes.object,\n language: PropTypes.string,\n markup: PropTypes.string,\n maxLengthPerChoice: PropTypes.array,\n maxLengthPerChoiceEnabled: PropTypes.bool,\n mode: PropTypes.string,\n note: PropTypes.string,\n onChange: PropTypes.func,\n playerSpellCheckEnabled: PropTypes.bool,\n prompt: PropTypes.string,\n rationale: PropTypes.string,\n role: PropTypes.string,\n showNote: PropTypes.bool,\n teacherInstructions: PropTypes.string,\n value: PropTypes.object,\n responseAreaInputConfiguration: PropTypes.object,\n model: PropTypes.object.isRequired,\n };\n\n static defaultProps = {\n value: {},\n };\n\n state = {\n showCorrectAnswer: this.props.alwaysShowCorrect || false,\n value: this.props.value,\n };\n\n // if for all responses max length is 1, call onChange for each keystroke\n getChangeSession = (maxLengthPerChoice) =>\n maxLengthPerChoice && maxLengthPerChoice.every((val, i, arr) => val === arr[0] && val === 1)\n ? this.props.onChange\n : debounce(this.props.onChange, 1500, { maxWait: 1500 });\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n const { maxLengthPerChoice, language } = this.props;\n let { note } = this.props;\n\n if (isEmpty(nextProps.feedback)) {\n this.setState({ showCorrectAnswer: false });\n }\n\n if (nextProps.alwaysShowCorrect) {\n this.setState({ showCorrectAnswer: true });\n }\n\n if (maxLengthPerChoice && !isEqual(maxLengthPerChoice, nextProps.maxLengthPerChoice)) {\n this.changeSession = this.getChangeSession(nextProps.maxLengthPerChoice);\n }\n\n // check if the note is the default one for prev language and change to the default one for new language\n // this check is necessary in order to diferanciate between default and authour defined note\n // and only change between languages for default ones\n if (\n note &&\n language &&\n language !== nextProps.language &&\n note === translator.t('common:commonCorrectAnswerWithAlternates', { lng: language })\n ) {\n note = translator.t('common:commonCorrectAnswerWithAlternates', { lng: nextProps.language });\n }\n }\n\n toggleShowCorrect = () => {\n this.setState({ showCorrectAnswer: !this.state.showCorrectAnswer });\n };\n\n changeSession = this.getChangeSession(this.props.maxLengthPerChoice);\n\n onChange = (value) => {\n this.setState({ value });\n\n this.changeSession(value);\n };\n\n render() {\n const { showCorrectAnswer, value } = this.state;\n const {\n alwaysShowCorrect,\n animationsDisabled,\n classes,\n mode,\n displayType,\n role,\n language,\n maxLengthPerChoice,\n maxLengthPerChoiceEnabled,\n note,\n playerSpellCheckEnabled,\n prompt,\n rationale,\n showNote,\n teacherInstructions,\n responseAreaInputConfiguration,\n model,\n } = this.props;\n\n const { extraCSSRules } = model || {};\n const displayNote = (showCorrectAnswer || (mode === 'view' && role === 'instructor')) && showNote && note;\n const mainClasses = classNames([\n classes.mainContainer,\n {\n [classes.noBorderColor]: alwaysShowCorrect,\n },\n ]);\n\n const teacherInstructionsDiv = (\n <PreviewPrompt defaultClassName=\"teacher-instructions\" prompt={teacherInstructions} />\n );\n\n const rationaleDiv = <PreviewPrompt prompt={rationale} />;\n\n return (\n <UiLayout extraCSSRules={extraCSSRules} className={mainClasses} style={{ display: `${displayType}` }}>\n {mode === 'gather' && <h2 className={classes.srOnly}>Fill in the Blank Question</h2>}\n\n {teacherInstructions && hasText(teacherInstructions) && (\n <div className={classes.collapsible}>\n {!animationsDisabled ? (\n <Collapsible labels={{ hidden: 'Show Teacher Instructions', visible: 'Hide Teacher Instructions' }}>\n {teacherInstructionsDiv}\n </Collapsible>\n ) : (\n teacherInstructionsDiv\n )}\n </div>\n )}\n\n {prompt && <PreviewPrompt prompt={prompt} />}\n\n {!alwaysShowCorrect && (\n <CorrectAnswerToggle\n show={mode === 'evaluate'}\n toggled={showCorrectAnswer}\n onToggle={this.toggleShowCorrect}\n language={language}\n />\n )}\n\n <ConstructedResponse\n {...this.props}\n onChange={this.onChange}\n showCorrectAnswer={showCorrectAnswer}\n value={value}\n maxLength={maxLengthPerChoice}\n adjustedLimit={maxLengthPerChoiceEnabled}\n spellCheck={playerSpellCheckEnabled}\n pluginProps={responseAreaInputConfiguration}\n />\n\n {displayNote && <div className={classNames(classes.note, 'note')} dangerouslySetInnerHTML={{ __html: note }} />}\n\n {rationale && hasText(rationale) && (\n <div className={classes.collapsible}>\n {!animationsDisabled ? (\n <Collapsible labels={{ hidden: 'Show Rationale', visible: 'Hide Rationale' }}>{rationaleDiv}</Collapsible>\n ) : (\n rationaleDiv\n )}\n </div>\n )}\n </UiLayout>\n );\n }\n}\n\nconst styles = (theme) => ({\n mainContainer: {\n color: color.text(),\n backgroundColor: color.background(),\n },\n inlineDisplay: {\n display: 'inline-block',\n },\n blockDisplay: {\n display: 'block',\n },\n note: {\n marginBottom: theme.spacing.unit * 2,\n },\n collapsible: {\n marginBottom: theme.spacing.unit * 2,\n },\n noBorderColor: {\n '& *': {\n borderColor: `${color.text()} !important`,\n },\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 default withStyles(styles)(Main);\n"],"file":"main.js"}
1
+ {"version":3,"sources":["../src/main.js"],"names":["translator","Translator","Main","showCorrectAnswer","props","alwaysShowCorrect","maxLengthPerChoice","every","val","i","arr","onChange","maxWait","setState","state","getChangeSession","value","changeSession","nextProps","language","note","feedback","t","lng","animationsDisabled","classes","mode","displayType","role","maxLengthPerChoiceEnabled","playerSpellCheckEnabled","prompt","rationale","showNote","teacherInstructions","responseAreaInputConfiguration","model","extraCSSRules","displayNote","mainClasses","mainContainer","noBorderColor","teacherInstructionsDiv","rationaleDiv","display","srOnly","collapsible","hidden","visible","toggleShowCorrect","__html","React","Component","PropTypes","bool","object","isRequired","disabled","string","markup","array","func","styles","theme","color","text","backgroundColor","background","inlineDisplay","blockDisplay","marginBottom","spacing","unit","borderColor","position","left","top","width","height","overflow"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,IAAQA,UAAR,GAAuBC,sBAAvB,CAAQD,UAAR;;IAEaE,I;;;;;;;;;;;;;;;8FA8BH;AACNC,MAAAA,iBAAiB,EAAE,MAAKC,KAAL,CAAWC,iBAAX,IAAgC;AAD7C,K;yGAKW,UAACC,kBAAD;AAAA,aACjBA,kBAAkB,IAAIA,kBAAkB,CAACC,KAAnB,CAAyB,UAACC,GAAD,EAAMC,CAAN,EAASC,GAAT;AAAA,eAAiBF,GAAG,KAAKE,GAAG,CAAC,CAAD,CAAX,IAAkBF,GAAG,KAAK,CAA3C;AAAA,OAAzB,CAAtB,GACI,MAAKJ,KAAL,CAAWO,QADf,GAEI,0BAAS,MAAKP,KAAL,CAAWO,QAApB,EAA8B,IAA9B,EAAoC;AAAEC,QAAAA,OAAO,EAAE;AAAX,OAApC,CAHa;AAAA,K;0GAkCC,YAAM;AACxB,YAAKC,QAAL,CAAc;AAAEV,QAAAA,iBAAiB,EAAE,CAAC,MAAKW,KAAL,CAAWX;AAAjC,OAAd;AACD,K;sGAEe,MAAKY,gBAAL,CAAsB,MAAKX,KAAL,CAAWE,kBAAjC,C;iGAEL,UAACU,KAAD,EAAW;AACpB,YAAKC,aAAL,CAAmBD,KAAnB;AACD,K;;;;;;WArCD,0CAAiCE,SAAjC,EAA4C;AAC1C,wBAAyC,KAAKd,K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AAE;AACbwB,MAAAA,KAAK,EAAEA,gBAAMC,IAAN,EADM;AAEbC,MAAAA,eAAe,EAAEF,gBAAMG,UAAN;AAFJ,KADU;AAKzBC,IAAAA,aAAa,EAAE;AACbxB,MAAAA,OAAO,EAAE;AADI,KALU;AAQzByB,IAAAA,YAAY,EAAE;AACZzB,MAAAA,OAAO,EAAE;AADG,KARW;AAWzBxB,IAAAA,IAAI,EAAE;AACJkD,MAAAA,YAAY,EAAEP,KAAK,CAACQ,OAAN,CAAcC,IAAd,GAAqB;AAD/B,KAXmB;AAczB1B,IAAAA,WAAW,EAAE;AACXwB,MAAAA,YAAY,EAAEP,KAAK,CAACQ,OAAN,CAAcC,IAAd,GAAqB;AADxB,KAdY;AAiBzB/B,IAAAA,aAAa,EAAE;AACb,aAAO;AACLgC,QAAAA,WAAW,YAAKT,gBAAMC,IAAN,EAAL;AADN;AADM,KAjBU;AAsBzBpB,IAAAA,MAAM,EAAE;AACN6B,MAAAA,QAAQ,EAAE,UADJ;AAENC,MAAAA,IAAI,EAAE,UAFA;AAGNC,MAAAA,GAAG,EAAE,MAHC;AAINC,MAAAA,KAAK,EAAE,KAJD;AAKNC,MAAAA,MAAM,EAAE,KALF;AAMNC,MAAAA,QAAQ,EAAE;AANJ;AAtBiB,GAAZ;AAAA,CAAf;;eAgCe,wBAAWjB,MAAX,EAAmB5D,IAAnB,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport debounce from 'lodash/debounce';\nimport isEmpty from 'lodash/isEmpty';\nimport isEqual from 'lodash/isEqual';\nimport { CorrectAnswerToggle } from '@pie-lib/pie-toolbox/correct-answer-toggle';\nimport { ConstructedResponse } from '@pie-lib/pie-toolbox/mask-markup';\nimport { color, Collapsible, hasText, PreviewPrompt, UiLayout } from '@pie-lib/pie-toolbox/render-ui';\nimport { withStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\nimport Translator from '@pie-lib/pie-toolbox/translator';\n\nconst { translator } = Translator;\n\nexport class Main extends React.Component {\n static propTypes = {\n alwaysShowCorrect: PropTypes.bool,\n animationsDisabled: PropTypes.bool,\n classes: PropTypes.object.isRequired,\n disabled: PropTypes.bool,\n displayType: PropTypes.string,\n feedback: PropTypes.object,\n language: PropTypes.string,\n markup: PropTypes.string,\n maxLengthPerChoice: PropTypes.array,\n maxLengthPerChoiceEnabled: PropTypes.bool,\n mode: PropTypes.string,\n note: PropTypes.string,\n onChange: PropTypes.func,\n playerSpellCheckEnabled: PropTypes.bool,\n prompt: PropTypes.string,\n rationale: PropTypes.string,\n role: PropTypes.string,\n showNote: PropTypes.bool,\n teacherInstructions: PropTypes.string,\n value: PropTypes.object,\n responseAreaInputConfiguration: PropTypes.object,\n model: PropTypes.object.isRequired,\n };\n\n static defaultProps = {\n value: {},\n };\n\n state = {\n showCorrectAnswer: this.props.alwaysShowCorrect || false,\n };\n\n // if for all responses max length is 1, call onChange for each keystroke\n getChangeSession = (maxLengthPerChoice) =>\n maxLengthPerChoice && maxLengthPerChoice.every((val, i, arr) => val === arr[0] && val === 1)\n ? this.props.onChange\n : debounce(this.props.onChange, 1500, { maxWait: 1500 });\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n const { maxLengthPerChoice, language } = this.props;\n let { note } = this.props;\n\n if (isEmpty(nextProps.feedback)) {\n this.setState({ showCorrectAnswer: false });\n }\n\n if (nextProps.alwaysShowCorrect) {\n this.setState({ showCorrectAnswer: true });\n }\n\n if (maxLengthPerChoice && !isEqual(maxLengthPerChoice, nextProps.maxLengthPerChoice)) {\n this.changeSession = this.getChangeSession(nextProps.maxLengthPerChoice);\n }\n\n // check if the note is the default one for prev language and change to the default one for new language\n // this check is necessary in order to diferanciate between default and authour defined note\n // and only change between languages for default ones\n if (\n note &&\n language &&\n language !== nextProps.language &&\n note === translator.t('common:commonCorrectAnswerWithAlternates', { lng: language })\n ) {\n note = translator.t('common:commonCorrectAnswerWithAlternates', { lng: nextProps.language });\n }\n }\n\n toggleShowCorrect = () => {\n this.setState({ showCorrectAnswer: !this.state.showCorrectAnswer });\n };\n\n changeSession = this.getChangeSession(this.props.maxLengthPerChoice);\n\n onChange = (value) => {\n this.changeSession(value);\n };\n\n render() {\n const { showCorrectAnswer } = this.state;\n const {\n alwaysShowCorrect,\n animationsDisabled,\n classes,\n mode,\n displayType,\n role,\n language,\n maxLengthPerChoice,\n maxLengthPerChoiceEnabled,\n note,\n playerSpellCheckEnabled,\n prompt,\n rationale,\n showNote,\n teacherInstructions,\n responseAreaInputConfiguration,\n model,\n value,\n } = this.props;\n\n const { extraCSSRules } = model || {};\n const displayNote = (showCorrectAnswer || (mode === 'view' && role === 'instructor')) && showNote && note;\n const mainClasses = classNames([\n classes.mainContainer,\n {\n [classes.noBorderColor]: alwaysShowCorrect,\n },\n ]);\n\n const teacherInstructionsDiv = (\n <PreviewPrompt defaultClassName=\"teacher-instructions\" prompt={teacherInstructions} />\n );\n\n const rationaleDiv = <PreviewPrompt prompt={rationale} />;\n\n return (\n <UiLayout extraCSSRules={extraCSSRules} className={mainClasses} style={{ display: `${displayType}` }}>\n {mode === 'gather' && <h2 className={classes.srOnly}>Fill in the Blank Question</h2>}\n\n {teacherInstructions && hasText(teacherInstructions) && (\n <div className={classes.collapsible}>\n {!animationsDisabled ? (\n <Collapsible labels={{ hidden: 'Show Teacher Instructions', visible: 'Hide Teacher Instructions' }}>\n {teacherInstructionsDiv}\n </Collapsible>\n ) : (\n teacherInstructionsDiv\n )}\n </div>\n )}\n\n {prompt && <PreviewPrompt prompt={prompt} />}\n\n {!alwaysShowCorrect && (\n <CorrectAnswerToggle\n show={mode === 'evaluate'}\n toggled={showCorrectAnswer}\n onToggle={this.toggleShowCorrect}\n language={language}\n />\n )}\n\n <ConstructedResponse\n {...this.props}\n onChange={this.onChange}\n showCorrectAnswer={showCorrectAnswer}\n value={value}\n maxLength={maxLengthPerChoice}\n adjustedLimit={maxLengthPerChoiceEnabled}\n spellCheck={playerSpellCheckEnabled}\n pluginProps={responseAreaInputConfiguration}\n />\n\n {displayNote && <div className={classNames(classes.note, 'note')} dangerouslySetInnerHTML={{ __html: note }} />}\n\n {rationale && hasText(rationale) && (\n <div className={classes.collapsible}>\n {!animationsDisabled ? (\n <Collapsible labels={{ hidden: 'Show Rationale', visible: 'Hide Rationale' }}>{rationaleDiv}</Collapsible>\n ) : (\n rationaleDiv\n )}\n </div>\n )}\n </UiLayout>\n );\n }\n}\n\nconst styles = (theme) => ({\n mainContainer: {\n color: color.text(),\n backgroundColor: color.background(),\n },\n inlineDisplay: {\n display: 'inline-block',\n },\n blockDisplay: {\n display: 'block',\n },\n note: {\n marginBottom: theme.spacing.unit * 2,\n },\n collapsible: {\n marginBottom: theme.spacing.unit * 2,\n },\n noBorderColor: {\n '& *': {\n borderColor: `${color.text()} !important`,\n },\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 default withStyles(styles)(Main);\n"],"file":"main.js"}
@@ -1,4 +1,4 @@
1
- import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@3.3.2/module/index.js";
1
+ import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@3.3.3/module/index.js";
2
2
  import {_dll_pie_lib__pie_toolbox_editable_html, _dll_pie_lib__pie_toolbox_config_ui} from "../../../@pie-lib/pie-toolbox-module@5.10.2/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) {
package/module/element.js CHANGED
@@ -1,4 +1,4 @@
1
- import {_dll_react, _dll_prop_types, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_classnames, _dll_react_dom, _dll_pie_framework__mathquill, _dll_pie_lib__pie_toolbox_math_rendering} from "../../../@pie-lib/pie-toolbox-math-rendering-module@3.3.2/module/index.js";
1
+ import {_dll_react, _dll_prop_types, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_classnames, _dll_react_dom, _dll_pie_framework__mathquill, _dll_pie_lib__pie_toolbox_math_rendering} from "../../../@pie-lib/pie-toolbox-math-rendering-module@3.3.3/module/index.js";
2
2
  import {_dll_pie_lib__pie_toolbox_correct_answer_toggle, _dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@5.10.2/module/index.js";
3
3
  function _mergeNamespaces(n, m) {
4
4
  m.forEach(function (e) {
@@ -184512,8 +184512,7 @@ class Main extends React$1.Component {
184512
184512
  }
184513
184513
  __init() {
184514
184514
  this.state = {
184515
- showCorrectAnswer: this.props.alwaysShowCorrect || false,
184516
- value: this.props.value
184515
+ showCorrectAnswer: this.props.alwaysShowCorrect || false
184517
184516
  };
184518
184517
  }
184519
184518
  __init2() {
@@ -184557,15 +184556,12 @@ class Main extends React$1.Component {
184557
184556
  }
184558
184557
  __init5() {
184559
184558
  this.onChange = value => {
184560
- this.setState({
184561
- value
184562
- });
184563
184559
  this.changeSession(value);
184564
184560
  };
184565
184561
  }
184566
184562
  render() {
184567
- const {showCorrectAnswer, value} = this.state;
184568
- const {alwaysShowCorrect, animationsDisabled, classes, mode, displayType, role, language, maxLengthPerChoice, maxLengthPerChoiceEnabled, note, playerSpellCheckEnabled, prompt, rationale, showNote, teacherInstructions, responseAreaInputConfiguration, model} = this.props;
184563
+ const {showCorrectAnswer} = this.state;
184564
+ const {alwaysShowCorrect, animationsDisabled, classes, mode, displayType, role, language, maxLengthPerChoice, maxLengthPerChoiceEnabled, note, playerSpellCheckEnabled, prompt, rationale, showNote, teacherInstructions, responseAreaInputConfiguration, model, value} = this.props;
184569
184565
  const {extraCSSRules} = model || ({});
184570
184566
  const displayNote = (showCorrectAnswer || mode === 'view' && role === 'instructor') && showNote && note;
184571
184567
  const mainClasses = classNames([classes.mainContainer, {
@@ -184577,7 +184573,7 @@ class Main extends React$1.Component {
184577
184573
  __self: this,
184578
184574
  __source: {
184579
184575
  fileName: _jsxFileName,
184580
- lineNumber: 129
184576
+ lineNumber: 127
184581
184577
  }
184582
184578
  });
184583
184579
  const rationaleDiv = React$1.createElement(PreviewPrompt, {
@@ -184585,7 +184581,7 @@ class Main extends React$1.Component {
184585
184581
  __self: this,
184586
184582
  __source: {
184587
184583
  fileName: _jsxFileName,
184588
- lineNumber: 132
184584
+ lineNumber: 130
184589
184585
  }
184590
184586
  });
184591
184587
  return React$1.createElement(UiLayout, {
@@ -184597,21 +184593,21 @@ class Main extends React$1.Component {
184597
184593
  __self: this,
184598
184594
  __source: {
184599
184595
  fileName: _jsxFileName,
184600
- lineNumber: 135
184596
+ lineNumber: 133
184601
184597
  }
184602
184598
  }, mode === 'gather' && React$1.createElement('h2', {
184603
184599
  className: classes.srOnly,
184604
184600
  __self: this,
184605
184601
  __source: {
184606
184602
  fileName: _jsxFileName,
184607
- lineNumber: 136
184603
+ lineNumber: 134
184608
184604
  }
184609
184605
  }, "Fill in the Blank Question"), teacherInstructions && hasText(teacherInstructions) && React$1.createElement('div', {
184610
184606
  className: classes.collapsible,
184611
184607
  __self: this,
184612
184608
  __source: {
184613
184609
  fileName: _jsxFileName,
184614
- lineNumber: 139
184610
+ lineNumber: 137
184615
184611
  }
184616
184612
  }, !animationsDisabled ? React$1.createElement(Collapsible, {
184617
184613
  labels: {
@@ -184621,14 +184617,14 @@ class Main extends React$1.Component {
184621
184617
  __self: this,
184622
184618
  __source: {
184623
184619
  fileName: _jsxFileName,
184624
- lineNumber: 141
184620
+ lineNumber: 139
184625
184621
  }
184626
184622
  }, teacherInstructionsDiv) : teacherInstructionsDiv), prompt && React$1.createElement(PreviewPrompt, {
184627
184623
  prompt: prompt,
184628
184624
  __self: this,
184629
184625
  __source: {
184630
184626
  fileName: _jsxFileName,
184631
- lineNumber: 150
184627
+ lineNumber: 148
184632
184628
  }
184633
184629
  }), !alwaysShowCorrect && React$1.createElement(CorrectAnswerToggle, {
184634
184630
  show: mode === 'evaluate',
@@ -184638,7 +184634,7 @@ class Main extends React$1.Component {
184638
184634
  __self: this,
184639
184635
  __source: {
184640
184636
  fileName: _jsxFileName,
184641
- lineNumber: 153
184637
+ lineNumber: 151
184642
184638
  }
184643
184639
  }), React$1.createElement(maskMarkup$1.ConstructedResponse, {
184644
184640
  ...this.props,
@@ -184652,7 +184648,7 @@ class Main extends React$1.Component {
184652
184648
  __self: this,
184653
184649
  __source: {
184654
184650
  fileName: _jsxFileName,
184655
- lineNumber: 161
184651
+ lineNumber: 159
184656
184652
  }
184657
184653
  }), displayNote && React$1.createElement('div', {
184658
184654
  className: classNames(classes.note, 'note'),
@@ -184662,14 +184658,14 @@ class Main extends React$1.Component {
184662
184658
  __self: this,
184663
184659
  __source: {
184664
184660
  fileName: _jsxFileName,
184665
- lineNumber: 172
184661
+ lineNumber: 170
184666
184662
  }
184667
184663
  }), rationale && hasText(rationale) && React$1.createElement('div', {
184668
184664
  className: classes.collapsible,
184669
184665
  __self: this,
184670
184666
  __source: {
184671
184667
  fileName: _jsxFileName,
184672
- lineNumber: 175
184668
+ lineNumber: 173
184673
184669
  }
184674
184670
  }, !animationsDisabled ? React$1.createElement(Collapsible, {
184675
184671
  labels: {
@@ -184679,7 +184675,7 @@ class Main extends React$1.Component {
184679
184675
  __self: this,
184680
184676
  __source: {
184681
184677
  fileName: _jsxFileName,
184682
- lineNumber: 177
184678
+ lineNumber: 175
184683
184679
  }
184684
184680
  }, rationaleDiv) : rationaleDiv));
184685
184681
  }
package/module/index.html CHANGED
@@ -2,7 +2,7 @@
2
2
  <!doctype html>
3
3
  <html>
4
4
  <head>
5
- <title>@pie-element/explicit-constructed-response@7.3.3</title>
5
+ <title>@pie-element/explicit-constructed-response@7.3.4</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,10 +1,10 @@
1
1
  {
2
2
  "name": "@pie-element/explicit-constructed-response",
3
- "version": "7.3.3",
3
+ "version": "7.3.4",
4
4
  "modules": [
5
5
  {
6
6
  "name": "@pie-lib/pie-toolbox-math-rendering-module",
7
- "version": "3.3.2"
7
+ "version": "3.3.3"
8
8
  },
9
9
  {
10
10
  "name": "@pie-lib/pie-toolbox-module",
package/module/print.html CHANGED
@@ -2,7 +2,7 @@
2
2
  <!doctype html>
3
3
  <html>
4
4
  <head>
5
- <title>@pie-element/explicit-constructed-response@7.3.3</title>
5
+ <title>@pie-element/explicit-constructed-response@7.3.4</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,4 +1,4 @@
1
- import {_dll_react, _dll_prop_types, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_classnames, _dll_react_dom, _dll_pie_framework__mathquill, _dll_pie_lib__pie_toolbox_math_rendering} from "../../../@pie-lib/pie-toolbox-math-rendering-module@3.3.2/module/index.js";
1
+ import {_dll_react, _dll_prop_types, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_classnames, _dll_react_dom, _dll_pie_framework__mathquill, _dll_pie_lib__pie_toolbox_math_rendering} from "../../../@pie-lib/pie-toolbox-math-rendering-module@3.3.3/module/index.js";
2
2
  import {_dll_pie_lib__pie_toolbox_correct_answer_toggle, _dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@5.10.2/module/index.js";
3
3
  function _mergeNamespaces(n, m) {
4
4
  m.forEach(function (e) {
@@ -184475,8 +184475,7 @@ class Main extends React$1.Component {
184475
184475
  }
184476
184476
  __init() {
184477
184477
  this.state = {
184478
- showCorrectAnswer: this.props.alwaysShowCorrect || false,
184479
- value: this.props.value
184478
+ showCorrectAnswer: this.props.alwaysShowCorrect || false
184480
184479
  };
184481
184480
  }
184482
184481
  __init2() {
@@ -184520,15 +184519,12 @@ class Main extends React$1.Component {
184520
184519
  }
184521
184520
  __init5() {
184522
184521
  this.onChange = value => {
184523
- this.setState({
184524
- value
184525
- });
184526
184522
  this.changeSession(value);
184527
184523
  };
184528
184524
  }
184529
184525
  render() {
184530
- const {showCorrectAnswer, value} = this.state;
184531
- const {alwaysShowCorrect, animationsDisabled, classes, mode, displayType, role, language, maxLengthPerChoice, maxLengthPerChoiceEnabled, note, playerSpellCheckEnabled, prompt, rationale, showNote, teacherInstructions, responseAreaInputConfiguration, model} = this.props;
184526
+ const {showCorrectAnswer} = this.state;
184527
+ const {alwaysShowCorrect, animationsDisabled, classes, mode, displayType, role, language, maxLengthPerChoice, maxLengthPerChoiceEnabled, note, playerSpellCheckEnabled, prompt, rationale, showNote, teacherInstructions, responseAreaInputConfiguration, model, value} = this.props;
184532
184528
  const {extraCSSRules} = model || ({});
184533
184529
  const displayNote = (showCorrectAnswer || mode === 'view' && role === 'instructor') && showNote && note;
184534
184530
  const mainClasses = classNames([classes.mainContainer, {
@@ -184540,7 +184536,7 @@ class Main extends React$1.Component {
184540
184536
  __self: this,
184541
184537
  __source: {
184542
184538
  fileName: _jsxFileName,
184543
- lineNumber: 129
184539
+ lineNumber: 127
184544
184540
  }
184545
184541
  });
184546
184542
  const rationaleDiv = React$1.createElement(PreviewPrompt, {
@@ -184548,7 +184544,7 @@ class Main extends React$1.Component {
184548
184544
  __self: this,
184549
184545
  __source: {
184550
184546
  fileName: _jsxFileName,
184551
- lineNumber: 132
184547
+ lineNumber: 130
184552
184548
  }
184553
184549
  });
184554
184550
  return React$1.createElement(UiLayout, {
@@ -184560,21 +184556,21 @@ class Main extends React$1.Component {
184560
184556
  __self: this,
184561
184557
  __source: {
184562
184558
  fileName: _jsxFileName,
184563
- lineNumber: 135
184559
+ lineNumber: 133
184564
184560
  }
184565
184561
  }, mode === 'gather' && React$1.createElement('h2', {
184566
184562
  className: classes.srOnly,
184567
184563
  __self: this,
184568
184564
  __source: {
184569
184565
  fileName: _jsxFileName,
184570
- lineNumber: 136
184566
+ lineNumber: 134
184571
184567
  }
184572
184568
  }, "Fill in the Blank Question"), teacherInstructions && hasText(teacherInstructions) && React$1.createElement('div', {
184573
184569
  className: classes.collapsible,
184574
184570
  __self: this,
184575
184571
  __source: {
184576
184572
  fileName: _jsxFileName,
184577
- lineNumber: 139
184573
+ lineNumber: 137
184578
184574
  }
184579
184575
  }, !animationsDisabled ? React$1.createElement(Collapsible, {
184580
184576
  labels: {
@@ -184584,14 +184580,14 @@ class Main extends React$1.Component {
184584
184580
  __self: this,
184585
184581
  __source: {
184586
184582
  fileName: _jsxFileName,
184587
- lineNumber: 141
184583
+ lineNumber: 139
184588
184584
  }
184589
184585
  }, teacherInstructionsDiv) : teacherInstructionsDiv), prompt && React$1.createElement(PreviewPrompt, {
184590
184586
  prompt: prompt,
184591
184587
  __self: this,
184592
184588
  __source: {
184593
184589
  fileName: _jsxFileName,
184594
- lineNumber: 150
184590
+ lineNumber: 148
184595
184591
  }
184596
184592
  }), !alwaysShowCorrect && React$1.createElement(CorrectAnswerToggle, {
184597
184593
  show: mode === 'evaluate',
@@ -184601,7 +184597,7 @@ class Main extends React$1.Component {
184601
184597
  __self: this,
184602
184598
  __source: {
184603
184599
  fileName: _jsxFileName,
184604
- lineNumber: 153
184600
+ lineNumber: 151
184605
184601
  }
184606
184602
  }), React$1.createElement(maskMarkup$1.ConstructedResponse, {
184607
184603
  ...this.props,
@@ -184615,7 +184611,7 @@ class Main extends React$1.Component {
184615
184611
  __self: this,
184616
184612
  __source: {
184617
184613
  fileName: _jsxFileName,
184618
- lineNumber: 161
184614
+ lineNumber: 159
184619
184615
  }
184620
184616
  }), displayNote && React$1.createElement('div', {
184621
184617
  className: classNames(classes.note, 'note'),
@@ -184625,14 +184621,14 @@ class Main extends React$1.Component {
184625
184621
  __self: this,
184626
184622
  __source: {
184627
184623
  fileName: _jsxFileName,
184628
- lineNumber: 172
184624
+ lineNumber: 170
184629
184625
  }
184630
184626
  }), rationale && hasText(rationale) && React$1.createElement('div', {
184631
184627
  className: classes.collapsible,
184632
184628
  __self: this,
184633
184629
  __source: {
184634
184630
  fileName: _jsxFileName,
184635
- lineNumber: 175
184631
+ lineNumber: 173
184636
184632
  }
184637
184633
  }, !animationsDisabled ? React$1.createElement(Collapsible, {
184638
184634
  labels: {
@@ -184642,7 +184638,7 @@ class Main extends React$1.Component {
184642
184638
  __self: this,
184643
184639
  __source: {
184644
184640
  fileName: _jsxFileName,
184645
- lineNumber: 177
184641
+ lineNumber: 175
184646
184642
  }
184647
184643
  }, rationaleDiv) : rationaleDiv));
184648
184644
  }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "repository": "pie-framework/pie-elements",
7
- "version": "7.3.4",
7
+ "version": "7.3.5-next.10+29cb392a6",
8
8
  "description": "",
9
9
  "scripts": {
10
10
  "postpublish": "../../scripts/postpublish"
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "author": "",
23
23
  "license": "ISC",
24
- "gitHead": "fe5970fc89907fd6b1b02816ce9286d5798217ef",
24
+ "gitHead": "29cb392a6b20836b25a322f1ef94b8c4dc8eb245",
25
25
  "main": "lib/index.js",
26
26
  "module": "src/index.js",
27
27
  "exports": {