@pie-element/drag-in-the-blank 6.10.4-next.6 → 6.10.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,20 @@
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
+ ## [6.10.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/drag-in-the-blank@6.10.3...@pie-element/drag-in-the-blank@6.10.4) (2025-04-29)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * update pie-lib/pie-toolbox PD-4976, PD-4980, PD-3496 ([a001d12](https://github.com/pie-framework/pie-elements/commit/a001d122ca198b23eeef9596857555eb1a76bb6b))
12
+ * **drag-in-the-blank:** set correctAnswer back to false when correctResponse undefined PD-4979 ([5673c4c](https://github.com/pie-framework/pie-elements/commit/5673c4c0a2ec3107ee7f327519e5ad12e448d1a9))
13
+ * update pie-lib/pie-toolbox PD-4976 ([ccf7412](https://github.com/pie-framework/pie-elements/commit/ccf74123f4581fc45383bdf2c181e699588b989d))
14
+ * **categorize, hotspot, multiple-choice, drag-in-the-blank:** prevent multiple initializations of event listeners for audio autoplay PD-4975 ([de1356f](https://github.com/pie-framework/pie-elements/commit/de1356fcc62490afe0deaca747062e08197e1499))
15
+
16
+
17
+
18
+
19
+
6
20
  ## [6.10.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/drag-in-the-blank@6.10.2...@pie-element/drag-in-the-blank@6.10.3) (2025-04-18)
7
21
 
8
22
 
@@ -3,6 +3,18 @@
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
+ ## [6.4.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/drag-in-the-blank-configure@6.4.3...@pie-element/drag-in-the-blank-configure@6.4.4) (2025-04-29)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * update pie-lib/pie-toolbox PD-4976 ([ccf7412](https://github.com/pie-framework/pie-elements/commit/ccf74123f4581fc45383bdf2c181e699588b989d))
12
+ * update pie-lib/pie-toolbox PD-4976, PD-4980, PD-3496 ([a001d12](https://github.com/pie-framework/pie-elements/commit/a001d122ca198b23eeef9596857555eb1a76bb6b))
13
+
14
+
15
+
16
+
17
+
6
18
  ## [6.4.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/drag-in-the-blank-configure@6.4.2...@pie-element/drag-in-the-blank-configure@6.4.3) (2025-04-18)
7
19
 
8
20
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-element/drag-in-the-blank-configure",
3
- "version": "6.4.3",
3
+ "version": "6.4.4",
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.14.4",
11
+ "@pie-lib/pie-toolbox": "2.14.5",
12
12
  "debug": "^3.1.0",
13
13
  "lodash": "^4.17.15",
14
14
  "prop-types": "^15.6.2",
@@ -3,6 +3,18 @@
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
+ ## [6.1.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/drag-in-the-blank-controller@6.1.3...@pie-element/drag-in-the-blank-controller@6.1.4) (2025-04-29)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * update pie-lib/pie-toolbox PD-4976 ([ccf7412](https://github.com/pie-framework/pie-elements/commit/ccf74123f4581fc45383bdf2c181e699588b989d))
12
+ * update pie-lib/pie-toolbox PD-4976, PD-4980, PD-3496 ([a001d12](https://github.com/pie-framework/pie-elements/commit/a001d122ca198b23eeef9596857555eb1a76bb6b))
13
+
14
+
15
+
16
+
17
+
6
18
  ## [6.1.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/drag-in-the-blank-controller@6.1.2...@pie-element/drag-in-the-blank-controller@6.1.3) (2025-04-18)
7
19
 
8
20
 
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@pie-element/drag-in-the-blank-controller",
3
3
  "private": true,
4
- "version": "6.1.3",
4
+ "version": "6.1.4",
5
5
  "description": "",
6
6
  "main": "lib/index.js",
7
7
  "module": "src/index.js",
8
8
  "author": "",
9
9
  "license": "ISC",
10
10
  "dependencies": {
11
- "@pie-lib/pie-toolbox": "2.14.4",
11
+ "@pie-lib/pie-toolbox": "2.14.5",
12
12
  "debug": "^3.1.0",
13
13
  "lodash": "^4.17.15",
14
14
  "type-of": "^2.0.1"
package/lib/main.js CHANGED
@@ -74,6 +74,17 @@ var Main = /*#__PURE__*/function (_React$Component) {
74
74
  }
75
75
 
76
76
  (0, _createClass2["default"])(Main, [{
77
+ key: "UNSAFE_componentWillReceiveProps",
78
+ value: function UNSAFE_componentWillReceiveProps(nextProps) {
79
+ var nextModel = nextProps.model;
80
+
81
+ if (nextModel && !nextModel.correctResponse && this.state.showCorrectAnswer !== false) {
82
+ this.setState({
83
+ showCorrectAnswer: false
84
+ });
85
+ }
86
+ }
87
+ }, {
77
88
  key: "render",
78
89
  value: function render() {
79
90
  var showCorrectAnswer = this.state.showCorrectAnswer;
package/lib/main.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/main.js"],"names":["DraggableDragInTheBlank","DragInTheBlank","Main","showCorrectAnswer","setState","state","props","model","onChange","value","classes","extraCSSRules","prompt","mode","language","fontSizeFactor","autoplayAudioEnabled","customAudioButton","modelWithValue","showCorrectAnswerToggle","mainContainer","teacherInstructions","collapsible","hidden","visible","toggleShowCorrect","rationale","React","Component","PropTypes","object","feedback","func","styles","theme","color","text","backgroundColor","background","position","marginBottom","spacing","unit","marginTop"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA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sBAAUC,MAJH;AAKjBtB,EAAAA,QAAQ,EAAEqB,sBAAUG;AALH,C;iCADR9B,I,kBASW;AACpBO,EAAAA,KAAK,EAAE;AADa,C;;AA0DxB,IAAMwB,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;AAAA,SAAY;AACzBd,IAAAA,aAAa,EAAE;AACbe,MAAAA,KAAK,EAAEA,gBAAMC,IAAN,EADM;AAEbC,MAAAA,eAAe,EAAEF,gBAAMG,UAAN,EAFJ;AAGb,mBAAa;AACXH,QAAAA,KAAK,EAAEA,gBAAMC,IAAN;AADI,OAHA;AAMbG,MAAAA,QAAQ,EAAE;AANG,KADU;AASzBjB,IAAAA,WAAW,EAAE;AACXkB,MAAAA,YAAY,EAAEN,KAAK,CAACO,OAAN,CAAcC,IAAd,GAAqB;AADxB,KATY;AAYzBhB,IAAAA,SAAS,EAAE;AACTiB,MAAAA,SAAS,EAAET,KAAK,CAACO,OAAN,CAAcC,IAAd,GAAqB;AADvB;AAZc,GAAZ;AAAA,CAAf;;eAiBe,wBAAWT,MAAX,EAAmB/B,IAAnB,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { CorrectAnswerToggle } from '@pie-lib/pie-toolbox/correct-answer-toggle';\nimport { DragInTheBlank } from '@pie-lib/pie-toolbox/mask-markup';\nimport { withDragContext } from '@pie-lib/pie-toolbox/drag';\nimport { color, Collapsible, hasText, PreviewPrompt, UiLayout } from '@pie-lib/pie-toolbox/render-ui';\nimport { withStyles } from '@material-ui/core/styles';\n\nconst DraggableDragInTheBlank = withDragContext(DragInTheBlank);\n\nexport class Main extends React.Component {\n static propTypes = {\n classes: PropTypes.object,\n model: PropTypes.object,\n value: PropTypes.object,\n feedback: PropTypes.object,\n onChange: PropTypes.func,\n };\n\n static defaultProps = {\n value: {},\n };\n\n state = {\n showCorrectAnswer: false,\n };\n\n toggleShowCorrect = () => {\n this.setState({ showCorrectAnswer: !this.state.showCorrectAnswer });\n };\n\n render() {\n const { showCorrectAnswer } = this.state;\n const { model, onChange, value, classes } = this.props;\n const { extraCSSRules, prompt, mode, language, fontSizeFactor, autoplayAudioEnabled, customAudioButton } = model;\n const modelWithValue = { ...model, value };\n const showCorrectAnswerToggle = mode === 'evaluate';\n\n return (\n <UiLayout extraCSSRules={extraCSSRules} id={'main-container'} className={classes.mainContainer} fontSizeFactor={fontSizeFactor}>\n {model.teacherInstructions && hasText(model.teacherInstructions) && (\n <Collapsible\n className={classes.collapsible}\n labels={{ hidden: 'Show Teacher Instructions', visible: 'Hide Teacher Instructions' }}\n >\n <PreviewPrompt prompt={model.teacherInstructions} />\n </Collapsible>\n )}\n\n {prompt && (\n <PreviewPrompt\n className=\"prompt\"\n prompt={prompt}\n autoplayAudioEnabled={autoplayAudioEnabled}\n customAudioButton={customAudioButton}\n />\n )}\n\n <CorrectAnswerToggle\n show={showCorrectAnswerToggle}\n toggled={showCorrectAnswer}\n onToggle={this.toggleShowCorrect}\n language={language}\n />\n\n <DraggableDragInTheBlank {...modelWithValue} onChange={onChange} showCorrectAnswer={showCorrectAnswer} />\n\n {model.rationale && hasText(model.rationale) && (\n <Collapsible className={classes.rationale} labels={{ hidden: 'Show Rationale', visible: 'Hide Rationale' }}>\n <PreviewPrompt prompt={model.rationale} />\n </Collapsible>\n )}\n </UiLayout>\n );\n }\n}\n\nconst styles = (theme) => ({\n mainContainer: {\n color: color.text(),\n backgroundColor: color.background(),\n '& tr > td': {\n color: color.text(),\n },\n position: 'relative'\n },\n collapsible: {\n marginBottom: theme.spacing.unit * 2,\n },\n rationale: {\n marginTop: theme.spacing.unit * 2,\n },\n});\n\nexport default withStyles(styles)(Main);\n"],"file":"main.js"}
1
+ {"version":3,"sources":["../src/main.js"],"names":["DraggableDragInTheBlank","DragInTheBlank","Main","showCorrectAnswer","setState","state","nextProps","nextModel","model","correctResponse","props","onChange","value","classes","extraCSSRules","prompt","mode","language","fontSizeFactor","autoplayAudioEnabled","customAudioButton","modelWithValue","showCorrectAnswerToggle","mainContainer","teacherInstructions","collapsible","hidden","visible","toggleShowCorrect","rationale","React","Component","PropTypes","object","feedback","func","styles","theme","color","text","backgroundColor","background","position","marginBottom","spacing","unit","marginTop"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,uBAAuB,GAAG,2BAAgBC,0BAAhB,CAAhC;;IAEaC,I;;;;;;;;;;;;;;;8FAaH;AACNC,MAAAA,iBAAiB,EAAE;AADb,K;0GAIY,YAAM;AACxB,YAAKC,QAAL,CAAc;AAAED,QAAAA,iBAAiB,EAAE,CAAC,MAAKE,KAAL,CAAWF;AAAjC,OAAd;AACD,K;;;;;;WAED,0CAAiCG,SAAjC,EAA4C;AAC1C,UAAeC,SAAf,GAA6BD,SAA7B,CAAQE,KAAR;;AAEA,UAAGD,SAAS,IAAI,CAACA,SAAS,CAACE,eAAxB,IAA2C,KAAKJ,KAAL,CAAWF,iBAAX,KAAiC,KAA/E,EAAqF;AACnF,aAAKC,QAAL,CAAc;AAAED,UAAAA,iBAAiB,EAAE;AAArB,SAAd;AACD;AACF;;;WAED,kBAAS;AACP,UAAQA,iBAAR,GAA8B,KAAKE,KAAnC,CAAQF,iBAAR;AACA,wBAA4C,KAAKO,KAAjD;AAAA,UAAQF,KAAR,eAAQA,KAAR;AAAA,UAAeG,QAAf,eAAeA,QAAf;AAAA,UAAyBC,KAAzB,eAAyBA,KAAzB;AAAA,UAAgCC,OAAhC,eAAgCA,OAAhC;AACA,UAAQC,aAAR,GAA2GN,KAA3G,CAAQM,aAAR;AAAA,UAAuBC,MAAvB,GAA2GP,KAA3G,CAAuBO,MAAvB;AAAA,UAA+BC,IAA/B,GAA2GR,KAA3G,CAA+BQ,IAA/B;AAAA,UAAqCC,QAArC,GAA2GT,KAA3G,CAAqCS,QAArC;AAAA,UAA+CC,cAA/C,GAA2GV,KAA3G,CAA+CU,cAA/C;AAAA,UAA+DC,oBAA/D,GAA2GX,KA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,QAAA,SAAS,EAAEhB,OAAO,CAACgB,SAAhC;AAA2C,QAAA,MAAM,EAAE;AAAEH,UAAAA,MAAM,EAAE,gBAAV;AAA4BC,UAAAA,OAAO,EAAE;AAArC;AAAnD,sBACE,gCAAC,uBAAD;AAAe,QAAA,MAAM,EAAEnB,KAAK,CAACqB;AAA7B,QADF,CA7BJ,CADF;AAoCD;;;EAxEuBC,kBAAMC,S;;;iCAAnB7B,I,eACQ;AACjBW,EAAAA,OAAO,EAAEmB,sBAAUC,MADF;AAEjBzB,EAAAA,KAAK,EAAEwB,sBAAUC,MAFA;AAGjBrB,EAAAA,KAAK,EAAEoB,sBAAUC,MAHA;AAIjBC,EAAAA,QAAQ,EAAEF,sBAAUC,MAJH;AAKjBtB,EAAAA,QAAQ,EAAEqB,sBAAUG;AALH,C;iCADRjC,I,kBASW;AACpBU,EAAAA,KAAK,EAAE;AADa,C;;AAkExB,IAAMwB,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;AAAA,SAAY;AACzBd,IAAAA,aAAa,EAAE;AACbe,MAAAA,KAAK,EAAEA,gBAAMC,IAAN,EADM;AAEbC,MAAAA,eAAe,EAAEF,gBAAMG,UAAN,EAFJ;AAGb,mBAAa;AACXH,QAAAA,KAAK,EAAEA,gBAAMC,IAAN;AADI,OAHA;AAMbG,MAAAA,QAAQ,EAAE;AANG,KADU;AASzBjB,IAAAA,WAAW,EAAE;AACXkB,MAAAA,YAAY,EAAEN,KAAK,CAACO,OAAN,CAAcC,IAAd,GAAqB;AADxB,KATY;AAYzBhB,IAAAA,SAAS,EAAE;AACTiB,MAAAA,SAAS,EAAET,KAAK,CAACO,OAAN,CAAcC,IAAd,GAAqB;AADvB;AAZc,GAAZ;AAAA,CAAf;;eAiBe,wBAAWT,MAAX,EAAmBlC,IAAnB,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { CorrectAnswerToggle } from '@pie-lib/pie-toolbox/correct-answer-toggle';\nimport { DragInTheBlank } from '@pie-lib/pie-toolbox/mask-markup';\nimport { withDragContext } from '@pie-lib/pie-toolbox/drag';\nimport { color, Collapsible, hasText, PreviewPrompt, UiLayout } from '@pie-lib/pie-toolbox/render-ui';\nimport { withStyles } from '@material-ui/core/styles';\n\nconst DraggableDragInTheBlank = withDragContext(DragInTheBlank);\n\nexport class Main extends React.Component {\n static propTypes = {\n classes: PropTypes.object,\n model: PropTypes.object,\n value: PropTypes.object,\n feedback: PropTypes.object,\n onChange: PropTypes.func,\n };\n\n static defaultProps = {\n value: {},\n };\n\n state = {\n showCorrectAnswer: false,\n };\n\n toggleShowCorrect = () => {\n this.setState({ showCorrectAnswer: !this.state.showCorrectAnswer });\n };\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n const { model: nextModel } = nextProps;\n\n if(nextModel && !nextModel.correctResponse && this.state.showCorrectAnswer !== false){\n this.setState({ showCorrectAnswer: false });\n }\n }\n\n render() {\n const { showCorrectAnswer } = this.state;\n const { model, onChange, value, classes } = this.props;\n const { extraCSSRules, prompt, mode, language, fontSizeFactor, autoplayAudioEnabled, customAudioButton } = model;\n const modelWithValue = { ...model, value };\n const showCorrectAnswerToggle = mode === 'evaluate';\n\n return (\n <UiLayout extraCSSRules={extraCSSRules} id={'main-container'} className={classes.mainContainer} fontSizeFactor={fontSizeFactor}>\n {model.teacherInstructions && hasText(model.teacherInstructions) && (\n <Collapsible\n className={classes.collapsible}\n labels={{ hidden: 'Show Teacher Instructions', visible: 'Hide Teacher Instructions' }}\n >\n <PreviewPrompt prompt={model.teacherInstructions} />\n </Collapsible>\n )}\n\n {prompt && (\n <PreviewPrompt\n className=\"prompt\"\n prompt={prompt}\n autoplayAudioEnabled={autoplayAudioEnabled}\n customAudioButton={customAudioButton}\n />\n )}\n\n <CorrectAnswerToggle\n show={showCorrectAnswerToggle}\n toggled={showCorrectAnswer}\n onToggle={this.toggleShowCorrect}\n language={language}\n />\n\n <DraggableDragInTheBlank {...modelWithValue} onChange={onChange} showCorrectAnswer={showCorrectAnswer} />\n\n {model.rationale && hasText(model.rationale) && (\n <Collapsible className={classes.rationale} labels={{ hidden: 'Show Rationale', visible: 'Hide Rationale' }}>\n <PreviewPrompt prompt={model.rationale} />\n </Collapsible>\n )}\n </UiLayout>\n );\n }\n}\n\nconst styles = (theme) => ({\n mainContainer: {\n color: color.text(),\n backgroundColor: color.background(),\n '& tr > td': {\n color: color.text(),\n },\n position: 'relative'\n },\n collapsible: {\n marginBottom: theme.spacing.unit * 2,\n },\n rationale: {\n marginTop: theme.spacing.unit * 2,\n },\n});\n\nexport default withStyles(styles)(Main);\n"],"file":"main.js"}
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "repository": "pie-framework/pie-elements",
7
- "version": "6.10.4-next.6+f1133e571",
7
+ "version": "6.10.4",
8
8
  "description": "",
9
9
  "scripts": {
10
10
  "postpublish": "../../scripts/postpublish"
@@ -12,7 +12,7 @@
12
12
  "dependencies": {
13
13
  "@material-ui/core": "^3.9.2",
14
14
  "@pie-framework/pie-player-events": "^0.1.0",
15
- "@pie-lib/pie-toolbox": "2.14.4",
15
+ "@pie-lib/pie-toolbox": "2.14.5",
16
16
  "classnames": "^2.2.5",
17
17
  "lodash": "^4.17.10",
18
18
  "prop-types": "^15.6.1",
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "author": "",
23
23
  "license": "ISC",
24
- "gitHead": "f1133e5713577ba27d416aff97de6e49a071c339",
24
+ "gitHead": "84bcb59cdfb8f9a60c82345195d75b3503b13533",
25
25
  "main": "lib/index.js",
26
26
  "module": "src/index.js"
27
27
  }