@pie-element/image-cloze-association 4.1.8 → 4.1.10-next.173
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 +8 -0
- package/configure/CHANGELOG.md +8 -0
- package/configure/lib/defaults.js +4 -0
- package/configure/lib/defaults.js.map +1 -1
- package/configure/lib/index.js +14 -0
- package/configure/lib/index.js.map +1 -1
- package/configure/lib/root.js +19 -5
- package/configure/lib/root.js.map +1 -1
- package/configure/package.json +4 -3
- package/configure/src/defaults.js +4 -0
- package/configure/src/index.js +19 -1
- package/configure/src/root.jsx +16 -2
- package/docs/config-schema.json +17 -1
- package/docs/config-schema.json.md +12 -0
- package/docs/demo/generate.js +2 -1
- package/docs/pie-schema.json +6 -0
- package/docs/pie-schema.json.md +4 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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
|
+
## [4.1.9](https://github.com/pie-framework/pie-elements/compare/@pie-element/image-cloze-association@4.1.8...@pie-element/image-cloze-association@4.1.9) (2022-09-29)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @pie-element/image-cloze-association
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [4.1.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/image-cloze-association@4.1.7...@pie-element/image-cloze-association@4.1.8) (2022-09-14)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @pie-element/image-cloze-association
|
package/configure/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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
|
+
## [4.1.9](https://github.com/pie-framework/pie-elements/compare/@pie-element/image-cloze-association-configure@4.1.8...@pie-element/image-cloze-association-configure@4.1.9) (2022-09-29)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @pie-element/image-cloze-association-configure
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [4.1.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/image-cloze-association-configure@4.1.7...@pie-element/image-cloze-association-configure@4.1.8) (2022-09-14)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @pie-element/image-cloze-association-configure
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/defaults.js"],"names":["model","rationaleEnabled","teacherInstructionsEnabled","studentInstructionsEnabled","configuration","spellCheck","label","settings","enabled","teacherInstructions","maxImageWidth","maxImageHeight"],"mappings":";;;;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,gBAAgB,EAAE,IADb;AAELC,IAAAA,0BAA0B,EAAE,IAFvB;AAGLC,IAAAA,0BAA0B,EAAE;AAHvB,GADM;AAMbC,EAAAA,aAAa,EAAE;AACbC,IAAAA,UAAU,EAAE;AACVC,MAAAA,KAAK,EAAE,YADG;AAEVC,MAAAA,QAAQ,EAAC,KAFC;AAGVC,MAAAA,OAAO,EAAC;AAHE,KADC;AAMbC,IAAAA,mBAAmB,EAAE;AACnBF,MAAAA,QAAQ,EAAE,IADS;AAEnBD,MAAAA,KAAK,EAAE;AAFY,KANR;AAUbI,IAAAA,aAAa,EAAE;AACbD,MAAAA,mBAAmB,EAAE;AADR,KAVF;AAabE,IAAAA,cAAc,EAAE;AACdF,MAAAA,mBAAmB,EAAE;AADP;
|
|
1
|
+
{"version":3,"sources":["../src/defaults.js"],"names":["model","rationaleEnabled","teacherInstructionsEnabled","studentInstructionsEnabled","configuration","spellCheck","label","settings","enabled","teacherInstructions","maxImageWidth","maxImageHeight","withRubric"],"mappings":";;;;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,gBAAgB,EAAE,IADb;AAELC,IAAAA,0BAA0B,EAAE,IAFvB;AAGLC,IAAAA,0BAA0B,EAAE;AAHvB,GADM;AAMbC,EAAAA,aAAa,EAAE;AACbC,IAAAA,UAAU,EAAE;AACVC,MAAAA,KAAK,EAAE,YADG;AAEVC,MAAAA,QAAQ,EAAC,KAFC;AAGVC,MAAAA,OAAO,EAAC;AAHE,KADC;AAMbC,IAAAA,mBAAmB,EAAE;AACnBF,MAAAA,QAAQ,EAAE,IADS;AAEnBD,MAAAA,KAAK,EAAE;AAFY,KANR;AAUbI,IAAAA,aAAa,EAAE;AACbD,MAAAA,mBAAmB,EAAE;AADR,KAVF;AAabE,IAAAA,cAAc,EAAE;AACdF,MAAAA,mBAAmB,EAAE;AADP,KAbH;AAgBbG,IAAAA,UAAU,EAAE;AACVL,MAAAA,QAAQ,EAAE,KADA;AAEVD,MAAAA,KAAK,EAAE;AAFG;AAhBC;AANF,C","sourcesContent":["export default {\n model: {\n rationaleEnabled: true,\n teacherInstructionsEnabled: true,\n studentInstructionsEnabled: true,\n },\n configuration: {\n spellCheck: {\n label: 'Spellcheck',\n settings:false,\n enabled:true\n },\n teacherInstructions: {\n settings: true,\n label: 'Teacher Instructions'\n },\n maxImageWidth: {\n teacherInstructions: 300\n },\n maxImageHeight: {\n teacherInstructions: 300\n },\n withRubric: {\n settings: false,\n label: 'Add Rubric'\n }\n }\n};\n"],"file":"defaults.js"}
|
package/configure/lib/index.js
CHANGED
|
@@ -118,6 +118,16 @@ var ImageClozeAssociationConfigure = /*#__PURE__*/function (_HTMLElement) {
|
|
|
118
118
|
value: function onDeleteImage(src, done) {
|
|
119
119
|
this.dispatchEvent(new _pieConfigureEvents.DeleteImageEvent(src, done));
|
|
120
120
|
}
|
|
121
|
+
}, {
|
|
122
|
+
key: "insertSound",
|
|
123
|
+
value: function insertSound(handler) {
|
|
124
|
+
this.dispatchEvent(new _pieConfigureEvents.InsertSoundEvent(handler));
|
|
125
|
+
}
|
|
126
|
+
}, {
|
|
127
|
+
key: "onDeleteSound",
|
|
128
|
+
value: function onDeleteSound(src, done) {
|
|
129
|
+
this.dispatchEvent(new _pieConfigureEvents.DeleteSoundEvent(src, done));
|
|
130
|
+
}
|
|
121
131
|
}, {
|
|
122
132
|
key: "_render",
|
|
123
133
|
value: function _render() {
|
|
@@ -132,6 +142,10 @@ var ImageClozeAssociationConfigure = /*#__PURE__*/function (_HTMLElement) {
|
|
|
132
142
|
imageSupport: {
|
|
133
143
|
add: this.insertImage.bind(this),
|
|
134
144
|
"delete": this.onDeleteImage.bind(this)
|
|
145
|
+
},
|
|
146
|
+
uploadSoundSupport: {
|
|
147
|
+
add: this.insertSound.bind(this),
|
|
148
|
+
"delete": this.onDeleteSound.bind(this)
|
|
135
149
|
}
|
|
136
150
|
});
|
|
137
151
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.js"],"names":["log","ImageClozeAssociationConfigure","_model","createDefaultModel","onModelChanged","bind","_configuration","sensibleDefaults","configuration","s","_render","c","_disableSidePanel","reset","resetValue","dispatchEvent","ModelUpdatedEvent","m","dispatchModelUpdated","config","handler","InsertImageEvent","src","done","DeleteImageEvent","element","React","createElement","Root","disableSidePanel","model","onConfigurationChanged","imageSupport","add","insertImage","onDeleteImage","ReactDOM","render","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;
|
|
1
|
+
{"version":3,"sources":["../src/index.js"],"names":["log","ImageClozeAssociationConfigure","_model","createDefaultModel","onModelChanged","bind","_configuration","sensibleDefaults","configuration","s","_render","c","_disableSidePanel","reset","resetValue","dispatchEvent","ModelUpdatedEvent","m","dispatchModelUpdated","config","handler","InsertImageEvent","src","done","DeleteImageEvent","InsertSoundEvent","DeleteSoundEvent","element","React","createElement","Root","disableSidePanel","model","onConfigurationChanged","imageSupport","add","insertImage","onDeleteImage","uploadSoundSupport","insertSound","onDeleteSound","ReactDOM","render","HTMLElement"],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AEvBA,KAFuB;AAAA,C","sourcesContent":["import {\n ModelUpdatedEvent,\n DeleteImageEvent,\n InsertImageEvent,\n InsertSoundEvent,\n DeleteSoundEvent\n} from '@pie-framework/pie-configure-events';\n\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport debug from 'debug';\n\nimport Root from './root';\nimport sensibleDefaults from './defaults';\n\nconst log = debug('image-cloze-association:configure');\n\nexport default class ImageClozeAssociationConfigure extends HTMLElement {\n static createDefaultModel = (model = {}) => ({\n ...sensibleDefaults.model,\n ...model,\n });\n\n constructor() {\n super();\n this._model = ImageClozeAssociationConfigure.createDefaultModel();\n this.onModelChanged = this.onModelChanged.bind(this);\n this._configuration = sensibleDefaults.configuration;\n }\n\n set model(s) {\n this._model = ImageClozeAssociationConfigure.createDefaultModel(s);\n this._render();\n }\n\n set configuration(c) {\n this._configuration = c;\n this._render();\n }\n\n set disableSidePanel(s) {\n this._disableSidePanel = s;\n this._render();\n }\n\n dispatchModelUpdated(reset) {\n const resetValue = !!reset;\n\n this.dispatchEvent(new ModelUpdatedEvent(this._model, resetValue));\n }\n\n onModelChanged(m, reset) {\n this._model = m;\n this.dispatchModelUpdated(reset);\n this._render();\n }\n\n onConfigurationChanged(config) {\n this._configuration = config;\n this._render();\n }\n\n /**\n *\n * @param {done, progress, file} handler\n */\n insertImage(handler) {\n this.dispatchEvent(new InsertImageEvent(handler));\n }\n\n onDeleteImage(src, done) {\n this.dispatchEvent(new DeleteImageEvent(src, done));\n }\n\n insertSound(handler) {\n this.dispatchEvent(new InsertSoundEvent(handler));\n }\n\n onDeleteSound(src, done) {\n this.dispatchEvent(new DeleteSoundEvent(src, done));\n }\n\n _render() {\n log('_render');\n let element = React.createElement(Root, {\n disableSidePanel: this._disableSidePanel,\n model: this._model,\n configuration: this._configuration,\n onModelChanged: this.onModelChanged.bind(this),\n onConfigurationChanged: this.onConfigurationChanged.bind(this),\n imageSupport: {\n add: this.insertImage.bind(this),\n delete: this.onDeleteImage.bind(this)\n },\n uploadSoundSupport: {\n add: this.insertSound.bind(this),\n delete: this.onDeleteSound.bind(this)\n }\n });\n ReactDOM.render(element, this);\n }\n}\n"],"file":"index.js"}
|
package/configure/lib/root.js
CHANGED
|
@@ -74,7 +74,8 @@ var Root = /*#__PURE__*/function (_React$Component) {
|
|
|
74
74
|
configuration = _this$props.configuration,
|
|
75
75
|
onModelChanged = _this$props.onModelChanged,
|
|
76
76
|
onConfigurationChanged = _this$props.onConfigurationChanged,
|
|
77
|
-
imageSupport = _this$props.imageSupport
|
|
77
|
+
imageSupport = _this$props.imageSupport,
|
|
78
|
+
uploadSoundSupport = _this$props.uploadSoundSupport;
|
|
78
79
|
|
|
79
80
|
var _ref = configuration || {},
|
|
80
81
|
_ref$teacherInstructi = _ref.teacherInstructions,
|
|
@@ -84,10 +85,12 @@ var Root = /*#__PURE__*/function (_React$Component) {
|
|
|
84
85
|
_ref$maxImageWidth = _ref.maxImageWidth,
|
|
85
86
|
maxImageWidth = _ref$maxImageWidth === void 0 ? {} : _ref$maxImageWidth,
|
|
86
87
|
_ref$maxImageHeight = _ref.maxImageHeight,
|
|
87
|
-
maxImageHeight = _ref$maxImageHeight === void 0 ? {} : _ref$maxImageHeight
|
|
88
|
+
maxImageHeight = _ref$maxImageHeight === void 0 ? {} : _ref$maxImageHeight,
|
|
89
|
+
withRubric = _ref.withRubric;
|
|
88
90
|
|
|
89
91
|
var _ref2 = model || {},
|
|
90
|
-
spellCheckEnabled = _ref2.spellCheckEnabled
|
|
92
|
+
spellCheckEnabled = _ref2.spellCheckEnabled,
|
|
93
|
+
rubricEnabled = _ref2.rubricEnabled;
|
|
91
94
|
|
|
92
95
|
return /*#__PURE__*/_react["default"].createElement(_configUi.layout.ConfigLayout, {
|
|
93
96
|
settings: /*#__PURE__*/_react["default"].createElement(Panel, {
|
|
@@ -102,7 +105,8 @@ var Root = /*#__PURE__*/function (_React$Component) {
|
|
|
102
105
|
groups: {
|
|
103
106
|
Properties: {
|
|
104
107
|
teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),
|
|
105
|
-
spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label)
|
|
108
|
+
spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),
|
|
109
|
+
rubricEnabled: withRubric.settings && toggle(withRubric.label)
|
|
106
110
|
}
|
|
107
111
|
}
|
|
108
112
|
})
|
|
@@ -119,7 +123,13 @@ var Root = /*#__PURE__*/function (_React$Component) {
|
|
|
119
123
|
nonEmpty: false,
|
|
120
124
|
spellCheck: spellCheckEnabled,
|
|
121
125
|
maxImageWidth: maxImageWidth && maxImageWidth.teacherInstructions,
|
|
122
|
-
maxImageHeight: maxImageHeight && maxImageHeight.teacherInstructions
|
|
126
|
+
maxImageHeight: maxImageHeight && maxImageHeight.teacherInstructions,
|
|
127
|
+
uploadSoundSupport: uploadSoundSupport,
|
|
128
|
+
languageCharactersProps: [{
|
|
129
|
+
language: 'spanish'
|
|
130
|
+
}, {
|
|
131
|
+
language: 'special'
|
|
132
|
+
}]
|
|
123
133
|
})), "Image cloze association"));
|
|
124
134
|
}
|
|
125
135
|
}]);
|
|
@@ -153,6 +163,10 @@ Root.propTypes = {
|
|
|
153
163
|
imageSupport: _propTypes["default"].shape({
|
|
154
164
|
add: _propTypes["default"].func.isRequired,
|
|
155
165
|
"delete": _propTypes["default"].func.isRequired
|
|
166
|
+
}),
|
|
167
|
+
uploadSoundSupport: _propTypes["default"].shape({
|
|
168
|
+
add: _propTypes["default"].func.isRequired,
|
|
169
|
+
"delete": _propTypes["default"].func.isRequired
|
|
156
170
|
})
|
|
157
171
|
};
|
|
158
172
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/root.jsx"],"names":["Panel","settings","toggle","Root","teacherInstructions","props","onModelChanged","model","classes","configuration","onConfigurationChanged","imageSupport","spellCheck","maxImageWidth","maxImageHeight","spellCheckEnabled","config","Properties","teacherInstructionsEnabled","label","content","promptHolder","prompt","onTeacherInstructionsChanged","React","Component","styles","theme","base","marginTop","spacing","unit","width","paddingTop","propTypes","PropTypes","object","isRequired","func","shape","add"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAQA,KAAR,GAA0BC,kBAA1B,CAAQD,KAAR;AAAA,IAAeE,MAAf,GAA0BD,kBAA1B,CAAeC,MAAf;;IAEaC,I;;;;;;;;;;;;;;;qHACoB,UAACC,mBAAD,EAAyB;AACtD,YAAKC,KAAL,CAAWC,cAAX,iCACK,MAAKD,KAAL,CAAWE,KADhB;AAEEH,QAAAA,mBAAmB,EAAnBA;AAFF;AAID,K;;;;;;WAED,kBAAS;AACP,
|
|
1
|
+
{"version":3,"sources":["../src/root.jsx"],"names":["Panel","settings","toggle","Root","teacherInstructions","props","onModelChanged","model","classes","configuration","onConfigurationChanged","imageSupport","uploadSoundSupport","spellCheck","maxImageWidth","maxImageHeight","withRubric","spellCheckEnabled","rubricEnabled","config","Properties","teacherInstructionsEnabled","label","content","promptHolder","prompt","onTeacherInstructionsChanged","language","React","Component","styles","theme","base","marginTop","spacing","unit","width","paddingTop","propTypes","PropTypes","object","isRequired","func","shape","add"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAQA,KAAR,GAA0BC,kBAA1B,CAAQD,KAAR;AAAA,IAAeE,MAAf,GAA0BD,kBAA1B,CAAeC,MAAf;;IAEaC,I;;;;;;;;;;;;;;;qHACoB,UAACC,mBAAD,EAAyB;AACtD,YAAKC,KAAL,CAAWC,cAAX,iCACK,MAAKD,KAAL,CAAWE,KADhB;AAEEH,QAAAA,mBAAmB,EAAnBA;AAFF;AAID,K;;;;;;WAED,kBAAS;AACP,wBAQI,KAAKC,KART;AAAA,UACEG,OADF,eACEA,OADF;AAAA,UAEED,KAFF,eAEEA,KAFF;AAAA,UAGEE,aAHF,eAGEA,aAHF;AAAA,UAIEH,cAJF,eAIEA,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B;AACf9B,EAAAA,OAAO,EAAE+B,sBAAUC,MAAV,CAAiBC,UADX;AAEfnC,EAAAA,cAAc,EAAEiC,sBAAUG,IAFX;AAGfhC,EAAAA,sBAAsB,EAAE6B,sBAAUG,IAHnB;AAIfnC,EAAAA,KAAK,EAAEgC,sBAAUC,MAAV,CAAiBC,UAJT;AAKfhC,EAAAA,aAAa,EAAE8B,sBAAUC,MAAV,CAAiBC,UALjB;AAMf9B,EAAAA,YAAY,EAAE4B,sBAAUI,KAAV,CAAgB;AAC5BC,IAAAA,GAAG,EAAEL,sBAAUG,IAAV,CAAeD,UADQ;AAE5B,cAAQF,sBAAUG,IAAV,CAAeD;AAFK,GAAhB,CANC;AAUf7B,EAAAA,kBAAkB,EAAE2B,sBAAUI,KAAV,CAAgB;AAClCC,IAAAA,GAAG,EAAEL,sBAAUG,IAAV,CAAeD,UADc;AAElC,cAAQF,sBAAUG,IAAV,CAAeD;AAFW,GAAhB;AAVL,CAAjB;;eAgBe,wBAAWX,MAAX,EAAmB3B,IAAnB,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@material-ui/core/styles';\nimport { settings, layout, InputContainer } from '@pie-lib/config-ui';\nimport EditableHtml from '@pie-lib/editable-html';\n\nconst { Panel, toggle } = settings;\n\nexport class Root extends React.Component {\n onTeacherInstructionsChanged = (teacherInstructions) => {\n this.props.onModelChanged({\n ...this.props.model,\n teacherInstructions,\n });\n };\n\n render() {\n const {\n classes,\n model,\n configuration,\n onModelChanged,\n onConfigurationChanged,\n imageSupport,\n uploadSoundSupport\n } = this.props;\n const {\n teacherInstructions = {},\n spellCheck = {},\n maxImageWidth = {},\n maxImageHeight = {},\n withRubric\n } = configuration || {};\n const { spellCheckEnabled, rubricEnabled } = model || {};\n\n return (\n <layout.ConfigLayout\n settings={\n <Panel\n model={model}\n configuration={configuration}\n onChangeModel={(model) => onModelChanged(model)}\n onChangeConfiguration={(config) => onConfigurationChanged(config)}\n groups={{\n Properties: {\n teacherInstructionsEnabled:\n teacherInstructions.settings &&\n toggle(teacherInstructions.label),\n spellCheckEnabled:\n spellCheck.settings && toggle(spellCheck.label),\n rubricEnabled: withRubric.settings && toggle(withRubric.label)\n },\n }}\n />\n }\n >\n <div className={classes.content}>\n {model && model.teacherInstructionsEnabled && (\n <InputContainer\n label={teacherInstructions.label}\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={model.teacherInstructions || ''}\n onChange={this.onTeacherInstructionsChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n spellCheck={spellCheckEnabled}\n maxImageWidth={maxImageWidth && maxImageWidth.teacherInstructions}\n maxImageHeight={maxImageHeight && maxImageHeight.teacherInstructions}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n />\n </InputContainer>\n )}\n Image cloze association\n </div>\n </layout.ConfigLayout>\n );\n }\n}\n\nconst styles = (theme) => ({\n base: {\n marginTop: theme.spacing.unit * 3,\n },\n promptHolder: {\n width: '100%',\n paddingTop: theme.spacing.unit * 2,\n },\n prompt: {\n paddingTop: theme.spacing.unit * 2,\n width: '100%',\n },\n});\n\nRoot.propTypes = {\n classes: PropTypes.object.isRequired,\n onModelChanged: PropTypes.func,\n onConfigurationChanged: PropTypes.func,\n model: PropTypes.object.isRequired,\n configuration: PropTypes.object.isRequired,\n imageSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n uploadSoundSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n};\n\nexport default withStyles(styles)(Root);\n"],"file":"root.js"}
|
package/configure/package.json
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/image-cloze-association-configure",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "4.1.
|
|
4
|
+
"version": "4.1.9",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "src/index.js",
|
|
8
8
|
"author": "",
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@material-ui/core": "^3.9.2",
|
|
11
|
-
"@pie-framework/pie-configure-events": "^1.
|
|
12
|
-
"@pie-lib/config-ui": "^11.0.
|
|
11
|
+
"@pie-framework/pie-configure-events": "^1.3.0",
|
|
12
|
+
"@pie-lib/config-ui": "^11.0.20",
|
|
13
|
+
"@pie-lib/editable-html": "^9.2.2",
|
|
13
14
|
"debug": "^3.1.0",
|
|
14
15
|
"prop-types": "^15.7.2",
|
|
15
16
|
"react": "^16.8.6",
|
package/configure/src/index.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
ModelUpdatedEvent,
|
|
3
|
+
DeleteImageEvent,
|
|
4
|
+
InsertImageEvent,
|
|
5
|
+
InsertSoundEvent,
|
|
6
|
+
DeleteSoundEvent
|
|
7
|
+
} from '@pie-framework/pie-configure-events';
|
|
2
8
|
|
|
3
9
|
import React from 'react';
|
|
4
10
|
import ReactDOM from 'react-dom';
|
|
@@ -66,6 +72,14 @@ export default class ImageClozeAssociationConfigure extends HTMLElement {
|
|
|
66
72
|
this.dispatchEvent(new DeleteImageEvent(src, done));
|
|
67
73
|
}
|
|
68
74
|
|
|
75
|
+
insertSound(handler) {
|
|
76
|
+
this.dispatchEvent(new InsertSoundEvent(handler));
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
onDeleteSound(src, done) {
|
|
80
|
+
this.dispatchEvent(new DeleteSoundEvent(src, done));
|
|
81
|
+
}
|
|
82
|
+
|
|
69
83
|
_render() {
|
|
70
84
|
log('_render');
|
|
71
85
|
let element = React.createElement(Root, {
|
|
@@ -77,6 +91,10 @@ export default class ImageClozeAssociationConfigure extends HTMLElement {
|
|
|
77
91
|
imageSupport: {
|
|
78
92
|
add: this.insertImage.bind(this),
|
|
79
93
|
delete: this.onDeleteImage.bind(this)
|
|
94
|
+
},
|
|
95
|
+
uploadSoundSupport: {
|
|
96
|
+
add: this.insertSound.bind(this),
|
|
97
|
+
delete: this.onDeleteSound.bind(this)
|
|
80
98
|
}
|
|
81
99
|
});
|
|
82
100
|
ReactDOM.render(element, this);
|
package/configure/src/root.jsx
CHANGED
|
@@ -22,9 +22,16 @@ export class Root extends React.Component {
|
|
|
22
22
|
onModelChanged,
|
|
23
23
|
onConfigurationChanged,
|
|
24
24
|
imageSupport,
|
|
25
|
+
uploadSoundSupport
|
|
25
26
|
} = this.props;
|
|
26
|
-
const {
|
|
27
|
-
|
|
27
|
+
const {
|
|
28
|
+
teacherInstructions = {},
|
|
29
|
+
spellCheck = {},
|
|
30
|
+
maxImageWidth = {},
|
|
31
|
+
maxImageHeight = {},
|
|
32
|
+
withRubric
|
|
33
|
+
} = configuration || {};
|
|
34
|
+
const { spellCheckEnabled, rubricEnabled } = model || {};
|
|
28
35
|
|
|
29
36
|
return (
|
|
30
37
|
<layout.ConfigLayout
|
|
@@ -41,6 +48,7 @@ export class Root extends React.Component {
|
|
|
41
48
|
toggle(teacherInstructions.label),
|
|
42
49
|
spellCheckEnabled:
|
|
43
50
|
spellCheck.settings && toggle(spellCheck.label),
|
|
51
|
+
rubricEnabled: withRubric.settings && toggle(withRubric.label)
|
|
44
52
|
},
|
|
45
53
|
}}
|
|
46
54
|
/>
|
|
@@ -61,6 +69,8 @@ export class Root extends React.Component {
|
|
|
61
69
|
spellCheck={spellCheckEnabled}
|
|
62
70
|
maxImageWidth={maxImageWidth && maxImageWidth.teacherInstructions}
|
|
63
71
|
maxImageHeight={maxImageHeight && maxImageHeight.teacherInstructions}
|
|
72
|
+
uploadSoundSupport={uploadSoundSupport}
|
|
73
|
+
languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}
|
|
64
74
|
/>
|
|
65
75
|
</InputContainer>
|
|
66
76
|
)}
|
|
@@ -95,6 +105,10 @@ Root.propTypes = {
|
|
|
95
105
|
add: PropTypes.func.isRequired,
|
|
96
106
|
delete: PropTypes.func.isRequired,
|
|
97
107
|
}),
|
|
108
|
+
uploadSoundSupport: PropTypes.shape({
|
|
109
|
+
add: PropTypes.func.isRequired,
|
|
110
|
+
delete: PropTypes.func.isRequired,
|
|
111
|
+
}),
|
|
98
112
|
};
|
|
99
113
|
|
|
100
114
|
export default withStyles(styles)(Root);
|
package/docs/config-schema.json
CHANGED
|
@@ -77,6 +77,22 @@
|
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
},
|
|
80
|
+
"withRubric": {
|
|
81
|
+
"title": "ConfigureProp",
|
|
82
|
+
"type": "object",
|
|
83
|
+
"properties": {
|
|
84
|
+
"settings": {
|
|
85
|
+
"description": "Indicates if the item has to be displayed in the Settings Panel",
|
|
86
|
+
"type": "boolean",
|
|
87
|
+
"title": "settings"
|
|
88
|
+
},
|
|
89
|
+
"label": {
|
|
90
|
+
"description": "Indicates the label for the item that has to be displayed in the Settings Panel",
|
|
91
|
+
"type": "string",
|
|
92
|
+
"title": "label"
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
},
|
|
80
96
|
"showPrompt": {
|
|
81
97
|
"description": "Determines whether prompt field will be displayed or not",
|
|
82
98
|
"default": true,
|
|
@@ -136,4 +152,4 @@
|
|
|
136
152
|
}
|
|
137
153
|
},
|
|
138
154
|
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
139
|
-
}
|
|
155
|
+
}
|
|
@@ -58,6 +58,18 @@ Indicates the max dimension for images in prompt - this is also the default dime
|
|
|
58
58
|
|
|
59
59
|
Indicates the max dimension for images in rationale
|
|
60
60
|
|
|
61
|
+
# `withRubric` (object)
|
|
62
|
+
|
|
63
|
+
Properties of the `withRubric` object:
|
|
64
|
+
|
|
65
|
+
## `settings` (boolean)
|
|
66
|
+
|
|
67
|
+
Indicates if the item has to be displayed in the Settings Panel
|
|
68
|
+
|
|
69
|
+
## `label` (string)
|
|
70
|
+
|
|
71
|
+
Indicates the label for the item that has to be displayed in the Settings Panel
|
|
72
|
+
|
|
61
73
|
# `showPrompt` (boolean)
|
|
62
74
|
|
|
63
75
|
Determines whether prompt field will be displayed or not
|
package/docs/demo/generate.js
CHANGED
package/docs/pie-schema.json
CHANGED
|
@@ -177,6 +177,11 @@
|
|
|
177
177
|
"type": "boolean",
|
|
178
178
|
"title": "showDashedBorder"
|
|
179
179
|
},
|
|
180
|
+
"rubricEnabled": {
|
|
181
|
+
"description": "Indicates if Rubric is enabled",
|
|
182
|
+
"type": "boolean",
|
|
183
|
+
"title": "rubricEnabled"
|
|
184
|
+
},
|
|
180
185
|
"id": {
|
|
181
186
|
"description": "Identifier to identify the Pie Element in html markup, Must be unique within a pie item config.",
|
|
182
187
|
"type": "string",
|
|
@@ -191,6 +196,7 @@
|
|
|
191
196
|
"required": [
|
|
192
197
|
"element",
|
|
193
198
|
"id",
|
|
199
|
+
"rubricEnabled",
|
|
194
200
|
"spellCheckEnabled"
|
|
195
201
|
],
|
|
196
202
|
"definitions": {
|
package/docs/pie-schema.json.md
CHANGED
|
@@ -141,6 +141,10 @@ Indicates if duplicate responses are allowed
|
|
|
141
141
|
|
|
142
142
|
Indicates if the response containers should have a dashed border
|
|
143
143
|
|
|
144
|
+
# `rubricEnabled` (boolean, required)
|
|
145
|
+
|
|
146
|
+
Indicates if Rubric is enabled
|
|
147
|
+
|
|
144
148
|
# `id` (string, required)
|
|
145
149
|
|
|
146
150
|
Identifier to identify the Pie Element in html markup, Must be unique within a pie item config.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/image-cloze-association",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.10-next.173+d434ce108",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": "pie-framework/pie-elements",
|
|
6
6
|
"publishConfig": {
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
"@material-ui/core": "^3.9.3",
|
|
11
11
|
"@material-ui/icons": "^3.0.1",
|
|
12
12
|
"@pie-framework/pie-player-events": "^0.1.0",
|
|
13
|
-
"@pie-lib/correct-answer-toggle": "^2.3.
|
|
13
|
+
"@pie-lib/correct-answer-toggle": "^2.3.46",
|
|
14
14
|
"@pie-lib/drag": "^1.1.52",
|
|
15
15
|
"@pie-lib/math-rendering": "^2.5.0",
|
|
16
|
-
"@pie-lib/render-ui": "^4.13.
|
|
16
|
+
"@pie-lib/render-ui": "^4.13.6",
|
|
17
17
|
"classnames": "^2.2.6",
|
|
18
18
|
"prop-types": "^15.6.1",
|
|
19
19
|
"react": "^16.8.1",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"author": "pie framework developers",
|
|
23
23
|
"license": "ISC",
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "d434ce108dd12cb05f72f676a79bbfba67944cb3",
|
|
25
25
|
"scripts": {
|
|
26
26
|
"postpublish": "../../scripts/postpublish"
|
|
27
27
|
},
|