@pie-element/ebsr 7.0.16 → 7.0.19
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 +24 -0
- package/configure/CHANGELOG.md +24 -0
- package/configure/lib/defaults.js +6 -0
- package/configure/lib/defaults.js.map +1 -1
- package/configure/lib/main.js +10 -4
- package/configure/lib/main.js.map +1 -1
- package/configure/package.json +3 -3
- package/configure/src/__tests__/__snapshots__/index.test.js.snap +4 -0
- package/configure/src/defaults.js +6 -0
- package/configure/src/main.jsx +10 -4
- package/docs/config-schema.json +48 -0
- package/docs/config-schema.json.md +36 -0
- package/docs/pie-schema.json +34 -0
- package/docs/pie-schema.json.md +24 -0
- package/lib/print.js +245 -0
- package/lib/print.js.map +1 -0
- package/module/configure.js +472 -0
- package/module/controller.js +20756 -0
- package/module/demo.js +77 -0
- package/module/element.js +2146 -0
- package/module/index.html +21 -0
- package/module/manifest.json +14 -0
- package/module/print-demo.js +115 -0
- package/module/print.html +18 -0
- package/module/print.js +2175 -0
- package/package.json +8 -4
- package/src/print.js +183 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,30 @@
|
|
|
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
|
+
## [7.0.19](https://github.com/pie-framework/pie-elements/compare/@pie-element/ebsr@7.0.18...@pie-element/ebsr@7.0.19) (2022-03-22)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @pie-element/ebsr
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [7.0.18](https://github.com/pie-framework/pie-elements/compare/@pie-element/ebsr@7.0.17...@pie-element/ebsr@7.0.18) (2022-03-08)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @pie-element/ebsr
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [7.0.17](https://github.com/pie-framework/pie-elements/compare/@pie-element/ebsr@7.0.16...@pie-element/ebsr@7.0.17) (2022-03-08)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @pie-element/ebsr
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
6
30
|
## [7.0.16](https://github.com/pie-framework/pie-elements/compare/@pie-element/ebsr@7.0.15...@pie-element/ebsr@7.0.16) (2022-02-21)
|
|
7
31
|
|
|
8
32
|
**Note:** Version bump only for package @pie-element/ebsr
|
package/configure/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,30 @@
|
|
|
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
|
+
## [7.0.19](https://github.com/pie-framework/pie-elements/compare/@pie-element/ebsr-configure@7.0.18...@pie-element/ebsr-configure@7.0.19) (2022-03-22)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @pie-element/ebsr-configure
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [7.0.18](https://github.com/pie-framework/pie-elements/compare/@pie-element/ebsr-configure@7.0.17...@pie-element/ebsr-configure@7.0.18) (2022-03-08)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @pie-element/ebsr-configure
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [7.0.17](https://github.com/pie-framework/pie-elements/compare/@pie-element/ebsr-configure@7.0.16...@pie-element/ebsr-configure@7.0.17) (2022-03-08)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @pie-element/ebsr-configure
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
6
30
|
## [7.0.16](https://github.com/pie-framework/pie-elements/compare/@pie-element/ebsr-configure@7.0.15...@pie-element/ebsr-configure@7.0.16) (2022-02-21)
|
|
7
31
|
|
|
8
32
|
**Note:** Version bump only for package @pie-element/ebsr-configure
|
|
@@ -61,6 +61,11 @@ var defaultConfig = {
|
|
|
61
61
|
},
|
|
62
62
|
gridColumns: {
|
|
63
63
|
label: 'Grid columns'
|
|
64
|
+
},
|
|
65
|
+
spellCheck: {
|
|
66
|
+
label: "Spellcheck",
|
|
67
|
+
settings: true,
|
|
68
|
+
enabled: true
|
|
64
69
|
}
|
|
65
70
|
};
|
|
66
71
|
|
|
@@ -77,6 +82,7 @@ var partModel = function partModel(base) {
|
|
|
77
82
|
rationale: '',
|
|
78
83
|
teacherInstructionsEnabled: true,
|
|
79
84
|
studentInstructionsEnabled: true,
|
|
85
|
+
spellCheckEnabled: false,
|
|
80
86
|
choicesLayout: 'vertical',
|
|
81
87
|
gridColumns: '2'
|
|
82
88
|
}, base);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/defaults.js"],"names":["defaultConfig","addChoiceButton","settings","label","choiceMode","choicePrefix","deleteChoice","feedback","lockChoiceOrder","prompt","rationale","studentInstructions","teacherInstructions","choicesLayout","gridColumns","partModel","base","choices","rationaleEnabled","feedbackEnabled","promptEnabled","teacherInstructionsEnabled","studentInstructionsEnabled","model","partLabels","partLabelType","partialScoring","partA","partB","configuration","scoringType","settingsPanelDisabled"],"mappings":";;;;;;;;;;;AAAA;;;;;;AAEA,IAAMA,aAAa,GAAG;AACpBC,EAAAA,eAAe,EAAE;AACfC,IAAAA,QAAQ,EAAE,IADK;AAEfC,IAAAA,KAAK,EAAE;AAFQ,GADG;AAKpBC,EAAAA,UAAU,EAAE;AACVF,IAAAA,QAAQ,EAAE,IADA;AAEVC,IAAAA,KAAK,EAAE;AAFG,GALQ;AASpBE,EAAAA,YAAY,EAAE;AACZH,IAAAA,QAAQ,EAAE,IADE;AAEZC,IAAAA,KAAK,EAAE;AAFK,GATM;AAapBG,EAAAA,YAAY,EAAE;AACZJ,IAAAA,QAAQ,EAAE;AADE,GAbM;AAgBpBK,EAAAA,QAAQ,EAAE;AACRL,IAAAA,QAAQ,EAAE,IADF;AAERC,IAAAA,KAAK,EAAE;AAFC,GAhBU;AAoBpBK,EAAAA,eAAe,EAAE;AACfN,IAAAA,QAAQ,EAAE,IADK;AAEfC,IAAAA,KAAK,EAAE;AAFQ,GApBG;AAwBpBM,EAAAA,MAAM,EAAE;AACNP,IAAAA,QAAQ,EAAE,IADJ;AAENC,IAAAA,KAAK,EAAE;AAFD,GAxBY;AA4BpBO,EAAAA,SAAS,EAAE;AACTR,IAAAA,QAAQ,EAAE,IADD;AAETC,IAAAA,KAAK,EAAE;AAFE,GA5BS;AAgCpBQ,EAAAA,mBAAmB,EAAE;AACnBT,IAAAA,QAAQ,EAAE,KADS;AAEnBC,IAAAA,KAAK,EAAE;AAFY,GAhCD;AAoCpBS,EAAAA,mBAAmB,EAAE;AACnBV,IAAAA,QAAQ,EAAE,IADS;AAEnBC,IAAAA,KAAK,EAAE;AAFY,GApCD;AAwCpBU,EAAAA,aAAa,EAAE;AACbX,IAAAA,QAAQ,EAAE,KADG;AAEbC,IAAAA,KAAK,EAAE;AAFM,GAxCK;AA4CpBW,EAAAA,WAAW,EAAE;AACXX,IAAAA,KAAK,EAAE;AADI;
|
|
1
|
+
{"version":3,"sources":["../src/defaults.js"],"names":["defaultConfig","addChoiceButton","settings","label","choiceMode","choicePrefix","deleteChoice","feedback","lockChoiceOrder","prompt","rationale","studentInstructions","teacherInstructions","choicesLayout","gridColumns","spellCheck","enabled","partModel","base","choices","rationaleEnabled","feedbackEnabled","promptEnabled","teacherInstructionsEnabled","studentInstructionsEnabled","spellCheckEnabled","model","partLabels","partLabelType","partialScoring","partA","partB","configuration","scoringType","settingsPanelDisabled"],"mappings":";;;;;;;;;;;AAAA;;;;;;AAEA,IAAMA,aAAa,GAAG;AACpBC,EAAAA,eAAe,EAAE;AACfC,IAAAA,QAAQ,E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,EAAE,IADA;AAEVC,MAAAA,KAAK,EAAE;AAFG,KAdC;AAkBb+B,IAAAA,qBAAqB,EAAE;AAlBV;AARF,C","sourcesContent":["import cloneDeep from 'lodash/cloneDeep';\n\nconst defaultConfig = {\n addChoiceButton: {\n settings: true,\n label: 'Add a Choice'\n },\n choiceMode: {\n settings: true,\n label: 'Response Type'\n },\n choicePrefix: {\n settings: true,\n label: 'Choice Labels'\n },\n deleteChoice: {\n settings: true\n },\n feedback: {\n settings: true,\n label: 'Feedback'\n },\n lockChoiceOrder: {\n settings: true,\n label: 'Lock Choice Order'\n },\n prompt: {\n settings: true,\n label: 'Prompt'\n },\n rationale: {\n settings: true,\n label: 'Rationale'\n },\n studentInstructions: {\n settings: false,\n label: 'Student Instructions'\n },\n teacherInstructions: {\n settings: true,\n label: 'Teacher Instructions'\n },\n choicesLayout: {\n settings: false,\n label: 'Choices Layout',\n },\n gridColumns: {\n label: 'Grid columns',\n },\n spellCheck: {\n label: \"Spellcheck\",\n settings:true,\n enabled:true\n },\n};\n\nconst partModel = base => ({\n choiceMode: 'radio',\n choices: [],\n choicePrefix: 'numbers',\n prompt: 'Prompt',\n rationaleEnabled: true,\n feedbackEnabled: true,\n promptEnabled: true,\n teacherInstructions: '',\n rationale: '',\n teacherInstructionsEnabled: true,\n studentInstructionsEnabled: true,\n spellCheckEnabled:false,\n choicesLayout: 'vertical',\n gridColumns: '2',\n ...base\n});\n\nexport default {\n model: {\n partLabels: true,\n partLabelType: 'Letters',\n partialScoring: false,\n partA: partModel({ prompt: 'Prompt A' }),\n partB: partModel({ prompt: 'Prompt B' })\n },\n configuration: {\n partialScoring: {\n label: 'Allow Partial Scoring',\n // this will turn off partial scoring toggle in the settings tab by default for the interaction\n // as we'd like partial scoring to be controlled from the environment entirely\n // if any other consumers would like to enable it for themselves, they can do so from their model directly.\n settings: false\n },\n scoringType: {\n settings: false,\n label: 'Scoring Type'\n },\n partA: cloneDeep(defaultConfig),\n partB: cloneDeep(defaultConfig),\n partLabels: {\n settings: true,\n label: 'Part Labels'\n },\n settingsPanelDisabled: true\n }\n};\n"],"file":"defaults.js"}
|
package/configure/lib/main.js
CHANGED
|
@@ -149,7 +149,9 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
149
149
|
_ref$gridColumns = _ref.gridColumns,
|
|
150
150
|
gridColumnsA = _ref$gridColumns === void 0 ? {} : _ref$gridColumns,
|
|
151
151
|
_ref$rationale = _ref.rationale,
|
|
152
|
-
rationaleA = _ref$rationale === void 0 ? {} : _ref$rationale
|
|
152
|
+
rationaleA = _ref$rationale === void 0 ? {} : _ref$rationale,
|
|
153
|
+
_ref$spellCheck = _ref.spellCheck,
|
|
154
|
+
spellCheckA = _ref$spellCheck === void 0 ? {} : _ref$spellCheck;
|
|
153
155
|
|
|
154
156
|
var _ref2 = partB || {},
|
|
155
157
|
_ref2$feedback = _ref2.feedback,
|
|
@@ -171,7 +173,9 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
171
173
|
_ref2$gridColumns = _ref2.gridColumns,
|
|
172
174
|
gridColumnsB = _ref2$gridColumns === void 0 ? {} : _ref2$gridColumns,
|
|
173
175
|
_ref2$rationale = _ref2.rationale,
|
|
174
|
-
rationaleB = _ref2$rationale === void 0 ? {} : _ref2$rationale
|
|
176
|
+
rationaleB = _ref2$rationale === void 0 ? {} : _ref2$rationale,
|
|
177
|
+
_ref2$spellCheck = _ref2.spellCheck,
|
|
178
|
+
spellCheckB = _ref2$spellCheck === void 0 ? {} : _ref2$spellCheck;
|
|
175
179
|
|
|
176
180
|
var type = partLabelType || 'Numbers';
|
|
177
181
|
var typeIsNumber = type === 'Numbers';
|
|
@@ -215,7 +219,8 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
215
219
|
'partA.promptEnabled': promptA.settings && toggle(promptA.label),
|
|
216
220
|
'partA.teacherInstructionsEnabled': teacherInstructionsA.settings && toggle(teacherInstructionsA.label),
|
|
217
221
|
'partA.studentInstructionsEnabled': studentInstructionsA.settings && toggle(studentInstructionsA.label),
|
|
218
|
-
'partA.rationaleEnabled': rationaleA.settings && toggle(rationaleA.label)
|
|
222
|
+
'partA.rationaleEnabled': rationaleA.settings && toggle(rationaleA.label),
|
|
223
|
+
'partA.spellCheckEnabled': spellCheckA.settings && toggle(spellCheckA.label)
|
|
219
224
|
}), (0, _defineProperty2["default"])(_ref3, "Settings ".concat(secondPart), {
|
|
220
225
|
'partB.choiceMode': choiceModeB.settings && radio(choiceModeB.label, ['checkbox', 'radio']),
|
|
221
226
|
'partB.choicePrefix': choicePrefixB.settings && radio(choicePrefixB.label, ['numbers', 'letters']),
|
|
@@ -227,7 +232,8 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
227
232
|
'partB.promptEnabled': promptB.settings && toggle(promptB.label),
|
|
228
233
|
'partB.teacherInstructionsEnabled': teacherInstructionsB.settings && toggle(teacherInstructionsB.label),
|
|
229
234
|
'partB.studentInstructionsEnabled': studentInstructionsB.settings && toggle(studentInstructionsB.label),
|
|
230
|
-
'partB.rationaleEnabled': rationaleB.settings && toggle(rationaleB.label)
|
|
235
|
+
'partB.rationaleEnabled': rationaleB.settings && toggle(rationaleB.label),
|
|
236
|
+
'partB.spellCheckEnabled': spellCheckB.settings && toggle(spellCheckB.label)
|
|
231
237
|
}), _ref3)
|
|
232
238
|
})
|
|
233
239
|
}, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/main.jsx"],"names":["Panel","settings","toggle","radio","dropdown","styles","theme","design","paddingTop","spacing","unit","part","display","flexDirection","padding","Main","choices","correctFound","map","choice","correct","model","key","onModelChanged","props","partA","choiceMode","removeExtraChoices","partB","classes","configuration","onConfigurationChanged","partLabelType","modelPartA","modelPartB","partialScoring","scoringType","generalConfiguration","feedback","feedbackA","choiceModeA","choicePrefix","choicePrefixA","lockChoiceOrder","lockChoiceOrderA","prompt","promptA","teacherInstructions","teacherInstructionsA","studentInstructions","studentInstructionsA","choicesLayout","choicesLayoutA","gridColumns","gridColumnsA","rationale","rationaleA","feedbackB","choiceModeB","choicePrefixB","lockChoiceOrderB","promptB","teacherInstructionsB","studentInstructionsB","choicesLayoutB","gridColumnsB","rationaleB","type","typeIsNumber","firstPart","secondPart","nrOfColumnsAvailable","length","Array","from","_","i","partLabels","label","ref","_model","React","Component","PropTypes","object","func","Styled"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;AAEA,IAAQA,KAAR,GAA2CC,kBAA3C,CAAQD,KAAR;AAAA,IAAeE,MAAf,GAA2CD,kBAA3C,CAAeC,MAAf;AAAA,IAAuBC,KAAvB,GAA2CF,kBAA3C,CAAuBE,KAAvB;AAAA,IAA8BC,QAA9B,GAA2CH,kBAA3C,CAA8BG,QAA9B;;AAEA,IAAMC,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;AAAA,SAAK;AACvBC,IAAAA,MAAM,EAAE;AACNC,MAAAA,UAAU,EAAEF,KAAK,CAACG,OAAN,CAAcC,IAAd,GAAqB;AAD3B,KADe;AAIvBC,IAAAA,IAAI,EAAE;AACJC,MAAAA,OAAO,EAAE,MADL;AAEJC,MAAAA,aAAa,EAAE,QAFX;AAGJC,MAAAA,OAAO,EAAE;AAHL;AAJiB,GAAL;AAAA,CAApB;;IAWaC,I;;;;;;;;;;;;;;;2GASU,UAACC,OAAD,EAAa;AAChC,UAAIC,YAAY,GAAG,KAAnB;AAEC,aAAO,CAACD,OAAO,IAAI,EAAZ,EAAgBE,GAAhB,CAAoB,UAAAC,MAAM,EAAI;AACpC,YAAIF,YAAJ,EAAkB;AAChBE,UAAAA,MAAM,CAACC,OAAP,GAAiB,KAAjB;AACA,iBAAOD,MAAP;AACD;;AAED,YAAIA,MAAM,CAACC,OAAX,EAAoB;AAClBH,UAAAA,YAAY,GAAG,IAAf;AACD;;AAED,eAAOE,MAAP;AACD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KADL,GAEKS,oBAFL;AAID;AACF;AAbH,QAFF,CApBF,CArFF,CADF,CADF;AAiID;;;EAzNuB4C,kBAAMC,S;;;iCAAnBnE,I,eACQ;AACjBc,EAAAA,OAAO,EAAEsD,sBAAUC,MADF;AAEjBtD,EAAAA,aAAa,EAAEqD,sBAAUC,MAFR;AAGjB/D,EAAAA,KAAK,EAAE8D,sBAAUC,MAHA;AAIjB7D,EAAAA,cAAc,EAAE4D,sBAAUE,IAJT;AAKjBtD,EAAAA,sBAAsB,EAAEoD,sBAAUE;AALjB,C;AA2NrB,IAAMC,MAAM,GAAG,wBAAWjF,MAAX,EAAmBU,IAAnB,CAAf;eAEeuE,M","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { settings, layout } from '@pie-lib/config-ui';\nimport { withStyles } from '@material-ui/core/styles';\nimport cloneDeep from 'lodash/cloneDeep';\n\nconst { Panel, toggle, radio, dropdown } = settings;\n\nconst styles = theme => ({\n design: {\n paddingTop: theme.spacing.unit * 3\n },\n part: {\n display: 'flex',\n flexDirection: 'column',\n padding: '16px 0 32px'\n }\n});\n\nexport class Main extends React.Component {\n static propTypes = {\n classes: PropTypes.object,\n configuration: PropTypes.object,\n model: PropTypes.object,\n onModelChanged: PropTypes.func,\n onConfigurationChanged: PropTypes.func\n };\n\n removeExtraChoices = (choices) => {\n let correctFound = false;\n\n return (choices || []).map(choice => {\n if (correctFound) {\n choice.correct = false;\n return choice;\n }\n\n if (choice.correct) {\n correctFound = true;\n }\n\n return choice;\n });\n }\n\n onModelChanged = (model, key) => {\n const { onModelChanged } = this.props;\n\n if (key === 'partA.choiceMode' && model.partA.choiceMode === 'radio') {\n model.partA.choices = this.removeExtraChoices(model.partA.choices);\n\n return onModelChanged(model, true);\n }\n\n if (key === 'partB.choiceMode' && model.partB.choiceMode === 'radio') {\n model.partB.choices = this.removeExtraChoices(model.partB.choices);\n\n return onModelChanged(model, true);\n }\n\n return onModelChanged(model);\n }\n\n render() {\n const {\n classes,\n model,\n configuration,\n onConfigurationChanged\n } = this.props;\n const { partLabelType, partA: modelPartA, partB: modelPartB } = model;\n const { partA, partB, partialScoring, scoringType, ...generalConfiguration } = configuration;\n const {\n feedback: feedbackA = {},\n choiceMode: choiceModeA = {},\n choicePrefix: choicePrefixA = {},\n lockChoiceOrder: lockChoiceOrderA = {},\n prompt: promptA = {},\n teacherInstructions: teacherInstructionsA = {},\n studentInstructions: studentInstructionsA = {},\n choicesLayout: choicesLayoutA = {},\n gridColumns: gridColumnsA = {},\n rationale: rationaleA = {}\n } = partA || {};\n const {\n feedback: feedbackB = {},\n choiceMode: choiceModeB = {},\n choicePrefix: choicePrefixB = {},\n lockChoiceOrder: lockChoiceOrderB = {},\n prompt: promptB = {},\n teacherInstructions: teacherInstructionsB = {},\n studentInstructions: studentInstructionsB = {},\n choicesLayout: choicesLayoutB = {},\n gridColumns: gridColumnsB = {},\n rationale: rationaleB = {}\n } = partB || {};\n const type = partLabelType || 'Numbers';\n const typeIsNumber = type === 'Numbers';\n const firstPart = `Part ${typeIsNumber ? '1' : 'A'}`;\n const secondPart = `Part ${typeIsNumber ? '2' : 'B'}`;\n const nrOfColumnsAvailable = {\n partA: modelPartA.choices && modelPartA.choices.length ?\n Array.from({length: modelPartA.choices.length}, (_, i) => (`${i + 1}`)) : [],\n partB: modelPartB.choices && modelPartB.choices.length ?\n Array.from({length: modelPartB.choices.length}, (_, i) => (`${i + 1}`)) : [],\n };\n\n return (\n <div className={classes.design}>\n <layout.ConfigLayout\n settings={\n <Panel\n model={model}\n onChangeModel={this.onModelChanged}\n configuration={configuration}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n 'Settings for both': {\n partLabels:\n generalConfiguration.partLabels.settings &&\n toggle(generalConfiguration.partLabels.label),\n partLabelType:\n model.partLabels && dropdown('', ['Numbers', 'Letters']),\n partialScoring:\n partialScoring.settings && toggle(partialScoring.label),\n scoringType:\n scoringType.settings && radio(scoringType.label, ['auto', 'rubric'])\n },\n [`Settings ${firstPart}`]: {\n 'partA.choiceMode':\n choiceModeA.settings &&\n radio(choiceModeA.label, ['checkbox', 'radio']),\n 'partA.choicePrefix':\n choicePrefixA.settings &&\n radio(choicePrefixA.label, ['numbers', 'letters']),\n 'partA.lockChoiceOrder':\n lockChoiceOrderA.settings && toggle(lockChoiceOrderA.label),\n 'partA.choicesLayout':\n choicesLayoutA.settings &&\n dropdown(choicesLayoutA.label, ['vertical', 'grid', 'horizontal']),\n 'partA.gridColumns':\n choicesLayoutA.settings && modelPartA.choicesLayout === 'grid' &&\n nrOfColumnsAvailable.partA.length > 0 &&\n dropdown(gridColumnsA.label, nrOfColumnsAvailable.partA)\n },\n [`Properties ${firstPart}`]: {\n 'partA.feedbackEnabled': feedbackA.settings &&\n toggle(feedbackA.label),\n 'partA.promptEnabled':\n promptA.settings && toggle(promptA.label),\n 'partA.teacherInstructionsEnabled':\n teacherInstructionsA.settings &&\n toggle(teacherInstructionsA.label),\n 'partA.studentInstructionsEnabled':\n studentInstructionsA.settings &&\n toggle(studentInstructionsA.label),\n 'partA.rationaleEnabled':\n rationaleA.settings && toggle(rationaleA.label)\n },\n [`Settings ${secondPart}`]: {\n 'partB.choiceMode':\n choiceModeB.settings &&\n radio(choiceModeB.label, ['checkbox', 'radio']),\n 'partB.choicePrefix':\n choicePrefixB.settings &&\n radio(choicePrefixB.label, ['numbers', 'letters']),\n 'partB.lockChoiceOrder':\n lockChoiceOrderB.settings && toggle(lockChoiceOrderB.label),\n 'partB.choicesLayout':\n choicesLayoutB.settings &&\n dropdown(choicesLayoutB.label, ['vertical', 'grid', 'horizontal']),\n 'partB.gridColumns':\n choicesLayoutB.settings && modelPartB.choicesLayout === 'grid' &&\n nrOfColumnsAvailable.partB.length > 0 &&\n dropdown(gridColumnsB.label, nrOfColumnsAvailable.partB)\n },\n [`Properties ${secondPart}`]: {\n 'partB.feedbackEnabled':\n feedbackB.settings && toggle(feedbackB.label),\n 'partB.promptEnabled':\n promptB.settings && toggle(promptB.label),\n 'partB.teacherInstructionsEnabled':\n teacherInstructionsB.settings &&\n toggle(teacherInstructionsB.label),\n 'partB.studentInstructionsEnabled':\n studentInstructionsB.settings &&\n toggle(studentInstructionsB.label),\n 'partB.rationaleEnabled':\n rationaleB.settings && toggle(rationaleB.label)\n }\n }}\n />\n }\n >\n <div>\n <div className={classes.part}>\n {model.partLabels && <p>{firstPart}</p>}\n <ebsr-multiple-choice-configure\n id=\"A\"\n key=\"partA\"\n ref={ref => {\n if (ref) {\n // do not use destructuring to get model from props\n this.partA = ref;\n this.partA._model = cloneDeep(this.props.model.partA);\n this.partA.configuration = {\n ...partA,\n ...generalConfiguration\n };\n }\n }}\n />\n </div>\n\n <div className={classes.part}>\n {model.partLabels && <p>{secondPart}</p>}\n <ebsr-multiple-choice-configure\n id=\"B\"\n key=\"partB\"\n ref={ref => {\n if (ref) {\n // do not use destructuring to get model from props\n this.partB = ref;\n this.partB._model = cloneDeep(this.props.model.partB);\n this.partB.configuration = {\n ...partB,\n ...generalConfiguration\n };\n }\n }}\n />\n </div>\n </div>\n </layout.ConfigLayout>\n </div>\n );\n }\n}\n\nconst Styled = withStyles(styles)(Main);\n\nexport default Styled;\n"],"file":"main.js"}
|
|
1
|
+
{"version":3,"sources":["../src/main.jsx"],"names":["Panel","settings","toggle","radio","dropdown","styles","theme","design","paddingTop","spacing","unit","part","display","flexDirection","padding","Main","choices","correctFound","map","choice","correct","model","key","onModelChanged","props","partA","choiceMode","removeExtraChoices","partB","classes","configuration","onConfigurationChanged","partLabelType","modelPartA","modelPartB","partialScoring","scoringType","generalConfiguration","feedback","feedbackA","choiceModeA","choicePrefix","choicePrefixA","lockChoiceOrder","lockChoiceOrderA","prompt","promptA","teacherInstructions","teacherInstructionsA","studentInstructions","studentInstructionsA","choicesLayout","choicesLayoutA","gridColumns","gridColumnsA","rationale","rationaleA","spellCheck","spellCheckA","feedbackB","choiceModeB","choicePrefixB","lockChoiceOrderB","promptB","teacherInstructionsB","studentInstructionsB","choicesLayoutB","gridColumnsB","rationaleB","spellCheckB","type","typeIsNumber","firstPart","secondPart","nrOfColumnsAvailable","length","Array","from","_","i","partLabels","label","ref","_model","React","Component","PropTypes","object","func","Styled"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;AAEA,IAAQA,KAAR,GAA2CC,kBAA3C,CAAQD,KAAR;AAAA,IAAeE,MAAf,GAA2CD,kBAA3C,CAAeC,MAAf;AAAA,IAAuBC,KAAvB,GAA2CF,kBAA3C,CAAuBE,KAAvB;AAAA,IAA8BC,QAA9B,GAA2CH,kBAA3C,CAA8BG,QAA9B;;AAEA,IAAMC,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;AAAA,SAAK;AACvBC,IAAAA,MAAM,EAAE;AACNC,MAAAA,UAAU,EAAEF,KAAK,CAACG,OAAN,CAAcC,IAAd,GAAqB;AAD3B,KADe;AAIvBC,IAAAA,IAAI,EAAE;AACJC,MAAAA,OAAO,EAAE,MADL;AAEJC,MAAAA,aAAa,EAAE,QAFX;AAGJC,MAAAA,OAAO,EAAE;AAHL;AAJiB,GAAL;AAAA,CAApB;;IAWaC,I;;;;;;;;;;;;;;;2GASU,UAACC,OAAD,EAAa;AAChC,UAAIC,YAAY,GAAG,KAAnB;AAEC,aAAO,CAACD,OAAO,IAAI,EAAZ,EAAgBE,GAAhB,CAAoB,UAAAC,MAAM,EAAI;AACpC,YAAIF,YAAJ,EAAkB;AAChBE,UAAAA,MAAM,CAACC,OAAP,GAAiB,KAAjB;AACA,iBAAOD,MAAP;AACD;;AAED,YAAIA,MAAM,CAACC,OAAX,EAAoB;AAClBH,UAAAA,YAAY,GAAG,IAAf;AACD;;AAED,eAAOE,MAAP;AACD,OAXO,CAAP;AAYF,K;uGAEgB,UAACE,KAAD,EAAQC,GAAR,EAAgB;AAC/B,UAAQC,cAAR,GAA2B,MAAKC,KAAhC,CAAQD,cAAR;;AAEA,UAAID,GAAG,KAAK,kBAAR,IAA8BD,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,MAAX,GAAoB,2BAAU,MAAI,CAAC3D,KAAL,CAAWH,KAAX,CAAiBO,KAA3B,CAApB;AACA,YAAA,MAAI,CAACA,KAAL,CAAWE,aAAX,mCACKF,KADL,GAEKS,oBAFL;AAID;AACF;AAbH,QAFF,CApBF,CAzFF,CADF,CADF;AAqID;;;EA/NuB+C,kBAAMC,S;;;iCAAnBtE,I,eACQ;AACjBc,EAAAA,OAAO,EAAEyD,sBAAUC,MADF;AAEjBzD,EAAAA,aAAa,EAAEwD,sBAAUC,MAFR;AAGjBlE,EAAAA,KAAK,EAAEiE,sBAAUC,MAHA;AAIjBhE,EAAAA,cAAc,EAAE+D,sBAAUE,IAJT;AAKjBzD,EAAAA,sBAAsB,EAAEuD,sBAAUE;AALjB,C;AAiOrB,IAAMC,MAAM,GAAG,wBAAWpF,MAAX,EAAmBU,IAAnB,CAAf;eAEe0E,M","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { settings, layout } from '@pie-lib/config-ui';\nimport { withStyles } from '@material-ui/core/styles';\nimport cloneDeep from 'lodash/cloneDeep';\n\nconst { Panel, toggle, radio, dropdown } = settings;\n\nconst styles = theme => ({\n design: {\n paddingTop: theme.spacing.unit * 3\n },\n part: {\n display: 'flex',\n flexDirection: 'column',\n padding: '16px 0 32px'\n }\n});\n\nexport class Main extends React.Component {\n static propTypes = {\n classes: PropTypes.object,\n configuration: PropTypes.object,\n model: PropTypes.object,\n onModelChanged: PropTypes.func,\n onConfigurationChanged: PropTypes.func\n };\n\n removeExtraChoices = (choices) => {\n let correctFound = false;\n\n return (choices || []).map(choice => {\n if (correctFound) {\n choice.correct = false;\n return choice;\n }\n\n if (choice.correct) {\n correctFound = true;\n }\n\n return choice;\n });\n }\n\n onModelChanged = (model, key) => {\n const { onModelChanged } = this.props;\n\n if (key === 'partA.choiceMode' && model.partA.choiceMode === 'radio') {\n model.partA.choices = this.removeExtraChoices(model.partA.choices);\n\n return onModelChanged(model, true);\n }\n\n if (key === 'partB.choiceMode' && model.partB.choiceMode === 'radio') {\n model.partB.choices = this.removeExtraChoices(model.partB.choices);\n\n return onModelChanged(model, true);\n }\n\n return onModelChanged(model);\n }\n\n render() {\n const {\n classes,\n model,\n configuration,\n onConfigurationChanged\n } = this.props;\n const { partLabelType, partA: modelPartA, partB: modelPartB } = model;\n const { partA, partB, partialScoring, scoringType, ...generalConfiguration } = configuration;\n const {\n feedback: feedbackA = {},\n choiceMode: choiceModeA = {},\n choicePrefix: choicePrefixA = {},\n lockChoiceOrder: lockChoiceOrderA = {},\n prompt: promptA = {},\n teacherInstructions: teacherInstructionsA = {},\n studentInstructions: studentInstructionsA = {},\n choicesLayout: choicesLayoutA = {},\n gridColumns: gridColumnsA = {},\n rationale: rationaleA = {},\n spellCheck: spellCheckA = {}\n } = partA || {};\n const {\n feedback: feedbackB = {},\n choiceMode: choiceModeB = {},\n choicePrefix: choicePrefixB = {},\n lockChoiceOrder: lockChoiceOrderB = {},\n prompt: promptB = {},\n teacherInstructions: teacherInstructionsB = {},\n studentInstructions: studentInstructionsB = {},\n choicesLayout: choicesLayoutB = {},\n gridColumns: gridColumnsB = {},\n rationale: rationaleB = {},\n spellCheck: spellCheckB = {}\n } = partB || {};\n const type = partLabelType || 'Numbers';\n const typeIsNumber = type === 'Numbers';\n const firstPart = `Part ${typeIsNumber ? '1' : 'A'}`;\n const secondPart = `Part ${typeIsNumber ? '2' : 'B'}`;\n const nrOfColumnsAvailable = {\n partA: modelPartA.choices && modelPartA.choices.length ?\n Array.from({length: modelPartA.choices.length}, (_, i) => (`${i + 1}`)) : [],\n partB: modelPartB.choices && modelPartB.choices.length ?\n Array.from({length: modelPartB.choices.length}, (_, i) => (`${i + 1}`)) : [],\n };\n\n return (\n <div className={classes.design}>\n <layout.ConfigLayout\n settings={\n <Panel\n model={model}\n onChangeModel={this.onModelChanged}\n configuration={configuration}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n 'Settings for both': {\n partLabels:\n generalConfiguration.partLabels.settings &&\n toggle(generalConfiguration.partLabels.label),\n partLabelType:\n model.partLabels && dropdown('', ['Numbers', 'Letters']),\n partialScoring:\n partialScoring.settings && toggle(partialScoring.label),\n scoringType:\n scoringType.settings && radio(scoringType.label, ['auto', 'rubric'])\n },\n [`Settings ${firstPart}`]: {\n 'partA.choiceMode':\n choiceModeA.settings &&\n radio(choiceModeA.label, ['checkbox', 'radio']),\n 'partA.choicePrefix':\n choicePrefixA.settings &&\n radio(choicePrefixA.label, ['numbers', 'letters']),\n 'partA.lockChoiceOrder':\n lockChoiceOrderA.settings && toggle(lockChoiceOrderA.label),\n 'partA.choicesLayout':\n choicesLayoutA.settings &&\n dropdown(choicesLayoutA.label, ['vertical', 'grid', 'horizontal']),\n 'partA.gridColumns':\n choicesLayoutA.settings && modelPartA.choicesLayout === 'grid' &&\n nrOfColumnsAvailable.partA.length > 0 &&\n dropdown(gridColumnsA.label, nrOfColumnsAvailable.partA)\n },\n [`Properties ${firstPart}`]: {\n 'partA.feedbackEnabled': feedbackA.settings &&\n toggle(feedbackA.label),\n 'partA.promptEnabled':\n promptA.settings && toggle(promptA.label),\n 'partA.teacherInstructionsEnabled':\n teacherInstructionsA.settings &&\n toggle(teacherInstructionsA.label),\n 'partA.studentInstructionsEnabled':\n studentInstructionsA.settings &&\n toggle(studentInstructionsA.label),\n 'partA.rationaleEnabled':\n rationaleA.settings && toggle(rationaleA.label),\n 'partA.spellCheckEnabled':\n spellCheckA.settings && toggle(spellCheckA.label),\n },\n [`Settings ${secondPart}`]: {\n 'partB.choiceMode':\n choiceModeB.settings &&\n radio(choiceModeB.label, ['checkbox', 'radio']),\n 'partB.choicePrefix':\n choicePrefixB.settings &&\n radio(choicePrefixB.label, ['numbers', 'letters']),\n 'partB.lockChoiceOrder':\n lockChoiceOrderB.settings && toggle(lockChoiceOrderB.label),\n 'partB.choicesLayout':\n choicesLayoutB.settings &&\n dropdown(choicesLayoutB.label, ['vertical', 'grid', 'horizontal']),\n 'partB.gridColumns':\n choicesLayoutB.settings && modelPartB.choicesLayout === 'grid' &&\n nrOfColumnsAvailable.partB.length > 0 &&\n dropdown(gridColumnsB.label, nrOfColumnsAvailable.partB)\n },\n [`Properties ${secondPart}`]: {\n 'partB.feedbackEnabled':\n feedbackB.settings && toggle(feedbackB.label),\n 'partB.promptEnabled':\n promptB.settings && toggle(promptB.label),\n 'partB.teacherInstructionsEnabled':\n teacherInstructionsB.settings &&\n toggle(teacherInstructionsB.label),\n 'partB.studentInstructionsEnabled':\n studentInstructionsB.settings &&\n toggle(studentInstructionsB.label),\n 'partB.rationaleEnabled':\n rationaleB.settings && toggle(rationaleB.label),\n 'partB.spellCheckEnabled':\n spellCheckB.settings && toggle(spellCheckB.label),\n }\n }}\n />\n }\n >\n <div>\n <div className={classes.part}>\n {model.partLabels && <p>{firstPart}</p>}\n <ebsr-multiple-choice-configure\n id=\"A\"\n key=\"partA\"\n ref={ref => {\n if (ref) {\n // do not use destructuring to get model from props\n this.partA = ref;\n this.partA._model = cloneDeep(this.props.model.partA);\n this.partA.configuration = {\n ...partA,\n ...generalConfiguration\n };\n }\n }}\n />\n </div>\n\n <div className={classes.part}>\n {model.partLabels && <p>{secondPart}</p>}\n <ebsr-multiple-choice-configure\n id=\"B\"\n key=\"partB\"\n ref={ref => {\n if (ref) {\n // do not use destructuring to get model from props\n this.partB = ref;\n this.partB._model = cloneDeep(this.props.model.partB);\n this.partB.configuration = {\n ...partB,\n ...generalConfiguration\n };\n }\n }}\n />\n </div>\n </div>\n </layout.ConfigLayout>\n </div>\n );\n }\n}\n\nconst Styled = withStyles(styles)(Main);\n\nexport default Styled;\n"],"file":"main.js"}
|
package/configure/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/ebsr-configure",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "7.0.
|
|
4
|
+
"version": "7.0.19",
|
|
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-element/multiple-choice": "^6.2.
|
|
11
|
+
"@pie-element/multiple-choice": "^6.2.5",
|
|
12
12
|
"@pie-framework/pie-configure-events": "^1.2.0",
|
|
13
|
-
"@pie-lib/config-ui": "^10.10.
|
|
13
|
+
"@pie-lib/config-ui": "^10.10.24",
|
|
14
14
|
"lodash": "^4.17.15",
|
|
15
15
|
"prop-types": "^15.6.2",
|
|
16
16
|
"react": "^16.8.1",
|
|
@@ -13,6 +13,7 @@ Object {
|
|
|
13
13
|
"promptEnabled": true,
|
|
14
14
|
"rationale": "",
|
|
15
15
|
"rationaleEnabled": true,
|
|
16
|
+
"spellCheckEnabled": false,
|
|
16
17
|
"studentInstructionsEnabled": true,
|
|
17
18
|
"teacherInstructions": "",
|
|
18
19
|
"teacherInstructionsEnabled": true,
|
|
@@ -28,6 +29,7 @@ Object {
|
|
|
28
29
|
"promptEnabled": true,
|
|
29
30
|
"rationale": "",
|
|
30
31
|
"rationaleEnabled": true,
|
|
32
|
+
"spellCheckEnabled": false,
|
|
31
33
|
"studentInstructionsEnabled": true,
|
|
32
34
|
"teacherInstructions": "",
|
|
33
35
|
"teacherInstructionsEnabled": true,
|
|
@@ -51,6 +53,7 @@ Object {
|
|
|
51
53
|
"promptEnabled": true,
|
|
52
54
|
"rationale": "foo",
|
|
53
55
|
"rationaleEnabled": true,
|
|
56
|
+
"spellCheckEnabled": false,
|
|
54
57
|
"studentInstructionsEnabled": true,
|
|
55
58
|
"teacherInstructions": "ti",
|
|
56
59
|
"teacherInstructionsEnabled": true,
|
|
@@ -66,6 +69,7 @@ Object {
|
|
|
66
69
|
"promptEnabled": true,
|
|
67
70
|
"rationale": "",
|
|
68
71
|
"rationaleEnabled": true,
|
|
72
|
+
"spellCheckEnabled": false,
|
|
69
73
|
"studentInstructionsEnabled": true,
|
|
70
74
|
"teacherInstructions": "",
|
|
71
75
|
"teacherInstructionsEnabled": true,
|
|
@@ -47,6 +47,11 @@ const defaultConfig = {
|
|
|
47
47
|
gridColumns: {
|
|
48
48
|
label: 'Grid columns',
|
|
49
49
|
},
|
|
50
|
+
spellCheck: {
|
|
51
|
+
label: "Spellcheck",
|
|
52
|
+
settings:true,
|
|
53
|
+
enabled:true
|
|
54
|
+
},
|
|
50
55
|
};
|
|
51
56
|
|
|
52
57
|
const partModel = base => ({
|
|
@@ -61,6 +66,7 @@ const partModel = base => ({
|
|
|
61
66
|
rationale: '',
|
|
62
67
|
teacherInstructionsEnabled: true,
|
|
63
68
|
studentInstructionsEnabled: true,
|
|
69
|
+
spellCheckEnabled:false,
|
|
64
70
|
choicesLayout: 'vertical',
|
|
65
71
|
gridColumns: '2',
|
|
66
72
|
...base
|
package/configure/src/main.jsx
CHANGED
|
@@ -80,7 +80,8 @@ export class Main extends React.Component {
|
|
|
80
80
|
studentInstructions: studentInstructionsA = {},
|
|
81
81
|
choicesLayout: choicesLayoutA = {},
|
|
82
82
|
gridColumns: gridColumnsA = {},
|
|
83
|
-
rationale: rationaleA = {}
|
|
83
|
+
rationale: rationaleA = {},
|
|
84
|
+
spellCheck: spellCheckA = {}
|
|
84
85
|
} = partA || {};
|
|
85
86
|
const {
|
|
86
87
|
feedback: feedbackB = {},
|
|
@@ -92,7 +93,8 @@ export class Main extends React.Component {
|
|
|
92
93
|
studentInstructions: studentInstructionsB = {},
|
|
93
94
|
choicesLayout: choicesLayoutB = {},
|
|
94
95
|
gridColumns: gridColumnsB = {},
|
|
95
|
-
rationale: rationaleB = {}
|
|
96
|
+
rationale: rationaleB = {},
|
|
97
|
+
spellCheck: spellCheckB = {}
|
|
96
98
|
} = partB || {};
|
|
97
99
|
const type = partLabelType || 'Numbers';
|
|
98
100
|
const typeIsNumber = type === 'Numbers';
|
|
@@ -155,7 +157,9 @@ export class Main extends React.Component {
|
|
|
155
157
|
studentInstructionsA.settings &&
|
|
156
158
|
toggle(studentInstructionsA.label),
|
|
157
159
|
'partA.rationaleEnabled':
|
|
158
|
-
rationaleA.settings && toggle(rationaleA.label)
|
|
160
|
+
rationaleA.settings && toggle(rationaleA.label),
|
|
161
|
+
'partA.spellCheckEnabled':
|
|
162
|
+
spellCheckA.settings && toggle(spellCheckA.label),
|
|
159
163
|
},
|
|
160
164
|
[`Settings ${secondPart}`]: {
|
|
161
165
|
'partB.choiceMode':
|
|
@@ -186,7 +190,9 @@ export class Main extends React.Component {
|
|
|
186
190
|
studentInstructionsB.settings &&
|
|
187
191
|
toggle(studentInstructionsB.label),
|
|
188
192
|
'partB.rationaleEnabled':
|
|
189
|
-
rationaleB.settings && toggle(rationaleB.label)
|
|
193
|
+
rationaleB.settings && toggle(rationaleB.label),
|
|
194
|
+
'partB.spellCheckEnabled':
|
|
195
|
+
spellCheckB.settings && toggle(spellCheckB.label),
|
|
190
196
|
}
|
|
191
197
|
}}
|
|
192
198
|
/>
|
package/docs/config-schema.json
CHANGED
|
@@ -119,6 +119,22 @@
|
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
},
|
|
122
|
+
"spellCheck": {
|
|
123
|
+
"title": "ConfigureProp",
|
|
124
|
+
"type": "object",
|
|
125
|
+
"properties": {
|
|
126
|
+
"settings": {
|
|
127
|
+
"description": "Indicates if the item has to be displayed in the Settings Panel",
|
|
128
|
+
"type": "boolean",
|
|
129
|
+
"title": "settings"
|
|
130
|
+
},
|
|
131
|
+
"label": {
|
|
132
|
+
"description": "Indicates the label for the item that has to be displayed in the Settings Panel",
|
|
133
|
+
"type": "string",
|
|
134
|
+
"title": "label"
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
},
|
|
122
138
|
"rationale": {
|
|
123
139
|
"title": "ConfigureProp",
|
|
124
140
|
"type": "object",
|
|
@@ -317,6 +333,22 @@
|
|
|
317
333
|
}
|
|
318
334
|
}
|
|
319
335
|
},
|
|
336
|
+
"spellCheck": {
|
|
337
|
+
"title": "ConfigureProp",
|
|
338
|
+
"type": "object",
|
|
339
|
+
"properties": {
|
|
340
|
+
"settings": {
|
|
341
|
+
"description": "Indicates if the item has to be displayed in the Settings Panel",
|
|
342
|
+
"type": "boolean",
|
|
343
|
+
"title": "settings"
|
|
344
|
+
},
|
|
345
|
+
"label": {
|
|
346
|
+
"description": "Indicates the label for the item that has to be displayed in the Settings Panel",
|
|
347
|
+
"type": "string",
|
|
348
|
+
"title": "label"
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
},
|
|
320
352
|
"rationale": {
|
|
321
353
|
"title": "ConfigureProp",
|
|
322
354
|
"type": "object",
|
|
@@ -581,6 +613,22 @@
|
|
|
581
613
|
}
|
|
582
614
|
}
|
|
583
615
|
},
|
|
616
|
+
"spellCheck": {
|
|
617
|
+
"title": "ConfigureProp",
|
|
618
|
+
"type": "object",
|
|
619
|
+
"properties": {
|
|
620
|
+
"settings": {
|
|
621
|
+
"description": "Indicates if the item has to be displayed in the Settings Panel",
|
|
622
|
+
"type": "boolean",
|
|
623
|
+
"title": "settings"
|
|
624
|
+
},
|
|
625
|
+
"label": {
|
|
626
|
+
"description": "Indicates the label for the item that has to be displayed in the Settings Panel",
|
|
627
|
+
"type": "string",
|
|
628
|
+
"title": "label"
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
},
|
|
584
632
|
"rationale": {
|
|
585
633
|
"title": "ConfigureProp",
|
|
586
634
|
"type": "object",
|
|
@@ -90,6 +90,18 @@ Indicates if the item has to be displayed in the Settings Panel
|
|
|
90
90
|
|
|
91
91
|
Indicates the label for the item that has to be displayed in the Settings Panel
|
|
92
92
|
|
|
93
|
+
## `spellCheck` (object)
|
|
94
|
+
|
|
95
|
+
Properties of the `spellCheck` object:
|
|
96
|
+
|
|
97
|
+
### `settings` (boolean)
|
|
98
|
+
|
|
99
|
+
Indicates if the item has to be displayed in the Settings Panel
|
|
100
|
+
|
|
101
|
+
### `label` (string)
|
|
102
|
+
|
|
103
|
+
Indicates the label for the item that has to be displayed in the Settings Panel
|
|
104
|
+
|
|
93
105
|
## `rationale` (object)
|
|
94
106
|
|
|
95
107
|
Properties of the `rationale` object:
|
|
@@ -238,6 +250,18 @@ Indicates if the item has to be displayed in the Settings Panel
|
|
|
238
250
|
|
|
239
251
|
Indicates the label for the item that has to be displayed in the Settings Panel
|
|
240
252
|
|
|
253
|
+
## `spellCheck` (object)
|
|
254
|
+
|
|
255
|
+
Properties of the `spellCheck` object:
|
|
256
|
+
|
|
257
|
+
### `settings` (boolean)
|
|
258
|
+
|
|
259
|
+
Indicates if the item has to be displayed in the Settings Panel
|
|
260
|
+
|
|
261
|
+
### `label` (string)
|
|
262
|
+
|
|
263
|
+
Indicates the label for the item that has to be displayed in the Settings Panel
|
|
264
|
+
|
|
241
265
|
## `rationale` (object)
|
|
242
266
|
|
|
243
267
|
Properties of the `rationale` object:
|
|
@@ -440,6 +464,18 @@ Indicates if the item has to be displayed in the Settings Panel
|
|
|
440
464
|
|
|
441
465
|
Indicates the label for the item that has to be displayed in the Settings Panel
|
|
442
466
|
|
|
467
|
+
### `spellCheck` (object)
|
|
468
|
+
|
|
469
|
+
Properties of the `spellCheck` object:
|
|
470
|
+
|
|
471
|
+
#### `settings` (boolean)
|
|
472
|
+
|
|
473
|
+
Indicates if the item has to be displayed in the Settings Panel
|
|
474
|
+
|
|
475
|
+
#### `label` (string)
|
|
476
|
+
|
|
477
|
+
Indicates the label for the item that has to be displayed in the Settings Panel
|
|
478
|
+
|
|
443
479
|
### `rationale` (object)
|
|
444
480
|
|
|
445
481
|
Properties of the `rationale` object:
|
package/docs/pie-schema.json
CHANGED
|
@@ -85,6 +85,11 @@
|
|
|
85
85
|
"type": "boolean",
|
|
86
86
|
"title": "rationaleEnabled"
|
|
87
87
|
},
|
|
88
|
+
"spellCheckEnabled": {
|
|
89
|
+
"description": "Indicates if spellcheck is enabled",
|
|
90
|
+
"type": "boolean",
|
|
91
|
+
"title": "spellCheckEnabled"
|
|
92
|
+
},
|
|
88
93
|
"studentInstructionsEnabled": {
|
|
89
94
|
"description": "Indicates if Student Instructions are enabled",
|
|
90
95
|
"type": "boolean",
|
|
@@ -109,6 +114,7 @@
|
|
|
109
114
|
"feedbackEnabled",
|
|
110
115
|
"prompt",
|
|
111
116
|
"rationaleEnabled",
|
|
117
|
+
"spellCheckEnabled",
|
|
112
118
|
"studentInstructionsEnabled",
|
|
113
119
|
"teacherInstructionsEnabled"
|
|
114
120
|
]
|
|
@@ -195,6 +201,11 @@
|
|
|
195
201
|
"type": "boolean",
|
|
196
202
|
"title": "rationaleEnabled"
|
|
197
203
|
},
|
|
204
|
+
"spellCheckEnabled": {
|
|
205
|
+
"description": "Indicates if spellcheck is enabled",
|
|
206
|
+
"type": "boolean",
|
|
207
|
+
"title": "spellCheckEnabled"
|
|
208
|
+
},
|
|
198
209
|
"studentInstructionsEnabled": {
|
|
199
210
|
"description": "Indicates if Student Instructions are enabled",
|
|
200
211
|
"type": "boolean",
|
|
@@ -219,6 +230,7 @@
|
|
|
219
230
|
"feedbackEnabled",
|
|
220
231
|
"prompt",
|
|
221
232
|
"rationaleEnabled",
|
|
233
|
+
"spellCheckEnabled",
|
|
222
234
|
"studentInstructionsEnabled",
|
|
223
235
|
"teacherInstructionsEnabled"
|
|
224
236
|
]
|
|
@@ -387,6 +399,22 @@
|
|
|
387
399
|
}
|
|
388
400
|
}
|
|
389
401
|
},
|
|
402
|
+
"spellCheck": {
|
|
403
|
+
"title": "ConfigureProp",
|
|
404
|
+
"type": "object",
|
|
405
|
+
"properties": {
|
|
406
|
+
"settings": {
|
|
407
|
+
"description": "Indicates if the item has to be displayed in the Settings Panel",
|
|
408
|
+
"type": "boolean",
|
|
409
|
+
"title": "settings"
|
|
410
|
+
},
|
|
411
|
+
"label": {
|
|
412
|
+
"description": "Indicates the label for the item that has to be displayed in the Settings Panel",
|
|
413
|
+
"type": "string",
|
|
414
|
+
"title": "label"
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
},
|
|
390
418
|
"rationale": {
|
|
391
419
|
"title": "ConfigureProp",
|
|
392
420
|
"type": "object",
|
|
@@ -567,6 +595,11 @@
|
|
|
567
595
|
"type": "boolean",
|
|
568
596
|
"title": "rationaleEnabled"
|
|
569
597
|
},
|
|
598
|
+
"spellCheckEnabled": {
|
|
599
|
+
"description": "Indicates if spellcheck is enabled",
|
|
600
|
+
"type": "boolean",
|
|
601
|
+
"title": "spellCheckEnabled"
|
|
602
|
+
},
|
|
570
603
|
"studentInstructionsEnabled": {
|
|
571
604
|
"description": "Indicates if Student Instructions are enabled",
|
|
572
605
|
"type": "boolean",
|
|
@@ -591,6 +624,7 @@
|
|
|
591
624
|
"feedbackEnabled",
|
|
592
625
|
"prompt",
|
|
593
626
|
"rationaleEnabled",
|
|
627
|
+
"spellCheckEnabled",
|
|
594
628
|
"studentInstructionsEnabled",
|
|
595
629
|
"teacherInstructionsEnabled"
|
|
596
630
|
]
|
package/docs/pie-schema.json.md
CHANGED
|
@@ -68,6 +68,10 @@ Indicates if Feedback is enabled
|
|
|
68
68
|
|
|
69
69
|
Indicates if Rationale are enabled
|
|
70
70
|
|
|
71
|
+
## `spellCheckEnabled` (boolean, required)
|
|
72
|
+
|
|
73
|
+
Indicates if spellcheck is enabled
|
|
74
|
+
|
|
71
75
|
## `studentInstructionsEnabled` (boolean, required)
|
|
72
76
|
|
|
73
77
|
Indicates if Student Instructions are enabled
|
|
@@ -148,6 +152,10 @@ Indicates if Feedback is enabled
|
|
|
148
152
|
|
|
149
153
|
Indicates if Rationale are enabled
|
|
150
154
|
|
|
155
|
+
## `spellCheckEnabled` (boolean, required)
|
|
156
|
+
|
|
157
|
+
Indicates if spellcheck is enabled
|
|
158
|
+
|
|
151
159
|
## `studentInstructionsEnabled` (boolean, required)
|
|
152
160
|
|
|
153
161
|
Indicates if Student Instructions are enabled
|
|
@@ -290,6 +298,18 @@ Indicates if the item has to be displayed in the Settings Panel
|
|
|
290
298
|
|
|
291
299
|
Indicates the label for the item that has to be displayed in the Settings Panel
|
|
292
300
|
|
|
301
|
+
### `spellCheck` (object)
|
|
302
|
+
|
|
303
|
+
Properties of the `spellCheck` object:
|
|
304
|
+
|
|
305
|
+
#### `settings` (boolean)
|
|
306
|
+
|
|
307
|
+
Indicates if the item has to be displayed in the Settings Panel
|
|
308
|
+
|
|
309
|
+
#### `label` (string)
|
|
310
|
+
|
|
311
|
+
Indicates the label for the item that has to be displayed in the Settings Panel
|
|
312
|
+
|
|
293
313
|
### `rationale` (object)
|
|
294
314
|
|
|
295
315
|
Properties of the `rationale` object:
|
|
@@ -428,6 +448,10 @@ Indicates if Feedback is enabled
|
|
|
428
448
|
|
|
429
449
|
Indicates if Rationale are enabled
|
|
430
450
|
|
|
451
|
+
### `spellCheckEnabled` (boolean, required)
|
|
452
|
+
|
|
453
|
+
Indicates if spellcheck is enabled
|
|
454
|
+
|
|
431
455
|
### `studentInstructionsEnabled` (boolean, required)
|
|
432
456
|
|
|
433
457
|
Indicates if Student Instructions are enabled
|