@pie-element/explicit-constructed-response 3.11.7 → 3.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,55 @@
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.12.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response@3.12.0...@pie-element/explicit-constructed-response@3.12.1) (2022-02-04)
7
+
8
+ **Note:** Version bump only for package @pie-element/explicit-constructed-response
9
+
10
+
11
+
12
+
13
+
14
+ # [3.12.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response@3.11.9...@pie-element/explicit-constructed-response@3.12.0) (2022-01-24)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **explicit-constructed-response:** Displayed delta, theta, times and tan symbols correctly PD-1507 ([29d97ec](https://github.com/pie-framework/pie-elements/commit/29d97ec68c6b66056595eb9444b9984aeb04472e))
20
+ * **multiple-choice, explicit-constructed-response, extended-text-entry:** print do not show teacher instructions, rationale or prompt if they are diabled DNA-13089 ([06b9555](https://github.com/pie-framework/pie-elements/commit/06b9555b25e094e0b2bce0e6a852a206c6d2c17d))
21
+ * use preview prompt for prompt, rationale and teacher instructions to fix table rendering PD-1456 ([f330601](https://github.com/pie-framework/pie-elements/commit/f3306019a2d1c8ce3e2783823dfe9ef0a0394e4f))
22
+ * **explicit-constructed-response:** call session change depending on input max length PD-1353 ([2664a10](https://github.com/pie-framework/pie-elements/commit/2664a108cce80a9e3a9d34141613836cf057e25e))
23
+ * **explicit-constructed-response:** fix authoring bug when changing markup PD-1413. Show all choices and change title when maxLengthPerChoice is enabled PD-1396 ([b7944f4](https://github.com/pie-framework/pie-elements/commit/b7944f4ee7ae82eb7d40b7ec13dd1c5214157690))
24
+ * **explicit-constructed-response:** Fixed characters limit PD-1396 PD-1395 ([fcbf149](https://github.com/pie-framework/pie-elements/commit/fcbf149e49b5ead36585935e0b5616a970d0a81e))
25
+ * **multiple-choice-print, ecr-print:** fix toggle issue, change options.mode to options.role ([0b3f534](https://github.com/pie-framework/pie-elements/commit/0b3f534bb4d2f969e21528e74516345e84f18d72))
26
+
27
+
28
+ ### Features
29
+
30
+ * **explicit-constructed-response:** Added a max limit of characters and adjusted the width PD-794 ([135f176](https://github.com/pie-framework/pie-elements/commit/135f176402187e9a6120b88768ae7fb0152ac418))
31
+ * **explicit-constructed-response:** added the ability to choose the display property of the element [PD-1418] ([ac3ad81](https://github.com/pie-framework/pie-elements/commit/ac3ad8182911077b0eb3096944304c935bdf5e9a))
32
+ * **explicit-constructed-response:** Calculate maxChoicesLength if it's undefined. Fixed delete response area and choices bug. BREAKING CHANGE: add maxChoicesLength prop ([97431b9](https://github.com/pie-framework/pie-elements/commit/97431b9c3fbdafd84e040653c54d5f04bae16a1d))
33
+ * **explicit-constructed-response:** implement print PD-1284 ([3a387ba](https://github.com/pie-framework/pie-elements/commit/3a387ba5e9aff0e94cbb6465550bd07185ba7eff))
34
+
35
+
36
+
37
+
38
+
39
+ ## [3.11.9](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response@3.11.8...@pie-element/explicit-constructed-response@3.11.9) (2022-01-10)
40
+
41
+ **Note:** Version bump only for package @pie-element/explicit-constructed-response
42
+
43
+
44
+
45
+
46
+
47
+ ## [3.11.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response@3.11.7...@pie-element/explicit-constructed-response@3.11.8) (2021-12-23)
48
+
49
+ **Note:** Version bump only for package @pie-element/explicit-constructed-response
50
+
51
+
52
+
53
+
54
+
6
55
  ## [3.11.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response@3.11.5...@pie-element/explicit-constructed-response@3.11.6) (2021-12-13)
7
56
 
8
57
  **Note:** Version bump only for package @pie-element/explicit-constructed-response
@@ -3,6 +3,50 @@
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.7.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-configure@3.7.0...@pie-element/explicit-constructed-response-configure@3.7.1) (2022-02-04)
7
+
8
+ **Note:** Version bump only for package @pie-element/explicit-constructed-response-configure
9
+
10
+
11
+
12
+
13
+
14
+ # [3.7.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-configure@3.6.9...@pie-element/explicit-constructed-response-configure@3.7.0) (2022-01-24)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **explicit-constructed-response:** Displayed delta, theta, times and tan symbols correctly PD-1507 ([29d97ec](https://github.com/pie-framework/pie-elements/commit/29d97ec68c6b66056595eb9444b9984aeb04472e))
20
+ * **explicit-constructed-response:** fix authoring bug when changing markup PD-1413. Show all choices and change title when maxLengthPerChoice is enabled PD-1396 ([b7944f4](https://github.com/pie-framework/pie-elements/commit/b7944f4ee7ae82eb7d40b7ec13dd1c5214157690))
21
+ * **explicit-constructed-response:** Fixed characters limit PD-1396 PD-1395 ([fcbf149](https://github.com/pie-framework/pie-elements/commit/fcbf149e49b5ead36585935e0b5616a970d0a81e))
22
+
23
+
24
+ ### Features
25
+
26
+ * **explicit-constructed-response:** Added a max limit of characters and adjusted the width PD-794 ([135f176](https://github.com/pie-framework/pie-elements/commit/135f176402187e9a6120b88768ae7fb0152ac418))
27
+ * **explicit-constructed-response:** added the ability to choose the display property of the element [PD-1418] ([ac3ad81](https://github.com/pie-framework/pie-elements/commit/ac3ad8182911077b0eb3096944304c935bdf5e9a))
28
+ * **explicit-constructed-response:** Calculate maxChoicesLength if it's undefined. Fixed delete response area and choices bug. BREAKING CHANGE: add maxChoicesLength prop ([97431b9](https://github.com/pie-framework/pie-elements/commit/97431b9c3fbdafd84e040653c54d5f04bae16a1d))
29
+
30
+
31
+
32
+
33
+
34
+ ## [3.6.9](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-configure@3.6.8...@pie-element/explicit-constructed-response-configure@3.6.9) (2022-01-10)
35
+
36
+ **Note:** Version bump only for package @pie-element/explicit-constructed-response-configure
37
+
38
+
39
+
40
+
41
+
42
+ ## [3.6.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-configure@3.6.7...@pie-element/explicit-constructed-response-configure@3.6.8) (2021-12-23)
43
+
44
+ **Note:** Version bump only for package @pie-element/explicit-constructed-response-configure
45
+
46
+
47
+
48
+
49
+
6
50
  ## [3.6.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-configure@3.6.5...@pie-element/explicit-constructed-response-configure@3.6.6) (2021-12-13)
7
51
 
8
52
  **Note:** Version bump only for package @pie-element/explicit-constructed-response-configure
@@ -9,8 +9,15 @@ exports.getAdjustedLength = exports.createSlateMarkup = exports.processMarkup =
9
9
 
10
10
  var _escape = _interopRequireDefault(require("lodash/escape"));
11
11
 
12
+ // do not remove \t from \times, \triangle, \tan, \theta or \therefore
13
+ var tSymbols = 'imes|riangle|an|heta|herefore'; // do not remove \n from \nthroot, \nparallel, \ncong, \napprox, \neq, \ne or \nsim
14
+
15
+ var nSymbols = 'throot|parallel|cong|approx|eq|e|sim'; // match all \t and \n that are not part of math symbols that starts with \t or \n
16
+
17
+ var matchTabAndNewLine = new RegExp("(\\t(?!".concat(tSymbols, "))|(\\n(?!").concat(nSymbols, "))|(\\\\t(?!").concat(tSymbols, "))|(\\\\n(?!").concat(nSymbols, "))"), 'g');
18
+
12
19
  var removeUnwantedCharacters = function removeUnwantedCharacters(markup) {
13
- return markup.replace(/(\t+(?!imes))|(\n)|(\\t+(?!imes))|(\\n)/g, '').replace(/\\"/g, '"').replace(/\\\//g, '/');
20
+ return markup.replace(matchTabAndNewLine, '').replace(/\\"/g, '"').replace(/\\\//g, '/');
14
21
  };
15
22
 
16
23
  exports.removeUnwantedCharacters = removeUnwantedCharacters;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/markupUtils.js"],"names":["removeUnwantedCharacters","markup","replace","createElementFromHTML","htmlString","div","document","createElement","innerHTML","trim","processMarkup","newMarkup","slateMarkup","index","querySelectorAll","forEach","s","replaceWith","REGEX","createSlateMarkup","choices","match","g","label","getAdjustedLength","length"],"mappings":";;;;;;;;;AAAA;;AAEO,IAAMA,wBAAwB,GAAG,SAA3BA,wBAA2B,CAAAC,MAAM;AAAA,SAC5CA,MAAM,CACHC,OADH,CACW,0CADX,EACuD,EADvD,EAEGA,OAFH,CAEW,MAFX,EAEmB,GAFnB,EAEwBA,OAFxB,CAEgC,OAFhC,EAEyC,GAFzC,CAD4C;AAAA,CAAvC;;;;AAKP,IAAMC,qBAAqB,GAAG,SAAxBA,qBAAwB,GAAqB;AAAA,MAApBC,UAAoB,uEAAP,EAAO;AACjD,MAAMC,GAAG,GAAGC,QAAQ,CAACC,aAAT,CAAuB,KAAvB,CAAZ;AAEAF,EAAAA,GAAG,CAACG,SAAJ,GAAgBJ,UAAU,CAACK,IAAX,EAAhB;AAEA,SAAOJ,GAAP;AACD,CAND;;AAQO,IAAMK,aAAa,GAAG,SAAhBA,aAAgB,CAAAT,MAAM,EAAI;AACrC,MAAMU,SAAS,GAAGX,wBAAwB,CAACC,MAAM,IAAI,EAAX,CAA1C;AACA,MAAMW,WAAW,GAAGT,qBAAqB,CAACQ,SAAS,IAAI,EAAd,CAAzC;AACA,MAAIE,KAAK,GAAG,CAAZ;AAEAD,EAAAA,WAAW,CAACE,gBAAZ,CAA6B,6CAA7B,EAA4EC,OAA5E,CAAoF,UAAAC,CAAC,EAAI;AACvFA,IAAAA,CAAC,CAACC,WAAF,aAAmBJ,KAAK,EAAxB;AACD,GAFD;AAIA,SAAOD,WAAW,CAACJ,SAAnB;AACD,CAVM;;;AAYP,IAAMU,KAAK,GAAG,gBAAd;;AAEO,IAAMC,iBAAiB,GAAG,SAApBA,iBAAoB,CAAClB,MAAD,EAASmB,OAAT,EAAqB;AACpD,MAAI,CAACnB,MAAL,EAAa;AACX,WAAO,EAAP;AACD;;AAED,MAAMU,SAAS,GAAGX,wBAAwB,CAACC,MAAD,CAA1C;AAEA,SAAOU,SAAS,CAACT,OAAV,CAAkBgB,KAAlB,EAAyB,UAACG,KAAD,EAAQC,CAAR,EAAc;AAC5C,QAAMC,KAAK,GAAGH,OAAO,CAACE,CAAD,CAAP,CAAW,CAAX,EAAcC,KAAd,IAAuB,EAArC;AAEA,oFAAsED,CAAtE,6BAAwF,wBAAOC,KAAP,CAAxF;AACD,GAJM,CAAP;AAKD,CAZM,C,CAcP;;;;;AACO,IAAMC,iBAAiB,GAAG,SAApBA,iBAAoB,CAAAC,MAAM,EAAI;AACzC,MAAIA,MAAM,IAAI,CAAd,EAAiB;AACf,WAAOA,MAAM,GAAG,CAAhB;AACD;;AAED,MAAIA,MAAM,IAAI,CAAd,EAAiB;AACf,WAAOA,MAAM,GAAG,CAAhB;AACD;;AAED,MAAIA,MAAM,IAAI,CAAd,EAAiB;AACf,WAAOA,MAAM,GAAG,CAAhB;AACD;;AAED,SAAOA,MAAM,GAAG,CAAhB;AACD,CAdM","sourcesContent":["import escape from 'lodash/escape';\n\nexport const removeUnwantedCharacters = markup =>\n markup\n .replace(/(\\t+(?!imes))|(\\n)|(\\\\t+(?!imes))|(\\\\n)/g, '')\n .replace(/\\\\\"/g, '\"').replace(/\\\\\\//g, '/');\n\nconst createElementFromHTML = (htmlString = '') => {\n const div = document.createElement('div');\n\n div.innerHTML = htmlString.trim();\n\n return div;\n};\n\nexport const processMarkup = markup => {\n const newMarkup = removeUnwantedCharacters(markup || '');\n const slateMarkup = createElementFromHTML(newMarkup || '');\n let index = 0;\n\n slateMarkup.querySelectorAll('[data-type=\"explicit_constructed_response\"]').forEach(s => {\n s.replaceWith(`{{${index++}}}`);\n });\n\n return slateMarkup.innerHTML;\n};\n\nconst REGEX = /\\{\\{(\\d+)\\}\\}/g;\n\nexport const createSlateMarkup = (markup, choices) => {\n if (!markup) {\n return '';\n }\n\n const newMarkup = removeUnwantedCharacters(markup);\n\n return newMarkup.replace(REGEX, (match, g) => {\n const label = choices[g][0].label || '';\n\n return `<span data-type=\"explicit_constructed_response\" data-index=\"${g}\" data-value=\"${escape(label)}\"></span>`;\n });\n};\n\n// also used in controller/src/index.js\nexport const getAdjustedLength = length => {\n if (length <= 2) {\n return length + 2;\n }\n\n if (length <= 4) {\n return length + 3;\n }\n\n if (length <= 6) {\n return length + 4;\n }\n\n return length + 5;\n};\n"],"file":"markupUtils.js"}
1
+ {"version":3,"sources":["../src/markupUtils.js"],"names":["tSymbols","nSymbols","matchTabAndNewLine","RegExp","removeUnwantedCharacters","markup","replace","createElementFromHTML","htmlString","div","document","createElement","innerHTML","trim","processMarkup","newMarkup","slateMarkup","index","querySelectorAll","forEach","s","replaceWith","REGEX","createSlateMarkup","choices","match","g","label","getAdjustedLength","length"],"mappings":";;;;;;;;;AAAA;;AAEA;AACA,IAAMA,QAAQ,GAAG,+BAAjB,C,CACA;;AACA,IAAMC,QAAQ,GAAG,sCAAjB,C,CACA;;AACA,IAAMC,kBAAkB,GAAG,IAAIC,MAAJ,kBAAqBH,QAArB,uBAA0CC,QAA1C,yBAAiED,QAAjE,yBAAwFC,QAAxF,SAAsG,GAAtG,CAA3B;;AAEO,IAAMG,wBAAwB,GAAG,SAA3BA,wBAA2B,CAAAC,MAAM;AAAA,SAC5CA,MAAM,CAACC,OAAP,CAAeJ,kBAAf,EAAmC,EAAnC,EAAuCI,OAAvC,CAA+C,MAA/C,EAAuD,GAAvD,EAA4DA,OAA5D,CAAoE,OAApE,EAA6E,GAA7E,CAD4C;AAAA,CAAvC;;;;AAGP,IAAMC,qBAAqB,GAAG,SAAxBA,qBAAwB,GAAqB;AAAA,MAApBC,UAAoB,uEAAP,EAAO;AACjD,MAAMC,GAAG,GAAGC,QAAQ,CAACC,aAAT,CAAuB,KAAvB,CAAZ;AAEAF,EAAAA,GAAG,CAACG,SAAJ,GAAgBJ,UAAU,CAACK,IAAX,EAAhB;A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;;AAED,SAAOA,MAAM,GAAG,CAAhB;AACD,CAdM","sourcesContent":["import escape from 'lodash/escape';\n\n// do not remove \\t from \\times, \\triangle, \\tan, \\theta or \\therefore\nconst tSymbols = 'imes|riangle|an|heta|herefore';\n// do not remove \\n from \\nthroot, \\nparallel, \\ncong, \\napprox, \\neq, \\ne or \\nsim\nconst nSymbols = 'throot|parallel|cong|approx|eq|e|sim';\n// match all \\t and \\n that are not part of math symbols that starts with \\t or \\n\nconst matchTabAndNewLine = new RegExp(`(\\\\t(?!${tSymbols}))|(\\\\n(?!${nSymbols}))|(\\\\\\\\t(?!${tSymbols}))|(\\\\\\\\n(?!${nSymbols}))`, 'g');\n\nexport const removeUnwantedCharacters = markup =>\n markup.replace(matchTabAndNewLine, '').replace(/\\\\\"/g, '\"').replace(/\\\\\\//g, '/');\n\nconst createElementFromHTML = (htmlString = '') => {\n const div = document.createElement('div');\n\n div.innerHTML = htmlString.trim();\n\n return div;\n};\n\nexport const processMarkup = markup => {\n const newMarkup = removeUnwantedCharacters(markup || '');\n const slateMarkup = createElementFromHTML(newMarkup || '');\n let index = 0;\n\n slateMarkup.querySelectorAll('[data-type=\"explicit_constructed_response\"]').forEach(s => {\n s.replaceWith(`{{${index++}}}`);\n });\n\n return slateMarkup.innerHTML;\n};\n\nconst REGEX = /\\{\\{(\\d+)\\}\\}/g;\n\nexport const createSlateMarkup = (markup, choices) => {\n if (!markup) {\n return '';\n }\n\n const newMarkup = removeUnwantedCharacters(markup);\n\n return newMarkup.replace(REGEX, (match, g) => {\n const label = choices[g][0].label || '';\n\n return `<span data-type=\"explicit_constructed_response\" data-index=\"${g}\" data-value=\"${escape(label)}\"></span>`;\n });\n};\n\n// also used in controller/src/index.js\nexport const getAdjustedLength = length => {\n if (length <= 2) {\n return length + 2;\n }\n\n if (length <= 4) {\n return length + 3;\n }\n\n if (length <= 6) {\n return length + 4;\n }\n\n return length + 5;\n};\n"],"file":"markupUtils.js"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-element/explicit-constructed-response-configure",
3
- "version": "3.6.7",
3
+ "version": "3.7.1",
4
4
  "private": true,
5
5
  "main": "lib/index.js",
6
6
  "modue": "src/index.js",
@@ -8,8 +8,8 @@
8
8
  "@material-ui/core": "^3.9.2",
9
9
  "@material-ui/icons": "^3.0.1",
10
10
  "@pie-framework/pie-configure-events": "^1.2.0",
11
- "@pie-lib/config-ui": "^10.10.13",
12
- "@pie-lib/editable-html": "^7.17.13",
11
+ "@pie-lib/config-ui": "^10.10.18",
12
+ "@pie-lib/editable-html": "^7.17.18",
13
13
  "classnames": "^2.2.6",
14
14
  "debug": "^3.1.0",
15
15
  "lodash": "^4.17.15",