@pie-element/ebsr 8.3.2-next.31 → 8.4.2

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,31 @@
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.4.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/ebsr@8.4.0...@pie-element/ebsr@8.4.2) (2023-01-05)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * force release ebsr ([3e739fd](https://github.com/pie-framework/pie-elements/commit/3e739fd913531365c0d09fe1337f93f209a9c8dc))
12
+
13
+
14
+
15
+
16
+
17
+ # [8.4.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/ebsr@8.3.1...@pie-element/ebsr@8.4.0) (2023-01-05)
18
+
19
+
20
+ ### Features
21
+
22
+ * update pie-libs ([b174476](https://github.com/pie-framework/pie-elements/commit/b174476729119a0689f1f8adfc8c235246676cab))
23
+ * update pie-libs ([f72c3c8](https://github.com/pie-framework/pie-elements/commit/f72c3c8d8bc9bbf061bb81502317157a63c22972))
24
+ * update pie-libs ([8490729](https://github.com/pie-framework/pie-elements/commit/8490729a2389d36fd3968f0806119fde96577842))
25
+ * **ebsr:** added configuration prop to hide the settings panel PD-1999 ([30fd6c7](https://github.com/pie-framework/pie-elements/commit/30fd6c7bd6bbca6badd2d0ddc99b78a10fab7155))
26
+
27
+
28
+
29
+
30
+
6
31
  ## [8.3.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/ebsr@8.3.0...@pie-element/ebsr@8.3.1) (2022-12-21)
7
32
 
8
33
 
@@ -3,6 +3,20 @@
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.3.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/ebsr-configure@8.2.8...@pie-element/ebsr-configure@8.3.0) (2023-01-05)
7
+
8
+
9
+ ### Features
10
+
11
+ * update pie-libs ([b174476](https://github.com/pie-framework/pie-elements/commit/b174476729119a0689f1f8adfc8c235246676cab))
12
+ * update pie-libs ([f72c3c8](https://github.com/pie-framework/pie-elements/commit/f72c3c8d8bc9bbf061bb81502317157a63c22972))
13
+ * update pie-libs ([8490729](https://github.com/pie-framework/pie-elements/commit/8490729a2389d36fd3968f0806119fde96577842))
14
+ * **ebsr:** added configuration prop to hide the settings panel PD-1999 ([30fd6c7](https://github.com/pie-framework/pie-elements/commit/30fd6c7bd6bbca6badd2d0ddc99b78a10fab7155))
15
+
16
+
17
+
18
+
19
+
6
20
  ## [8.2.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/ebsr-configure@8.2.7...@pie-element/ebsr-configure@8.2.8) (2022-12-21)
7
21
 
8
22
 
@@ -47,6 +47,7 @@ var defaultConfig = {
47
47
  settings: true,
48
48
  label: 'Rationale'
49
49
  },
50
+ settingsPanelDisabled: true,
50
51
  studentInstructions: {
51
52
  settings: false,
52
53
  label: 'Student Instructions'
@@ -130,7 +131,7 @@ var _default = {
130
131
  settings: true,
131
132
  label: 'Part Labels'
132
133
  },
133
- settingsPanelDisabled: true
134
+ settingsPanelDisabled: false
134
135
  }
135
136
  };
136
137
  exports["default"] = _default;
@@ -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","spellCheck","enabled","maxImageWidth","choices","maxImageHeight","partModel","base","rationaleEnabled","feedbackEnabled","promptEnabled","teacherInstructionsEnabled","studentInstructionsEnabled","spellCheckEnabled","model","partLabels","partLabelType","partA","partB","configuration","partialScoring","scoringType","settingsPanelDisabled"],"mappings":";;;;;;;;;;;AAAA;;;;;;AAEA,IAAMA,aAAa,GAAG;AACpBC,EAAAA,eAAe,EAAE;AACfC,I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,MAAAA,KAAK,EAAE,uBADO;AAEd;AACA;AACA;AACAD,MAAAA,QAAQ,EAAE;AALI,KADH;AAQbiC,IAAAA,WAAW,EAAE;AACXjC,MAAAA,QAAQ,EAAE,KADC;AAEXC,MAAAA,KAAK,EAAE;AAFI,KARA;AAYb4B,IAAAA,KAAK,EAAE,2BAAU/B,aAAV,CAZM;AAabgC,IAAAA,KAAK,EAAE,2BAAUhC,aAAV,CAbM;AAcb6B,IAAAA,UAAU,EAAE;AACV3B,MAAAA,QAAQ,EAAE,IADA;AAEVC,MAAAA,KAAK,EAAE;AAFG,KAdC;AAkBbiC,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: false,\n enabled: true,\n },\n maxImageWidth: {\n teacherInstructions: 300,\n prompt: 300,\n rationale: 636,\n choices: 636,\n },\n maxImageHeight: {\n teacherInstructions: 300,\n prompt: 300,\n rationale: 300,\n choices: 300,\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: true,\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"}
1
+ {"version":3,"sources":["../src/defaults.js"],"names":["defaultConfig","addChoiceButton","settings","label","choiceMode","choicePrefix","deleteChoice","feedback","lockChoiceOrder","prompt","rationale","settingsPanelDisabled","studentInstructions","teacherInstructions","choicesLayout","gridColumns","spellCheck","enabled","maxImageWidth","choices","maxImageHeight","partModel","base","rationaleEnabled","feedbackEnabled","promptEnabled","teacherInstructionsEnabled","studentInstructionsEnabled","spellCheckEnabled","model","partLabels","partLabelType","partA","partB","configuration","partialScoring","scoringType"],"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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2BAAUjC,aAAV,CAbM;AAcb8B,IAAAA,UAAU,EAAE;AACV5B,MAAAA,QAAQ,EAAE,IADA;AAEVC,MAAAA,KAAK,EAAE;AAFG,KAdC;AAkBbQ,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 settingsPanelDisabled: true,\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: false,\n enabled: true,\n },\n maxImageWidth: {\n teacherInstructions: 300,\n prompt: 300,\n rationale: 636,\n choices: 636,\n },\n maxImageHeight: {\n teacherInstructions: 300,\n prompt: 300,\n rationale: 300,\n choices: 300,\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: true,\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: false,\n },\n};\n"],"file":"defaults.js"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.js"],"names":["MODEL_UPDATED","ModelUpdatedEvent","TYPE","MC_TAG_NAME","EbsrMCConfigure","MultipleChoiceConfigure","defineMultipleChoice","customElements","get","define","prepareCustomizationObject","config","model","configuration","sensibleDefaults","settingsPanelDisabled","modelDefault","EbsrConfigure","m","reset","_model","createDefaultModel","dispatchModelUpdated","_render","e","target","preventDefault","stopImmediatePropagation","id","getAttribute","update","dispatchEvent","_configuration","onConfigurationChanged","bind","resetValue","c","info","onModelChanged","addEventListener","onModelUpdated","removeEventListener","element","React","createElement","Main","ReactDOM","render","HTMLElement","partA","partB","defaults","choicesLayout","verticalMode"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;;;;;;;AAEA,IAAMA,aAAa,GAAGC,sCAAkBC,IAAxC;AACA,IAAMC,WAAW,GAAG,gCAApB;;IAEMC,e;;;;;;;;;;;EAAwBC,e;;AAE9B,IAAMC,oBAAoB,GAAG,SAAvBA,oBAAuB,GAAM;AACjC,MAAI,CAACC,cAAc,CAACC,GAAf,CAAmBL,WAAnB,CAAL,EAAsC;AACpCI,IAAAA,cAAc,CAACE,MAAf,CAAsBN,WAAtB,EAAmCC,eAAnC;AACD;AACF,CAJD;;AAMAE,oBAAoB;;AAEpB,IAAMI,0BAA0B,GAAG,SAA7BA,0BAA6B,CAACC,MAAD,EAASC,KAAT,EAAmB;AACpD,MAAMC,aAA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C;AAAA,0BAAGgC,KAAH;AAAA,MAAGA,KAAH,4BAAW,EAAX;AAAA,0BAAeC,KAAf;AAAA,MAAeA,KAAf,4BAAuB,EAAvB;AAAA,MAA8BtC,KAA9B;;AAAA,MAA4CuC,QAA5C,uEAAuDnC,YAAvD;AAAA,uDACvBmC,QADuB,GAEvBvC,KAFuB;AAG1BqC,IAAAA,KAAK,gDACAE,QAAQ,CAACF,KADT,GAEAA,KAFA;AAGHG,MAAAA,aAAa,EACXH,KAAK,CAACG,aAAN,IAAwBH,KAAK,CAACI,YAAN,KAAuB,KAAvB,IAAgC,YAAxD,IAAyEF,QAAQ,CAACF,KAAT,CAAeG;AAJvF,MAHqB;AAS1BF,IAAAA,KAAK,gDACAC,QAAQ,CAACD,KADT,GAEAA,KAFA;AAGHE,MAAAA,aAAa,EACXF,KAAK,CAACE,aAAN,IAAwBF,KAAK,CAACG,YAAN,KAAuB,KAAvB,IAAgC,YAAxD,IAAyEF,QAAQ,CAACD,KAAT,CAAeE;AAJvF;AATqB;AAAA,C","sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport { ModelUpdatedEvent } from '@pie-framework/pie-configure-events';\nimport MultipleChoiceConfigure from '@pie-element/multiple-choice/configure/lib';\nimport defaults from 'lodash/defaults';\nimport Main from './main';\n\nimport sensibleDefaults from './defaults';\n\nconst MODEL_UPDATED = ModelUpdatedEvent.TYPE;\nconst MC_TAG_NAME = 'ebsr-multiple-choice-configure';\n\nclass EbsrMCConfigure extends MultipleChoiceConfigure {}\n\nconst defineMultipleChoice = () => {\n if (!customElements.get(MC_TAG_NAME)) {\n customElements.define(MC_TAG_NAME, EbsrMCConfigure);\n }\n};\n\ndefineMultipleChoice();\n\nconst prepareCustomizationObject = (config, model) => {\n const configuration = defaults(config, sensibleDefaults.configuration);\n configuration.settingsPanelDisabled = true;\n\n return {\n configuration,\n model,\n };\n};\n\nconst { model: modelDefault } = sensibleDefaults || {};\n\nexport default class EbsrConfigure extends HTMLElement {\n static createDefaultModel = ({ partA = {}, partB = {}, ...model } = {}, defaults = modelDefault) => ({\n ...defaults,\n ...model,\n partA: {\n ...defaults.partA,\n ...partA,\n choicesLayout:\n partA.choicesLayout || (partA.verticalMode === false && 'horizontal') || defaults.partA.choicesLayout,\n },\n partB: {\n ...defaults.partB,\n ...partB,\n choicesLayout:\n partB.choicesLayout || (partB.verticalMode === false && 'horizontal') || defaults.partB.choicesLayout,\n },\n });\n\n constructor() {\n super();\n\n this._model = EbsrConfigure.createDefaultModel();\n\n this._configuration = sensibleDefaults.configuration;\n this.onConfigurationChanged = this.onConfigurationChanged.bind(this);\n }\n\n set model(m) {\n this._model = EbsrConfigure.createDefaultModel(m, this._model);\n\n this._render();\n }\n\n dispatchModelUpdated(reset) {\n const resetValue = !!reset;\n\n this.dispatchEvent(new ModelUpdatedEvent(this._model, resetValue));\n }\n\n onModelChanged = (m, reset) => {\n this._model = EbsrConfigure.createDefaultModel(m, this._model);\n\n this.dispatchModelUpdated(reset);\n this._render();\n };\n\n set configuration(c) {\n const info = prepareCustomizationObject(c, this._model);\n this._configuration = info.configuration;\n\n this._render();\n }\n\n onConfigurationChanged(c) {\n this._configuration = prepareCustomizationObject(c, this._model).configuration;\n\n if (this._model) {\n this.onModelChanged(this._model);\n }\n\n this._render();\n }\n\n onModelUpdated = (e) => {\n if (e.target === this) {\n return;\n }\n\n e.preventDefault();\n e.stopImmediatePropagation();\n\n const id = e.target && e.target.getAttribute('id');\n\n if (id) {\n if (e.update) {\n this._model[`part${id}`] = e.update;\n }\n\n this.dispatchEvent(new ModelUpdatedEvent(this._model));\n }\n };\n\n connectedCallback() {\n this.addEventListener(MODEL_UPDATED, this.onModelUpdated);\n this._render();\n }\n\n disconnectedCallback() {\n this.removeEventListener(MODEL_UPDATED, this.onModelUpdated);\n }\n\n _render() {\n let element = React.createElement(Main, {\n model: this._model,\n configuration: this._configuration,\n onModelChanged: this.onModelChanged,\n onConfigurationChanged: this.onConfigurationChanged,\n });\n ReactDOM.render(element, this);\n }\n}\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../src/index.js"],"names":["MODEL_UPDATED","ModelUpdatedEvent","TYPE","MC_TAG_NAME","EbsrMCConfigure","MultipleChoiceConfigure","defineMultipleChoice","customElements","get","define","prepareCustomizationObject","config","model","configuration","sensibleDefaults","settingsPanelDisabled","modelDefault","EbsrConfigure","m","reset","_model","createDefaultModel","dispatchModelUpdated","_render","e","target","preventDefault","stopImmediatePropagation","id","getAttribute","update","dispatchEvent","_configuration","onConfigurationChanged","bind","resetValue","c","info","onModelChanged","addEventListener","onModelUpdated","removeEventListener","element","React","createElement","Main","ReactDOM","render","HTMLElement","partA","partB","defaults","choicesLayout","verticalMode"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;;;;;;;AAEA,IAAMA,aAAa,GAAGC,sCAAkBC,IAAxC;AACA,IAAMC,WAAW,GAAG,gCAApB;;IAEMC,e;;;;;;;;;;;EAAwBC,e;;AAE9B,IAAMC,oBAAoB,GAAG,SAAvBA,oBAAuB,GAAM;AACjC,MAAI,CAACC,cAAc,CAACC,GAAf,CAAmBL,WAAnB,CAAL,EAAsC;AACpCI,IAAAA,cAAc,CAACE,MAAf,CAAsBN,WAAtB,EAAmCC,eAAnC;AACD;AACF,CAJD;;AAMAE,oBAAoB;;AAEpB,IAAMI,0BAA0B,GAAG,SAA7BA,0BAA6B,CAACC,MAAD,EAASC,KAAT,EAAmB;AACpD,MAAMC,aAAa,GAAG,0BAASF,MAAT,EAAiBG,sBAAiBD,aAAlC,CAAtB;AACAA,EAAAA,aAAa,CAACE,qBAAd,GAAsC,IAAtC;AAEA,SAAO;AACLF,IAAAA,aAAa,EAAbA,aADK;AAELD,IAAAA,KAAK,EAALA;AAFK,GAAP;AAID,CARD;;AAUA,WAAgCE,yBAAoB,EAApD;AAAA,IAAeE,YAAf,QAAQJ,KAAR;;IAEqBK,a;;;;;AAkBnB,2BAA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AAA,aAAa,EACXH,KAAK,CAACG,aAAN,IAAwBH,KAAK,CAACI,YAAN,KAAuB,KAAvB,IAAgC,YAAxD,IAAyEF,QAAQ,CAACF,KAAT,CAAeG;AAJvF,MAHqB;AAS1BF,IAAAA,KAAK,gDACAC,QAAQ,CAACD,KADT,GAEAA,KAFA;AAGHE,MAAAA,aAAa,EACXF,KAAK,CAACE,aAAN,IAAwBF,KAAK,CAACG,YAAN,KAAuB,KAAvB,IAAgC,YAAxD,IAAyEF,QAAQ,CAACD,KAAT,CAAeE;AAJvF;AATqB;AAAA,C","sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport { ModelUpdatedEvent } from '@pie-framework/pie-configure-events';\nimport MultipleChoiceConfigure from '@pie-element/multiple-choice/configure/lib';\nimport defaults from 'lodash/defaults';\nimport Main from './main';\n\nimport sensibleDefaults from './defaults';\n\nconst MODEL_UPDATED = ModelUpdatedEvent.TYPE;\nconst MC_TAG_NAME = 'ebsr-multiple-choice-configure';\n\nclass EbsrMCConfigure extends MultipleChoiceConfigure {}\n\nconst defineMultipleChoice = () => {\n if (!customElements.get(MC_TAG_NAME)) {\n customElements.define(MC_TAG_NAME, EbsrMCConfigure);\n }\n};\n\ndefineMultipleChoice();\n\nconst prepareCustomizationObject = (config, model) => {\n const configuration = defaults(config, sensibleDefaults.configuration);\n configuration.settingsPanelDisabled = true;\n\n return {\n configuration,\n model,\n };\n};\n\nconst { model: modelDefault } = sensibleDefaults || {};\n\nexport default class EbsrConfigure extends HTMLElement {\n static createDefaultModel = ({ partA = {}, partB = {}, ...model } = {}, defaults = modelDefault) => ({\n ...defaults,\n ...model,\n partA: {\n ...defaults.partA,\n ...partA,\n choicesLayout:\n partA.choicesLayout || (partA.verticalMode === false && 'horizontal') || defaults.partA.choicesLayout,\n },\n partB: {\n ...defaults.partB,\n ...partB,\n choicesLayout:\n partB.choicesLayout || (partB.verticalMode === false && 'horizontal') || defaults.partB.choicesLayout,\n },\n });\n\n constructor() {\n super();\n\n this._model = EbsrConfigure.createDefaultModel();\n\n this._configuration = sensibleDefaults.configuration;\n this.onConfigurationChanged = this.onConfigurationChanged.bind(this);\n }\n\n set model(m) {\n this._model = EbsrConfigure.createDefaultModel(m, this._model);\n\n this._render();\n }\n\n dispatchModelUpdated(reset) {\n const resetValue = !!reset;\n\n this.dispatchEvent(new ModelUpdatedEvent(this._model, resetValue));\n }\n\n onModelChanged = (m, reset) => {\n this._model = EbsrConfigure.createDefaultModel(m, this._model);\n\n this.dispatchModelUpdated(reset);\n this._render();\n };\n\n set configuration(c) {\n const info = prepareCustomizationObject(c, this._model);\n this._configuration = info.configuration;\n\n this._render();\n }\n\n onConfigurationChanged(c) {\n this._configuration = prepareCustomizationObject(c, this._model).configuration;\n\n if (this._model) {\n this.onModelChanged(this._model);\n }\n\n this._render();\n }\n\n onModelUpdated = (e) => {\n if (e.target === this) {\n return;\n }\n\n e.preventDefault();\n e.stopImmediatePropagation();\n\n const id = e.target && e.target.getAttribute('id');\n\n if (id) {\n if (e.update) {\n this._model[`part${id}`] = e.update;\n }\n\n this.dispatchEvent(new ModelUpdatedEvent(this._model));\n }\n };\n\n connectedCallback() {\n this.addEventListener(MODEL_UPDATED, this.onModelUpdated);\n this._render();\n }\n\n disconnectedCallback() {\n this.removeEventListener(MODEL_UPDATED, this.onModelUpdated);\n }\n\n _render() {\n let element = React.createElement(Main, {\n model: this._model,\n configuration: this._configuration,\n onModelChanged: this.onModelChanged,\n onConfigurationChanged: this.onConfigurationChanged,\n });\n\n ReactDOM.render(element, this);\n }\n}\n"],"file":"index.js"}
@@ -31,7 +31,7 @@ var _configUi = require("@pie-lib/config-ui");
31
31
 
32
32
  var _styles = require("@material-ui/core/styles");
33
33
 
34
- var _excluded = ["partA", "partB", "partialScoring", "scoringType"];
34
+ var _excluded = ["partA", "partB", "partialScoring", "settingsPanelDisabled", "scoringType"];
35
35
 
36
36
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
37
37
 
@@ -48,13 +48,12 @@ var Panel = _configUi.settings.Panel,
48
48
 
49
49
  var styles = function styles(theme) {
50
50
  return {
51
- design: {
52
- paddingTop: theme.spacing.unit * 3
53
- },
54
51
  part: {
55
52
  display: 'flex',
56
53
  flexDirection: 'column',
57
- padding: '16px 0 32px'
54
+ '&:not(:first-child)': {
55
+ paddingTop: theme.spacing.unit * 4
56
+ }
58
57
  }
59
58
  };
60
59
  };
@@ -124,6 +123,7 @@ var Main = /*#__PURE__*/function (_React$Component) {
124
123
  var partA = configuration.partA,
125
124
  partB = configuration.partB,
126
125
  partialScoring = configuration.partialScoring,
126
+ settingsPanelDisabled = configuration.settingsPanelDisabled,
127
127
  scoringType = configuration.scoringType,
128
128
  generalConfiguration = (0, _objectWithoutProperties2["default"])(configuration, _excluded);
129
129
 
@@ -191,52 +191,56 @@ var Main = /*#__PURE__*/function (_React$Component) {
191
191
  return "".concat(i + 1);
192
192
  }) : []
193
193
  };
194
- return /*#__PURE__*/_react["default"].createElement("div", {
195
- className: classes.design
196
- }, /*#__PURE__*/_react["default"].createElement(_configUi.layout.ConfigLayout, {
194
+ var panelSettings = {
195
+ partLabels: generalConfiguration.partLabels.settings && toggle(generalConfiguration.partLabels.label),
196
+ partLabelType: model.partLabels && dropdown('', ['Numbers', 'Letters']),
197
+ partialScoring: partialScoring.settings && toggle(partialScoring.label),
198
+ scoringType: scoringType.settings && radio(scoringType.label, ['auto', 'rubric'])
199
+ };
200
+ var panelSettingsPartA = {
201
+ 'partA.choiceMode': choiceModeA.settings && radio(choiceModeA.label, ['checkbox', 'radio']),
202
+ 'partA.choicePrefix': choicePrefixA.settings && radio(choicePrefixA.label, ['numbers', 'letters']),
203
+ 'partA.lockChoiceOrder': lockChoiceOrderA.settings && toggle(lockChoiceOrderA.label),
204
+ 'partA.choicesLayout': choicesLayoutA.settings && dropdown(choicesLayoutA.label, ['vertical', 'grid', 'horizontal']),
205
+ 'partA.gridColumns': choicesLayoutA.settings && modelPartA.choicesLayout === 'grid' && nrOfColumnsAvailable.partA.length > 0 && dropdown(gridColumnsA.label, nrOfColumnsAvailable.partA)
206
+ };
207
+ var panelPropertiesPartA = {
208
+ 'partA.feedbackEnabled': feedbackA.settings && toggle(feedbackA.label),
209
+ 'partA.promptEnabled': promptA.settings && toggle(promptA.label),
210
+ 'partA.teacherInstructionsEnabled': teacherInstructionsA.settings && toggle(teacherInstructionsA.label),
211
+ 'partA.studentInstructionsEnabled': studentInstructionsA.settings && toggle(studentInstructionsA.label),
212
+ 'partA.rationaleEnabled': rationaleA.settings && toggle(rationaleA.label),
213
+ 'partA.spellCheckEnabled': spellCheckA.settings && toggle(spellCheckA.label)
214
+ };
215
+ var panelSettingsPartB = {
216
+ 'partB.choiceMode': choiceModeB.settings && radio(choiceModeB.label, ['checkbox', 'radio']),
217
+ 'partB.choicePrefix': choicePrefixB.settings && radio(choicePrefixB.label, ['numbers', 'letters']),
218
+ 'partB.lockChoiceOrder': lockChoiceOrderB.settings && toggle(lockChoiceOrderB.label),
219
+ 'partB.choicesLayout': choicesLayoutB.settings && dropdown(choicesLayoutB.label, ['vertical', 'grid', 'horizontal']),
220
+ 'partB.gridColumns': choicesLayoutB.settings && modelPartB.choicesLayout === 'grid' && nrOfColumnsAvailable.partB.length > 0 && dropdown(gridColumnsB.label, nrOfColumnsAvailable.partB)
221
+ };
222
+ var panelPropertiesPartB = {
223
+ 'partB.feedbackEnabled': feedbackB.settings && toggle(feedbackB.label),
224
+ 'partB.promptEnabled': promptB.settings && toggle(promptB.label),
225
+ 'partB.teacherInstructionsEnabled': teacherInstructionsB.settings && toggle(teacherInstructionsB.label),
226
+ 'partB.studentInstructionsEnabled': studentInstructionsB.settings && toggle(studentInstructionsB.label),
227
+ 'partB.rationaleEnabled': rationaleB.settings && toggle(rationaleB.label),
228
+ 'partB.spellCheckEnabled': spellCheckB.settings && toggle(spellCheckB.label)
229
+ };
230
+ return /*#__PURE__*/_react["default"].createElement(_configUi.layout.ConfigLayout, {
231
+ hideSettings: settingsPanelDisabled,
197
232
  settings: /*#__PURE__*/_react["default"].createElement(Panel, {
198
233
  model: model,
199
234
  onChangeModel: this.onModelChanged,
200
235
  configuration: configuration,
201
236
  onChangeConfiguration: onConfigurationChanged,
202
237
  groups: (_ref3 = {
203
- 'Settings for both': {
204
- partLabels: generalConfiguration.partLabels.settings && toggle(generalConfiguration.partLabels.label),
205
- partLabelType: model.partLabels && dropdown('', ['Numbers', 'Letters']),
206
- partialScoring: partialScoring.settings && toggle(partialScoring.label),
207
- scoringType: scoringType.settings && radio(scoringType.label, ['auto', 'rubric'])
208
- }
209
- }, (0, _defineProperty2["default"])(_ref3, "Settings ".concat(firstPart), {
210
- 'partA.choiceMode': choiceModeA.settings && radio(choiceModeA.label, ['checkbox', 'radio']),
211
- 'partA.choicePrefix': choicePrefixA.settings && radio(choicePrefixA.label, ['numbers', 'letters']),
212
- 'partA.lockChoiceOrder': lockChoiceOrderA.settings && toggle(lockChoiceOrderA.label),
213
- 'partA.choicesLayout': choicesLayoutA.settings && dropdown(choicesLayoutA.label, ['vertical', 'grid', 'horizontal']),
214
- 'partA.gridColumns': choicesLayoutA.settings && modelPartA.choicesLayout === 'grid' && nrOfColumnsAvailable.partA.length > 0 && dropdown(gridColumnsA.label, nrOfColumnsAvailable.partA)
215
- }), (0, _defineProperty2["default"])(_ref3, "Properties ".concat(firstPart), {
216
- 'partA.feedbackEnabled': feedbackA.settings && toggle(feedbackA.label),
217
- 'partA.promptEnabled': promptA.settings && toggle(promptA.label),
218
- 'partA.teacherInstructionsEnabled': teacherInstructionsA.settings && toggle(teacherInstructionsA.label),
219
- 'partA.studentInstructionsEnabled': studentInstructionsA.settings && toggle(studentInstructionsA.label),
220
- 'partA.rationaleEnabled': rationaleA.settings && toggle(rationaleA.label),
221
- 'partA.spellCheckEnabled': spellCheckA.settings && toggle(spellCheckA.label)
222
- }), (0, _defineProperty2["default"])(_ref3, "Settings ".concat(secondPart), {
223
- 'partB.choiceMode': choiceModeB.settings && radio(choiceModeB.label, ['checkbox', 'radio']),
224
- 'partB.choicePrefix': choicePrefixB.settings && radio(choicePrefixB.label, ['numbers', 'letters']),
225
- 'partB.lockChoiceOrder': lockChoiceOrderB.settings && toggle(lockChoiceOrderB.label),
226
- 'partB.choicesLayout': choicesLayoutB.settings && dropdown(choicesLayoutB.label, ['vertical', 'grid', 'horizontal']),
227
- 'partB.gridColumns': choicesLayoutB.settings && modelPartB.choicesLayout === 'grid' && nrOfColumnsAvailable.partB.length > 0 && dropdown(gridColumnsB.label, nrOfColumnsAvailable.partB)
228
- }), (0, _defineProperty2["default"])(_ref3, "Properties ".concat(secondPart), {
229
- 'partB.feedbackEnabled': feedbackB.settings && toggle(feedbackB.label),
230
- 'partB.promptEnabled': promptB.settings && toggle(promptB.label),
231
- 'partB.teacherInstructionsEnabled': teacherInstructionsB.settings && toggle(teacherInstructionsB.label),
232
- 'partB.studentInstructionsEnabled': studentInstructionsB.settings && toggle(studentInstructionsB.label),
233
- 'partB.rationaleEnabled': rationaleB.settings && toggle(rationaleB.label),
234
- 'partB.spellCheckEnabled': spellCheckB.settings && toggle(spellCheckB.label)
235
- }), _ref3)
238
+ 'Settings for both': panelSettings
239
+ }, (0, _defineProperty2["default"])(_ref3, "Settings ".concat(firstPart), panelSettingsPartA), (0, _defineProperty2["default"])(_ref3, "Properties ".concat(firstPart), panelPropertiesPartA), (0, _defineProperty2["default"])(_ref3, "Settings ".concat(secondPart), panelSettingsPartB), (0, _defineProperty2["default"])(_ref3, "Properties ".concat(secondPart), panelPropertiesPartB), _ref3)
236
240
  })
237
241
  }, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
238
242
  className: classes.part
239
- }, model.partLabels && /*#__PURE__*/_react["default"].createElement("p", null, firstPart), /*#__PURE__*/_react["default"].createElement("ebsr-multiple-choice-configure", {
243
+ }, model.partLabels && /*#__PURE__*/_react["default"].createElement("div", null, firstPart), /*#__PURE__*/_react["default"].createElement("ebsr-multiple-choice-configure", {
240
244
  id: "A",
241
245
  key: "partA",
242
246
  ref: function ref(_ref4) {
@@ -251,7 +255,7 @@ var Main = /*#__PURE__*/function (_React$Component) {
251
255
  }
252
256
  })), /*#__PURE__*/_react["default"].createElement("div", {
253
257
  className: classes.part
254
- }, model.partLabels && /*#__PURE__*/_react["default"].createElement("p", null, secondPart), /*#__PURE__*/_react["default"].createElement("ebsr-multiple-choice-configure", {
258
+ }, model.partLabels && /*#__PURE__*/_react["default"].createElement("div", null, secondPart), /*#__PURE__*/_react["default"].createElement("ebsr-multiple-choice-configure", {
255
259
  id: "B",
256
260
  key: "partB",
257
261
  ref: function ref(_ref5) {
@@ -264,7 +268,7 @@ var Main = /*#__PURE__*/function (_React$Component) {
264
268
  _this2.partB.configuration = _objectSpread(_objectSpread({}, partB), generalConfiguration);
265
269
  }
266
270
  }
267
- })))));
271
+ }))));
268
272
  }
269
273
  }]);
270
274
  return Main;
@@ -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","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","errors","React","Component","PropTypes","object","func","Styled"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;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,CAACC,KAAD;AAAA,SAAY;AACzBC,IAAAA,MAAM,EAAE;AACNC,MAAAA,UAAU,EAAEF,KAAK,CAACG,OAAN,CAAcC,IAAd,GAAqB;AAD3B,KADiB;AAIzBC,IAAAA,IAAI,EAAE;AACJC,MAAAA,OAAO,EAAE,MADL;AAEJC,MAAAA,aAAa,EAAE,QAFX;AAGJC,MAAAA,OAAO,EAAE;AAHL;AAJmB,GAAZ;AAAA,CAAf;;IAWaC,I;;;;;;;;;;;;;;;2GASU,UAACC,OAAD,EAAa;AAChC,UAAIC,YAAY,GAAG,KAAnB;AAEA,aAAO,CAACD,OAAO,IAAI,EAAZ,EAAgBE,GAAhB,CAAoB,UAACC,MAAD,EAAY;AACrC,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,OAXM,CAAP;AAYD,K;uGAEgB,UAACE,KAAD,EAAQC,GAAR,EAAgB;AAC/B,UAAQC,cAAR,GAA2B,MAAKC,KAAhC,CAAQD,cAAR;;AAEA,UAAID,GAAG,KAAK,kBAAR,IAA8BD,KAAK,CAACI,KAAN,CAAYC,UAAZ,KAA2B,O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E,QAAA,EAAE,EAAC,GADL;AAEE,QAAA,GAAG,EAAC,OAFN;AAGE,QAAA,GAAG,EAAE,aAACS,KAAD,EAAS;AACZ,cAAIA,KAAJ,EAAS;AACP;AACA,YAAA,MAAI,CAACtD,KAAL,GAAasD,KAAb;AACA,YAAA,MAAI,CAACtD,KAAL,CAAWuD,MAAX,mCACK,MAAI,CAAC3D,KAAL,CAAWH,KAAX,CAAiBO,KADtB;AAEEwD,cAAAA,MAAM,EAAG,MAAI,CAAC5D,KAAL,CAAWH,KAAX,CAAiB+D,MAAjB,IAA2B,MAAI,CAAC5D,KAAL,CAAWH,KAAX,CAAiB+D,MAAjB,CAAwBxD,KAApD,IAA8D;AAFxE;AAIA,YAAA,MAAI,CAACA,KAAL,CAAWE,aAAX,mCACKF,KADL,GAEKS,oBAFL;AAID;AACF;AAhBH,QAFF,CAvBF,CA9DF,CADF,CADF;AAgHD;;;EAzMuBgD,kBAAMC,S;;;iCAAnBvE,I,eACQ;AACjBc,EAAAA,OAAO,EAAE0D,sBAAUC,MADF;AAEjB1D,EAAAA,aAAa,EAAEyD,sBAAUC,MAFR;AAGjBnE,EAAAA,KAAK,EAAEkE,sBAAUC,MAHA;AAIjBjE,EAAAA,cAAc,EAAEgE,sBAAUE,IAJT;AAKjB1D,EAAAA,sBAAsB,EAAEwD,sBAAUE;AALjB,C;AA2MrB,IAAMC,MAAM,GAAG,wBAAWrF,MAAX,EAAmBU,IAAnB,CAAf;eAEe2E,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';\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 { classes, model, configuration, onConfigurationChanged } = 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:\n modelPartA.choices && modelPartA.choices.length\n ? Array.from({ length: modelPartA.choices.length }, (_, i) => `${i + 1}`)\n : [],\n partB:\n modelPartB.choices && modelPartB.choices.length\n ? Array.from({ length: modelPartB.choices.length }, (_, i) => `${i + 1}`)\n : [],\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: generalConfiguration.partLabels.settings && toggle(generalConfiguration.partLabels.label),\n partLabelType: model.partLabels && dropdown('', ['Numbers', 'Letters']),\n partialScoring: partialScoring.settings && toggle(partialScoring.label),\n scoringType: scoringType.settings && radio(scoringType.label, ['auto', 'rubric']),\n },\n [`Settings ${firstPart}`]: {\n 'partA.choiceMode': choiceModeA.settings && radio(choiceModeA.label, ['checkbox', 'radio']),\n 'partA.choicePrefix': choicePrefixA.settings && radio(choicePrefixA.label, ['numbers', 'letters']),\n 'partA.lockChoiceOrder': lockChoiceOrderA.settings && toggle(lockChoiceOrderA.label),\n 'partA.choicesLayout':\n choicesLayoutA.settings && dropdown(choicesLayoutA.label, ['vertical', 'grid', 'horizontal']),\n 'partA.gridColumns':\n choicesLayoutA.settings &&\n modelPartA.choicesLayout === 'grid' &&\n nrOfColumnsAvailable.partA.length > 0 &&\n dropdown(gridColumnsA.label, nrOfColumnsAvailable.partA),\n },\n [`Properties ${firstPart}`]: {\n 'partA.feedbackEnabled': feedbackA.settings && toggle(feedbackA.label),\n 'partA.promptEnabled': promptA.settings && toggle(promptA.label),\n 'partA.teacherInstructionsEnabled':\n teacherInstructionsA.settings && toggle(teacherInstructionsA.label),\n 'partA.studentInstructionsEnabled':\n studentInstructionsA.settings && toggle(studentInstructionsA.label),\n 'partA.rationaleEnabled': rationaleA.settings && toggle(rationaleA.label),\n 'partA.spellCheckEnabled': spellCheckA.settings && toggle(spellCheckA.label),\n },\n [`Settings ${secondPart}`]: {\n 'partB.choiceMode': choiceModeB.settings && radio(choiceModeB.label, ['checkbox', 'radio']),\n 'partB.choicePrefix': choicePrefixB.settings && radio(choicePrefixB.label, ['numbers', 'letters']),\n 'partB.lockChoiceOrder': lockChoiceOrderB.settings && toggle(lockChoiceOrderB.label),\n 'partB.choicesLayout':\n choicesLayoutB.settings && dropdown(choicesLayoutB.label, ['vertical', 'grid', 'horizontal']),\n 'partB.gridColumns':\n choicesLayoutB.settings &&\n modelPartB.choicesLayout === 'grid' &&\n nrOfColumnsAvailable.partB.length > 0 &&\n dropdown(gridColumnsB.label, nrOfColumnsAvailable.partB),\n },\n [`Properties ${secondPart}`]: {\n 'partB.feedbackEnabled': feedbackB.settings && toggle(feedbackB.label),\n 'partB.promptEnabled': promptB.settings && toggle(promptB.label),\n 'partB.teacherInstructionsEnabled':\n teacherInstructionsB.settings && toggle(teacherInstructionsB.label),\n 'partB.studentInstructionsEnabled':\n studentInstructionsB.settings && toggle(studentInstructionsB.label),\n 'partB.rationaleEnabled': rationaleB.settings && toggle(rationaleB.label),\n 'partB.spellCheckEnabled': 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 = {\n ...this.props.model.partA,\n errors: (this.props.model.errors && this.props.model.errors.partA) || {},\n };\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 = {\n ...this.props.model.partB,\n errors: (this.props.model.errors && this.props.model.errors.partB) || {},\n };\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","part","display","flexDirection","paddingTop","spacing","unit","Main","choices","correctFound","map","choice","correct","model","key","onModelChanged","props","partA","choiceMode","removeExtraChoices","partB","classes","configuration","onConfigurationChanged","partLabelType","modelPartA","modelPartB","partialScoring","settingsPanelDisabled","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","panelSettings","partLabels","label","panelSettingsPartA","panelPropertiesPartA","panelSettingsPartB","panelPropertiesPartB","ref","_model","errors","React","Component","PropTypes","object","func","Styled"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;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,CAACC,KAAD;AAAA,SAAY;AACzBC,IAAAA,IAAI,EAAE;AACJC,MAAAA,OAAO,EAAE,MADL;AAEJC,MAAAA,aAAa,EAAE,QAFX;AAGJ,6BAAuB;A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jB,IAA2B,MAAI,CAAClE,KAAL,CAAWH,KAAX,CAAiBqE,MAAjB,CAAwB9D,KAApD,IAA8D;AAFxE;AAIA,YAAA,MAAI,CAACA,KAAL,CAAWE,aAAX,mCACKF,KADL,GAEKU,oBAFL;AAID;AACF;AAhBH,QAFF,CAvBF,CAlBF,CADF;AAkED;;;EA9MuBqD,kBAAMC,S;;;iCAAnB7E,I,eACQ;AACjBc,EAAAA,OAAO,EAAEgE,sBAAUC,MADF;AAEjBhE,EAAAA,aAAa,EAAE+D,sBAAUC,MAFR;AAGjBzE,EAAAA,KAAK,EAAEwE,sBAAUC,MAHA;AAIjBvE,EAAAA,cAAc,EAAEsE,sBAAUE,IAJT;AAKjBhE,EAAAA,sBAAsB,EAAE8D,sBAAUE;AALjB,C;AAgNrB,IAAMC,MAAM,GAAG,wBAAWzF,MAAX,EAAmBQ,IAAnB,CAAf;eAEeiF,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';\n\nconst { Panel, toggle, radio, dropdown } = settings;\n\nconst styles = (theme) => ({\n part: {\n display: 'flex',\n flexDirection: 'column',\n '&:not(:first-child)': {\n paddingTop: theme.spacing.unit * 4,\n },\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\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 { classes, model, configuration, onConfigurationChanged } = this.props;\n const { partLabelType, partA: modelPartA, partB: modelPartB } = model;\n const { partA, partB, partialScoring, settingsPanelDisabled, 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\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:\n modelPartA.choices && modelPartA.choices.length\n ? Array.from({ length: modelPartA.choices.length }, (_, i) => `${i + 1}`)\n : [],\n partB:\n modelPartB.choices && modelPartB.choices.length\n ? Array.from({ length: modelPartB.choices.length }, (_, i) => `${i + 1}`)\n : [],\n };\n\n const panelSettings = {\n partLabels: generalConfiguration.partLabels.settings && toggle(generalConfiguration.partLabels.label),\n partLabelType: model.partLabels && dropdown('', ['Numbers', 'Letters']),\n partialScoring: partialScoring.settings && toggle(partialScoring.label),\n scoringType: scoringType.settings && radio(scoringType.label, ['auto', 'rubric']),\n };\n\n const panelSettingsPartA = {\n 'partA.choiceMode': choiceModeA.settings && radio(choiceModeA.label, ['checkbox', 'radio']),\n 'partA.choicePrefix': choicePrefixA.settings && radio(choicePrefixA.label, ['numbers', 'letters']),\n 'partA.lockChoiceOrder': lockChoiceOrderA.settings && toggle(lockChoiceOrderA.label),\n 'partA.choicesLayout':\n choicesLayoutA.settings && dropdown(choicesLayoutA.label, ['vertical', 'grid', 'horizontal']),\n 'partA.gridColumns':\n choicesLayoutA.settings &&\n modelPartA.choicesLayout === 'grid' &&\n nrOfColumnsAvailable.partA.length > 0 &&\n dropdown(gridColumnsA.label, nrOfColumnsAvailable.partA),\n };\n const panelPropertiesPartA = {\n 'partA.feedbackEnabled': feedbackA.settings && toggle(feedbackA.label),\n 'partA.promptEnabled': promptA.settings && toggle(promptA.label),\n 'partA.teacherInstructionsEnabled': teacherInstructionsA.settings && toggle(teacherInstructionsA.label),\n 'partA.studentInstructionsEnabled': studentInstructionsA.settings && toggle(studentInstructionsA.label),\n 'partA.rationaleEnabled': rationaleA.settings && toggle(rationaleA.label),\n 'partA.spellCheckEnabled': spellCheckA.settings && toggle(spellCheckA.label),\n };\n\n const panelSettingsPartB = {\n 'partB.choiceMode': choiceModeB.settings && radio(choiceModeB.label, ['checkbox', 'radio']),\n 'partB.choicePrefix': choicePrefixB.settings && radio(choicePrefixB.label, ['numbers', 'letters']),\n 'partB.lockChoiceOrder': lockChoiceOrderB.settings && toggle(lockChoiceOrderB.label),\n 'partB.choicesLayout':\n choicesLayoutB.settings && dropdown(choicesLayoutB.label, ['vertical', 'grid', 'horizontal']),\n 'partB.gridColumns':\n choicesLayoutB.settings &&\n modelPartB.choicesLayout === 'grid' &&\n nrOfColumnsAvailable.partB.length > 0 &&\n dropdown(gridColumnsB.label, nrOfColumnsAvailable.partB),\n };\n const panelPropertiesPartB = {\n 'partB.feedbackEnabled': feedbackB.settings && toggle(feedbackB.label),\n 'partB.promptEnabled': promptB.settings && toggle(promptB.label),\n 'partB.teacherInstructionsEnabled': teacherInstructionsB.settings && toggle(teacherInstructionsB.label),\n 'partB.studentInstructionsEnabled': studentInstructionsB.settings && toggle(studentInstructionsB.label),\n 'partB.rationaleEnabled': rationaleB.settings && toggle(rationaleB.label),\n 'partB.spellCheckEnabled': spellCheckB.settings && toggle(spellCheckB.label),\n };\n\n return (\n <layout.ConfigLayout\n hideSettings={settingsPanelDisabled}\n settings={\n <Panel\n model={model}\n onChangeModel={this.onModelChanged}\n configuration={configuration}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n 'Settings for both': panelSettings,\n [`Settings ${firstPart}`]: panelSettingsPartA,\n [`Properties ${firstPart}`]: panelPropertiesPartA,\n [`Settings ${secondPart}`]: panelSettingsPartB,\n [`Properties ${secondPart}`]: panelPropertiesPartB,\n }}\n />\n }\n >\n <div>\n <div className={classes.part}>\n {model.partLabels && <div>{firstPart}</div>}\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 = {\n ...this.props.model.partA,\n errors: (this.props.model.errors && this.props.model.errors.partA) || {},\n };\n this.partA.configuration = {\n ...partA,\n ...generalConfiguration,\n };\n }\n }}\n />\n </div>\n\n <div className={classes.part}>\n {model.partLabels && <div>{secondPart}</div>}\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 = {\n ...this.props.model.partB,\n errors: (this.props.model.errors && this.props.model.errors.partB) || {},\n };\n this.partB.configuration = {\n ...partB,\n ...generalConfiguration,\n };\n }\n }}\n />\n </div>\n </div>\n </layout.ConfigLayout>\n );\n }\n}\n\nconst Styled = withStyles(styles)(Main);\n\nexport default Styled;\n"],"file":"main.js"}
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@pie-element/ebsr-configure",
3
3
  "private": true,
4
- "version": "8.2.8",
4
+ "version": "8.3.0",
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": "^7.4.1",
11
+ "@pie-element/multiple-choice": "^7.5.0",
12
12
  "@pie-framework/pie-configure-events": "^1.2.0",
13
- "@pie-lib/config-ui": "^11.1.4",
13
+ "@pie-lib/config-ui": "^11.2.2",
14
14
  "lodash": "^4.17.15",
15
15
  "prop-types": "^15.6.2",
16
16
  "react": "^16.8.1",
@@ -32,6 +32,7 @@ const defaultConfig = {
32
32
  settings: true,
33
33
  label: 'Rationale',
34
34
  },
35
+ settingsPanelDisabled: true,
35
36
  studentInstructions: {
36
37
  settings: false,
37
38
  label: 'Student Instructions',
@@ -110,6 +111,6 @@ export default {
110
111
  settings: true,
111
112
  label: 'Part Labels',
112
113
  },
113
- settingsPanelDisabled: true,
114
+ settingsPanelDisabled: false,
114
115
  },
115
116
  };
@@ -130,6 +130,7 @@ export default class EbsrConfigure extends HTMLElement {
130
130
  onModelChanged: this.onModelChanged,
131
131
  onConfigurationChanged: this.onConfigurationChanged,
132
132
  });
133
+
133
134
  ReactDOM.render(element, this);
134
135
  }
135
136
  }
@@ -6,13 +6,12 @@ import { withStyles } from '@material-ui/core/styles';
6
6
  const { Panel, toggle, radio, dropdown } = settings;
7
7
 
8
8
  const styles = (theme) => ({
9
- design: {
10
- paddingTop: theme.spacing.unit * 3,
11
- },
12
9
  part: {
13
10
  display: 'flex',
14
11
  flexDirection: 'column',
15
- padding: '16px 0 32px',
12
+ '&:not(:first-child)': {
13
+ paddingTop: theme.spacing.unit * 4,
14
+ },
16
15
  },
17
16
  });
18
17
 
@@ -31,6 +30,7 @@ export class Main extends React.Component {
31
30
  return (choices || []).map((choice) => {
32
31
  if (correctFound) {
33
32
  choice.correct = false;
33
+
34
34
  return choice;
35
35
  }
36
36
 
@@ -63,7 +63,7 @@ export class Main extends React.Component {
63
63
  render() {
64
64
  const { classes, model, configuration, onConfigurationChanged } = this.props;
65
65
  const { partLabelType, partA: modelPartA, partB: modelPartB } = model;
66
- const { partA, partB, partialScoring, scoringType, ...generalConfiguration } = configuration;
66
+ const { partA, partB, partialScoring, settingsPanelDisabled, scoringType, ...generalConfiguration } = configuration;
67
67
  const {
68
68
  feedback: feedbackA = {},
69
69
  choiceMode: choiceModeA = {},
@@ -90,6 +90,7 @@ export class Main extends React.Component {
90
90
  rationale: rationaleB = {},
91
91
  spellCheck: spellCheckB = {},
92
92
  } = partB || {};
93
+
93
94
  const type = partLabelType || 'Numbers';
94
95
  const typeIsNumber = type === 'Numbers';
95
96
  const firstPart = `Part ${typeIsNumber ? '1' : 'A'}`;
@@ -105,117 +106,120 @@ export class Main extends React.Component {
105
106
  : [],
106
107
  };
107
108
 
109
+ const panelSettings = {
110
+ partLabels: generalConfiguration.partLabels.settings && toggle(generalConfiguration.partLabels.label),
111
+ partLabelType: model.partLabels && dropdown('', ['Numbers', 'Letters']),
112
+ partialScoring: partialScoring.settings && toggle(partialScoring.label),
113
+ scoringType: scoringType.settings && radio(scoringType.label, ['auto', 'rubric']),
114
+ };
115
+
116
+ const panelSettingsPartA = {
117
+ 'partA.choiceMode': choiceModeA.settings && radio(choiceModeA.label, ['checkbox', 'radio']),
118
+ 'partA.choicePrefix': choicePrefixA.settings && radio(choicePrefixA.label, ['numbers', 'letters']),
119
+ 'partA.lockChoiceOrder': lockChoiceOrderA.settings && toggle(lockChoiceOrderA.label),
120
+ 'partA.choicesLayout':
121
+ choicesLayoutA.settings && dropdown(choicesLayoutA.label, ['vertical', 'grid', 'horizontal']),
122
+ 'partA.gridColumns':
123
+ choicesLayoutA.settings &&
124
+ modelPartA.choicesLayout === 'grid' &&
125
+ nrOfColumnsAvailable.partA.length > 0 &&
126
+ dropdown(gridColumnsA.label, nrOfColumnsAvailable.partA),
127
+ };
128
+ const panelPropertiesPartA = {
129
+ 'partA.feedbackEnabled': feedbackA.settings && toggle(feedbackA.label),
130
+ 'partA.promptEnabled': promptA.settings && toggle(promptA.label),
131
+ 'partA.teacherInstructionsEnabled': teacherInstructionsA.settings && toggle(teacherInstructionsA.label),
132
+ 'partA.studentInstructionsEnabled': studentInstructionsA.settings && toggle(studentInstructionsA.label),
133
+ 'partA.rationaleEnabled': rationaleA.settings && toggle(rationaleA.label),
134
+ 'partA.spellCheckEnabled': spellCheckA.settings && toggle(spellCheckA.label),
135
+ };
136
+
137
+ const panelSettingsPartB = {
138
+ 'partB.choiceMode': choiceModeB.settings && radio(choiceModeB.label, ['checkbox', 'radio']),
139
+ 'partB.choicePrefix': choicePrefixB.settings && radio(choicePrefixB.label, ['numbers', 'letters']),
140
+ 'partB.lockChoiceOrder': lockChoiceOrderB.settings && toggle(lockChoiceOrderB.label),
141
+ 'partB.choicesLayout':
142
+ choicesLayoutB.settings && dropdown(choicesLayoutB.label, ['vertical', 'grid', 'horizontal']),
143
+ 'partB.gridColumns':
144
+ choicesLayoutB.settings &&
145
+ modelPartB.choicesLayout === 'grid' &&
146
+ nrOfColumnsAvailable.partB.length > 0 &&
147
+ dropdown(gridColumnsB.label, nrOfColumnsAvailable.partB),
148
+ };
149
+ const panelPropertiesPartB = {
150
+ 'partB.feedbackEnabled': feedbackB.settings && toggle(feedbackB.label),
151
+ 'partB.promptEnabled': promptB.settings && toggle(promptB.label),
152
+ 'partB.teacherInstructionsEnabled': teacherInstructionsB.settings && toggle(teacherInstructionsB.label),
153
+ 'partB.studentInstructionsEnabled': studentInstructionsB.settings && toggle(studentInstructionsB.label),
154
+ 'partB.rationaleEnabled': rationaleB.settings && toggle(rationaleB.label),
155
+ 'partB.spellCheckEnabled': spellCheckB.settings && toggle(spellCheckB.label),
156
+ };
157
+
108
158
  return (
109
- <div className={classes.design}>
110
- <layout.ConfigLayout
111
- settings={
112
- <Panel
113
- model={model}
114
- onChangeModel={this.onModelChanged}
115
- configuration={configuration}
116
- onChangeConfiguration={onConfigurationChanged}
117
- groups={{
118
- 'Settings for both': {
119
- partLabels: generalConfiguration.partLabels.settings && toggle(generalConfiguration.partLabels.label),
120
- partLabelType: model.partLabels && dropdown('', ['Numbers', 'Letters']),
121
- partialScoring: partialScoring.settings && toggle(partialScoring.label),
122
- scoringType: scoringType.settings && radio(scoringType.label, ['auto', 'rubric']),
123
- },
124
- [`Settings ${firstPart}`]: {
125
- 'partA.choiceMode': choiceModeA.settings && radio(choiceModeA.label, ['checkbox', 'radio']),
126
- 'partA.choicePrefix': choicePrefixA.settings && radio(choicePrefixA.label, ['numbers', 'letters']),
127
- 'partA.lockChoiceOrder': lockChoiceOrderA.settings && toggle(lockChoiceOrderA.label),
128
- 'partA.choicesLayout':
129
- choicesLayoutA.settings && dropdown(choicesLayoutA.label, ['vertical', 'grid', 'horizontal']),
130
- 'partA.gridColumns':
131
- choicesLayoutA.settings &&
132
- modelPartA.choicesLayout === 'grid' &&
133
- nrOfColumnsAvailable.partA.length > 0 &&
134
- dropdown(gridColumnsA.label, nrOfColumnsAvailable.partA),
135
- },
136
- [`Properties ${firstPart}`]: {
137
- 'partA.feedbackEnabled': feedbackA.settings && toggle(feedbackA.label),
138
- 'partA.promptEnabled': promptA.settings && toggle(promptA.label),
139
- 'partA.teacherInstructionsEnabled':
140
- teacherInstructionsA.settings && toggle(teacherInstructionsA.label),
141
- 'partA.studentInstructionsEnabled':
142
- studentInstructionsA.settings && toggle(studentInstructionsA.label),
143
- 'partA.rationaleEnabled': rationaleA.settings && toggle(rationaleA.label),
144
- 'partA.spellCheckEnabled': spellCheckA.settings && toggle(spellCheckA.label),
145
- },
146
- [`Settings ${secondPart}`]: {
147
- 'partB.choiceMode': choiceModeB.settings && radio(choiceModeB.label, ['checkbox', 'radio']),
148
- 'partB.choicePrefix': choicePrefixB.settings && radio(choicePrefixB.label, ['numbers', 'letters']),
149
- 'partB.lockChoiceOrder': lockChoiceOrderB.settings && toggle(lockChoiceOrderB.label),
150
- 'partB.choicesLayout':
151
- choicesLayoutB.settings && dropdown(choicesLayoutB.label, ['vertical', 'grid', 'horizontal']),
152
- 'partB.gridColumns':
153
- choicesLayoutB.settings &&
154
- modelPartB.choicesLayout === 'grid' &&
155
- nrOfColumnsAvailable.partB.length > 0 &&
156
- dropdown(gridColumnsB.label, nrOfColumnsAvailable.partB),
157
- },
158
- [`Properties ${secondPart}`]: {
159
- 'partB.feedbackEnabled': feedbackB.settings && toggle(feedbackB.label),
160
- 'partB.promptEnabled': promptB.settings && toggle(promptB.label),
161
- 'partB.teacherInstructionsEnabled':
162
- teacherInstructionsB.settings && toggle(teacherInstructionsB.label),
163
- 'partB.studentInstructionsEnabled':
164
- studentInstructionsB.settings && toggle(studentInstructionsB.label),
165
- 'partB.rationaleEnabled': rationaleB.settings && toggle(rationaleB.label),
166
- 'partB.spellCheckEnabled': spellCheckB.settings && toggle(spellCheckB.label),
167
- },
159
+ <layout.ConfigLayout
160
+ hideSettings={settingsPanelDisabled}
161
+ settings={
162
+ <Panel
163
+ model={model}
164
+ onChangeModel={this.onModelChanged}
165
+ configuration={configuration}
166
+ onChangeConfiguration={onConfigurationChanged}
167
+ groups={{
168
+ 'Settings for both': panelSettings,
169
+ [`Settings ${firstPart}`]: panelSettingsPartA,
170
+ [`Properties ${firstPart}`]: panelPropertiesPartA,
171
+ [`Settings ${secondPart}`]: panelSettingsPartB,
172
+ [`Properties ${secondPart}`]: panelPropertiesPartB,
173
+ }}
174
+ />
175
+ }
176
+ >
177
+ <div>
178
+ <div className={classes.part}>
179
+ {model.partLabels && <div>{firstPart}</div>}
180
+ <ebsr-multiple-choice-configure
181
+ id="A"
182
+ key="partA"
183
+ ref={(ref) => {
184
+ if (ref) {
185
+ // do not use destructuring to get model from props
186
+ this.partA = ref;
187
+ this.partA._model = {
188
+ ...this.props.model.partA,
189
+ errors: (this.props.model.errors && this.props.model.errors.partA) || {},
190
+ };
191
+ this.partA.configuration = {
192
+ ...partA,
193
+ ...generalConfiguration,
194
+ };
195
+ }
196
+ }}
197
+ />
198
+ </div>
199
+
200
+ <div className={classes.part}>
201
+ {model.partLabels && <div>{secondPart}</div>}
202
+ <ebsr-multiple-choice-configure
203
+ id="B"
204
+ key="partB"
205
+ ref={(ref) => {
206
+ if (ref) {
207
+ // do not use destructuring to get model from props
208
+ this.partB = ref;
209
+ this.partB._model = {
210
+ ...this.props.model.partB,
211
+ errors: (this.props.model.errors && this.props.model.errors.partB) || {},
212
+ };
213
+ this.partB.configuration = {
214
+ ...partB,
215
+ ...generalConfiguration,
216
+ };
217
+ }
168
218
  }}
169
219
  />
170
- }
171
- >
172
- <div>
173
- <div className={classes.part}>
174
- {model.partLabels && <p>{firstPart}</p>}
175
- <ebsr-multiple-choice-configure
176
- id="A"
177
- key="partA"
178
- ref={(ref) => {
179
- if (ref) {
180
- // do not use destructuring to get model from props
181
- this.partA = ref;
182
- this.partA._model = {
183
- ...this.props.model.partA,
184
- errors: (this.props.model.errors && this.props.model.errors.partA) || {},
185
- };
186
- this.partA.configuration = {
187
- ...partA,
188
- ...generalConfiguration,
189
- };
190
- }
191
- }}
192
- />
193
- </div>
194
-
195
- <div className={classes.part}>
196
- {model.partLabels && <p>{secondPart}</p>}
197
- <ebsr-multiple-choice-configure
198
- id="B"
199
- key="partB"
200
- ref={(ref) => {
201
- if (ref) {
202
- // do not use destructuring to get model from props
203
- this.partB = ref;
204
- this.partB._model = {
205
- ...this.props.model.partB,
206
- errors: (this.props.model.errors && this.props.model.errors.partB) || {},
207
- };
208
- this.partB.configuration = {
209
- ...partB,
210
- ...generalConfiguration,
211
- };
212
- }
213
- }}
214
- />
215
- </div>
216
220
  </div>
217
- </layout.ConfigLayout>
218
- </div>
221
+ </div>
222
+ </layout.ConfigLayout>
219
223
  );
220
224
  }
221
225
  }
@@ -119,6 +119,11 @@
119
119
  }
120
120
  }
121
121
  },
122
+ "settingsPanelDisabled": {
123
+ "description": "Indicates if the settings panel is not available",
124
+ "type": "boolean",
125
+ "title": "settingsPanelDisabled"
126
+ },
122
127
  "spellCheck": {
123
128
  "title": "ConfigureProp",
124
129
  "type": "object",
@@ -395,6 +400,11 @@
395
400
  }
396
401
  }
397
402
  },
403
+ "settingsPanelDisabled": {
404
+ "description": "Indicates if the settings panel is not available",
405
+ "type": "boolean",
406
+ "title": "settingsPanelDisabled"
407
+ },
398
408
  "spellCheck": {
399
409
  "title": "ConfigureProp",
400
410
  "type": "object",
@@ -587,6 +597,11 @@
587
597
  }
588
598
  }
589
599
  },
600
+ "settingsPanelDisabled": {
601
+ "description": "Indicates if the settings panel is not available",
602
+ "type": "boolean",
603
+ "title": "settingsPanelDisabled"
604
+ },
590
605
  "scoringType": {
591
606
  "title": "ConfigureProp",
592
607
  "type": "object",
@@ -737,6 +752,11 @@
737
752
  }
738
753
  }
739
754
  },
755
+ "settingsPanelDisabled": {
756
+ "description": "Indicates if the settings panel is not available",
757
+ "type": "boolean",
758
+ "title": "settingsPanelDisabled"
759
+ },
740
760
  "spellCheck": {
741
761
  "title": "ConfigureProp",
742
762
  "type": "object",
@@ -90,6 +90,10 @@ 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
+ ## `settingsPanelDisabled` (boolean)
94
+
95
+ Indicates if the settings panel is not available
96
+
93
97
  ## `spellCheck` (object)
94
98
 
95
99
  Properties of the `spellCheck` object:
@@ -298,6 +302,10 @@ Indicates if the item has to be displayed in the Settings Panel
298
302
 
299
303
  Indicates the label for the item that has to be displayed in the Settings Panel
300
304
 
305
+ ## `settingsPanelDisabled` (boolean)
306
+
307
+ Indicates if the settings panel is not available
308
+
301
309
  ## `spellCheck` (object)
302
310
 
303
311
  Properties of the `spellCheck` object:
@@ -442,6 +450,10 @@ Indicates if the item has to be displayed in the Settings Panel
442
450
 
443
451
  Indicates the label for the item that has to be displayed in the Settings Panel
444
452
 
453
+ # `settingsPanelDisabled` (boolean)
454
+
455
+ Indicates if the settings panel is not available
456
+
445
457
  # `scoringType` (object)
446
458
 
447
459
  Properties of the `scoringType` object:
@@ -560,6 +572,10 @@ Indicates if the item has to be displayed in the Settings Panel
560
572
 
561
573
  Indicates the label for the item that has to be displayed in the Settings Panel
562
574
 
575
+ ### `settingsPanelDisabled` (boolean)
576
+
577
+ Indicates if the settings panel is not available
578
+
563
579
  ### `spellCheck` (object)
564
580
 
565
581
  Properties of the `spellCheck` object:
@@ -399,6 +399,11 @@
399
399
  }
400
400
  }
401
401
  },
402
+ "settingsPanelDisabled": {
403
+ "description": "Indicates if the settings panel is not available",
404
+ "type": "boolean",
405
+ "title": "settingsPanelDisabled"
406
+ },
402
407
  "spellCheck": {
403
408
  "title": "ConfigureProp",
404
409
  "type": "object",
@@ -298,6 +298,10 @@ Indicates if the item has to be displayed in the Settings Panel
298
298
 
299
299
  Indicates the label for the item that has to be displayed in the Settings Panel
300
300
 
301
+ ### `settingsPanelDisabled` (boolean)
302
+
303
+ Indicates if the settings panel is not available
304
+
301
305
  ### `spellCheck` (object)
302
306
 
303
307
  Properties of the `spellCheck` object:
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@pie-element/ebsr",
3
- "version": "8.3.2-next.31+80da0617c",
3
+ "version": "8.4.2",
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": "^7.4.2-next.31+80da0617c",
10
+ "@pie-element/multiple-choice": "^7.5.0",
11
11
  "@pie-framework/pie-player-events": "^0.1.0",
12
12
  "classnames": "^2.2.5",
13
13
  "debug": "^4.1.1",
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "author": "pie framework developers",
17
17
  "license": "ISC",
18
- "gitHead": "80da0617ca8a9fe53b8b7cb8f64e635af84bf4be",
18
+ "gitHead": "39d984245e60a46166922a56a6d56adf7d2e570d",
19
19
  "scripts": {
20
20
  "postpublish": "../../scripts/postpublish"
21
21
  },