@pie-element/drawing-response 8.1.3-next.3 → 8.1.3
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 +11 -0
- package/configure/CHANGELOG.md +11 -0
- package/configure/lib/defaults.js +6 -5
- package/configure/lib/defaults.js.map +1 -1
- package/configure/package.json +2 -2
- package/configure/src/defaults.js +6 -8
- package/controller/CHANGELOG.md +8 -0
- package/controller/lib/defaults.js +10 -3
- package/controller/lib/defaults.js.map +1 -1
- package/controller/lib/index.js +1 -6
- package/controller/lib/index.js.map +1 -1
- package/controller/package.json +1 -1
- package/controller/src/defaults.js +9 -5
- package/controller/src/index.js +1 -7
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -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
|
+
## [8.1.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response@8.1.2...@pie-element/drawing-response@8.1.3) (2024-10-22)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* update pie-toolbox PD-4220, PD-4194, PD-4201, PD-4189, PD-4193, PD-4018, PD-4187 ([47b14fb](https://github.com/pie-framework/pie-elements/commit/47b14fbd80a04494511bc0ae44196b4e0175f0bb))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [8.1.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response@8.1.1...@pie-element/drawing-response@8.1.2) (2024-10-15)
|
|
7
18
|
|
|
8
19
|
|
package/configure/CHANGELOG.md
CHANGED
|
@@ -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
|
+
## [8.0.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@8.0.4...@pie-element/drawing-response-configure@8.0.5) (2024-10-22)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* update pie-toolbox PD-4220, PD-4194, PD-4201, PD-4189, PD-4193, PD-4018, PD-4187 ([47b14fb](https://github.com/pie-framework/pie-elements/commit/47b14fbd80a04494511bc0ae44196b4e0175f0bb))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [8.0.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@8.0.3...@pie-element/drawing-response-configure@8.0.4) (2024-10-15)
|
|
7
18
|
|
|
8
19
|
|
|
@@ -6,17 +6,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _default = {
|
|
8
8
|
model: {
|
|
9
|
-
|
|
10
|
-
imageUrl: '',
|
|
9
|
+
backgroundImageEnabled: true,
|
|
11
10
|
imageDimensions: {
|
|
12
11
|
height: 0,
|
|
13
12
|
width: 0
|
|
14
13
|
},
|
|
14
|
+
imageUrl: '',
|
|
15
|
+
prompt: '',
|
|
15
16
|
promptEnabled: true,
|
|
16
|
-
teacherInstructionsEnabled: true,
|
|
17
|
-
studentInstructionsEnabled: true,
|
|
18
|
-
backgroundImageEnabled: true,
|
|
19
17
|
spellCheckEnabled: true,
|
|
18
|
+
studentInstructionsEnabled: true,
|
|
19
|
+
teacherInstructions: '',
|
|
20
|
+
teacherInstructionsEnabled: true,
|
|
20
21
|
toolbarEditorPosition: 'bottom'
|
|
21
22
|
},
|
|
22
23
|
configuration: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/defaults.js"],"names":["model","
|
|
1
|
+
{"version":3,"sources":["../src/defaults.js"],"names":["model","backgroundImageEnabled","imageDimensions","height","width","imageUrl","prompt","promptEnabled","spellCheckEnabled","studentInstructionsEnabled","teacherInstructions","teacherInstructionsEnabled","toolbarEditorPosition","configuration","baseInputConfiguration","audio","disabled","video","image","spellCheck","label","settings","enabled","backgroundImage","inputConfiguration","required","settingsPanelDisabled","maxImageWidth","maxImageHeight","withRubric","mathMlOptions","mmlOutput","mmlEditing","language","languageChoices","options"],"mappings":";;;;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,sBAAsB,EAAE,IADnB;AAELC,IAAAA,eAAe,EAAE;AAAEC,MAAAA,MAAM,EAAE,CAAV;AAAaC,MAAAA,KAAK,EAAE;AAApB,KAFZ;AAGLC,IAAAA,QAAQ,EAAE,EAHL;AAILC,IAAAA,MAAM,EAAE,EAJH;AAKLC,IAAAA,aAAa,EAAE,IALV;AAMLC,IAAAA,iBAAiB,EAAE,IANd;AAOLC,IAAAA,0BAA0B,EAAE,IAPvB;AAQLC,IAAAA,mBAAmB,EAAE,EARhB;AASLC,IAAAA,0BAA0B,EAAE,IATvB;AAULC,IAAAA,qBAAqB,EAAE;AAVlB,GADM;AAabC,EAAAA,aAAa,EAAE;AACbC,IAAAA,sBAAsB,EAAE;AACtBC,MAAAA,KAAK,EAAE;AAAEC,QAAAA,QAAQ,EAAE;AAAZ,OADe;AAEtBC,MAAAA,KAAK,EAAE;AAAED,QAAAA,QAAQ,EAAE;AAAZ,OAFe;AAGtBE,MAAAA,KAAK,EAAE;AAAEF,QAAAA,QAAQ,EAAE;AAAZ;AAHe,KADX;AAMbG,IAAAA,UAAU,EAAE;AACVC,MAAAA,KAAK,EAAE,YADG;AAEVC,MAAAA,QAAQ,EAAE,KAFA;AAGVC,MAAAA,OAAO,EAAE;AAHC,KANC;AAWbC,IAAAA,eAAe,EAAE;AACfF,MAAAA,QAAQ,EAAE,IADK;AAEfD,MAAAA,KAAK,EAAE;AAFQ,KAXJ;AAebd,IAAAA,MAAM,EAAE;AACNe,MAAAA,QAAQ,EAAE,IADJ;AAEND,MAA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;AAHD,KApDG;AAyDbY,IAAAA,eAAe,EAAE;AACfd,MAAAA,KAAK,EAAE,kBADQ;AAEfe,MAAAA,OAAO,EAAE;AAFM;AAzDJ;AAbF,C","sourcesContent":["export default {\n model: {\n backgroundImageEnabled: true,\n imageDimensions: { height: 0, width: 0 },\n imageUrl: '',\n prompt: '',\n promptEnabled: true,\n spellCheckEnabled: true,\n studentInstructionsEnabled: true,\n teacherInstructions: '',\n teacherInstructionsEnabled: true,\n toolbarEditorPosition: 'bottom',\n },\n configuration: {\n baseInputConfiguration: {\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n },\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 inputConfiguration: {\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n },\n required: false,\n },\n settingsPanelDisabled: false,\n teacherInstructions: {\n settings: true,\n label: 'Teacher Instructions',\n inputConfiguration: {\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n },\n required: false,\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"}
|
package/configure/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/drawing-response-configure",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "8.0.
|
|
4
|
+
"version": "8.0.5",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "src/index.js",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@material-ui/core": "^3.9.2",
|
|
11
11
|
"@pie-framework/pie-configure-events": "^1.3.0",
|
|
12
|
-
"@pie-lib/pie-toolbox": "2.0.
|
|
12
|
+
"@pie-lib/pie-toolbox": "2.0.14",
|
|
13
13
|
"classnames": "^2.2.6",
|
|
14
14
|
"debug": "^3.1.0",
|
|
15
15
|
"lodash": "^4.17.15",
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
model: {
|
|
3
|
-
|
|
3
|
+
backgroundImageEnabled: true,
|
|
4
|
+
imageDimensions: { height: 0, width: 0 },
|
|
4
5
|
imageUrl: '',
|
|
5
|
-
|
|
6
|
-
height: 0,
|
|
7
|
-
width: 0,
|
|
8
|
-
},
|
|
6
|
+
prompt: '',
|
|
9
7
|
promptEnabled: true,
|
|
10
|
-
teacherInstructionsEnabled: true,
|
|
11
|
-
studentInstructionsEnabled: true,
|
|
12
|
-
backgroundImageEnabled: true,
|
|
13
8
|
spellCheckEnabled: true,
|
|
9
|
+
studentInstructionsEnabled: true,
|
|
10
|
+
teacherInstructions: '',
|
|
11
|
+
teacherInstructionsEnabled: true,
|
|
14
12
|
toolbarEditorPosition: 'bottom',
|
|
15
13
|
},
|
|
16
14
|
configuration: {
|
package/controller/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
|
+
## [3.4.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-controller@3.4.0...@pie-element/drawing-response-controller@3.4.1) (2024-10-22)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @pie-element/drawing-response-controller
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [3.4.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-controller@3.3.0...@pie-element/drawing-response-controller@3.4.0) (2024-03-28)
|
|
7
15
|
|
|
8
16
|
|
|
@@ -5,12 +5,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _default = {
|
|
8
|
-
|
|
9
|
-
imageUrl: '',
|
|
8
|
+
backgroundImageEnabled: true,
|
|
10
9
|
imageDimensions: {
|
|
11
10
|
height: 0,
|
|
12
11
|
width: 0
|
|
13
|
-
}
|
|
12
|
+
},
|
|
13
|
+
imageUrl: '',
|
|
14
|
+
prompt: '',
|
|
15
|
+
promptEnabled: true,
|
|
16
|
+
spellCheckEnabled: true,
|
|
17
|
+
studentInstructionsEnabled: true,
|
|
18
|
+
teacherInstructions: '',
|
|
19
|
+
teacherInstructionsEnabled: true,
|
|
20
|
+
toolbarEditorPosition: 'bottom'
|
|
14
21
|
};
|
|
15
22
|
exports["default"] = _default;
|
|
16
23
|
//# sourceMappingURL=defaults.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/defaults.js"],"names":["
|
|
1
|
+
{"version":3,"sources":["../src/defaults.js"],"names":["backgroundImageEnabled","imageDimensions","height","width","imageUrl","prompt","promptEnabled","spellCheckEnabled","studentInstructionsEnabled","teacherInstructions","teacherInstructionsEnabled","toolbarEditorPosition"],"mappings":";;;;;;eAAe;AACbA,EAAAA,sBAAsB,EAAE,IADX;AAEbC,EAAAA,eAAe,EAAE;AAAEC,IAAAA,MAAM,EAAE,CAAV;AAAaC,IAAAA,KAAK,EAAE;AAApB,GAFJ;AAGbC,EAAAA,QAAQ,EAAE,EAHG;AAIbC,EAAAA,MAAM,EAAE,EAJK;AAKbC,EAAAA,aAAa,EAAE,IALF;AAMbC,EAAAA,iBAAiB,EAAE,IANN;AAObC,EAAAA,0BAA0B,EAAE,IAPf;AAQbC,EAAAA,mBAAmB,EAAE,EARR;AASbC,EAAAA,0BAA0B,EAAE,IATf;AAUbC,EAAAA,qBAAqB,EAAE;AAVV,C","sourcesContent":["export default {\n backgroundImageEnabled: true,\n imageDimensions: { height: 0, width: 0 },\n imageUrl: '',\n prompt: '',\n promptEnabled: true,\n spellCheckEnabled: true,\n studentInstructionsEnabled: true,\n teacherInstructions: '',\n teacherInstructionsEnabled: true,\n toolbarEditorPosition: 'bottom',\n};\n"],"file":"defaults.js"}
|
package/controller/lib/index.js
CHANGED
|
@@ -24,12 +24,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
24
24
|
var log = (0, _debug["default"])('pie-elements:drawing-response:controller');
|
|
25
25
|
|
|
26
26
|
var normalize = function normalize(question) {
|
|
27
|
-
return _objectSpread({
|
|
28
|
-
promptEnabled: true,
|
|
29
|
-
teacherInstructionsEnabled: true,
|
|
30
|
-
studentInstructionsEnabled: true,
|
|
31
|
-
backgroundImageEnabled: true
|
|
32
|
-
}, question);
|
|
27
|
+
return _objectSpread(_objectSpread({}, _defaults["default"]), question);
|
|
33
28
|
};
|
|
34
29
|
|
|
35
30
|
exports.normalize = normalize;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.js"],"names":["log","normalize","question","
|
|
1
|
+
{"version":3,"sources":["../src/index.js"],"names":["log","normalize","question","defaults","model","session","env","normalizedQuestion","imageUrl","imageDimensions","prompt","promptEnabled","backgroundImageEnabled","language","Promise","resolve","out","disabled","mode","role","teacherInstructions","teacherInstructionsEnabled","createDefaultModel","outcome","score","completed","note","getInnerText","html","replaceAll","getContent","replace","validate","config","errors","forEach","field","required"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;;;;;AAEA,IAAMA,GAAG,GAAG,uBAAM,0CAAN,CAAZ;;AAEO,IAAMC,SAAS,GAAG,SAAZA,SAAY,CAACC,QAAD;AAAA,yCAAoBC,oBAApB,GAAiCD,QAAjC;AAAA,CAAlB;;;;AAEA,SAASE,KAAT,CAAeF,QAAf,EAAyBG,OAAzB,EAAkCC,GAAl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\n\nconst log = debug('pie-elements:drawing-response:controller');\n\nexport const normalize = (question) => ({ ...defaults, ...question });\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\n// remove all html tags\nconst getInnerText = (html) => (html || '').replaceAll(/<[^>]*>/g, '');\n\n// remove all html tags except img and iframe\nconst getContent = (html) => (html || '').replace(/(<(?!img|iframe)([^>]+)>)/gi, '');\n\nexport const validate = (model = {}, config = {}) => {\n const errors = {};\n\n ['teacherInstructions', 'prompt'].forEach((field) => {\n if (config[field]?.required && !getContent(model[field])) {\n errors[field] = 'This field is required.';\n }\n });\n\n return errors;\n};\n"],"file":"index.js"}
|
package/controller/package.json
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
|
|
2
|
+
backgroundImageEnabled: true,
|
|
3
|
+
imageDimensions: { height: 0, width: 0 },
|
|
3
4
|
imageUrl: '',
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
prompt: '',
|
|
6
|
+
promptEnabled: true,
|
|
7
|
+
spellCheckEnabled: true,
|
|
8
|
+
studentInstructionsEnabled: true,
|
|
9
|
+
teacherInstructions: '',
|
|
10
|
+
teacherInstructionsEnabled: true,
|
|
11
|
+
toolbarEditorPosition: 'bottom',
|
|
8
12
|
};
|
package/controller/src/index.js
CHANGED
|
@@ -3,13 +3,7 @@ import defaults from './defaults';
|
|
|
3
3
|
|
|
4
4
|
const log = debug('pie-elements:drawing-response:controller');
|
|
5
5
|
|
|
6
|
-
export const normalize = (question) => ({
|
|
7
|
-
promptEnabled: true,
|
|
8
|
-
teacherInstructionsEnabled: true,
|
|
9
|
-
studentInstructionsEnabled: true,
|
|
10
|
-
backgroundImageEnabled: true,
|
|
11
|
-
...question,
|
|
12
|
-
});
|
|
6
|
+
export const normalize = (question) => ({ ...defaults, ...question });
|
|
13
7
|
|
|
14
8
|
export function model(question, session, env) {
|
|
15
9
|
const normalizedQuestion = normalize(question);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/drawing-response",
|
|
3
|
-
"version": "8.1.3
|
|
3
|
+
"version": "8.1.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": "pie-framework/pie-elements",
|
|
6
6
|
"publishConfig": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"@mdi/js": "^3.6.95",
|
|
12
12
|
"@mdi/react": "^1.1.1",
|
|
13
13
|
"@pie-framework/pie-player-events": "^0.1.0",
|
|
14
|
-
"@pie-lib/pie-toolbox": "2.0.
|
|
14
|
+
"@pie-lib/pie-toolbox": "2.0.14",
|
|
15
15
|
"classnames": "^2.2.6",
|
|
16
16
|
"enzyme-to-json": "^3.3.5",
|
|
17
17
|
"konva": "^3.4.1",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"author": "pie framework developers",
|
|
25
25
|
"license": "ISC",
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "e017f0f51cfcabb6300719a2fa2309277404ce01",
|
|
27
27
|
"scripts": {
|
|
28
28
|
"postpublish": "../../scripts/postpublish"
|
|
29
29
|
},
|