@pie-element/ebsr 10.5.2-next.2 → 10.5.3-hotfix.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,28 @@
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
+ ## [10.5.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/ebsr@10.5.2...@pie-element/ebsr@10.5.3) (2025-04-18)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * update pie-lib/pie-toolbox PD-4967 ([cf4c095](https://github.com/pie-framework/pie-elements/commit/cf4c095f21a2e9bdf74ce5a419ad5fc8d0d7f6ca))
12
+
13
+
14
+
15
+
16
+
17
+ ## [10.5.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/ebsr@10.5.1...@pie-element/ebsr@10.5.2) (2025-04-17)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * update pie-lib/pie-toolbox PD-4967 ([0901bff](https://github.com/pie-framework/pie-elements/commit/0901bff14ea3398cf3930d7e41809a4d9dde0ccd))
23
+
24
+
25
+
26
+
27
+
6
28
  ## [10.5.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/ebsr@10.5.0...@pie-element/ebsr@10.5.1) (2025-04-10)
7
29
 
8
30
 
@@ -3,6 +3,28 @@
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
+ ## [10.4.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/ebsr-configure@10.4.2...@pie-element/ebsr-configure@10.4.3) (2025-04-18)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * update pie-lib/pie-toolbox PD-4967 ([cf4c095](https://github.com/pie-framework/pie-elements/commit/cf4c095f21a2e9bdf74ce5a419ad5fc8d0d7f6ca))
12
+
13
+
14
+
15
+
16
+
17
+ ## [10.4.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/ebsr-configure@10.4.1...@pie-element/ebsr-configure@10.4.2) (2025-04-17)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * update pie-lib/pie-toolbox PD-4967 ([0901bff](https://github.com/pie-framework/pie-elements/commit/0901bff14ea3398cf3930d7e41809a4d9dde0ccd))
23
+
24
+
25
+
26
+
27
+
6
28
  ## [10.4.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/ebsr-configure@10.4.0...@pie-element/ebsr-configure@10.4.1) (2025-04-10)
7
29
 
8
30
 
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@pie-element/ebsr-configure",
3
3
  "private": true,
4
- "version": "10.4.1",
4
+ "version": "10.4.3",
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": "^9.15.1",
11
+ "@pie-element/multiple-choice": "^9.15.3",
12
12
  "@pie-framework/pie-configure-events": "^1.2.0",
13
- "@pie-lib/pie-toolbox": "2.14.1",
13
+ "@pie-lib/pie-toolbox": "2.14.3",
14
14
  "lodash": "^4.17.15",
15
15
  "prop-types": "^15.6.2",
16
16
  "react": "^16.8.1",
@@ -3,6 +3,28 @@
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.2.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/ebsr-controller@8.2.2...@pie-element/ebsr-controller@8.2.3) (2025-04-18)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * update pie-lib/pie-toolbox PD-4967 ([cf4c095](https://github.com/pie-framework/pie-elements/commit/cf4c095f21a2e9bdf74ce5a419ad5fc8d0d7f6ca))
12
+
13
+
14
+
15
+
16
+
17
+ ## [8.2.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/ebsr-controller@8.2.1...@pie-element/ebsr-controller@8.2.2) (2025-04-17)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * update pie-lib/pie-toolbox PD-4967 ([0901bff](https://github.com/pie-framework/pie-elements/commit/0901bff14ea3398cf3930d7e41809a4d9dde0ccd))
23
+
24
+
25
+
26
+
27
+
6
28
  ## [8.2.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/ebsr-controller@8.2.0...@pie-element/ebsr-controller@8.2.1) (2025-04-10)
7
29
 
8
30
 
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@pie-element/ebsr-controller",
3
3
  "private": true,
4
- "version": "8.2.1",
4
+ "version": "8.2.3",
5
5
  "description": "",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1"
8
8
  },
9
9
  "dependencies": {
10
- "@pie-lib/pie-toolbox": "2.14.1",
10
+ "@pie-lib/pie-toolbox": "2.14.3",
11
11
  "lodash": "^4.17.15"
12
12
  },
13
13
  "author": "",
package/lib/print.js CHANGED
@@ -196,7 +196,9 @@ var Ebsr = /*#__PURE__*/function (_HTMLElement) {
196
196
  part.model = _objectSpread(_objectSpread({}, preparePrintModel(this._model[key], this._options)), {}, {
197
197
  keyMode: this._model[key].choicePrefix,
198
198
  partLabel: labels[key]
199
- });
199
+ }); // pass options to enable print mode detection in multiple-choice component
200
+
201
+ part.options = this._options;
200
202
 
201
203
  if (!part._session) {
202
204
  // for print, "set session" is not called,
package/lib/print.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/print.js"],"names":["MC_TAG_NAME","SESSION_CHANGED","SessionChangedEvent","TYPE","translator","Translator","log","preparePrintModel","model","opts","instr","role","prompt","promptEnabled","undefined","teacherInstructions","teacherInstructionsEnabled","showTeacherInstructions","alwaysShowCorrect","mode","disabled","animationsDisabled","lockChoiceOrder","choicesLayout","choices","map","c","rationale","rationaleEnabled","hideTick","feedback","keyMode","choicePrefix","EbsrMC","MultipleChoice","defineMultipleChoice","customElements","get","define","isNonEmptyArray","a","Array","isArray","length","isSessionComplete","session","b","Ebsr","e","target","preventDefault","stopImmediatePropagation","id","getAttribute","key","toUpperCase","update","_model","dispatchSessionChanged","srcElement","_session","_options","m","whenDefined","then","setPartModel","partA","partB","s","setPartSession","part","labels","partLabels","language","t","lng","index","partLabelType","partLabel","o","value","partSession","complete","dispatchEvent","tagName","toLowerCase","querySelector","_render","addEventListener","onSessionUpdated","removeEventListener","innerHTML","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AAGA;;;;;;;;;;AAFA,IAAMA,WAAW,GAAG,sBAApB;AACA,IAAMC,eAAe,GAAGC,qCAAoBC,IAA5C;AAGA,IAAQC,UAAR,GAAuBC,sBAAvB,CAAQD,UAAR;AAEA,IAAME,GAAG,GAAG,uBAAM,wBAAN,CAAZ;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,IAAMC,iBAAiB,GAAG,SAApBA,iBAAoB,CAACC,KAAD,EAAQC,IAAR,EAAiB;AACzC,MAAMC,KAAK,GAAGD,IAAI,CAACE,IAAL,KAAc,YAA5B;AAEAH,EAAAA,KAAK,CAACI,MAAN,GAAeJ,KAAK,CAACK,aAAN,KAAwB,KAAxB,GAAgCL,KAAK,CAACI,MAAtC,GAA+CE,SAA9D;AACAN,EAAAA,KAAK,CAACO,mBAAN,GACEL,KAAK,IAAIF,KAAK,CAACQ,0BAAN,KAAqC,KAA9C,GAAsDR,KAAK,CAACO,mBAA5D,GAAkFD,SADpF;AAEAN,EAAAA,KAAK,CAACS,uBAAN,GAAgCP,KAAhC;AACAF,EAAAA,KAAK,CAACU,iBAAN,GAA0BR,KAA1B;AACAF,EAAAA,KAAK,CAACW,IAAN,GAAaT,KAAK,GAAG,UAAH,GAAgB,QAAlC;AAEAF,EAAAA,KAAK,CAACY,QAAN,GAAiB,IAAjB;AACAZ,EAAAA,KAAK,CAACa,kBAAN,GAA2B,IAA3B;AACAb,EAAAA,KAAK,CA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DAlI+B4F,W","sourcesContent":["import cloneDeep from 'lodash/cloneDeep';\nimport MultipleChoice from '@pie-element/multiple-choice';\nimport debug from 'debug';\nimport get from 'lodash/get';\nimport { SessionChangedEvent } from '@pie-framework/pie-player-events';\nconst MC_TAG_NAME = 'ebsr-multiple-choice';\nconst SESSION_CHANGED = SessionChangedEvent.TYPE;\nimport Translator from '@pie-lib/pie-toolbox/translator';\n\nconst { translator } = Translator;\n\nconst log = debug('pie-element:ebsr:print');\n\n/**\n * Live in same package as main element - so we can access some of the shared comps!\n *\n * - update pslb to build print if src/print.js is there\n * - update demo el\n * - get configure/controller building\n */\n\nconst preparePrintModel = (model, opts) => {\n const instr = opts.role === 'instructor';\n\n model.prompt = model.promptEnabled !== false ? model.prompt : undefined;\n model.teacherInstructions =\n instr && model.teacherInstructionsEnabled !== false ? model.teacherInstructions : undefined;\n model.showTeacherInstructions = instr;\n model.alwaysShowCorrect = instr;\n model.mode = instr ? 'evaluate' : 'gather';\n\n model.disabled = true;\n model.animationsDisabled = true;\n model.lockChoiceOrder = true;\n model.choicesLayout = model.choicesLayout || 'vertical';\n\n const choices = cloneDeep(model.choices);\n\n model.choices = choices.map((c) => {\n c.rationale = instr && model.rationaleEnabled !== false ? c.rationale : undefined;\n c.hideTick = instr;\n c.feedback = undefined;\n return c;\n });\n\n model.keyMode = model.choicePrefix || 'letters';\n\n return model;\n};\n\nclass EbsrMC extends MultipleChoice {}\n\nconst defineMultipleChoice = () => {\n if (!customElements.get(MC_TAG_NAME)) {\n customElements.define(MC_TAG_NAME, EbsrMC);\n }\n};\n\ndefineMultipleChoice();\n\nconst isNonEmptyArray = (a) => Array.isArray(a) && a.length > 0;\n\nexport const isSessionComplete = (session) => {\n const a = get(session, 'value.partA.value');\n const b = get(session, 'value.partB.value');\n\n return isNonEmptyArray(a) && isNonEmptyArray(b);\n};\n\nexport default class Ebsr extends HTMLElement {\n constructor() {\n super();\n this._model = {};\n this._session = {};\n this._options = null;\n }\n\n onSessionUpdated = (e) => {\n if (e.target === this) {\n return;\n }\n\n e.preventDefault();\n e.stopImmediatePropagation();\n\n const id = e.target.getAttribute('id');\n\n if (id) {\n const key = `part${id.toUpperCase()}`;\n\n if (e.update) {\n this._model[key] = e.update;\n }\n //TODO: accessing a private property here. The session event should contain the update in future to prevent this.\n this.dispatchSessionChanged(e.srcElement._session, key);\n }\n };\n\n set model(m) {\n this._model = m;\n\n customElements.whenDefined(MC_TAG_NAME).then(() => {\n this.setPartModel(this.partA, 'partA');\n this.setPartModel(this.partB, 'partB');\n });\n }\n\n set session(s) {\n this._session = s;\n\n customElements.whenDefined(MC_TAG_NAME).then(() => {\n this.setPartSession(this.partA, 'partA');\n this.setPartSession(this.partB, 'partB');\n });\n }\n\n setPartModel(part, key) {\n if (this._model && this._model[key] && part) {\n let labels = {\n 'partA': undefined,\n 'partB': undefined\n };\n\n if (this._model.partLabels) {\n const language = this._model.language;\n\n labels = {\n 'partA': translator.t('ebsr.part', {\n lng: language,\n index: this._model.partLabelType === 'Letters' ? 'A' : '1'\n }),\n 'partB': translator.t('ebsr.part', {\n lng: language,\n index: this._model.partLabelType === 'Letters' ? 'B' : '2'\n })\n };\n }\n\n part.model = {\n ...preparePrintModel(this._model[key], this._options),\n keyMode: this._model[key].choicePrefix,\n partLabel: labels[key]\n };\n\n if (!part._session) {\n // for print, \"set session\" is not called,\n // but ebsr needs sessions in order to render the elements,\n // so we set it here it was not set already\n part.session = {};\n }\n }\n }\n\n set options(o) {\n this._options = o;\n }\n\n setPartSession(part, key) {\n if (this._session && this._model && part) {\n const { value } = this._session;\n part.session = value && value[key] ? value[key] : { id: key };\n }\n }\n\n dispatchSessionChanged(partSession, key) {\n this._session.value = {\n ...this._session.value,\n [key]: partSession,\n };\n\n log('[onSessionChanged] session: ', this._session);\n const complete = isSessionComplete(this._session);\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), complete));\n }\n\n get partA() {\n return this.querySelector(`${MC_TAG_NAME}#a`);\n }\n\n get partB() {\n return this.querySelector(`${MC_TAG_NAME}#b`);\n }\n\n connectedCallback() {\n this._render();\n this.addEventListener(SESSION_CHANGED, this.onSessionUpdated);\n }\n\n disconnectedCallback() {\n this.removeEventListener(SESSION_CHANGED, this.onSessionUpdated);\n }\n\n _render() {\n this.innerHTML = `\n <div>\n <${MC_TAG_NAME} id=\"a\"></${MC_TAG_NAME}>\n <${MC_TAG_NAME} id=\"b\"></${MC_TAG_NAME}>\n </div>\n `;\n }\n}\n"],"file":"print.js"}
1
+ {"version":3,"sources":["../src/print.js"],"names":["MC_TAG_NAME","SESSION_CHANGED","SessionChangedEvent","TYPE","translator","Translator","log","preparePrintModel","model","opts","instr","role","prompt","promptEnabled","undefined","teacherInstructions","teacherInstructionsEnabled","showTeacherInstructions","alwaysShowCorrect","mode","disabled","animationsDisabled","lockChoiceOrder","choicesLayout","choices","map","c","rationale","rationaleEnabled","hideTick","feedback","keyMode","choicePrefix","EbsrMC","MultipleChoice","defineMultipleChoice","customElements","get","define","isNonEmptyArray","a","Array","isArray","length","isSessionComplete","session","b","Ebsr","e","target","preventDefault","stopImmediatePropagation","id","getAttribute","key","toUpperCase","update","_model","dispatchSessionChanged","srcElement","_session","_options","m","whenDefined","then","setPartModel","partA","partB","s","setPartSession","part","labels","partLabels","language","t","lng","index","partLabelType","partLabel","options","o","value","partSession","complete","dispatchEvent","tagName","toLowerCase","querySelector","_render","addEventListener","onSessionUpdated","removeEventListener","innerHTML","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AAGA;;;;;;;;;;AAFA,IAAMA,WAAW,GAAG,sBAApB;AACA,IAAMC,eAAe,GAAGC,qCAAoBC,IAA5C;AAGA,IAAQC,UAAR,GAAuBC,sBAAvB,CAAQD,UAAR;AAEA,IAAME,GAAG,GAAG,uBAAM,wBAAN,CAAZ;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,IAAMC,iBAAiB,GAAG,SAApBA,iB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,KADnB,4CAEG3B,GAFH,EAES4B,WAFT;AAKA5E,MAAAA,GAAG,CAAC,8BAAD,EAAiC,KAAKsD,QAAtC,CAAH;AACA,UAAMuB,QAAQ,GAAGvC,iBAAiB,CAAC,KAAKgB,QAAN,CAAlC;AACA,WAAKwB,aAAL,CAAmB,IAAIlF,oCAAJ,CAAwB,KAAKmF,OAAL,CAAaC,WAAb,EAAxB,EAAoDH,QAApD,CAAnB;AACD;;;SAED,eAAY;AACV,aAAO,KAAKI,aAAL,WAAsBvF,WAAtB,QAAP;AACD;;;SAED,eAAY;AACV,aAAO,KAAKuF,aAAL,WAAsBvF,WAAtB,QAAP;AACD;;;WAED,6BAAoB;AAClB,WAAKwF,OAAL;;AACA,WAAKC,gBAAL,CAAsBxF,eAAtB,EAAuC,KAAKyF,gBAA5C;AACD;;;WAED,gCAAuB;AACrB,WAAKC,mBAAL,CAAyB1F,eAAzB,EAA0C,KAAKyF,gBAA/C;AACD;;;WAED,mBAAU;AACR,WAAKE,SAAL,qCAEO5F,WAFP,yBAE+BA,WAF/B,yBAGOA,WAHP,yBAG+BA,WAH/B;AAMD;;;kDArI+B6F,W","sourcesContent":["import cloneDeep from 'lodash/cloneDeep';\nimport MultipleChoice from '@pie-element/multiple-choice';\nimport debug from 'debug';\nimport get from 'lodash/get';\nimport { SessionChangedEvent } from '@pie-framework/pie-player-events';\nconst MC_TAG_NAME = 'ebsr-multiple-choice';\nconst SESSION_CHANGED = SessionChangedEvent.TYPE;\nimport Translator from '@pie-lib/pie-toolbox/translator';\n\nconst { translator } = Translator;\n\nconst log = debug('pie-element:ebsr:print');\n\n/**\n * Live in same package as main element - so we can access some of the shared comps!\n *\n * - update pslb to build print if src/print.js is there\n * - update demo el\n * - get configure/controller building\n */\n\nconst preparePrintModel = (model, opts) => {\n const instr = opts.role === 'instructor';\n\n model.prompt = model.promptEnabled !== false ? model.prompt : undefined;\n model.teacherInstructions =\n instr && model.teacherInstructionsEnabled !== false ? model.teacherInstructions : undefined;\n model.showTeacherInstructions = instr;\n model.alwaysShowCorrect = instr;\n model.mode = instr ? 'evaluate' : 'gather';\n\n model.disabled = true;\n model.animationsDisabled = true;\n model.lockChoiceOrder = true;\n model.choicesLayout = model.choicesLayout || 'vertical';\n\n const choices = cloneDeep(model.choices);\n\n model.choices = choices.map((c) => {\n c.rationale = instr && model.rationaleEnabled !== false ? c.rationale : undefined;\n c.hideTick = instr;\n c.feedback = undefined;\n return c;\n });\n\n model.keyMode = model.choicePrefix || 'letters';\n\n return model;\n};\n\nclass EbsrMC extends MultipleChoice {}\n\nconst defineMultipleChoice = () => {\n if (!customElements.get(MC_TAG_NAME)) {\n customElements.define(MC_TAG_NAME, EbsrMC);\n }\n};\n\ndefineMultipleChoice();\n\nconst isNonEmptyArray = (a) => Array.isArray(a) && a.length > 0;\n\nexport const isSessionComplete = (session) => {\n const a = get(session, 'value.partA.value');\n const b = get(session, 'value.partB.value');\n\n return isNonEmptyArray(a) && isNonEmptyArray(b);\n};\n\nexport default class Ebsr extends HTMLElement {\n constructor() {\n super();\n this._model = {};\n this._session = {};\n this._options = null;\n }\n\n onSessionUpdated = (e) => {\n if (e.target === this) {\n return;\n }\n\n e.preventDefault();\n e.stopImmediatePropagation();\n\n const id = e.target.getAttribute('id');\n\n if (id) {\n const key = `part${id.toUpperCase()}`;\n\n if (e.update) {\n this._model[key] = e.update;\n }\n //TODO: accessing a private property here. The session event should contain the update in future to prevent this.\n this.dispatchSessionChanged(e.srcElement._session, key);\n }\n };\n\n set model(m) {\n this._model = m;\n\n customElements.whenDefined(MC_TAG_NAME).then(() => {\n this.setPartModel(this.partA, 'partA');\n this.setPartModel(this.partB, 'partB');\n });\n }\n\n set session(s) {\n this._session = s;\n\n customElements.whenDefined(MC_TAG_NAME).then(() => {\n this.setPartSession(this.partA, 'partA');\n this.setPartSession(this.partB, 'partB');\n });\n }\n\n setPartModel(part, key) {\n if (this._model && this._model[key] && part) {\n let labels = {\n 'partA': undefined,\n 'partB': undefined\n };\n\n if (this._model.partLabels) {\n const language = this._model.language;\n\n labels = {\n 'partA': translator.t('ebsr.part', {\n lng: language,\n index: this._model.partLabelType === 'Letters' ? 'A' : '1'\n }),\n 'partB': translator.t('ebsr.part', {\n lng: language,\n index: this._model.partLabelType === 'Letters' ? 'B' : '2'\n })\n };\n }\n\n part.model = {\n ...preparePrintModel(this._model[key], this._options),\n keyMode: this._model[key].choicePrefix,\n partLabel: labels[key]\n };\n\n // pass options to enable print mode detection in multiple-choice component\n part.options = this._options;\n\n if (!part._session) {\n // for print, \"set session\" is not called,\n // but ebsr needs sessions in order to render the elements,\n // so we set it here it was not set already\n part.session = {};\n }\n }\n }\n\n set options(o) {\n this._options = o;\n }\n\n setPartSession(part, key) {\n if (this._session && this._model && part) {\n const { value } = this._session;\n part.session = value && value[key] ? value[key] : { id: key };\n }\n }\n\n dispatchSessionChanged(partSession, key) {\n this._session.value = {\n ...this._session.value,\n [key]: partSession,\n };\n\n log('[onSessionChanged] session: ', this._session);\n const complete = isSessionComplete(this._session);\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), complete));\n }\n\n get partA() {\n return this.querySelector(`${MC_TAG_NAME}#a`);\n }\n\n get partB() {\n return this.querySelector(`${MC_TAG_NAME}#b`);\n }\n\n connectedCallback() {\n this._render();\n this.addEventListener(SESSION_CHANGED, this.onSessionUpdated);\n }\n\n disconnectedCallback() {\n this.removeEventListener(SESSION_CHANGED, this.onSessionUpdated);\n }\n\n _render() {\n this.innerHTML = `\n <div>\n <${MC_TAG_NAME} id=\"a\"></${MC_TAG_NAME}>\n <${MC_TAG_NAME} id=\"b\"></${MC_TAG_NAME}>\n </div>\n `;\n }\n}\n"],"file":"print.js"}
@@ -1,6 +1,6 @@
1
- import {_dll_react, _dll_prop_types, _dll_lodash, _dll_react_dom} from "../../../@pie-lib/pie-toolbox-math-rendering-module@3.8.1/module/index.js";
1
+ import {_dll_react, _dll_prop_types, _dll_lodash, _dll_react_dom} from "../../../@pie-lib/pie-toolbox-math-rendering-module@3.9.0/module/index.js";
2
2
  import MultipleChoiceConfigure from '@pie-element/multiple-choice/configure/lib';
3
- import {_dll_pie_lib__pie_toolbox_config_ui} from "../../../@pie-lib/pie-toolbox-module@6.0.1/module/index.js";
3
+ import {_dll_pie_lib__pie_toolbox_config_ui} from "../../../@pie-lib/pie-toolbox-module@6.0.3/module/index.js";
4
4
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
5
5
  function getDefaultExportFromCjs(x) {
6
6
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
@@ -5499,7 +5499,7 @@ const React$1 = _dll_react;
5499
5499
  const PropTypes = _dll_prop_types;
5500
5500
  const {settings: settings} = _dll_pie_lib__pie_toolbox_config_ui;
5501
5501
  const {layout: layout} = _dll_pie_lib__pie_toolbox_config_ui;
5502
- const _jsxFileName = "/home/circleci/repo/packages/ebsr/configure/src/main.jsx";
5502
+ const _jsxFileName = "/Users/carlacostea/Pie_Work/pie-framework/pie-elements/packages/ebsr/configure/src/main.jsx";
5503
5503
  const {Panel, toggle, radio, dropdown} = settings;
5504
5504
  const styles = theme => ({
5505
5505
  partLabel: {
package/module/element.js CHANGED
@@ -1,5 +1,5 @@
1
- import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_debug, _dll_pie_lib__pie_toolbox_math_rendering} from "../../../@pie-lib/pie-toolbox-math-rendering-module@3.8.1/module/index.js";
2
- import {_dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_correct_answer_toggle} from "../../../@pie-lib/pie-toolbox-module@6.0.1/module/index.js";
1
+ import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_debug, _dll_pie_lib__pie_toolbox_math_rendering} from "../../../@pie-lib/pie-toolbox-math-rendering-module@3.9.0/module/index.js";
2
+ import {_dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_correct_answer_toggle} from "../../../@pie-lib/pie-toolbox-module@6.0.3/module/index.js";
3
3
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
4
4
  function getDefaultExportFromCjs(x) {
5
5
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
@@ -11991,7 +11991,7 @@ var reactTransitionGroup = {
11991
11991
  const React$5 = _dll_react;
11992
11992
  const PropTypes$4 = _dll_prop_types;
11993
11993
  const {color: color$2} = _dll_pie_lib__pie_toolbox_render_ui;
11994
- const _jsxFileName$4 = "/home/circleci/repo/packages/multiple-choice/src/feedback-tick.jsx";
11994
+ const _jsxFileName$4 = "/Users/carlacostea/Pie_Work/pie-framework/pie-elements/packages/multiple-choice/src/feedback-tick.jsx";
11995
11995
  const stylesheet = {
11996
11996
  incorrect: {
11997
11997
  fill: `var(--feedback-incorrect-bg-color, ${color$2.incorrect()})`
@@ -12162,7 +12162,7 @@ const classNames$2 = _dll_classnames;
12162
12162
  const {Feedback: Feedback} = _dll_pie_lib__pie_toolbox_render_ui;
12163
12163
  const {color: color$1} = _dll_pie_lib__pie_toolbox_render_ui;
12164
12164
  const {PreviewPrompt: PreviewPrompt$1} = _dll_pie_lib__pie_toolbox_render_ui;
12165
- const _jsxFileName$3 = "/home/circleci/repo/packages/multiple-choice/src/choice-input.jsx";
12165
+ const _jsxFileName$3 = "/Users/carlacostea/Pie_Work/pie-framework/pie-elements/packages/multiple-choice/src/choice-input.jsx";
12166
12166
  const CLASS_NAME = 'multiple-choice-component';
12167
12167
  const styleSheet = theme => ({
12168
12168
  row: {
@@ -12516,7 +12516,7 @@ var ChoiceInput$1 = styles$b.withStyles(styleSheet)(ChoiceInput);
12516
12516
  const React$3 = _dll_react;
12517
12517
  const PropTypes$2 = _dll_prop_types;
12518
12518
  const classNames$1 = _dll_classnames;
12519
- const _jsxFileName$2 = "/home/circleci/repo/packages/multiple-choice/src/choice.jsx";
12519
+ const _jsxFileName$2 = "/Users/carlacostea/Pie_Work/pie-framework/pie-elements/packages/multiple-choice/src/choice.jsx";
12520
12520
  class Choice extends React$3.Component {
12521
12521
  constructor(...args) {
12522
12522
  super(...args);
@@ -12623,7 +12623,7 @@ const {CorrectAnswerToggle: CorrectAnswerToggle} = _dll_pie_lib__pie_toolbox_cor
12623
12623
  const {color: color} = _dll_pie_lib__pie_toolbox_render_ui;
12624
12624
  const {Collapsible: Collapsible} = _dll_pie_lib__pie_toolbox_render_ui;
12625
12625
  const {PreviewPrompt: PreviewPrompt} = _dll_pie_lib__pie_toolbox_render_ui;
12626
- const _jsxFileName$1 = "/home/circleci/repo/packages/multiple-choice/src/multiple-choice.jsx";
12626
+ const _jsxFileName$1 = "/Users/carlacostea/Pie_Work/pie-framework/pie-elements/packages/multiple-choice/src/multiple-choice.jsx";
12627
12627
  const {translator} = Translator;
12628
12628
  const styles$1 = theme => ({
12629
12629
  main: {
@@ -12703,7 +12703,8 @@ class MultipleChoice$1 extends React$2.Component {
12703
12703
  customAudioButton: {
12704
12704
  playImage: PropTypes$1.string,
12705
12705
  pauseImage: PropTypes$1.string
12706
- }
12706
+ },
12707
+ options: PropTypes$1.object
12707
12708
  };
12708
12709
  }
12709
12710
  constructor(props) {
@@ -12805,7 +12806,12 @@ class MultipleChoice$1 extends React$2.Component {
12805
12806
  };
12806
12807
  }
12807
12808
  getChecked(choice) {
12808
- if (this.state.showCorrect) {
12809
+ const isPrintMode = this.props.options && this.props.alwaysShowCorrect;
12810
+ if (isPrintMode) {
12811
+ return choice.correct || false;
12812
+ }
12813
+ const isEvaluateMode = this.state.showCorrect && this.props.mode === 'evaluate';
12814
+ if (isEvaluateMode) {
12809
12815
  return choice.correct || false;
12810
12816
  }
12811
12817
  return this.isSelected(choice.value);
@@ -12820,14 +12826,14 @@ class MultipleChoice$1 extends React$2.Component {
12820
12826
  __self: this,
12821
12827
  __source: {
12822
12828
  fileName: _jsxFileName$1,
12823
- lineNumber: 215
12829
+ lineNumber: 227
12824
12830
  }
12825
12831
  }, "Multiple Choice Question") : React$2.createElement('h2', {
12826
12832
  className: classes.srOnly,
12827
12833
  __self: this,
12828
12834
  __source: {
12829
12835
  fileName: _jsxFileName$1,
12830
- lineNumber: 217
12836
+ lineNumber: 229
12831
12837
  }
12832
12838
  }, "Multiple Select Question");
12833
12839
  }
@@ -12848,7 +12854,7 @@ class MultipleChoice$1 extends React$2.Component {
12848
12854
  __self: this,
12849
12855
  __source: {
12850
12856
  fileName: _jsxFileName$1,
12851
- lineNumber: 251
12857
+ lineNumber: 263
12852
12858
  }
12853
12859
  });
12854
12860
  const getMultipleChoiceMinSelectionErrorMessage = () => {
@@ -12876,21 +12882,21 @@ class MultipleChoice$1 extends React$2.Component {
12876
12882
  __self: this,
12877
12883
  __source: {
12878
12884
  fileName: _jsxFileName$1,
12879
- lineNumber: 274
12885
+ lineNumber: 286
12880
12886
  }
12881
12887
  }, partLabel && React$2.createElement('h3', {
12882
12888
  className: classes.partLabel,
12883
12889
  __self: this,
12884
12890
  __source: {
12885
12891
  fileName: _jsxFileName$1,
12886
- lineNumber: 275
12892
+ lineNumber: 287
12887
12893
  }
12888
12894
  }, partLabel), this.renderHeading(), teacherInstructions && React$2.createElement('div', {
12889
12895
  className: classes.teacherInstructions,
12890
12896
  __self: this,
12891
12897
  __source: {
12892
12898
  fileName: _jsxFileName$1,
12893
- lineNumber: 280
12899
+ lineNumber: 292
12894
12900
  }
12895
12901
  }, !animationsDisabled ? React$2.createElement(Collapsible, {
12896
12902
  labels: {
@@ -12900,14 +12906,14 @@ class MultipleChoice$1 extends React$2.Component {
12900
12906
  __self: this,
12901
12907
  __source: {
12902
12908
  fileName: _jsxFileName$1,
12903
- lineNumber: 282
12909
+ lineNumber: 294
12904
12910
  }
12905
12911
  }, teacherInstructionsDiv) : teacherInstructionsDiv), React$2.createElement('fieldset', {
12906
12912
  className: classes.fieldset,
12907
12913
  __self: this,
12908
12914
  __source: {
12909
12915
  fileName: _jsxFileName$1,
12910
- lineNumber: 296
12916
+ lineNumber: 308
12911
12917
  }
12912
12918
  }, React$2.createElement(PreviewPrompt, {
12913
12919
  className: "prompt",
@@ -12919,7 +12925,7 @@ class MultipleChoice$1 extends React$2.Component {
12919
12925
  __self: this,
12920
12926
  __source: {
12921
12927
  fileName: _jsxFileName$1,
12922
- lineNumber: 297
12928
+ lineNumber: 309
12923
12929
  }
12924
12930
  }), !alwaysShowCorrect && React$2.createElement(CorrectAnswerToggle, {
12925
12931
  show: showCorrectAnswerToggle,
@@ -12929,7 +12935,7 @@ class MultipleChoice$1 extends React$2.Component {
12929
12935
  __self: this,
12930
12936
  __source: {
12931
12937
  fileName: _jsxFileName$1,
12932
- lineNumber: 307
12938
+ lineNumber: 319
12933
12939
  }
12934
12940
  }), React$2.createElement('div', {
12935
12941
  className: classNames({
@@ -12940,7 +12946,7 @@ class MultipleChoice$1 extends React$2.Component {
12940
12946
  __self: this,
12941
12947
  __source: {
12942
12948
  fileName: _jsxFileName$1,
12943
- lineNumber: 315
12949
+ lineNumber: 327
12944
12950
  }
12945
12951
  }, choices.map((choice, index) => React$2.createElement(StyledChoice, {
12946
12952
  choicesLayout: this.props.choicesLayout,
@@ -12963,21 +12969,21 @@ class MultipleChoice$1 extends React$2.Component {
12963
12969
  __self: this,
12964
12970
  __source: {
12965
12971
  fileName: _jsxFileName$1,
12966
- lineNumber: 323
12972
+ lineNumber: 335
12967
12973
  }
12968
12974
  })))), choiceMode === 'checkbox' && selections < minSelections && React$2.createElement('div', {
12969
12975
  className: classes.errorText,
12970
12976
  __self: this,
12971
12977
  __source: {
12972
12978
  fileName: _jsxFileName$1,
12973
- lineNumber: 347
12979
+ lineNumber: 359
12974
12980
  }
12975
12981
  }, getMultipleChoiceMinSelectionErrorMessage()), choiceMode === 'checkbox' && maxSelectionsErrorState && React$2.createElement('div', {
12976
12982
  className: classes.errorText,
12977
12983
  __self: this,
12978
12984
  __source: {
12979
12985
  fileName: _jsxFileName$1,
12980
- lineNumber: 352
12986
+ lineNumber: 364
12981
12987
  }
12982
12988
  }, translator.t(`translation:multipleChoice:maxSelections_${maxSelections === 1 ? 'one' : 'other'}`, {
12983
12989
  lng: language,
@@ -12995,7 +13001,7 @@ var MultipleChoice$2 = styles$b.withStyles(styles$1)(MultipleChoice$1);
12995
13001
  const React$1 = _dll_react;
12996
13002
  const PropTypes = _dll_prop_types;
12997
13003
  const {PreviewLayout: PreviewLayout} = _dll_pie_lib__pie_toolbox_render_ui;
12998
- const _jsxFileName = "/home/circleci/repo/packages/multiple-choice/src/main.jsx";
13004
+ const _jsxFileName = "/Users/carlacostea/Pie_Work/pie-framework/pie-elements/packages/multiple-choice/src/main.jsx";
12999
13005
  const styles = () => ({});
13000
13006
  class Main extends React$1.Component {
13001
13007
  static __initStatic() {
package/module/index.html CHANGED
@@ -2,7 +2,7 @@
2
2
  <!doctype html>
3
3
  <html>
4
4
  <head>
5
- <title>@pie-element/ebsr@10.5.1</title>
5
+ <title>@pie-element/ebsr@10.5.3</title>
6
6
  <script
7
7
  type="module"
8
8
  src="https://cdn.jsdelivr.net/npm/@pslb/demo-el@^1.0.0/dist/demo-el/demo-el.esm.js"></script>
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@pie-element/ebsr",
3
- "version": "10.5.1",
3
+ "version": "10.5.3",
4
4
  "modules": [
5
5
  {
6
6
  "name": "@pie-lib/pie-toolbox-math-rendering-module",
7
- "version": "3.8.1"
7
+ "version": "3.9.0"
8
8
  },
9
9
  {
10
10
  "name": "@pie-lib/pie-toolbox-module",
11
- "version": "6.0.1"
11
+ "version": "6.0.3"
12
12
  }
13
13
  ]
14
14
  }
package/module/print.html CHANGED
@@ -2,7 +2,7 @@
2
2
  <!doctype html>
3
3
  <html>
4
4
  <head>
5
- <title>@pie-element/ebsr@10.5.1</title>
5
+ <title>@pie-element/ebsr@10.5.3</title>
6
6
  <link
7
7
  href="https://fonts.googleapis.com/css?family=Roboto&display=swap"
8
8
  rel="stylesheet"
package/module/print.js CHANGED
@@ -1,5 +1,5 @@
1
- import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_debug, _dll_pie_lib__pie_toolbox_math_rendering} from "../../../@pie-lib/pie-toolbox-math-rendering-module@3.8.1/module/index.js";
2
- import {_dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_correct_answer_toggle} from "../../../@pie-lib/pie-toolbox-module@6.0.1/module/index.js";
1
+ import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_debug, _dll_pie_lib__pie_toolbox_math_rendering} from "../../../@pie-lib/pie-toolbox-math-rendering-module@3.9.0/module/index.js";
2
+ import {_dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_correct_answer_toggle} from "../../../@pie-lib/pie-toolbox-module@6.0.3/module/index.js";
3
3
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
4
4
  function getDefaultExportFromCjs(x) {
5
5
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
@@ -11954,7 +11954,7 @@ var reactTransitionGroup = {
11954
11954
  const React$5 = _dll_react;
11955
11955
  const PropTypes$4 = _dll_prop_types;
11956
11956
  const {color: color$2} = _dll_pie_lib__pie_toolbox_render_ui;
11957
- const _jsxFileName$4 = "/home/circleci/repo/packages/multiple-choice/src/feedback-tick.jsx";
11957
+ const _jsxFileName$4 = "/Users/carlacostea/Pie_Work/pie-framework/pie-elements/packages/multiple-choice/src/feedback-tick.jsx";
11958
11958
  const stylesheet = {
11959
11959
  incorrect: {
11960
11960
  fill: `var(--feedback-incorrect-bg-color, ${color$2.incorrect()})`
@@ -12125,7 +12125,7 @@ const classNames$2 = _dll_classnames;
12125
12125
  const {Feedback: Feedback} = _dll_pie_lib__pie_toolbox_render_ui;
12126
12126
  const {color: color$1} = _dll_pie_lib__pie_toolbox_render_ui;
12127
12127
  const {PreviewPrompt: PreviewPrompt$1} = _dll_pie_lib__pie_toolbox_render_ui;
12128
- const _jsxFileName$3 = "/home/circleci/repo/packages/multiple-choice/src/choice-input.jsx";
12128
+ const _jsxFileName$3 = "/Users/carlacostea/Pie_Work/pie-framework/pie-elements/packages/multiple-choice/src/choice-input.jsx";
12129
12129
  const CLASS_NAME = 'multiple-choice-component';
12130
12130
  const styleSheet = theme => ({
12131
12131
  row: {
@@ -12479,7 +12479,7 @@ var ChoiceInput$1 = styles$b.withStyles(styleSheet)(ChoiceInput);
12479
12479
  const React$3 = _dll_react;
12480
12480
  const PropTypes$2 = _dll_prop_types;
12481
12481
  const classNames$1 = _dll_classnames;
12482
- const _jsxFileName$2 = "/home/circleci/repo/packages/multiple-choice/src/choice.jsx";
12482
+ const _jsxFileName$2 = "/Users/carlacostea/Pie_Work/pie-framework/pie-elements/packages/multiple-choice/src/choice.jsx";
12483
12483
  class Choice extends React$3.Component {
12484
12484
  constructor(...args) {
12485
12485
  super(...args);
@@ -12586,7 +12586,7 @@ const {CorrectAnswerToggle: CorrectAnswerToggle} = _dll_pie_lib__pie_toolbox_cor
12586
12586
  const {color: color} = _dll_pie_lib__pie_toolbox_render_ui;
12587
12587
  const {Collapsible: Collapsible} = _dll_pie_lib__pie_toolbox_render_ui;
12588
12588
  const {PreviewPrompt: PreviewPrompt} = _dll_pie_lib__pie_toolbox_render_ui;
12589
- const _jsxFileName$1 = "/home/circleci/repo/packages/multiple-choice/src/multiple-choice.jsx";
12589
+ const _jsxFileName$1 = "/Users/carlacostea/Pie_Work/pie-framework/pie-elements/packages/multiple-choice/src/multiple-choice.jsx";
12590
12590
  const {translator: translator$1} = Translator;
12591
12591
  const styles$1 = theme => ({
12592
12592
  main: {
@@ -12666,7 +12666,8 @@ class MultipleChoice$1 extends React$2.Component {
12666
12666
  customAudioButton: {
12667
12667
  playImage: PropTypes$1.string,
12668
12668
  pauseImage: PropTypes$1.string
12669
- }
12669
+ },
12670
+ options: PropTypes$1.object
12670
12671
  };
12671
12672
  }
12672
12673
  constructor(props) {
@@ -12768,7 +12769,12 @@ class MultipleChoice$1 extends React$2.Component {
12768
12769
  };
12769
12770
  }
12770
12771
  getChecked(choice) {
12771
- if (this.state.showCorrect) {
12772
+ const isPrintMode = this.props.options && this.props.alwaysShowCorrect;
12773
+ if (isPrintMode) {
12774
+ return choice.correct || false;
12775
+ }
12776
+ const isEvaluateMode = this.state.showCorrect && this.props.mode === 'evaluate';
12777
+ if (isEvaluateMode) {
12772
12778
  return choice.correct || false;
12773
12779
  }
12774
12780
  return this.isSelected(choice.value);
@@ -12783,14 +12789,14 @@ class MultipleChoice$1 extends React$2.Component {
12783
12789
  __self: this,
12784
12790
  __source: {
12785
12791
  fileName: _jsxFileName$1,
12786
- lineNumber: 215
12792
+ lineNumber: 227
12787
12793
  }
12788
12794
  }, "Multiple Choice Question") : React$2.createElement('h2', {
12789
12795
  className: classes.srOnly,
12790
12796
  __self: this,
12791
12797
  __source: {
12792
12798
  fileName: _jsxFileName$1,
12793
- lineNumber: 217
12799
+ lineNumber: 229
12794
12800
  }
12795
12801
  }, "Multiple Select Question");
12796
12802
  }
@@ -12811,7 +12817,7 @@ class MultipleChoice$1 extends React$2.Component {
12811
12817
  __self: this,
12812
12818
  __source: {
12813
12819
  fileName: _jsxFileName$1,
12814
- lineNumber: 251
12820
+ lineNumber: 263
12815
12821
  }
12816
12822
  });
12817
12823
  const getMultipleChoiceMinSelectionErrorMessage = () => {
@@ -12839,21 +12845,21 @@ class MultipleChoice$1 extends React$2.Component {
12839
12845
  __self: this,
12840
12846
  __source: {
12841
12847
  fileName: _jsxFileName$1,
12842
- lineNumber: 274
12848
+ lineNumber: 286
12843
12849
  }
12844
12850
  }, partLabel && React$2.createElement('h3', {
12845
12851
  className: classes.partLabel,
12846
12852
  __self: this,
12847
12853
  __source: {
12848
12854
  fileName: _jsxFileName$1,
12849
- lineNumber: 275
12855
+ lineNumber: 287
12850
12856
  }
12851
12857
  }, partLabel), this.renderHeading(), teacherInstructions && React$2.createElement('div', {
12852
12858
  className: classes.teacherInstructions,
12853
12859
  __self: this,
12854
12860
  __source: {
12855
12861
  fileName: _jsxFileName$1,
12856
- lineNumber: 280
12862
+ lineNumber: 292
12857
12863
  }
12858
12864
  }, !animationsDisabled ? React$2.createElement(Collapsible, {
12859
12865
  labels: {
@@ -12863,14 +12869,14 @@ class MultipleChoice$1 extends React$2.Component {
12863
12869
  __self: this,
12864
12870
  __source: {
12865
12871
  fileName: _jsxFileName$1,
12866
- lineNumber: 282
12872
+ lineNumber: 294
12867
12873
  }
12868
12874
  }, teacherInstructionsDiv) : teacherInstructionsDiv), React$2.createElement('fieldset', {
12869
12875
  className: classes.fieldset,
12870
12876
  __self: this,
12871
12877
  __source: {
12872
12878
  fileName: _jsxFileName$1,
12873
- lineNumber: 296
12879
+ lineNumber: 308
12874
12880
  }
12875
12881
  }, React$2.createElement(PreviewPrompt, {
12876
12882
  className: "prompt",
@@ -12882,7 +12888,7 @@ class MultipleChoice$1 extends React$2.Component {
12882
12888
  __self: this,
12883
12889
  __source: {
12884
12890
  fileName: _jsxFileName$1,
12885
- lineNumber: 297
12891
+ lineNumber: 309
12886
12892
  }
12887
12893
  }), !alwaysShowCorrect && React$2.createElement(CorrectAnswerToggle, {
12888
12894
  show: showCorrectAnswerToggle,
@@ -12892,7 +12898,7 @@ class MultipleChoice$1 extends React$2.Component {
12892
12898
  __self: this,
12893
12899
  __source: {
12894
12900
  fileName: _jsxFileName$1,
12895
- lineNumber: 307
12901
+ lineNumber: 319
12896
12902
  }
12897
12903
  }), React$2.createElement('div', {
12898
12904
  className: classNames({
@@ -12903,7 +12909,7 @@ class MultipleChoice$1 extends React$2.Component {
12903
12909
  __self: this,
12904
12910
  __source: {
12905
12911
  fileName: _jsxFileName$1,
12906
- lineNumber: 315
12912
+ lineNumber: 327
12907
12913
  }
12908
12914
  }, choices.map((choice, index) => React$2.createElement(StyledChoice, {
12909
12915
  choicesLayout: this.props.choicesLayout,
@@ -12926,21 +12932,21 @@ class MultipleChoice$1 extends React$2.Component {
12926
12932
  __self: this,
12927
12933
  __source: {
12928
12934
  fileName: _jsxFileName$1,
12929
- lineNumber: 323
12935
+ lineNumber: 335
12930
12936
  }
12931
12937
  })))), choiceMode === 'checkbox' && selections < minSelections && React$2.createElement('div', {
12932
12938
  className: classes.errorText,
12933
12939
  __self: this,
12934
12940
  __source: {
12935
12941
  fileName: _jsxFileName$1,
12936
- lineNumber: 347
12942
+ lineNumber: 359
12937
12943
  }
12938
12944
  }, getMultipleChoiceMinSelectionErrorMessage()), choiceMode === 'checkbox' && maxSelectionsErrorState && React$2.createElement('div', {
12939
12945
  className: classes.errorText,
12940
12946
  __self: this,
12941
12947
  __source: {
12942
12948
  fileName: _jsxFileName$1,
12943
- lineNumber: 352
12949
+ lineNumber: 364
12944
12950
  }
12945
12951
  }, translator$1.t(`translation:multipleChoice:maxSelections_${maxSelections === 1 ? 'one' : 'other'}`, {
12946
12952
  lng: language,
@@ -12958,7 +12964,7 @@ var MultipleChoice$2 = styles$b.withStyles(styles$1)(MultipleChoice$1);
12958
12964
  const React$1 = _dll_react;
12959
12965
  const PropTypes = _dll_prop_types;
12960
12966
  const {PreviewLayout: PreviewLayout} = _dll_pie_lib__pie_toolbox_render_ui;
12961
- const _jsxFileName = "/home/circleci/repo/packages/multiple-choice/src/main.jsx";
12967
+ const _jsxFileName = "/Users/carlacostea/Pie_Work/pie-framework/pie-elements/packages/multiple-choice/src/main.jsx";
12962
12968
  const styles = () => ({});
12963
12969
  class Main extends React$1.Component {
12964
12970
  static __initStatic() {
@@ -13441,6 +13447,7 @@ class Ebsr extends HTMLElement {
13441
13447
  keyMode: this._model[key].choicePrefix,
13442
13448
  partLabel: labels[key]
13443
13449
  };
13450
+ part.options = this._options;
13444
13451
  if (!part._session) {
13445
13452
  part.session = {};
13446
13453
  }
package/package.json CHANGED
@@ -1,22 +1,22 @@
1
1
  {
2
2
  "name": "@pie-element/ebsr",
3
- "version": "10.5.2-next.2+317f84408",
3
+ "version": "10.5.3-hotfix.0",
4
4
  "description": "",
5
5
  "repository": "pie-framework/pie-elements",
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
9
9
  "dependencies": {
10
- "@pie-element/multiple-choice": "^9.15.2-next.2+317f84408",
10
+ "@pie-element/multiple-choice": "9.15.3-hotfix.0",
11
11
  "@pie-framework/pie-player-events": "^0.1.0",
12
- "@pie-lib/pie-toolbox": "2.14.1",
12
+ "@pie-lib/pie-toolbox": "2.14.3",
13
13
  "classnames": "^2.2.5",
14
14
  "debug": "^4.1.1",
15
15
  "lodash": "^4.17.11"
16
16
  },
17
17
  "author": "pie framework developers",
18
18
  "license": "ISC",
19
- "gitHead": "317f84408e3cf52d95e76aa36fe5e53e747af7cb",
19
+ "gitHead": "0e14ff981bcdc8a89a0e58484026496701bfdbc3",
20
20
  "scripts": {
21
21
  "postpublish": "../../scripts/postpublish"
22
22
  },
package/src/print.js CHANGED
@@ -142,6 +142,9 @@ export default class Ebsr extends HTMLElement {
142
142
  partLabel: labels[key]
143
143
  };
144
144
 
145
+ // pass options to enable print mode detection in multiple-choice component
146
+ part.options = this._options;
147
+
145
148
  if (!part._session) {
146
149
  // for print, "set session" is not called,
147
150
  // but ebsr needs sessions in order to render the elements,
package/LICENSE.md DELETED
@@ -1,5 +0,0 @@
1
- Copyright 2019 CoreSpring Inc
2
-
3
- Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
4
-
5
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.