@pie-element/explicit-constructed-response 3.9.3-next.477 → 3.9.3-next.485
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 +7 -15
- package/lib/main.js.map +1 -1
- package/lib/print.js +3 -2
- package/lib/print.js.map +1 -1
- package/module/element.js +18 -25
- package/module/print.js +21 -27
- package/package.json +2 -2
package/lib/main.js
CHANGED
|
@@ -137,18 +137,13 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
137
137
|
var displayNote = (showCorrectAnswer || mode === 'view' && role === 'instructor') && showNote && note;
|
|
138
138
|
var mainClasses = (0, _classnames["default"])([classes.mainContainer, (0, _defineProperty2["default"])({}, classes.noBorderColor, alwaysShowCorrect)]);
|
|
139
139
|
|
|
140
|
-
var teacherInstructionsDiv = /*#__PURE__*/_react["default"].createElement(
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
__html: teacherInstructions
|
|
144
|
-
}
|
|
140
|
+
var teacherInstructionsDiv = /*#__PURE__*/_react["default"].createElement(_renderUi.PreviewPrompt, {
|
|
141
|
+
defaultClassName: "teacher-instructions",
|
|
142
|
+
prompt: teacherInstructions
|
|
145
143
|
});
|
|
146
144
|
|
|
147
|
-
var rationaleDiv = /*#__PURE__*/_react["default"].createElement(
|
|
148
|
-
|
|
149
|
-
dangerouslySetInnerHTML: {
|
|
150
|
-
__html: rationale
|
|
151
|
-
}
|
|
145
|
+
var rationaleDiv = /*#__PURE__*/_react["default"].createElement(_renderUi.PreviewPrompt, {
|
|
146
|
+
prompt: rationale
|
|
152
147
|
});
|
|
153
148
|
|
|
154
149
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -167,11 +162,8 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
167
162
|
show: mode === 'evaluate',
|
|
168
163
|
toggled: showCorrectAnswer,
|
|
169
164
|
onToggle: this.toggleShowCorrect
|
|
170
|
-
}), prompt && /*#__PURE__*/_react["default"].createElement(
|
|
171
|
-
|
|
172
|
-
dangerouslySetInnerHTML: {
|
|
173
|
-
__html: prompt
|
|
174
|
-
}
|
|
165
|
+
}), prompt && /*#__PURE__*/_react["default"].createElement(_renderUi.PreviewPrompt, {
|
|
166
|
+
prompt: prompt
|
|
175
167
|
}), /*#__PURE__*/_react["default"].createElement(_maskMarkup.ConstructedResponse, (0, _extends2["default"])({}, this.props, {
|
|
176
168
|
onChange: this.onChange,
|
|
177
169
|
showCorrectAnswer: showCorrectAnswer,
|
package/lib/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/main.js"],"names":["Main","showCorrectAnswer","props","alwaysShowCorrect","value","maxLengthPerChoice","every","val","i","arr","onChange","maxWait","setState","state","getChangeSession","changeSession","nextProps","feedback","classes","mode","prompt","rationale","teacherInstructions","note","showNote","env","animationsDisabled","maxLengthPerChoiceEnabled","displayType","role","displayNote","mainClasses","mainContainer","noBorderColor","teacherInstructionsDiv","__html","rationaleDiv","display","collapsible","hidden","visible","toggleShowCorrect","React","Component","PropTypes","object","isRequired","string","bool","disabled","markup","func","array","styles","theme","padding","spacing","unit","color","text","backgroundColor","background","inlineDisplay","blockDisplay","margin","borderColor"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;IAEaA,I;;;;;;;;;;;;;;;8FAwBH;AACNC,MAAAA,iBAAiB,EAAE,MAAKC,KAAL,CAAWC,iBAAX,IAAgC,KAD7C;AAENC,MAAAA,KAAK,EAAE,MAAKF,KAAL,CAAWE;AAFZ,K;yGAMW,UAAAC,kBAAkB;AAAA,aACnCA,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,OAA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IAAAA,aAAa,EAAE;AACb,aAAO;AACLgC,QAAAA,WAAW,YAAKP,gBAAMC,IAAN,EAAL;AADN;AADM;AAlBQ,GAAL;AAAA,CAApB;;eAyBe,wBAAWN,MAAX,EAAmBrD,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/correct-answer-toggle';\nimport { ConstructedResponse } from '@pie-lib/mask-markup';\nimport { color, Collapsible, hasText } from '@pie-lib/render-ui';\nimport { withStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\n\nexport class Main extends React.Component {\n static propTypes = {\n classes: PropTypes.object.isRequired,\n prompt: PropTypes.string,\n note: PropTypes.string,\n showNote: PropTypes.bool,\n env: PropTypes.object,\n rationale: PropTypes.string,\n disabled: PropTypes.bool,\n markup: PropTypes.string,\n mode: PropTypes.string,\n teacherInstructions: PropTypes.string,\n value: PropTypes.object,\n feedback: PropTypes.object,\n onChange: PropTypes.func,\n alwaysShowCorrect: PropTypes.bool,\n animationsDisabled: PropTypes.bool,\n maxLengthPerChoice: PropTypes.array\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) ? this.props.onChange\n : debounce(this.props.onChange, 1500, { maxWait: 1500 });\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n const { maxLengthPerChoice } = 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\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 classes,\n mode,\n prompt,\n rationale,\n teacherInstructions,\n note,\n showNote,\n env,\n animationsDisabled,\n alwaysShowCorrect,\n maxLengthPerChoice,\n maxLengthPerChoiceEnabled,\n displayType\n } = this.props;\n const { role } = env || {};\n const displayNote = (showCorrectAnswer || mode === 'view' && role === 'instructor') && showNote && note;\n const mainClasses = classNames([classes.mainContainer, {\n [classes.noBorderColor]: alwaysShowCorrect\n }]);\n\n const teacherInstructionsDiv = <div\n className=\"teacher-instructions\"\n dangerouslySetInnerHTML={{ __html: teacherInstructions }}\n />;\n\n const rationaleDiv = <div className=\"rationale\" dangerouslySetInnerHTML={{ __html: rationale }}/>;\n\n return (\n <div className={mainClasses} style={{ display: `${displayType}` }}>\n {\n teacherInstructions && hasText(teacherInstructions) && (\n <div className={classes.collapsible}>\n {!animationsDisabled ? <Collapsible\n labels={{ hidden: 'Show Teacher Instructions', visible: 'Hide Teacher Instructions' }}\n >\n {teacherInstructionsDiv}\n </Collapsible>\n : teacherInstructionsDiv}\n </div>\n )\n }\n {!alwaysShowCorrect && <CorrectAnswerToggle\n show={mode === 'evaluate'}\n toggled={showCorrectAnswer}\n onToggle={this.toggleShowCorrect}\n />}\n {prompt && <div className=\"prompt\" dangerouslySetInnerHTML={{ __html: prompt }}/>}\n <ConstructedResponse\n {...this.props}\n onChange={this.onChange}\n showCorrectAnswer={showCorrectAnswer}\n value={value}\n maxLength={maxLengthPerChoice}\n adjustedLimit={maxLengthPerChoiceEnabled}\n />\n {displayNote && (\n <div\n className={classNames(classes.note, 'note')}\n dangerouslySetInnerHTML={{ __html: `<strong>Note:</strong> ${note}` }}\n />\n )}\n {rationale && hasText(rationale) && (\n <div className={classes.collapsible}>\n {!animationsDisabled ? <Collapsible\n labels={{ hidden: 'Show Rationale', visible: 'Hide Rationale' }}\n >\n {rationaleDiv}\n </Collapsible>\n : rationaleDiv}\n </div>\n )}\n </div>\n );\n }\n}\n\nconst styles = theme => ({\n mainContainer: {\n padding: theme.spacing.unit,\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 padding: '5px 0'\n },\n collapsible: {\n margin: `${theme.spacing.unit * 2}px 0`\n },\n noBorderColor: {\n '& *': {\n borderColor: `${color.text()} !important`\n }\n }\n});\n\nexport default withStyles(styles)(Main);\n"],"file":"main.js"}
|
|
1
|
+
{"version":3,"sources":["../src/main.js"],"names":["Main","showCorrectAnswer","props","alwaysShowCorrect","value","maxLengthPerChoice","every","val","i","arr","onChange","maxWait","setState","state","getChangeSession","changeSession","nextProps","feedback","classes","mode","prompt","rationale","teacherInstructions","note","showNote","env","animationsDisabled","maxLengthPerChoiceEnabled","displayType","role","displayNote","mainClasses","mainContainer","noBorderColor","teacherInstructionsDiv","rationaleDiv","display","collapsible","hidden","visible","toggleShowCorrect","__html","React","Component","PropTypes","object","isRequired","string","bool","disabled","markup","func","array","styles","theme","padding","spacing","unit","color","text","backgroundColor","background","inlineDisplay","blockDisplay","margin","borderColor"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;IAEaA,I;;;;;;;;;;;;;;;8FAwBH;AACNC,MAAAA,iBAAiB,EAAE,MAAKC,KAAL,CAAWC,iBAAX,IAAgC,KAD7C;AAENC,MAAAA,KAAK,EAAE,MAAKF,KAAL,CAAWE;AAFZ,K;yGAMW,UAAAC,kBAAkB;AAAA,aACnCA,kBAAkB,IAAIA,kBAAkB,CAACC,KAAnB,CAAyB,UAACC,GAAD,EAAMC,CA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EAAE;AACb,aAAO;AACLgC,QAAAA,WAAW,YAAKP,gBAAMC,IAAN,EAAL;AADN;AADM;AAlBQ,GAAL;AAAA,CAApB;;eAyBe,wBAAWN,MAAX,EAAmBrD,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/correct-answer-toggle';\nimport { ConstructedResponse } from '@pie-lib/mask-markup';\nimport {color, Collapsible, hasText, PreviewPrompt} from '@pie-lib/render-ui';\nimport { withStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\n\nexport class Main extends React.Component {\n static propTypes = {\n classes: PropTypes.object.isRequired,\n prompt: PropTypes.string,\n note: PropTypes.string,\n showNote: PropTypes.bool,\n env: PropTypes.object,\n rationale: PropTypes.string,\n disabled: PropTypes.bool,\n markup: PropTypes.string,\n mode: PropTypes.string,\n teacherInstructions: PropTypes.string,\n value: PropTypes.object,\n feedback: PropTypes.object,\n onChange: PropTypes.func,\n alwaysShowCorrect: PropTypes.bool,\n animationsDisabled: PropTypes.bool,\n maxLengthPerChoice: PropTypes.array\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) ? this.props.onChange\n : debounce(this.props.onChange, 1500, { maxWait: 1500 });\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n const { maxLengthPerChoice } = 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\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 classes,\n mode,\n prompt,\n rationale,\n teacherInstructions,\n note,\n showNote,\n env,\n animationsDisabled,\n alwaysShowCorrect,\n maxLengthPerChoice,\n maxLengthPerChoiceEnabled,\n displayType\n } = this.props;\n const { role } = env || {};\n const displayNote = (showCorrectAnswer || mode === 'view' && role === 'instructor') && showNote && note;\n const mainClasses = classNames([classes.mainContainer, {\n [classes.noBorderColor]: alwaysShowCorrect\n }]);\n\n const teacherInstructionsDiv = <PreviewPrompt defaultClassName=\"teacher-instructions\" prompt={teacherInstructions} />;\n\n const rationaleDiv = <PreviewPrompt prompt={rationale} />;\n\n return (\n <div className={mainClasses} style={{ display: `${displayType}` }}>\n {\n teacherInstructions && hasText(teacherInstructions) && (\n <div className={classes.collapsible}>\n {!animationsDisabled ? <Collapsible\n labels={{ hidden: 'Show Teacher Instructions', visible: 'Hide Teacher Instructions' }}\n >\n {teacherInstructionsDiv}\n </Collapsible>\n : teacherInstructionsDiv}\n </div>\n )\n }\n {!alwaysShowCorrect && <CorrectAnswerToggle\n show={mode === 'evaluate'}\n toggled={showCorrectAnswer}\n onToggle={this.toggleShowCorrect}\n />}\n {prompt && <PreviewPrompt prompt={prompt} />}\n <ConstructedResponse\n {...this.props}\n onChange={this.onChange}\n showCorrectAnswer={showCorrectAnswer}\n value={value}\n maxLength={maxLengthPerChoice}\n adjustedLimit={maxLengthPerChoiceEnabled}\n />\n {displayNote && (\n <div\n className={classNames(classes.note, 'note')}\n dangerouslySetInnerHTML={{ __html: `<strong>Note:</strong> ${note}` }}\n />\n )}\n {rationale && hasText(rationale) && (\n <div className={classes.collapsible}>\n {!animationsDisabled ? <Collapsible\n labels={{ hidden: 'Show Rationale', visible: 'Hide Rationale' }}\n >\n {rationaleDiv}\n </Collapsible>\n : rationaleDiv}\n </div>\n )}\n </div>\n );\n }\n}\n\nconst styles = theme => ({\n mainContainer: {\n padding: theme.spacing.unit,\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 padding: '5px 0'\n },\n collapsible: {\n margin: `${theme.spacing.unit * 2}px 0`\n },\n noBorderColor: {\n '& *': {\n borderColor: `${color.text()} !important`\n }\n }\n});\n\nexport default withStyles(styles)(Main);\n"],"file":"main.js"}
|
package/lib/print.js
CHANGED
|
@@ -47,8 +47,9 @@ var log = (0, _debug["default"])('pie-element:explicit-constructed-response:prin
|
|
|
47
47
|
|
|
48
48
|
var preparePrintModel = function preparePrintModel(model, opts) {
|
|
49
49
|
var instr = opts.role === 'instructor';
|
|
50
|
-
model.
|
|
51
|
-
model.
|
|
50
|
+
model.prompt = model.promptEnabled !== false ? model.prompt : undefined;
|
|
51
|
+
model.teacherInstructions = instr && model.teacherInstructionsEnabled !== false ? model.teacherInstructions : undefined;
|
|
52
|
+
model.rationale = instr && model.rationaleEnabled !== false ? model.rationale : undefined;
|
|
52
53
|
model.alwaysShowCorrect = instr;
|
|
53
54
|
model.mode = instr ? 'evaluate' : model.mode;
|
|
54
55
|
model.disabled = true;
|
package/lib/print.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/print.js"],"names":["log","preparePrintModel","model","opts","instr","role","
|
|
1
|
+
{"version":3,"sources":["../src/print.js"],"names":["log","preparePrintModel","model","opts","instr","role","prompt","promptEnabled","undefined","teacherInstructions","teacherInstructionsEnabled","rationale","rationaleEnabled","alwaysShowCorrect","mode","disabled","animationsDisabled","ExplicitConstructedResponsePrint","_options","_model","_session","_rerender","printModel","element","React","createElement","Main","onChange","ReactDOM","render","leading","trailing","o","s","HTMLElement"],"mappings":";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O,GACX,MAAKL,QAAL,iBACAM,kBAAMC,aAAN,CAAoBC,gBAApB,kCACKJ,UADL;AAEEK,UAAAA,QAAQ,EAAE,oBAAM,CAAE;AAFpB,WAFF;;AAOAC,6BAASC,MAAT,CAAgBN,OAAhB,kDAA+B,YAAM;AACnCvB,UAAAA,GAAG,CAAC,+BAAD,CAAH;AACA;AACD,SAHD;AAID,OAdD,MAcO;AACLA,QAAAA,GAAG,CAAC,MAAD,CAAH;AACD;AACF,KAnBc,EAoBf,EApBe,EAqBf;AAAE8B,MAAAA,OAAO,EAAE,KAAX;AAAkBC,MAAAA,QAAQ,EAAE;AAA5B,KArBe,CAAjB;AALY;AA4Bb;;;;SACD,aAAYC,CAAZ,EAAe;AACb,WAAKd,QAAL,GAAgBc,CAAhB;AACD;;;SAED,aAAUC,CAAV,EAAa;AACX,WAAKd,MAAL,GAAcc,CAAd;;AACA,WAAKZ,SAAL;AACD;;;WAED,6BAAoB,CAAE;;;kDAvCsCa,W","sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport debounce from 'lodash/debounce';\nimport Main from './main';\nimport { renderMath } from '@pie-lib/math-rendering';\nimport debug from 'debug';\n\nconst log = debug('pie-element:explicit-constructed-response:print');\n\nconst preparePrintModel = (model, opts) => {\n const instr = opts.role === 'instructor';\n\n model.prompt = model.promptEnabled !== false ? model.prompt : undefined;\n model.teacherInstructions = instr && model.teacherInstructionsEnabled !== false ? model.teacherInstructions : undefined;\n model.rationale = instr && model.rationaleEnabled !== false ? model.rationale : undefined;\n\n model.alwaysShowCorrect = instr;\n model.mode = instr ? 'evaluate' : model.mode;\n\n model.disabled = true;\n model.animationsDisabled = true;\n\n return model;\n};\n\nexport default class ExplicitConstructedResponsePrint extends HTMLElement {\n constructor() {\n super();\n this._options = null;\n this._model = null;\n this._session = [];\n this._rerender = debounce(\n () => {\n if (this._model && this._session) {\n const printModel = preparePrintModel(this._model, this._options);\n\n const element =\n this._options &&\n React.createElement(Main, {\n ...printModel,\n onChange: () => {}\n });\n\n ReactDOM.render(element, this, () => {\n log('render complete - render math');\n renderMath(this);\n });\n } else {\n log('skip');\n }\n },\n 50,\n { leading: false, trailing: true }\n );\n }\n set options(o) {\n this._options = o;\n }\n\n set model(s) {\n this._model = s;\n this._rerender();\n }\n\n connectedCallback() {}\n}\n"],"file":"print.js"}
|
package/module/element.js
CHANGED
|
@@ -14093,6 +14093,7 @@ const CorrectAnswerToggle = _dll_pie_lib__correct_answer_toggle;
|
|
|
14093
14093
|
const {color: color} = _dll_pie_lib__render_ui;
|
|
14094
14094
|
const {Collapsible: Collapsible} = _dll_pie_lib__render_ui;
|
|
14095
14095
|
const {hasText: hasText} = _dll_pie_lib__render_ui;
|
|
14096
|
+
const {PreviewPrompt: PreviewPrompt} = _dll_pie_lib__render_ui;
|
|
14096
14097
|
const {withStyles: withStyles} = _dll_material_ui__core_styles;
|
|
14097
14098
|
const classNames = _dll_classnames;
|
|
14098
14099
|
const _jsxFileName = "/home/circleci/repo/packages/explicit-constructed-response/src/main.js";
|
|
@@ -14183,26 +14184,21 @@ class Main extends React$1.Component {
|
|
|
14183
14184
|
const mainClasses = classNames([classes.mainContainer, {
|
|
14184
14185
|
[classes.noBorderColor]: alwaysShowCorrect
|
|
14185
14186
|
}]);
|
|
14186
|
-
const teacherInstructionsDiv = React$1.createElement(
|
|
14187
|
-
|
|
14188
|
-
|
|
14189
|
-
__html: teacherInstructions
|
|
14190
|
-
},
|
|
14187
|
+
const teacherInstructionsDiv = React$1.createElement(PreviewPrompt, {
|
|
14188
|
+
defaultClassName: "teacher-instructions",
|
|
14189
|
+
prompt: teacherInstructions,
|
|
14191
14190
|
__self: this,
|
|
14192
14191
|
__source: {
|
|
14193
14192
|
fileName: _jsxFileName,
|
|
14194
14193
|
lineNumber: 97
|
|
14195
14194
|
}
|
|
14196
14195
|
});
|
|
14197
|
-
const rationaleDiv = React$1.createElement(
|
|
14198
|
-
|
|
14199
|
-
dangerouslySetInnerHTML: {
|
|
14200
|
-
__html: rationale
|
|
14201
|
-
},
|
|
14196
|
+
const rationaleDiv = React$1.createElement(PreviewPrompt, {
|
|
14197
|
+
prompt: rationale,
|
|
14202
14198
|
__self: this,
|
|
14203
14199
|
__source: {
|
|
14204
14200
|
fileName: _jsxFileName,
|
|
14205
|
-
lineNumber:
|
|
14201
|
+
lineNumber: 99
|
|
14206
14202
|
}
|
|
14207
14203
|
});
|
|
14208
14204
|
return React$1.createElement('div', {
|
|
@@ -14213,14 +14209,14 @@ class Main extends React$1.Component {
|
|
|
14213
14209
|
__self: this,
|
|
14214
14210
|
__source: {
|
|
14215
14211
|
fileName: _jsxFileName,
|
|
14216
|
-
lineNumber:
|
|
14212
|
+
lineNumber: 102
|
|
14217
14213
|
}
|
|
14218
14214
|
}, teacherInstructions && hasText(teacherInstructions) && React$1.createElement('div', {
|
|
14219
14215
|
className: classes.collapsible,
|
|
14220
14216
|
__self: this,
|
|
14221
14217
|
__source: {
|
|
14222
14218
|
fileName: _jsxFileName,
|
|
14223
|
-
lineNumber:
|
|
14219
|
+
lineNumber: 105
|
|
14224
14220
|
}
|
|
14225
14221
|
}, !animationsDisabled ? React$1.createElement(Collapsible, {
|
|
14226
14222
|
labels: {
|
|
@@ -14230,7 +14226,7 @@ class Main extends React$1.Component {
|
|
|
14230
14226
|
__self: this,
|
|
14231
14227
|
__source: {
|
|
14232
14228
|
fileName: _jsxFileName,
|
|
14233
|
-
lineNumber:
|
|
14229
|
+
lineNumber: 106
|
|
14234
14230
|
}
|
|
14235
14231
|
}, teacherInstructionsDiv) : teacherInstructionsDiv), !alwaysShowCorrect && React$1.createElement(CorrectAnswerToggle, {
|
|
14236
14232
|
show: mode === 'evaluate',
|
|
@@ -14239,17 +14235,14 @@ class Main extends React$1.Component {
|
|
|
14239
14235
|
__self: this,
|
|
14240
14236
|
__source: {
|
|
14241
14237
|
fileName: _jsxFileName,
|
|
14242
|
-
lineNumber:
|
|
14238
|
+
lineNumber: 115
|
|
14243
14239
|
}
|
|
14244
|
-
}), prompt && React$1.createElement(
|
|
14245
|
-
|
|
14246
|
-
dangerouslySetInnerHTML: {
|
|
14247
|
-
__html: prompt
|
|
14248
|
-
},
|
|
14240
|
+
}), prompt && React$1.createElement(PreviewPrompt, {
|
|
14241
|
+
prompt: prompt,
|
|
14249
14242
|
__self: this,
|
|
14250
14243
|
__source: {
|
|
14251
14244
|
fileName: _jsxFileName,
|
|
14252
|
-
lineNumber:
|
|
14245
|
+
lineNumber: 120
|
|
14253
14246
|
}
|
|
14254
14247
|
}), React$1.createElement(ConstructedResponse, {
|
|
14255
14248
|
...this.props,
|
|
@@ -14261,7 +14254,7 @@ class Main extends React$1.Component {
|
|
|
14261
14254
|
__self: this,
|
|
14262
14255
|
__source: {
|
|
14263
14256
|
fileName: _jsxFileName,
|
|
14264
|
-
lineNumber:
|
|
14257
|
+
lineNumber: 121
|
|
14265
14258
|
}
|
|
14266
14259
|
}), displayNote && React$1.createElement('div', {
|
|
14267
14260
|
className: classNames(classes.note, 'note'),
|
|
@@ -14271,14 +14264,14 @@ class Main extends React$1.Component {
|
|
|
14271
14264
|
__self: this,
|
|
14272
14265
|
__source: {
|
|
14273
14266
|
fileName: _jsxFileName,
|
|
14274
|
-
lineNumber:
|
|
14267
|
+
lineNumber: 130
|
|
14275
14268
|
}
|
|
14276
14269
|
}), rationale && hasText(rationale) && React$1.createElement('div', {
|
|
14277
14270
|
className: classes.collapsible,
|
|
14278
14271
|
__self: this,
|
|
14279
14272
|
__source: {
|
|
14280
14273
|
fileName: _jsxFileName,
|
|
14281
|
-
lineNumber:
|
|
14274
|
+
lineNumber: 136
|
|
14282
14275
|
}
|
|
14283
14276
|
}, !animationsDisabled ? React$1.createElement(Collapsible, {
|
|
14284
14277
|
labels: {
|
|
@@ -14288,7 +14281,7 @@ class Main extends React$1.Component {
|
|
|
14288
14281
|
__self: this,
|
|
14289
14282
|
__source: {
|
|
14290
14283
|
fileName: _jsxFileName,
|
|
14291
|
-
lineNumber:
|
|
14284
|
+
lineNumber: 137
|
|
14292
14285
|
}
|
|
14293
14286
|
}, rationaleDiv) : rationaleDiv));
|
|
14294
14287
|
}
|
package/module/print.js
CHANGED
|
@@ -14056,6 +14056,7 @@ const CorrectAnswerToggle = _dll_pie_lib__correct_answer_toggle;
|
|
|
14056
14056
|
const {color: color} = _dll_pie_lib__render_ui;
|
|
14057
14057
|
const {Collapsible: Collapsible} = _dll_pie_lib__render_ui;
|
|
14058
14058
|
const {hasText: hasText} = _dll_pie_lib__render_ui;
|
|
14059
|
+
const {PreviewPrompt: PreviewPrompt} = _dll_pie_lib__render_ui;
|
|
14059
14060
|
const {withStyles: withStyles} = _dll_material_ui__core_styles;
|
|
14060
14061
|
const classNames = _dll_classnames;
|
|
14061
14062
|
const _jsxFileName = "/home/circleci/repo/packages/explicit-constructed-response/src/main.js";
|
|
@@ -14146,26 +14147,21 @@ class Main extends React$1.Component {
|
|
|
14146
14147
|
const mainClasses = classNames([classes.mainContainer, {
|
|
14147
14148
|
[classes.noBorderColor]: alwaysShowCorrect
|
|
14148
14149
|
}]);
|
|
14149
|
-
const teacherInstructionsDiv = React$1.createElement(
|
|
14150
|
-
|
|
14151
|
-
|
|
14152
|
-
__html: teacherInstructions
|
|
14153
|
-
},
|
|
14150
|
+
const teacherInstructionsDiv = React$1.createElement(PreviewPrompt, {
|
|
14151
|
+
defaultClassName: "teacher-instructions",
|
|
14152
|
+
prompt: teacherInstructions,
|
|
14154
14153
|
__self: this,
|
|
14155
14154
|
__source: {
|
|
14156
14155
|
fileName: _jsxFileName,
|
|
14157
14156
|
lineNumber: 97
|
|
14158
14157
|
}
|
|
14159
14158
|
});
|
|
14160
|
-
const rationaleDiv = React$1.createElement(
|
|
14161
|
-
|
|
14162
|
-
dangerouslySetInnerHTML: {
|
|
14163
|
-
__html: rationale
|
|
14164
|
-
},
|
|
14159
|
+
const rationaleDiv = React$1.createElement(PreviewPrompt, {
|
|
14160
|
+
prompt: rationale,
|
|
14165
14161
|
__self: this,
|
|
14166
14162
|
__source: {
|
|
14167
14163
|
fileName: _jsxFileName,
|
|
14168
|
-
lineNumber:
|
|
14164
|
+
lineNumber: 99
|
|
14169
14165
|
}
|
|
14170
14166
|
});
|
|
14171
14167
|
return React$1.createElement('div', {
|
|
@@ -14176,14 +14172,14 @@ class Main extends React$1.Component {
|
|
|
14176
14172
|
__self: this,
|
|
14177
14173
|
__source: {
|
|
14178
14174
|
fileName: _jsxFileName,
|
|
14179
|
-
lineNumber:
|
|
14175
|
+
lineNumber: 102
|
|
14180
14176
|
}
|
|
14181
14177
|
}, teacherInstructions && hasText(teacherInstructions) && React$1.createElement('div', {
|
|
14182
14178
|
className: classes.collapsible,
|
|
14183
14179
|
__self: this,
|
|
14184
14180
|
__source: {
|
|
14185
14181
|
fileName: _jsxFileName,
|
|
14186
|
-
lineNumber:
|
|
14182
|
+
lineNumber: 105
|
|
14187
14183
|
}
|
|
14188
14184
|
}, !animationsDisabled ? React$1.createElement(Collapsible, {
|
|
14189
14185
|
labels: {
|
|
@@ -14193,7 +14189,7 @@ class Main extends React$1.Component {
|
|
|
14193
14189
|
__self: this,
|
|
14194
14190
|
__source: {
|
|
14195
14191
|
fileName: _jsxFileName,
|
|
14196
|
-
lineNumber:
|
|
14192
|
+
lineNumber: 106
|
|
14197
14193
|
}
|
|
14198
14194
|
}, teacherInstructionsDiv) : teacherInstructionsDiv), !alwaysShowCorrect && React$1.createElement(CorrectAnswerToggle, {
|
|
14199
14195
|
show: mode === 'evaluate',
|
|
@@ -14202,17 +14198,14 @@ class Main extends React$1.Component {
|
|
|
14202
14198
|
__self: this,
|
|
14203
14199
|
__source: {
|
|
14204
14200
|
fileName: _jsxFileName,
|
|
14205
|
-
lineNumber:
|
|
14201
|
+
lineNumber: 115
|
|
14206
14202
|
}
|
|
14207
|
-
}), prompt && React$1.createElement(
|
|
14208
|
-
|
|
14209
|
-
dangerouslySetInnerHTML: {
|
|
14210
|
-
__html: prompt
|
|
14211
|
-
},
|
|
14203
|
+
}), prompt && React$1.createElement(PreviewPrompt, {
|
|
14204
|
+
prompt: prompt,
|
|
14212
14205
|
__self: this,
|
|
14213
14206
|
__source: {
|
|
14214
14207
|
fileName: _jsxFileName,
|
|
14215
|
-
lineNumber:
|
|
14208
|
+
lineNumber: 120
|
|
14216
14209
|
}
|
|
14217
14210
|
}), React$1.createElement(ConstructedResponse, {
|
|
14218
14211
|
...this.props,
|
|
@@ -14224,7 +14217,7 @@ class Main extends React$1.Component {
|
|
|
14224
14217
|
__self: this,
|
|
14225
14218
|
__source: {
|
|
14226
14219
|
fileName: _jsxFileName,
|
|
14227
|
-
lineNumber:
|
|
14220
|
+
lineNumber: 121
|
|
14228
14221
|
}
|
|
14229
14222
|
}), displayNote && React$1.createElement('div', {
|
|
14230
14223
|
className: classNames(classes.note, 'note'),
|
|
@@ -14234,14 +14227,14 @@ class Main extends React$1.Component {
|
|
|
14234
14227
|
__self: this,
|
|
14235
14228
|
__source: {
|
|
14236
14229
|
fileName: _jsxFileName,
|
|
14237
|
-
lineNumber:
|
|
14230
|
+
lineNumber: 130
|
|
14238
14231
|
}
|
|
14239
14232
|
}), rationale && hasText(rationale) && React$1.createElement('div', {
|
|
14240
14233
|
className: classes.collapsible,
|
|
14241
14234
|
__self: this,
|
|
14242
14235
|
__source: {
|
|
14243
14236
|
fileName: _jsxFileName,
|
|
14244
|
-
lineNumber:
|
|
14237
|
+
lineNumber: 136
|
|
14245
14238
|
}
|
|
14246
14239
|
}, !animationsDisabled ? React$1.createElement(Collapsible, {
|
|
14247
14240
|
labels: {
|
|
@@ -14251,7 +14244,7 @@ class Main extends React$1.Component {
|
|
|
14251
14244
|
__self: this,
|
|
14252
14245
|
__source: {
|
|
14253
14246
|
fileName: _jsxFileName,
|
|
14254
|
-
lineNumber:
|
|
14247
|
+
lineNumber: 137
|
|
14255
14248
|
}
|
|
14256
14249
|
}, rationaleDiv) : rationaleDiv));
|
|
14257
14250
|
}
|
|
@@ -14291,8 +14284,9 @@ const {renderMath: renderMath} = _dll_pie_lib__math_rendering;
|
|
|
14291
14284
|
const log = debug('pie-element:explicit-constructed-response:print');
|
|
14292
14285
|
const preparePrintModel = (model, opts) => {
|
|
14293
14286
|
const instr = opts.role === 'instructor';
|
|
14294
|
-
model.
|
|
14295
|
-
model.
|
|
14287
|
+
model.prompt = model.promptEnabled !== false ? model.prompt : undefined;
|
|
14288
|
+
model.teacherInstructions = instr && model.teacherInstructionsEnabled !== false ? model.teacherInstructions : undefined;
|
|
14289
|
+
model.rationale = instr && model.rationaleEnabled !== false ? model.rationale : undefined;
|
|
14296
14290
|
model.alwaysShowCorrect = instr;
|
|
14297
14291
|
model.mode = instr ? 'evaluate' : model.mode;
|
|
14298
14292
|
model.disabled = true;
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"repository": "pie-framework/pie-elements",
|
|
7
|
-
"version": "3.9.3-next.
|
|
7
|
+
"version": "3.9.3-next.485+63508ad69",
|
|
8
8
|
"description": "",
|
|
9
9
|
"scripts": {
|
|
10
10
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"author": "",
|
|
27
27
|
"license": "ISC",
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "63508ad69affe18b229e1dd45475595ef12d0f77",
|
|
29
29
|
"main": "lib/index.js",
|
|
30
30
|
"module": "src/index.js",
|
|
31
31
|
"exports": {
|