@pie-element/drawing-response 6.4.1-next.9 → 6.5.0

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.
Files changed (36) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/configure/CHANGELOG.md +21 -0
  3. package/configure/lib/defaults.js +13 -0
  4. package/configure/lib/defaults.js.map +1 -1
  5. package/configure/lib/root.js +16 -4
  6. package/configure/lib/root.js.map +1 -1
  7. package/configure/package.json +3 -3
  8. package/configure/src/__tests__/__snapshots__/root.test.jsx.snap +21 -0
  9. package/configure/src/defaults.js +13 -0
  10. package/configure/src/root.jsx +8 -0
  11. package/controller/CHANGELOG.md +11 -0
  12. package/controller/lib/index.js +4 -2
  13. package/controller/lib/index.js.map +1 -1
  14. package/controller/package.json +1 -1
  15. package/controller/src/index.js +2 -1
  16. package/docs/config-schema.json +112 -0
  17. package/docs/config-schema.json.md +77 -1
  18. package/docs/pie-schema.json +41 -0
  19. package/docs/pie-schema.json.md +29 -0
  20. package/lib/drawing-response/container.js +56 -5
  21. package/lib/drawing-response/container.js.map +1 -1
  22. package/lib/drawing-response/drawable-main.js +15 -5
  23. package/lib/drawing-response/drawable-main.js.map +1 -1
  24. package/lib/drawing-response/drawable-palette.js +14 -5
  25. package/lib/drawing-response/drawable-palette.js.map +1 -1
  26. package/lib/drawing-response/drawable-text.js +8 -2
  27. package/lib/drawing-response/drawable-text.js.map +1 -1
  28. package/lib/drawing-response/index.js +4 -3
  29. package/lib/drawing-response/index.js.map +1 -1
  30. package/package.json +5 -4
  31. package/src/drawing-response/__tests__/__snapshots__/container.test.jsx.snap +30 -30
  32. package/src/drawing-response/container.jsx +36 -3
  33. package/src/drawing-response/drawable-main.jsx +8 -4
  34. package/src/drawing-response/drawable-palette.jsx +7 -3
  35. package/src/drawing-response/drawable-text.jsx +4 -2
  36. package/src/drawing-response/index.jsx +11 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,29 @@
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.5.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response@6.4.0...@pie-element/drawing-response@6.5.0) (2023-06-13)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * tests ([b5c5cae](https://github.com/pie-framework/pie-elements/commit/b5c5cae308eea1f99f05c01dbf5ee89cd69ceac8))
12
+ * update docs ([bc716ee](https://github.com/pie-framework/pie-elements/commit/bc716ee68f0673b391375df9d68904af4110c37a))
13
+ * update libs PD-2722, PD-2827, PD-2832 ([834ecf9](https://github.com/pie-framework/pie-elements/commit/834ecf92cc7204c851c68f0945ad5d52e453c9d0))
14
+ * update pie-libs ([649fb8f](https://github.com/pie-framework/pie-elements/commit/649fb8f535172d76b3ffc676ec53b2726432808c))
15
+ * update pie-libs PD-2150, PD-2795 ([ff6f64a](https://github.com/pie-framework/pie-elements/commit/ff6f64afa6ccaa8a060c986b1637c680e68c62b6))
16
+ * updated snapshots ([5cc0c23](https://github.com/pie-framework/pie-elements/commit/5cc0c23e41565160b7ffed3053d1d08aca637a88))
17
+
18
+
19
+ ### Features
20
+
21
+ * **drawing-response:** add language translator to text entry ([c45e41c](https://github.com/pie-framework/pie-elements/commit/c45e41c15af31ea5866b73a091d75f05cd865e14))
22
+ * **drawing-response:** add translator PD-2795 ([371fbce](https://github.com/pie-framework/pie-elements/commit/371fbceba849a1777770c9aba7584d914c60728c))
23
+ * add mathMlOptions PD-2150 ([0c6984c](https://github.com/pie-framework/pie-elements/commit/0c6984cf042141eac36badfbab1c46d8d42f71ee))
24
+
25
+
26
+
27
+
28
+
6
29
  # [6.4.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response@6.3.3...@pie-element/drawing-response@6.4.0) (2023-05-23)
7
30
 
8
31
 
@@ -3,6 +3,27 @@
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.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@6.3.0...@pie-element/drawing-response-configure@6.4.0) (2023-06-13)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * tests ([b5c5cae](https://github.com/pie-framework/pie-elements/commit/b5c5cae308eea1f99f05c01dbf5ee89cd69ceac8))
12
+ * update libs PD-2722, PD-2827, PD-2832 ([834ecf9](https://github.com/pie-framework/pie-elements/commit/834ecf92cc7204c851c68f0945ad5d52e453c9d0))
13
+ * update pie-libs ([649fb8f](https://github.com/pie-framework/pie-elements/commit/649fb8f535172d76b3ffc676ec53b2726432808c))
14
+ * update pie-libs PD-2150, PD-2795 ([ff6f64a](https://github.com/pie-framework/pie-elements/commit/ff6f64afa6ccaa8a060c986b1637c680e68c62b6))
15
+ * updated snapshots ([5cc0c23](https://github.com/pie-framework/pie-elements/commit/5cc0c23e41565160b7ffed3053d1d08aca637a88))
16
+
17
+
18
+ ### Features
19
+
20
+ * **drawing-response:** add translator PD-2795 ([371fbce](https://github.com/pie-framework/pie-elements/commit/371fbceba849a1777770c9aba7584d914c60728c))
21
+ * add mathMlOptions PD-2150 ([0c6984c](https://github.com/pie-framework/pie-elements/commit/0c6984cf042141eac36badfbab1c46d8d42f71ee))
22
+
23
+
24
+
25
+
26
+
6
27
  # [6.3.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@6.2.3...@pie-element/drawing-response-configure@6.3.0) (2023-05-23)
7
28
 
8
29
 
@@ -49,6 +49,19 @@ var _default = {
49
49
  withRubric: {
50
50
  settings: false,
51
51
  label: 'Add Rubric'
52
+ },
53
+ mathMlOptions: {
54
+ mmlOutput: false,
55
+ mmlEditing: false
56
+ },
57
+ language: {
58
+ settings: false,
59
+ label: 'Specify Language',
60
+ enabled: false
61
+ },
62
+ languageChoices: {
63
+ label: 'Language Choices',
64
+ options: []
52
65
  }
53
66
  }
54
67
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/defaults.js"],"names":["model","prompt","imageUrl","imageDimensions","height","width","promptEnabled","teacherInstructionsEnabled","studentInstructionsEnabled","backgroundImageEnabled","spellCheckEnabled","toolbarEditorPosition","configuration","spellCheck","label","settings","enabled","backgroundImage","settingsPanelDisabled","teacherInstructions","maxImageWidth","maxImageHeight","withRubric"],"mappings":";;;;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,MAAM,EAAE,6BADH;AAELC,IAAAA,QAAQ,EAAE,EAFL;AAGLC,IAAAA,eAAe,EAAE;AACfC,MAAAA,MAAM,EAAE,CADO;AAEfC,MAAAA,KAAK,EAAE;AAFQ,KAHZ;AAOLC,IAAAA,aAAa,EAAE,IAPV;AAQLC,IAAAA,0BAA0B,EAAE,IARvB;AASLC,IAAAA,0BAA0B,EAAE,IATvB;AAULC,IAAAA,sBAAsB,EAAE,IAVnB;AAWLC,IAAAA,iBAAiB,EAAE,IAXd;AAYLC,IAAAA,qBAAqB,EAAE;AAZlB,GADM;AAebC,EAAAA,aAAa,EAAE;AACbC,IAAAA,UAAU,EAAE;AACVC,MAAAA,KAAK,EAAE,YADG;AAEVC,MAAAA,QAAQ,EAAE,KAFA;AAGVC,MAAAA,OAAO,EAAE;AAHC,KADC;AAMbC,IAAAA,eAAe,EAAE;AACfF,MAAAA,QAAQ,EAAE,IADK;AAEfD,MAAAA,KAAK,EAAE;AAFQ,KANJ;AAUbb,IAAAA,MAAM,EAAE;AACNc,MAAAA,QAAQ,EAAE,IADJ;AAEND,MAAAA,KAAK,EAAE;AAFD,KAVK;AAcbI,IAAAA,qBAAqB,EAAE,KAdV;AAebC,IAAAA,mBAAmB,EAAE;AACnBJ,MAAAA,QAAQ,EAAE,IADS;AAEnBD,MAAAA,KAAK,EAAE;AAFY,KAfR;AAmBbM,IAAAA,aAAa,EAAE;AACbD,MAAAA,mBAAmB,EAAE,GADR;AAEblB,MAAAA,MAAM,EAAE;AAFK,KAnBF;AAuBboB,IAAAA,cAAc,EAAE;AACdF,MAAAA,mBAAmB,EAAE,GADP;AAEdlB,MAAAA,MAAM,EAAE;AAFM,KAvBH;AA2BbqB,IAAAA,UAAU,EAAE;AACVP,MAAAA,QAAQ,EAAE,KADA;AAEVD,MAAAA,KAAK,EAAE;AAFG;AA3BC;AAfF,C","sourcesContent":["export default {\n model: {\n prompt: 'This is the question prompt',\n imageUrl: '',\n imageDimensions: {\n height: 0,\n width: 0,\n },\n promptEnabled: true,\n teacherInstructionsEnabled: true,\n studentInstructionsEnabled: true,\n backgroundImageEnabled: true,\n spellCheckEnabled: true,\n toolbarEditorPosition: 'bottom',\n },\n configuration: {\n spellCheck: {\n label: 'Spellcheck',\n settings: false,\n enabled: true,\n },\n backgroundImage: {\n settings: true,\n label: 'Background Image',\n },\n prompt: {\n settings: true,\n label: 'Prompt',\n },\n settingsPanelDisabled: false,\n teacherInstructions: {\n settings: true,\n label: 'Teacher Instructions',\n },\n maxImageWidth: {\n teacherInstructions: 300,\n prompt: 300,\n },\n maxImageHeight: {\n teacherInstructions: 300,\n prompt: 300,\n },\n withRubric: {\n settings: false,\n label: 'Add Rubric',\n },\n },\n};\n"],"file":"defaults.js"}
1
+ {"version":3,"sources":["../src/defaults.js"],"names":["model","prompt","imageUrl","imageDimensions","height","width","promptEnabled","teacherInstructionsEnabled","studentInstructionsEnabled","backgroundImageEnabled","spellCheckEnabled","toolbarEditorPosition","configuration","spellCheck","label","settings","enabled","backgroundImage","settingsPanelDisabled","teacherInstructions","maxImageWidth","maxImageHeight","withRubric","mathMlOptions","mmlOutput","mmlEditing","language","languageChoices","options"],"mappings":";;;;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,MAAM,EAAE,6BADH;AAELC,IAAAA,QAAQ,EAAE,EAFL;AAGLC,IAAAA,eAAe,EAAE;AACfC,MAAAA,MAAM,EAAE,CADO;AAEfC,MAAAA,KAAK,EAAE;AAFQ,KAHZ;AAOLC,IAAAA,aAAa,EAAE,IAPV;AAQLC,IAAAA,0BAA0B,EAA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MAAAA,OAAO,EAAE;AAFM;AAxCJ;AAfF,C","sourcesContent":["export default {\n model: {\n prompt: 'This is the question prompt',\n imageUrl: '',\n imageDimensions: {\n height: 0,\n width: 0,\n },\n promptEnabled: true,\n teacherInstructionsEnabled: true,\n studentInstructionsEnabled: true,\n backgroundImageEnabled: true,\n spellCheckEnabled: true,\n toolbarEditorPosition: 'bottom',\n },\n configuration: {\n spellCheck: {\n label: 'Spellcheck',\n settings: false,\n enabled: true,\n },\n backgroundImage: {\n settings: true,\n label: 'Background Image',\n },\n prompt: {\n settings: true,\n label: 'Prompt',\n },\n settingsPanelDisabled: false,\n teacherInstructions: {\n settings: true,\n label: 'Teacher Instructions',\n },\n maxImageWidth: {\n teacherInstructions: 300,\n prompt: 300,\n },\n maxImageHeight: {\n teacherInstructions: 300,\n prompt: 300,\n },\n withRubric: {\n settings: false,\n label: 'Add Rubric',\n },\n mathMlOptions: {\n mmlOutput: false,\n mmlEditing: false,\n },\n language: {\n settings: false,\n label: 'Specify Language',\n enabled: false,\n },\n languageChoices: {\n label: 'Language Choices',\n options: [],\n }\n },\n};\n"],"file":"defaults.js"}
@@ -37,6 +37,8 @@ var _imageContainer = _interopRequireDefault(require("./image-container"));
37
37
 
38
38
  var _cloneDeep = _interopRequireDefault(require("lodash/cloneDeep"));
39
39
 
40
+ var _settings = require("@pie-lib/config-ui/lib/settings");
41
+
40
42
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
41
43
 
42
44
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@@ -128,7 +130,13 @@ var Root = /*#__PURE__*/function (_React$Component) {
128
130
  _ref$teacherInstructi = _ref.teacherInstructions,
129
131
  teacherInstructions = _ref$teacherInstructi === void 0 ? {} : _ref$teacherInstructi,
130
132
  _ref$withRubric = _ref.withRubric,
131
- withRubric = _ref$withRubric === void 0 ? {} : _ref$withRubric;
133
+ withRubric = _ref$withRubric === void 0 ? {} : _ref$withRubric,
134
+ _ref$language = _ref.language,
135
+ language = _ref$language === void 0 ? {} : _ref$language,
136
+ _ref$languageChoices = _ref.languageChoices,
137
+ languageChoices = _ref$languageChoices === void 0 ? {} : _ref$languageChoices,
138
+ _ref$mathMlOptions = _ref.mathMlOptions,
139
+ mathMlOptions = _ref$mathMlOptions === void 0 ? {} : _ref$mathMlOptions;
132
140
 
133
141
  var _ref2 = model || {},
134
142
  backgroundImageEnabled = _ref2.backgroundImageEnabled,
@@ -144,7 +152,9 @@ var Root = /*#__PURE__*/function (_React$Component) {
144
152
  };
145
153
  var panelSettings = {
146
154
  backgroundImageEnabled: backgroundImage.settings && toggle(backgroundImage.label),
147
- promptEnabled: prompt.settings && toggle(prompt.label)
155
+ promptEnabled: prompt.settings && toggle(prompt.label),
156
+ 'language.enabled': language.settings && toggle(language.label, true),
157
+ language: language.settings && language.enabled && (0, _settings.dropdown)(languageChoices.label, languageChoices.options)
148
158
  };
149
159
  var panelProperties = {
150
160
  teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),
@@ -181,7 +191,8 @@ var Root = /*#__PURE__*/function (_React$Component) {
181
191
  language: 'spanish'
182
192
  }, {
183
193
  language: 'special'
184
- }]
194
+ }],
195
+ mathMlOptions: mathMlOptions
185
196
  })), promptEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
186
197
  label: "Item Stem",
187
198
  className: classes.promptHolder
@@ -198,7 +209,8 @@ var Root = /*#__PURE__*/function (_React$Component) {
198
209
  language: 'spanish'
199
210
  }, {
200
211
  language: 'special'
201
- }]
212
+ }],
213
+ mathMlOptions: mathMlOptions
202
214
  })), backgroundImageEnabled && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
203
215
  variant: "subheading"
204
216
  }, "Define Background Image"), /*#__PURE__*/_react["default"].createElement(_imageContainer["default"], {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/root.jsx"],"names":["Panel","settings","toggle","Root","prompt","props","model","onModelChanged","update","teacherInstructions","dimensions","imageDimensions","imageUrl","classes","configuration","imageSupport","onConfigurationChanged","uploadSoundSupport","backgroundImage","contentDimensions","maxImageWidth","maxImageHeight","settingsPanelDisabled","spellCheck","withRubric","backgroundImageEnabled","promptEnabled","spellCheckEnabled","teacherInstructionsEnabled","toolbarEditorPosition","defaultImageMaxWidth","defaultImageMaxHeight","toolbarOpts","position","panelSettings","label","panelProperties","rubricEnabled","Settings","Properties","promptHolder","onTeacherInstructionsChanged","language","onPromptChanged","onUpdateImageDimension","onImageUpload","React","Component","styles","theme","paddingTop","spacing","unit","marginBottom","width","propTypes","PropTypes","object","isRequired","shape","add","func"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;;;;;AAEA,IAAQA,KAAR,GAA0BC,kBAA1B,CAAQD,KAAR;AAAA,IAAeE,MAAf,GAA0BD,kBAA1B,CAAeC,MAAf;;IAEaC,I;;;;;;;;;;;;;;;wGACO,UAACC,MAAD,EAAY;AAC5B,wBAAkC,MAAKC,KAAvC;AAAA,UAAQC,KAAR,eAAQA,KAAR;AAAA,UAAeC,cAAf,eAAeA,cAAf;AACA,UAAMC,MAAM,GAAG,2BAAUF,KAAV,CAAf;AAEAC,MAAAA,cAAc,iCAAMC,MAAN;AAAcJ,QAAAA,MAAM,EAANA;AAAd,SAA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MAFV;AAGfnD,EAAAA,KAAK,EAAEkD,sBAAUC,MAAV,CAAiBC,UAHT;AAIf3C,EAAAA,YAAY,EAAEyC,sBAAUG,KAAV,CAAgB;AAC5BC,IAAAA,GAAG,EAAEJ,sBAAUK,IADa;AAE5B,cAAQL,sBAAUK;AAFU,GAAhB,CAJC;AAQf5C,EAAAA,kBAAkB,EAAEuC,sBAAUG,KAAV,CAAgB;AAClCC,IAAAA,GAAG,EAAEJ,sBAAUK,IADmB;AAElC,cAAQL,sBAAUK;AAFgB,GAAhB,CARL;AAYftD,EAAAA,cAAc,EAAEiD,sBAAUK,IAAV,CAAeH,UAZhB;AAaf1C,EAAAA,sBAAsB,EAAEwC,sBAAUK,IAAV,CAAeH;AAbxB,CAAjB;;eAgBe,wBAAWV,MAAX,EAAmB7C,IAAnB,C","sourcesContent":["import React from 'react';\nimport { settings, layout, InputContainer } from '@pie-lib/config-ui';\nimport PropTypes from 'prop-types';\nimport EditableHtml from '@pie-lib/editable-html';\nimport Typography from '@material-ui/core/Typography';\nimport { withStyles } from '@material-ui/core/styles';\n\nimport ImageContainer from './image-container';\nimport cloneDeep from 'lodash/cloneDeep';\n\nconst { Panel, toggle } = settings;\n\nexport class Root extends React.Component {\n onPromptChanged = (prompt) => {\n const { model, onModelChanged } = this.props;\n const update = cloneDeep(model);\n\n onModelChanged({ ...update, prompt });\n };\n\n onTeacherInstructionsChanged = (teacherInstructions) => {\n const { model, onModelChanged } = this.props;\n\n onModelChanged({ ...model, teacherInstructions });\n };\n\n onUpdateImageDimension = (dimensions) => {\n const { model, onModelChanged } = this.props;\n\n onModelChanged({ ...model, imageDimensions: dimensions });\n };\n\n onImageUpload = (imageUrl) => {\n const { model, onModelChanged } = this.props;\n\n onModelChanged({ ...model, imageUrl });\n };\n\n render() {\n const { classes, configuration, imageSupport, model, onConfigurationChanged, onModelChanged, uploadSoundSupport } =\n this.props;\n const {\n backgroundImage = {},\n contentDimensions = {},\n maxImageWidth = {},\n maxImageHeight = {},\n prompt = {},\n settingsPanelDisabled,\n spellCheck = {},\n teacherInstructions = {},\n withRubric = {},\n } = configuration || {};\n const {\n backgroundImageEnabled,\n promptEnabled,\n spellCheckEnabled,\n teacherInstructionsEnabled,\n toolbarEditorPosition,\n } = model || {};\n\n const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;\n const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;\n\n const toolbarOpts = {\n position: toolbarEditorPosition === 'top' ? 'top' : 'bottom',\n };\n\n const panelSettings = {\n backgroundImageEnabled: backgroundImage.settings && toggle(backgroundImage.label),\n promptEnabled: prompt.settings && toggle(prompt.label),\n };\n\n const panelProperties = {\n teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),\n spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),\n rubricEnabled: withRubric?.settings && toggle(withRubric?.label),\n };\n\n return (\n <layout.ConfigLayout\n dimensions={contentDimensions}\n hideSettings={settingsPanelDisabled}\n settings={\n <Panel\n model={model}\n onChangeModel={onModelChanged}\n configuration={configuration}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n Settings: panelSettings,\n Properties: panelProperties,\n }}\n />\n }\n >\n {teacherInstructionsEnabled && (\n <InputContainer label={teacherInstructions.label} className={classes.promptHolder}>\n <EditableHtml\n markup={model.teacherInstructions || ''}\n onChange={this.onTeacherInstructionsChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheckEnabled}\n maxImageWidth={(maxImageWidth && maxImageWidth.teacherInstructions) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.teacherInstructions) || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n />\n </InputContainer>\n )}\n\n {promptEnabled && (\n <InputContainer label=\"Item Stem\" className={classes.promptHolder}>\n <EditableHtml\n markup={model.prompt}\n onChange={this.onPromptChanged}\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheckEnabled}\n imageSupport={imageSupport}\n maxImageWidth={defaultImageMaxWidth}\n maxImageHeight={defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n />\n </InputContainer>\n )}\n\n {backgroundImageEnabled && (\n <React.Fragment>\n <Typography variant=\"subheading\">Define Background Image</Typography>\n\n <ImageContainer\n imageUrl={model.imageUrl}\n onUpdateImageDimension={this.onUpdateImageDimension}\n onImageUpload={this.onImageUpload}\n imageDimensions={model.imageDimensions}\n />\n </React.Fragment>\n )}\n </layout.ConfigLayout>\n );\n }\n}\n\nconst styles = (theme) => ({\n promptHolder: {\n paddingTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2,\n width: '100%',\n },\n});\n\nRoot.propTypes = {\n classes: PropTypes.object.isRequired,\n configuration: PropTypes.object,\n model: PropTypes.object.isRequired,\n imageSupport: PropTypes.shape({\n add: PropTypes.func,\n delete: PropTypes.func,\n }),\n uploadSoundSupport: PropTypes.shape({\n add: PropTypes.func,\n delete: PropTypes.func,\n }),\n onModelChanged: PropTypes.func.isRequired,\n onConfigurationChanged: PropTypes.func.isRequired,\n};\n\nexport default withStyles(styles)(Root);\n"],"file":"root.js"}
1
+ {"version":3,"sources":["../src/root.jsx"],"names":["Panel","settings","toggle","Root","prompt","props","model","onModelChanged","update","teacherInstructions","dimensions","imageDimensions","imageUrl","classes","configuration","imageSupport","onConfigurationChanged","uploadSoundSupport","backgroundImage","contentDimensions","maxImageWidth","maxImageHeight","settingsPanelDisabled","spellCheck","withRubric","language","languageChoices","mathMlOptions","backgroundImageEnabled","promptEnabled","spellCheckEnabled","teacherInstructionsEnabled","toolbarEditorPosition","defaultImageMaxWidth","defaultImageMaxHeight","toolbarOpts","position","panelSettings","label","enabled","options","panelProperties","rubricEnabled","Settings","Properties","promptHolder","onTeacherInstructionsChanged","onPromptChanged","onUpdateImageDimension","onImageUpload","React","Component","styles","theme","paddingTop","spacing","unit","marginBottom","width","propTypes","PropTypes","object","isRequired","shape","add","func"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;;;;;;;;;AAEA,IAAQA,KAAR,GAA0BC,kBAA1B,CAAQD,KAAR;AAAA,IAAeE,MAAf,GAA0BD,kBAA1B,CAAeC,MAAf;;IAEaC,I;;;;;;;;;;;;;;;wGACO,UAACC,MAAD,EAAY;AAC5B,wBAAkC,MAAKC,KAAvC;AAAA,UAAQC,KAAR,eAAQA,KAAR;AAAA,UAAeC,cAAf,eAAeA,cAAf;AACA,UAAMC,MAAM,GAAG,2BAAUF,KAAV,CAAf;AAEAC,MAAAA,cAAc,iCAAMC,MAAN;AAAcJ,QAAAA,MAAM,EAANA;AAAd,SAAd;AACD,K;qHAE8B,UAACK,mBAAD,EAAyB;AACtD,yBAAkC,MAAKJ,KAAvC;AAAA,UAAQC,KAAR,gBAAQA,KAAR;AAAA,UAAeC,cAAf,gBAAeA,cAAf;AAEAA,MAAAA,cAAc,iCAAMD,KAAN;AAAaG,QAAAA,mBAAmB,EAAnBA;AAAb,SAAd;AACD,K;+GAEwB,UAACC,UAAD,EAAgB;AACvC,yBAAkC,MAAKL,KAAvC;AAAA,UAAQC,KAAR,gBAAQA,KAAR;AAAA,UAAeC,cAAf,gBAAeA,cAAf;AAEAA,MAAAA,cAAc,iCAAMD,KAAN;AAAaK,QAAAA,eAAe,EAAED;AAA9B,SAAd;AACD,K;sGAEe,UAACE,QAAD,EAAc;AAC5B,yBAAkC,MAAKP,KAAvC;AAAA,UAAQC,KAAR,gBAAQA,KAAR;AAAA,UAAeC,cAAf,gBAAeA,cAAf;AAEAA,MAAAA,cAAc,iCAAMD,KAAN;AAAaM,QAAAA,QAAQ,EAARA;AAAb,SAAd;AACD,K;;;;;;WAED,kBAAS;AACP,yBACE,KAAKP,KADP;AAAA,UAAQQ,OAAR,gBAAQA,OA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B,EAAE2C,sBAAUG,KAAV,CAAgB;AAClCC,IAAAA,GAAG,EAAEJ,sBAAUK,IADmB;AAElC,cAAQL,sBAAUK;AAFgB,GAAhB,CARL;AAYf1D,EAAAA,cAAc,EAAEqD,sBAAUK,IAAV,CAAeH,UAZhB;AAaf9C,EAAAA,sBAAsB,EAAE4C,sBAAUK,IAAV,CAAeH;AAbxB,CAAjB;;eAgBe,wBAAWV,MAAX,EAAmBjD,IAAnB,C","sourcesContent":["import React from 'react';\nimport { settings, layout, InputContainer } from '@pie-lib/config-ui';\nimport PropTypes from 'prop-types';\nimport EditableHtml from '@pie-lib/editable-html';\nimport Typography from '@material-ui/core/Typography';\nimport { withStyles } from '@material-ui/core/styles';\n\nimport ImageContainer from './image-container';\nimport cloneDeep from 'lodash/cloneDeep';\nimport { dropdown } from '@pie-lib/config-ui/lib/settings';\n\nconst { Panel, toggle } = settings;\n\nexport class Root extends React.Component {\n onPromptChanged = (prompt) => {\n const { model, onModelChanged } = this.props;\n const update = cloneDeep(model);\n\n onModelChanged({ ...update, prompt });\n };\n\n onTeacherInstructionsChanged = (teacherInstructions) => {\n const { model, onModelChanged } = this.props;\n\n onModelChanged({ ...model, teacherInstructions });\n };\n\n onUpdateImageDimension = (dimensions) => {\n const { model, onModelChanged } = this.props;\n\n onModelChanged({ ...model, imageDimensions: dimensions });\n };\n\n onImageUpload = (imageUrl) => {\n const { model, onModelChanged } = this.props;\n\n onModelChanged({ ...model, imageUrl });\n };\n\n render() {\n const { classes, configuration, imageSupport, model, onConfigurationChanged, onModelChanged, uploadSoundSupport } =\n this.props;\n const {\n backgroundImage = {},\n contentDimensions = {},\n maxImageWidth = {},\n maxImageHeight = {},\n prompt = {},\n settingsPanelDisabled,\n spellCheck = {},\n teacherInstructions = {},\n withRubric = {},\n language = {},\n languageChoices = {},\n mathMlOptions = {},\n } = configuration || {};\n const {\n backgroundImageEnabled,\n promptEnabled,\n spellCheckEnabled,\n teacherInstructionsEnabled,\n toolbarEditorPosition,\n } = model || {};\n\n const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;\n const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;\n\n const toolbarOpts = {\n position: toolbarEditorPosition === 'top' ? 'top' : 'bottom',\n };\n\n const panelSettings = {\n backgroundImageEnabled: backgroundImage.settings && toggle(backgroundImage.label),\n promptEnabled: prompt.settings && toggle(prompt.label),\n 'language.enabled': language.settings && toggle(language.label, true),\n language: language.settings && language.enabled && dropdown(languageChoices.label, languageChoices.options),\n };\n\n const panelProperties = {\n teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),\n spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),\n rubricEnabled: withRubric?.settings && toggle(withRubric?.label),\n };\n\n return (\n <layout.ConfigLayout\n dimensions={contentDimensions}\n hideSettings={settingsPanelDisabled}\n settings={\n <Panel\n model={model}\n onChangeModel={onModelChanged}\n configuration={configuration}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n Settings: panelSettings,\n Properties: panelProperties,\n }}\n />\n }\n >\n {teacherInstructionsEnabled && (\n <InputContainer label={teacherInstructions.label} className={classes.promptHolder}>\n <EditableHtml\n markup={model.teacherInstructions || ''}\n onChange={this.onTeacherInstructionsChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheckEnabled}\n maxImageWidth={(maxImageWidth && maxImageWidth.teacherInstructions) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.teacherInstructions) || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n />\n </InputContainer>\n )}\n\n {promptEnabled && (\n <InputContainer label=\"Item Stem\" className={classes.promptHolder}>\n <EditableHtml\n markup={model.prompt}\n onChange={this.onPromptChanged}\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheckEnabled}\n imageSupport={imageSupport}\n maxImageWidth={defaultImageMaxWidth}\n maxImageHeight={defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n />\n </InputContainer>\n )}\n\n {backgroundImageEnabled && (\n <React.Fragment>\n <Typography variant=\"subheading\">Define Background Image</Typography>\n\n <ImageContainer\n imageUrl={model.imageUrl}\n onUpdateImageDimension={this.onUpdateImageDimension}\n onImageUpload={this.onImageUpload}\n imageDimensions={model.imageDimensions}\n />\n </React.Fragment>\n )}\n </layout.ConfigLayout>\n );\n }\n}\n\nconst styles = (theme) => ({\n promptHolder: {\n paddingTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2,\n width: '100%',\n },\n});\n\nRoot.propTypes = {\n classes: PropTypes.object.isRequired,\n configuration: PropTypes.object,\n model: PropTypes.object.isRequired,\n imageSupport: PropTypes.shape({\n add: PropTypes.func,\n delete: PropTypes.func,\n }),\n uploadSoundSupport: PropTypes.shape({\n add: PropTypes.func,\n delete: PropTypes.func,\n }),\n onModelChanged: PropTypes.func.isRequired,\n onConfigurationChanged: PropTypes.func.isRequired,\n};\n\nexport default withStyles(styles)(Root);\n"],"file":"root.js"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pie-element/drawing-response-configure",
3
3
  "private": true,
4
- "version": "6.3.0",
4
+ "version": "6.4.0",
5
5
  "description": "",
6
6
  "main": "lib/index.js",
7
7
  "module": "src/index.js",
@@ -9,8 +9,8 @@
9
9
  "dependencies": {
10
10
  "@material-ui/core": "^3.9.2",
11
11
  "@pie-framework/pie-configure-events": "^1.3.0",
12
- "@pie-lib/config-ui": "^11.6.10",
13
- "@pie-lib/editable-html": "^9.6.2",
12
+ "@pie-lib/config-ui": "^11.8.1",
13
+ "@pie-lib/editable-html": "^9.6.5",
14
14
  "classnames": "^2.2.6",
15
15
  "debug": "^3.1.0",
16
16
  "lodash": "^4.17.15",
@@ -12,6 +12,19 @@ exports[`Root snapshot renders 1`] = `
12
12
  "label": "Background Image",
13
13
  "settings": true,
14
14
  },
15
+ "language": Object {
16
+ "enabled": false,
17
+ "label": "Specify Language",
18
+ "settings": false,
19
+ },
20
+ "languageChoices": Object {
21
+ "label": "Language Choices",
22
+ "options": Array [],
23
+ },
24
+ "mathMlOptions": Object {
25
+ "mmlEditing": false,
26
+ "mmlOutput": false,
27
+ },
15
28
  "maxImageHeight": Object {
16
29
  "prompt": 300,
17
30
  "teacherInstructions": 300,
@@ -49,6 +62,8 @@ exports[`Root snapshot renders 1`] = `
49
62
  },
50
63
  "Settings": Object {
51
64
  "backgroundImageEnabled": undefined,
65
+ "language": false,
66
+ "language.enabled": false,
52
67
  "promptEnabled": undefined,
53
68
  },
54
69
  }
@@ -84,6 +99,12 @@ exports[`Root snapshot renders 1`] = `
84
99
  ]
85
100
  }
86
101
  markup="Test Prompt"
102
+ mathMlOptions={
103
+ Object {
104
+ "mmlEditing": false,
105
+ "mmlOutput": false,
106
+ }
107
+ }
87
108
  maxImageHeight={300}
88
109
  maxImageWidth={300}
89
110
  onChange={[Function]}
@@ -44,5 +44,18 @@ export default {
44
44
  settings: false,
45
45
  label: 'Add Rubric',
46
46
  },
47
+ mathMlOptions: {
48
+ mmlOutput: false,
49
+ mmlEditing: false,
50
+ },
51
+ language: {
52
+ settings: false,
53
+ label: 'Specify Language',
54
+ enabled: false,
55
+ },
56
+ languageChoices: {
57
+ label: 'Language Choices',
58
+ options: [],
59
+ }
47
60
  },
48
61
  };
@@ -7,6 +7,7 @@ import { withStyles } from '@material-ui/core/styles';
7
7
 
8
8
  import ImageContainer from './image-container';
9
9
  import cloneDeep from 'lodash/cloneDeep';
10
+ import { dropdown } from '@pie-lib/config-ui/lib/settings';
10
11
 
11
12
  const { Panel, toggle } = settings;
12
13
 
@@ -49,6 +50,9 @@ export class Root extends React.Component {
49
50
  spellCheck = {},
50
51
  teacherInstructions = {},
51
52
  withRubric = {},
53
+ language = {},
54
+ languageChoices = {},
55
+ mathMlOptions = {},
52
56
  } = configuration || {};
53
57
  const {
54
58
  backgroundImageEnabled,
@@ -68,6 +72,8 @@ export class Root extends React.Component {
68
72
  const panelSettings = {
69
73
  backgroundImageEnabled: backgroundImage.settings && toggle(backgroundImage.label),
70
74
  promptEnabled: prompt.settings && toggle(prompt.label),
75
+ 'language.enabled': language.settings && toggle(language.label, true),
76
+ language: language.settings && language.enabled && dropdown(languageChoices.label, languageChoices.options),
71
77
  };
72
78
 
73
79
  const panelProperties = {
@@ -106,6 +112,7 @@ export class Root extends React.Component {
106
112
  maxImageHeight={(maxImageHeight && maxImageHeight.teacherInstructions) || defaultImageMaxHeight}
107
113
  uploadSoundSupport={uploadSoundSupport}
108
114
  languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}
115
+ mathMlOptions={mathMlOptions}
109
116
  />
110
117
  </InputContainer>
111
118
  )}
@@ -122,6 +129,7 @@ export class Root extends React.Component {
122
129
  maxImageHeight={defaultImageMaxHeight}
123
130
  uploadSoundSupport={uploadSoundSupport}
124
131
  languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}
132
+ mathMlOptions={mathMlOptions}
125
133
  />
126
134
  </InputContainer>
127
135
  )}
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.3.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-controller@3.2.9...@pie-element/drawing-response-controller@3.3.0) (2023-06-13)
7
+
8
+
9
+ ### Features
10
+
11
+ * **drawing-response:** add translator PD-2795 ([371fbce](https://github.com/pie-framework/pie-elements/commit/371fbceba849a1777770c9aba7584d914c60728c))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [3.2.9](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-controller@3.2.8...@pie-element/drawing-response-controller@3.2.9) (2022-12-07)
7
18
 
8
19
 
@@ -39,7 +39,8 @@ function model(question, session, env) {
39
39
  imageDimensions = normalizedQuestion.imageDimensions,
40
40
  prompt = normalizedQuestion.prompt,
41
41
  promptEnabled = normalizedQuestion.promptEnabled,
42
- backgroundImageEnabled = normalizedQuestion.backgroundImageEnabled;
42
+ backgroundImageEnabled = normalizedQuestion.backgroundImageEnabled,
43
+ language = normalizedQuestion.language;
43
44
  return new Promise(function (resolve) {
44
45
  var out = {
45
46
  disabled: env.mode !== 'gather',
@@ -47,7 +48,8 @@ function model(question, session, env) {
47
48
  imageDimensions: imageDimensions,
48
49
  imageUrl: imageUrl,
49
50
  prompt: promptEnabled ? prompt : null,
50
- backgroundImageEnabled: backgroundImageEnabled
51
+ backgroundImageEnabled: backgroundImageEnabled,
52
+ language: language
51
53
  };
52
54
 
53
55
  if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.js"],"names":["log","normalize","question","promptEnabled","teacherInstructionsEnabled","studentInstructionsEnabled","backgroundImageEnabled","model","session","env","normalizedQuestion","imageUrl","imageDimensions","prompt","Promise","resolve","out","disabled","mode","role","teacherInstructions","createDefaultModel","defaults","outcome","score","completed","note"],"mappings":";;;;;;;;;;;;;;AAAA;;AACA;;;;;;AAEA,IAAMA,GAAG,GAAG,uBAAM,0CAAN,CAAZ;;AAEO,IAAMC,SAAS,GAAG,SAAZA,SAAY,CAACC,QAAD;AAAA;AACvBC,IAAAA,aAAa,EAAE,IADQ;AAEvBC,IAAAA,0BAA0B,EAAE,IAFL;AAGvBC,IAAAA,0BAA0B,EAAE,IAHL;AAIvBC,IAAAA,sBAAsB,EAAE;AAJD,KAKpBJ,QALoB;AAAA,CAAlB;;;;AAQA,SAASK,KAAT,CAAeL,QAAf,EAAyBM,OAAzB,EAAkCC,GAAlC,EAAuC;AAC5C,MAAMC,kBAAkB,GAAGT,SAAS,CAACC,QAAD,CAApC;AACA,MAAQS,QAAR,GAAqFD,kBAArF,CAAQC,QAAR;AAAA,MAAkBC,eAAlB,G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,IAAAA,GAAG,CAAC,YAAD,CAAH;AACAe,IAAAA,OAAO,CAAC;AACNS,MAAAA,KAAK,EAAE,CADD;AAENC,MAAAA,SAAS,EAAE,KAFL;AAGNC,MAAAA,IAAI,EAAE;AAHA,KAAD,CAAP;AAKD,GAPM,CAAP;AAQD","sourcesContent":["import debug from 'debug';\nimport defaults from './defaults';\n\nconst log = debug('pie-elements:drawing-response:controller');\n\nexport const normalize = (question) => ({\n promptEnabled: true,\n teacherInstructionsEnabled: true,\n studentInstructionsEnabled: true,\n backgroundImageEnabled: true,\n ...question,\n});\n\nexport function model(question, session, env) {\n const normalizedQuestion = normalize(question);\n const { imageUrl, imageDimensions, prompt, promptEnabled, backgroundImageEnabled } = normalizedQuestion;\n\n return new Promise((resolve) => {\n const out = {\n disabled: env.mode !== 'gather',\n mode: env.mode,\n imageDimensions,\n imageUrl,\n prompt: promptEnabled ? prompt : null,\n backgroundImageEnabled,\n };\n\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n out.teacherInstructions = normalizedQuestion.teacherInstructionsEnabled\n ? normalizedQuestion.teacherInstructions\n : null;\n } else {\n out.teacherInstructions = null;\n }\n\n resolve(out);\n });\n}\n\nexport const createDefaultModel = (model = {}) =>\n new Promise((resolve) => {\n resolve({\n ...defaults,\n ...model,\n });\n });\n\nexport function outcome(/*config, session*/) {\n return new Promise((resolve) => {\n log('outcome...');\n resolve({\n score: 0,\n completed: 'n/a',\n note: 'Requires manual scoring',\n });\n });\n}\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../src/index.js"],"names":["log","normalize","question","promptEnabled","teacherInstructionsEnabled","studentInstructionsEnabled","backgroundImageEnabled","model","session","env","normalizedQuestion","imageUrl","imageDimensions","prompt","language","Promise","resolve","out","disabled","mode","role","teacherInstructions","createDefaultModel","defaults","outcome","score","completed","note"],"mappings":";;;;;;;;;;;;;;AAAA;;AACA;;;;;;AAEA,IAAMA,GAAG,GAAG,uBAAM,0CAAN,CAAZ;;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BAAJ,GAA0BX,kBAAkB,CAACN,0BAAnB,GACtBM,kBAAkB,CAACW,mBADG,GAEtB,IAFJ;AAGD,KAJD,MAIO;AACLJ,MAAAA,GAAG,CAACI,mBAAJ,GAA0B,IAA1B;AACD;;AAEDL,IAAAA,OAAO,CAACC,GAAD,CAAP;AACD,GApBM,CAAP;AAqBD;;AAEM,IAAMK,kBAAkB,GAAG,SAArBA,kBAAqB;AAAA,MAACf,KAAD,uEAAS,EAAT;AAAA,SAChC,IAAIQ,OAAJ,CAAY,UAACC,OAAD,EAAa;AACvBA,IAAAA,OAAO,iCACFO,oBADE,GAEFhB,KAFE,EAAP;AAID,GALD,CADgC;AAAA,CAA3B;;;;AAQA;AAAiB;AAARiB,OAAT,GAAsC;AAC3C,SAAO,IAAIT,OAAJ,CAAY,UAACC,OAAD,EAAa;AAC9BhB,IAAAA,GAAG,CAAC,YAAD,CAAH;AACAgB,IAAAA,OAAO,CAAC;AACNS,MAAAA,KAAK,EAAE,CADD;AAENC,MAAAA,SAAS,EAAE,KAFL;AAGNC,MAAAA,IAAI,EAAE;AAHA,KAAD,CAAP;AAKD,GAPM,CAAP;AAQD","sourcesContent":["import debug from 'debug';\nimport defaults from './defaults';\n\nconst log = debug('pie-elements:drawing-response:controller');\n\nexport const normalize = (question) => ({\n promptEnabled: true,\n teacherInstructionsEnabled: true,\n studentInstructionsEnabled: true,\n backgroundImageEnabled: true,\n ...question,\n});\n\nexport function model(question, session, env) {\n const normalizedQuestion = normalize(question);\n const { imageUrl, imageDimensions, prompt, promptEnabled, backgroundImageEnabled, language } = normalizedQuestion;\n\n return new Promise((resolve) => {\n const out = {\n disabled: env.mode !== 'gather',\n mode: env.mode,\n imageDimensions,\n imageUrl,\n prompt: promptEnabled ? prompt : null,\n backgroundImageEnabled,\n language\n };\n\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n out.teacherInstructions = normalizedQuestion.teacherInstructionsEnabled\n ? normalizedQuestion.teacherInstructions\n : null;\n } else {\n out.teacherInstructions = null;\n }\n\n resolve(out);\n });\n}\n\nexport const createDefaultModel = (model = {}) =>\n new Promise((resolve) => {\n resolve({\n ...defaults,\n ...model,\n });\n });\n\nexport function outcome(/*config, session*/) {\n return new Promise((resolve) => {\n log('outcome...');\n resolve({\n score: 0,\n completed: 'n/a',\n note: 'Requires manual scoring',\n });\n });\n}\n"],"file":"index.js"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pie-element/drawing-response-controller",
3
3
  "private": true,
4
- "version": "3.2.9",
4
+ "version": "3.3.0",
5
5
  "description": "",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -13,7 +13,7 @@ export const normalize = (question) => ({
13
13
 
14
14
  export function model(question, session, env) {
15
15
  const normalizedQuestion = normalize(question);
16
- const { imageUrl, imageDimensions, prompt, promptEnabled, backgroundImageEnabled } = normalizedQuestion;
16
+ const { imageUrl, imageDimensions, prompt, promptEnabled, backgroundImageEnabled, language } = normalizedQuestion;
17
17
 
18
18
  return new Promise((resolve) => {
19
19
  const out = {
@@ -23,6 +23,7 @@ export function model(question, session, env) {
23
23
  imageUrl,
24
24
  prompt: promptEnabled ? prompt : null,
25
25
  backgroundImageEnabled,
26
+ language
26
27
  };
27
28
 
28
29
  if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {
@@ -156,6 +156,82 @@
156
156
  }
157
157
  }
158
158
  },
159
+ "mathMlOptions": {
160
+ "title": "ConfigureMathMLProp",
161
+ "type": "object",
162
+ "properties": {
163
+ "mmlOutput": {
164
+ "description": "Indicates if model should have mathML output instead of latex",
165
+ "type": "number",
166
+ "title": "mmlOutput"
167
+ },
168
+ "mmlEditing": {
169
+ "description": "Indicates if mathML that's already in model should be editable",
170
+ "type": "number",
171
+ "title": "mmlEditing"
172
+ }
173
+ }
174
+ },
175
+ "language": {
176
+ "title": "ConfigurePropWithEnabled",
177
+ "type": "object",
178
+ "properties": {
179
+ "settings": {
180
+ "description": "Indicates if the item has to be displayed in the Settings Panel",
181
+ "type": "boolean",
182
+ "title": "settings"
183
+ },
184
+ "label": {
185
+ "description": "Indicates the label for the item that has to be displayed in the Settings Panel",
186
+ "type": "string",
187
+ "title": "label"
188
+ },
189
+ "enabled": {
190
+ "description": "Indicates the value of the item if it affects config-ui\n(eg.: if item is a switch and displaying an input on the config-ui depends on the switch value: on/off)",
191
+ "type": "boolean",
192
+ "title": "enabled"
193
+ }
194
+ }
195
+ },
196
+ "languageChoices": {
197
+ "description": "Language choices configuration\nOnly available if language is enabled",
198
+ "type": "object",
199
+ "properties": {
200
+ "label": {
201
+ "type": "string",
202
+ "title": "label"
203
+ },
204
+ "options": {
205
+ "type": "array",
206
+ "items": {
207
+ "title": "ConfigureLanguageOptionsProp",
208
+ "type": "object",
209
+ "properties": {
210
+ "value": {
211
+ "description": "Value of the language option",
212
+ "type": "string",
213
+ "title": "value"
214
+ },
215
+ "label": {
216
+ "description": "Label of the language option",
217
+ "type": "string",
218
+ "title": "label"
219
+ }
220
+ },
221
+ "required": [
222
+ "label",
223
+ "value"
224
+ ]
225
+ },
226
+ "title": "options"
227
+ }
228
+ },
229
+ "required": [
230
+ "label",
231
+ "options"
232
+ ],
233
+ "title": "languageChoices"
234
+ },
159
235
  "showPrompt": {
160
236
  "description": "Determines whether prompt field will be displayed or not",
161
237
  "default": true,
@@ -298,6 +374,42 @@
298
374
  "title": "forceEnabled"
299
375
  }
300
376
  }
377
+ },
378
+ "ConfigureMathMLProp": {
379
+ "title": "ConfigureMathMLProp",
380
+ "type": "object",
381
+ "properties": {
382
+ "mmlOutput": {
383
+ "description": "Indicates if model should have mathML output instead of latex",
384
+ "type": "number",
385
+ "title": "mmlOutput"
386
+ },
387
+ "mmlEditing": {
388
+ "description": "Indicates if mathML that's already in model should be editable",
389
+ "type": "number",
390
+ "title": "mmlEditing"
391
+ }
392
+ }
393
+ },
394
+ "ConfigureLanguageOptionsProp": {
395
+ "title": "ConfigureLanguageOptionsProp",
396
+ "type": "object",
397
+ "properties": {
398
+ "value": {
399
+ "description": "Value of the language option",
400
+ "type": "string",
401
+ "title": "value"
402
+ },
403
+ "label": {
404
+ "description": "Label of the language option",
405
+ "type": "string",
406
+ "title": "label"
407
+ }
408
+ },
409
+ "required": [
410
+ "label",
411
+ "value"
412
+ ]
301
413
  }
302
414
  },
303
415
  "$schema": "http://json-schema.org/draft-07/schema#"
@@ -122,6 +122,58 @@ if true:
122
122
  - this property will not be visible in Settings Panel (settings will become automatically false)
123
123
  - the model property afferent to it will become automatically false
124
124
 
125
+ # `mathMlOptions` (object)
126
+
127
+ Properties of the `mathMlOptions` object:
128
+
129
+ ## `mmlOutput` (number)
130
+
131
+ Indicates if model should have mathML output instead of latex
132
+
133
+ ## `mmlEditing` (number)
134
+
135
+ Indicates if mathML that's already in model should be editable
136
+
137
+ # `language` (object)
138
+
139
+ Properties of the `language` object:
140
+
141
+ ## `settings` (boolean)
142
+
143
+ Indicates if the item has to be displayed in the Settings Panel
144
+
145
+ ## `label` (string)
146
+
147
+ Indicates the label for the item that has to be displayed in the Settings Panel
148
+
149
+ ## `enabled` (boolean)
150
+
151
+ Indicates the value of the item if it affects config-ui
152
+ (eg.: if item is a switch and displaying an input on the config-ui depends on the switch value: on/off)
153
+
154
+ # `languageChoices` (object)
155
+
156
+ Language choices configuration
157
+ Only available if language is enabled
158
+
159
+ Properties of the `languageChoices` object:
160
+
161
+ ## `label` (string, required)
162
+
163
+ ## `options` (array, required)
164
+
165
+ The object is an array with all elements of the type `object`.
166
+
167
+ The array object has the following properties:
168
+
169
+ ### `value` (string, required)
170
+
171
+ Value of the language option
172
+
173
+ ### `label` (string, required)
174
+
175
+ Label of the language option
176
+
125
177
  # `showPrompt` (boolean)
126
178
 
127
179
  Determines whether prompt field will be displayed or not
@@ -242,4 +294,28 @@ Indicates the label for the item that has to be displayed in the Settings Panel
242
294
  Indicates the value for the toggle;
243
295
  if true:
244
296
  - this property will not be visible in Settings Panel (settings will become automatically false)
245
- - the model property afferent to it will become automatically false
297
+ - the model property afferent to it will become automatically false
298
+
299
+ ## `ConfigureMathMLProp` (object)
300
+
301
+ Properties of the `ConfigureMathMLProp` object:
302
+
303
+ ### `mmlOutput` (number)
304
+
305
+ Indicates if model should have mathML output instead of latex
306
+
307
+ ### `mmlEditing` (number)
308
+
309
+ Indicates if mathML that's already in model should be editable
310
+
311
+ ## `ConfigureLanguageOptionsProp` (object)
312
+
313
+ Properties of the `ConfigureLanguageOptionsProp` object:
314
+
315
+ ### `value` (string, required)
316
+
317
+ Value of the language option
318
+
319
+ ### `label` (string, required)
320
+
321
+ Label of the language option