@pie-element/ebsr 11.0.0 → 12.0.1-esmbeta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/configure/CHANGELOG.md +8 -0
- package/configure/node_modules/@pie-element/multiple-choice/CHANGELOG.json +1972 -0
- package/configure/node_modules/@pie-element/multiple-choice/CHANGELOG.md +4186 -0
- package/configure/node_modules/@pie-element/multiple-choice/LICENSE.md +5 -0
- package/configure/node_modules/@pie-element/multiple-choice/PRINT.md +35 -0
- package/configure/node_modules/@pie-element/multiple-choice/README.md +56 -0
- package/configure/node_modules/@pie-element/multiple-choice/choice.png +0 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/CHANGELOG.json +1387 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/CHANGELOG.md +3332 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/defaults.js +202 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/defaults.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/index.js +248 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/main.js +597 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/main.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/utils.js +18 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/utils.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/package.json +20 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/CHANGELOG.json +527 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/CHANGELOG.md +2297 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/defaults.js +34 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/defaults.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/index.js +346 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/utils.js +28 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/utils.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/package.json +15 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/config-schema.json +2993 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/config-schema.json.md +2217 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/demo/config.js +8 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/demo/generate.js +61 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/demo/index.html +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/demo/session.js +7 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/pie-schema.json +1332 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/pie-schema.json.md +1015 -0
- package/configure/node_modules/@pie-element/multiple-choice/esm/configure.css +847 -0
- package/configure/node_modules/@pie-element/multiple-choice/esm/configure.js +1218 -0
- package/configure/node_modules/@pie-element/multiple-choice/esm/configure.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/esm/controller.css +847 -0
- package/configure/node_modules/@pie-element/multiple-choice/esm/controller.js +324 -0
- package/configure/node_modules/@pie-element/multiple-choice/esm/controller.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/esm/element.css +847 -0
- package/configure/node_modules/@pie-element/multiple-choice/esm/element.js +3287 -0
- package/configure/node_modules/@pie-element/multiple-choice/esm/element.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/esm/print.css +847 -0
- package/configure/node_modules/@pie-element/multiple-choice/esm/print.js +3017 -0
- package/configure/node_modules/@pie-element/multiple-choice/esm/print.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/choice-input.js +427 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/choice-input.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/choice.js +252 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/choice.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/feedback-tick.js +174 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/feedback-tick.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/index.js +388 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/main.js +108 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/main.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/multiple-choice.js +469 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/multiple-choice.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/print.js +129 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/print.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/session-updater.js +48 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/session-updater.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/module/configure.js +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/module/controller.js +3472 -0
- package/configure/node_modules/@pie-element/multiple-choice/module/demo.js +86 -0
- package/configure/node_modules/@pie-element/multiple-choice/module/element.js +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/module/index.html +21 -0
- package/configure/node_modules/@pie-element/multiple-choice/module/index.js +2 -0
- package/configure/node_modules/@pie-element/multiple-choice/module/manifest.json +10 -0
- package/configure/node_modules/@pie-element/multiple-choice/module/print-demo.js +124 -0
- package/configure/node_modules/@pie-element/multiple-choice/module/print.html +18 -0
- package/configure/node_modules/@pie-element/multiple-choice/module/print.js +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/package.json +53 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/CHANGELOG.json +1 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/CHANGELOG.md +898 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/NEXT.CHANGELOG.json +1 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/esm/index.js +262 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/esm/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/lib/expander.js +88 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/lib/expander.js.map +1 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/lib/index.js +181 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/lib/styles.js +66 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/lib/styles.js.map +1 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/package.json +44 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/src/__tests__/index.test.jsx +99 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/src/expander.jsx +61 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/src/index.jsx +98 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/src/styles.js +61 -0
- package/configure/node_modules/@pie-lib/icons/CHANGELOG.json +1 -0
- package/configure/node_modules/@pie-lib/icons/CHANGELOG.md +539 -0
- package/configure/node_modules/@pie-lib/icons/NEXT.CHANGELOG.json +1 -0
- package/configure/node_modules/@pie-lib/icons/esm/index.js +1153 -0
- package/configure/node_modules/@pie-lib/icons/esm/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/icons/lib/correct-icon.js +89 -0
- package/configure/node_modules/@pie-lib/icons/lib/correct-icon.js.map +1 -0
- package/configure/node_modules/@pie-lib/icons/lib/correct-response-icon.js +153 -0
- package/configure/node_modules/@pie-lib/icons/lib/correct-response-icon.js.map +1 -0
- package/configure/node_modules/@pie-lib/icons/lib/icon-base.js +206 -0
- package/configure/node_modules/@pie-lib/icons/lib/icon-base.js.map +1 -0
- package/configure/node_modules/@pie-lib/icons/lib/icon-root.js +130 -0
- package/configure/node_modules/@pie-lib/icons/lib/icon-root.js.map +1 -0
- package/configure/node_modules/@pie-lib/icons/lib/incorrect-icon.js +92 -0
- package/configure/node_modules/@pie-lib/icons/lib/incorrect-icon.js.map +1 -0
- package/configure/node_modules/@pie-lib/icons/lib/index.js +72 -0
- package/configure/node_modules/@pie-lib/icons/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/icons/lib/instructions-icon.js +229 -0
- package/configure/node_modules/@pie-lib/icons/lib/instructions-icon.js.map +1 -0
- package/configure/node_modules/@pie-lib/icons/lib/learn-more-icon.js +145 -0
- package/configure/node_modules/@pie-lib/icons/lib/learn-more-icon.js.map +1 -0
- package/configure/node_modules/@pie-lib/icons/lib/nothing-submitted-icon.js +183 -0
- package/configure/node_modules/@pie-lib/icons/lib/nothing-submitted-icon.js.map +1 -0
- package/configure/node_modules/@pie-lib/icons/lib/partially-correct-icon.js +82 -0
- package/configure/node_modules/@pie-lib/icons/lib/partially-correct-icon.js.map +1 -0
- package/configure/node_modules/@pie-lib/icons/lib/show-rationale-icon.js +206 -0
- package/configure/node_modules/@pie-lib/icons/lib/show-rationale-icon.js.map +1 -0
- package/configure/node_modules/@pie-lib/icons/lib/sized.js +41 -0
- package/configure/node_modules/@pie-lib/icons/lib/sized.js.map +1 -0
- package/configure/node_modules/@pie-lib/icons/package.json +35 -0
- package/configure/node_modules/@pie-lib/icons/src/__tests__/index.test.js +3 -0
- package/configure/node_modules/@pie-lib/icons/src/correct-icon.jsx +64 -0
- package/configure/node_modules/@pie-lib/icons/src/correct-response-icon.jsx +121 -0
- package/configure/node_modules/@pie-lib/icons/src/icon-base.jsx +158 -0
- package/configure/node_modules/@pie-lib/icons/src/icon-root.jsx +76 -0
- package/configure/node_modules/@pie-lib/icons/src/incorrect-icon.jsx +61 -0
- package/configure/node_modules/@pie-lib/icons/src/index.js +19 -0
- package/configure/node_modules/@pie-lib/icons/src/instructions-icon.jsx +189 -0
- package/configure/node_modules/@pie-lib/icons/src/learn-more-icon.jsx +107 -0
- package/configure/node_modules/@pie-lib/icons/src/nothing-submitted-icon.jsx +130 -0
- package/configure/node_modules/@pie-lib/icons/src/partially-correct-icon.jsx +49 -0
- package/configure/node_modules/@pie-lib/icons/src/show-rationale-icon.jsx +152 -0
- package/configure/node_modules/@pie-lib/icons/src/sized.jsx +25 -0
- package/configure/node_modules/@pie-lib/math-rendering/CHANGELOG.json +1 -0
- package/configure/node_modules/@pie-lib/math-rendering/CHANGELOG.md +775 -0
- package/configure/node_modules/@pie-lib/math-rendering/NEXT.CHANGELOG.json +1 -0
- package/configure/node_modules/@pie-lib/math-rendering/esm/index.js +690 -0
- package/configure/node_modules/@pie-lib/math-rendering/esm/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/index.js +38 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/mml-to-latex.js +15 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/mml-to-latex.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/chtml.js +296 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/chtml.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/index.js +23 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/mml.js +109 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/mml.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/normalization.js +95 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/normalization.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/render-math.js +438 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/render-math.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-rendering/package.json +28 -0
- package/configure/node_modules/@pie-lib/math-rendering/src/__tests__/mml-to-latex.test.js +14 -0
- package/configure/node_modules/@pie-lib/math-rendering/src/__tests__/normalization.test.js +50 -0
- package/configure/node_modules/@pie-lib/math-rendering/src/__tests__/render-math.test.js +155 -0
- package/configure/node_modules/@pie-lib/math-rendering/src/index.js +5 -0
- package/configure/node_modules/@pie-lib/math-rendering/src/mml-to-latex.js +2 -0
- package/configure/node_modules/@pie-lib/math-rendering/src/mstack/__tests__/__snapshots__/chtml.test.js.snap +9 -0
- package/configure/node_modules/@pie-lib/math-rendering/src/mstack/__tests__/chtml.test.js +104 -0
- package/configure/node_modules/@pie-lib/math-rendering/src/mstack/chtml.js +220 -0
- package/configure/node_modules/@pie-lib/math-rendering/src/mstack/index.js +13 -0
- package/configure/node_modules/@pie-lib/math-rendering/src/mstack/mml.js +24 -0
- package/configure/node_modules/@pie-lib/math-rendering/src/normalization.js +69 -0
- package/configure/node_modules/@pie-lib/math-rendering/src/render-math.js +387 -0
- package/configure/node_modules/@pie-lib/render-ui/CHANGELOG.json +1 -0
- package/configure/node_modules/@pie-lib/render-ui/CHANGELOG.md +1026 -0
- package/configure/node_modules/@pie-lib/render-ui/NEXT.CHANGELOG.json +1 -0
- package/configure/node_modules/@pie-lib/render-ui/esm/index.js +1616 -0
- package/configure/node_modules/@pie-lib/render-ui/esm/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/append-css-rules.js +88 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/append-css-rules.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/assets/enableAudioAutoplayImage.js +9 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/assets/enableAudioAutoplayImage.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/collapsible/index.js +135 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/collapsible/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/color.js +344 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/color.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/feedback.js +150 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/feedback.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/has-media.js +27 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/has-media.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/has-text.js +28 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/has-text.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/html-and-math.js +74 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/html-and-math.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/index.js +136 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/input-container.js +60 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/input-container.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/preview-layout.js +145 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/preview-layout.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/preview-prompt.js +321 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/preview-prompt.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/purpose.js +28 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/purpose.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/readable.js +28 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/readable.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/response-indicators.js +151 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/response-indicators.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/ui-layout.js +122 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/ui-layout.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/withUndoReset.js +181 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/withUndoReset.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/package.json +40 -0
- package/configure/node_modules/@pie-lib/render-ui/src/__tests__/__snapshots__/html-and-math.test.js.snap +11 -0
- package/configure/node_modules/@pie-lib/render-ui/src/__tests__/__snapshots__/preview-prompt.test.jsx.snap +37 -0
- package/configure/node_modules/@pie-lib/render-ui/src/__tests__/__snapshots__/purpose.test.jsx.snap +42 -0
- package/configure/node_modules/@pie-lib/render-ui/src/__tests__/__snapshots__/readable.test.jsx.snap +64 -0
- package/configure/node_modules/@pie-lib/render-ui/src/__tests__/__snapshots__/response-indicators.test.jsx.snap +27 -0
- package/configure/node_modules/@pie-lib/render-ui/src/__tests__/color.test.js +12 -0
- package/configure/node_modules/@pie-lib/render-ui/src/__tests__/has-media.test.js +20 -0
- package/configure/node_modules/@pie-lib/render-ui/src/__tests__/has-text.test.js +21 -0
- package/configure/node_modules/@pie-lib/render-ui/src/__tests__/html-and-math.test.js +24 -0
- package/configure/node_modules/@pie-lib/render-ui/src/__tests__/preview-prompt.test.jsx +56 -0
- package/configure/node_modules/@pie-lib/render-ui/src/__tests__/purpose.test.jsx +47 -0
- package/configure/node_modules/@pie-lib/render-ui/src/__tests__/readable.test.jsx +64 -0
- package/configure/node_modules/@pie-lib/render-ui/src/__tests__/response-indicators.test.jsx +16 -0
- package/configure/node_modules/@pie-lib/render-ui/src/__tests__/ui-layout.test.jsx +34 -0
- package/configure/node_modules/@pie-lib/render-ui/src/__tests__/withUndoReset.test.jsx +254 -0
- package/configure/node_modules/@pie-lib/render-ui/src/append-css-rules.js +51 -0
- package/configure/node_modules/@pie-lib/render-ui/src/assets/enableAudioAutoplayImage.js +1 -0
- package/configure/node_modules/@pie-lib/render-ui/src/collapsible/__tests__/__snapshots__/index.test.jsx.snap +18 -0
- package/configure/node_modules/@pie-lib/render-ui/src/collapsible/__tests__/index.test.jsx +13 -0
- package/configure/node_modules/@pie-lib/render-ui/src/collapsible/index.jsx +64 -0
- package/configure/node_modules/@pie-lib/render-ui/src/color.js +121 -0
- package/configure/node_modules/@pie-lib/render-ui/src/feedback.jsx +99 -0
- package/configure/node_modules/@pie-lib/render-ui/src/has-media.js +16 -0
- package/configure/node_modules/@pie-lib/render-ui/src/has-text.js +18 -0
- package/configure/node_modules/@pie-lib/render-ui/src/html-and-math.js +21 -0
- package/configure/node_modules/@pie-lib/render-ui/src/index.js +35 -0
- package/configure/node_modules/@pie-lib/render-ui/src/input-container.jsx +41 -0
- package/configure/node_modules/@pie-lib/render-ui/src/preview-layout.jsx +95 -0
- package/configure/node_modules/@pie-lib/render-ui/src/preview-prompt.jsx +254 -0
- package/configure/node_modules/@pie-lib/render-ui/src/purpose.jsx +17 -0
- package/configure/node_modules/@pie-lib/render-ui/src/readable.jsx +19 -0
- package/configure/node_modules/@pie-lib/render-ui/src/response-indicators.jsx +89 -0
- package/configure/node_modules/@pie-lib/render-ui/src/ui-layout.jsx +66 -0
- package/configure/node_modules/@pie-lib/render-ui/src/withUndoReset.jsx +116 -0
- package/configure/node_modules/@pie-lib/test-utils/CHANGELOG.json +1 -0
- package/configure/node_modules/@pie-lib/test-utils/CHANGELOG.md +410 -0
- package/configure/node_modules/@pie-lib/test-utils/NEXT.CHANGELOG.json +1 -0
- package/configure/node_modules/@pie-lib/test-utils/esm/index.js +39 -0
- package/configure/node_modules/@pie-lib/test-utils/esm/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/test-utils/lib/index.js +40 -0
- package/configure/node_modules/@pie-lib/test-utils/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/test-utils/package.json +25 -0
- package/configure/node_modules/@pie-lib/test-utils/src/__tests__/index.test.js +45 -0
- package/configure/node_modules/@pie-lib/test-utils/src/index.js +18 -0
- package/configure/node_modules/@pie-lib/translator/CHANGELOG.json +1 -0
- package/configure/node_modules/@pie-lib/translator/CHANGELOG.md +282 -0
- package/configure/node_modules/@pie-lib/translator/NEXT.CHANGELOG.json +1 -0
- package/configure/node_modules/@pie-lib/translator/esm/index.js +257 -0
- package/configure/node_modules/@pie-lib/translator/esm/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/translator/lib/en.js +102 -0
- package/configure/node_modules/@pie-lib/translator/lib/en.js.map +1 -0
- package/configure/node_modules/@pie-lib/translator/lib/es.js +102 -0
- package/configure/node_modules/@pie-lib/translator/lib/es.js.map +1 -0
- package/configure/node_modules/@pie-lib/translator/lib/index.js +69 -0
- package/configure/node_modules/@pie-lib/translator/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/translator/package.json +25 -0
- package/configure/node_modules/@pie-lib/translator/src/en.js +99 -0
- package/configure/node_modules/@pie-lib/translator/src/es.js +99 -0
- package/configure/node_modules/@pie-lib/translator/src/index.js +43 -0
- package/configure/package.json +3 -3
- package/controller/CHANGELOG.md +8 -0
- package/controller/package.json +3 -3
- package/esm/configure.js +40550 -0
- package/esm/configure.js.map +1 -0
- package/esm/controller.js +3358 -0
- package/esm/controller.js.map +1 -0
- package/esm/element.js +2203 -0
- package/esm/element.js.map +1 -0
- package/esm/package.json +4 -0
- package/esm/print.js +4090 -0
- package/esm/print.js.map +1 -0
- package/module/controller.js +4973 -2252
- package/module/element.js +1 -1
- package/module/index.html +1 -1
- package/module/manifest.json +1 -1
- package/module/print.html +1 -1
- package/module/print.js +1 -1
- package/package.json +24 -6
|
@@ -0,0 +1,597 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = exports.Main = void 0;
|
|
9
|
+
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
|
|
12
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
+
|
|
14
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
+
|
|
16
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
17
|
+
|
|
18
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
19
|
+
|
|
20
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
21
|
+
|
|
22
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
23
|
+
|
|
24
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
25
|
+
|
|
26
|
+
var _react = _interopRequireDefault(require("react"));
|
|
27
|
+
|
|
28
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
29
|
+
|
|
30
|
+
var _editableHtml = _interopRequireDefault(require("@pie-lib/editable-html"));
|
|
31
|
+
|
|
32
|
+
var _configUi = require("@pie-lib/config-ui");
|
|
33
|
+
|
|
34
|
+
var _renderUi = require("@pie-lib/render-ui");
|
|
35
|
+
|
|
36
|
+
var _styles = require("@material-ui/core/styles");
|
|
37
|
+
|
|
38
|
+
var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
|
|
39
|
+
|
|
40
|
+
var _Tooltip = _interopRequireDefault(require("@material-ui/core/Tooltip"));
|
|
41
|
+
|
|
42
|
+
var _Typography = _interopRequireDefault(require("@material-ui/core/Typography"));
|
|
43
|
+
|
|
44
|
+
var _Info = _interopRequireDefault(require("@material-ui/icons/Info"));
|
|
45
|
+
|
|
46
|
+
var _merge = _interopRequireDefault(require("lodash/merge"));
|
|
47
|
+
|
|
48
|
+
var _utils = require("./utils");
|
|
49
|
+
|
|
50
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
51
|
+
|
|
52
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
53
|
+
|
|
54
|
+
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; }
|
|
55
|
+
|
|
56
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
57
|
+
|
|
58
|
+
var Panel = _configUi.settings.Panel,
|
|
59
|
+
toggle = _configUi.settings.toggle,
|
|
60
|
+
radio = _configUi.settings.radio,
|
|
61
|
+
dropdown = _configUi.settings.dropdown;
|
|
62
|
+
var MAX_CHOICES = 9;
|
|
63
|
+
|
|
64
|
+
var styles = function styles(theme) {
|
|
65
|
+
return {
|
|
66
|
+
promptHolder: {
|
|
67
|
+
width: '100%',
|
|
68
|
+
paddingTop: theme.spacing.unit * 2,
|
|
69
|
+
marginBottom: theme.spacing.unit * 2
|
|
70
|
+
},
|
|
71
|
+
rationaleHolder: {
|
|
72
|
+
flex: 1,
|
|
73
|
+
marginTop: theme.spacing.unit * 1.5,
|
|
74
|
+
paddingTop: theme.spacing.unit * 2,
|
|
75
|
+
marginLeft: theme.spacing.unit * 3.5
|
|
76
|
+
},
|
|
77
|
+
choiceConfigurationHolder: {
|
|
78
|
+
display: 'flex',
|
|
79
|
+
flexDirection: 'column',
|
|
80
|
+
marginBottom: theme.spacing.unit
|
|
81
|
+
},
|
|
82
|
+
choiceConfiguration: {
|
|
83
|
+
width: '100%'
|
|
84
|
+
},
|
|
85
|
+
switchElement: {
|
|
86
|
+
justifyContent: 'space-between',
|
|
87
|
+
margin: 0
|
|
88
|
+
},
|
|
89
|
+
addButton: {
|
|
90
|
+
marginTop: theme.spacing.unit,
|
|
91
|
+
"float": 'right'
|
|
92
|
+
},
|
|
93
|
+
disableButton: {
|
|
94
|
+
cursor: 'not-allowed',
|
|
95
|
+
pointerEvents: 'all',
|
|
96
|
+
backgroundColor: _renderUi.color.disabled(),
|
|
97
|
+
'&:hover': {
|
|
98
|
+
backgroundColor: _renderUi.color.disabled()
|
|
99
|
+
},
|
|
100
|
+
'&:focus': {
|
|
101
|
+
backgroundColor: _renderUi.color.disabled()
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
flexContainer: {
|
|
105
|
+
display: 'flex',
|
|
106
|
+
alignItems: 'center'
|
|
107
|
+
},
|
|
108
|
+
titleText: {
|
|
109
|
+
fontSize: theme.typography.fontSize + 2,
|
|
110
|
+
marginRight: theme.spacing.unit
|
|
111
|
+
},
|
|
112
|
+
tooltip: {
|
|
113
|
+
fontSize: theme.typography.fontSize - 2,
|
|
114
|
+
whiteSpace: 'pre',
|
|
115
|
+
maxWidth: '500px'
|
|
116
|
+
},
|
|
117
|
+
errorText: {
|
|
118
|
+
fontSize: theme.typography.fontSize - 2,
|
|
119
|
+
color: theme.palette.error.main,
|
|
120
|
+
paddingTop: theme.spacing.unit
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
var Design = (0, _styles.withStyles)(styles)(function (props) {
|
|
126
|
+
var _configuration$teache, _configuration$prompt;
|
|
127
|
+
|
|
128
|
+
var classes = props.classes,
|
|
129
|
+
model = props.model,
|
|
130
|
+
configuration = props.configuration,
|
|
131
|
+
onPromptChanged = props.onPromptChanged,
|
|
132
|
+
onChoiceChanged = props.onChoiceChanged,
|
|
133
|
+
onRemoveChoice = props.onRemoveChoice,
|
|
134
|
+
onAddChoice = props.onAddChoice,
|
|
135
|
+
imageSupport = props.imageSupport,
|
|
136
|
+
uploadSoundSupport = props.uploadSoundSupport,
|
|
137
|
+
onChangeModel = props.onChangeModel,
|
|
138
|
+
onConfigurationChanged = props.onConfigurationChanged,
|
|
139
|
+
onTeacherInstructionsChanged = props.onTeacherInstructionsChanged;
|
|
140
|
+
|
|
141
|
+
var _ref = configuration || {},
|
|
142
|
+
_ref$addChoiceButton = _ref.addChoiceButton,
|
|
143
|
+
addChoiceButton = _ref$addChoiceButton === void 0 ? {} : _ref$addChoiceButton,
|
|
144
|
+
_ref$contentDimension = _ref.contentDimensions,
|
|
145
|
+
contentDimensions = _ref$contentDimension === void 0 ? {} : _ref$contentDimension,
|
|
146
|
+
_ref$feedback = _ref.feedback,
|
|
147
|
+
feedback = _ref$feedback === void 0 ? {} : _ref$feedback,
|
|
148
|
+
_ref$deleteChoice = _ref.deleteChoice,
|
|
149
|
+
deleteChoice = _ref$deleteChoice === void 0 ? {} : _ref$deleteChoice,
|
|
150
|
+
_ref$choiceMode = _ref.choiceMode,
|
|
151
|
+
choiceMode = _ref$choiceMode === void 0 ? {} : _ref$choiceMode,
|
|
152
|
+
_ref$choicePrefix = _ref.choicePrefix,
|
|
153
|
+
choicePrefix = _ref$choicePrefix === void 0 ? {} : _ref$choicePrefix,
|
|
154
|
+
_ref$partialScoring = _ref.partialScoring,
|
|
155
|
+
partialScoring = _ref$partialScoring === void 0 ? {} : _ref$partialScoring,
|
|
156
|
+
_ref$lockChoiceOrder = _ref.lockChoiceOrder,
|
|
157
|
+
lockChoiceOrder = _ref$lockChoiceOrder === void 0 ? {} : _ref$lockChoiceOrder,
|
|
158
|
+
_ref$teacherInstructi = _ref.teacherInstructions,
|
|
159
|
+
teacherInstructions = _ref$teacherInstructi === void 0 ? {} : _ref$teacherInstructi,
|
|
160
|
+
_ref$studentInstructi = _ref.studentInstructions,
|
|
161
|
+
studentInstructions = _ref$studentInstructi === void 0 ? {} : _ref$studentInstructi,
|
|
162
|
+
_ref$rationale = _ref.rationale,
|
|
163
|
+
rationale = _ref$rationale === void 0 ? {} : _ref$rationale,
|
|
164
|
+
_ref$scoringType = _ref.scoringType,
|
|
165
|
+
scoringType = _ref$scoringType === void 0 ? {} : _ref$scoringType,
|
|
166
|
+
_ref$sequentialChoice = _ref.sequentialChoiceLabels,
|
|
167
|
+
sequentialChoiceLabels = _ref$sequentialChoice === void 0 ? {} : _ref$sequentialChoice,
|
|
168
|
+
settingsPanelDisabled = _ref.settingsPanelDisabled,
|
|
169
|
+
choicesLayout = _ref.choicesLayout,
|
|
170
|
+
_ref$spellCheck = _ref.spellCheck,
|
|
171
|
+
spellCheck = _ref$spellCheck === void 0 ? {} : _ref$spellCheck,
|
|
172
|
+
gridColumns = _ref.gridColumns,
|
|
173
|
+
_ref$maxImageWidth = _ref.maxImageWidth,
|
|
174
|
+
maxImageWidth = _ref$maxImageWidth === void 0 ? {} : _ref$maxImageWidth,
|
|
175
|
+
_ref$maxImageHeight = _ref.maxImageHeight,
|
|
176
|
+
maxImageHeight = _ref$maxImageHeight === void 0 ? {} : _ref$maxImageHeight,
|
|
177
|
+
_ref$prompt = _ref.prompt,
|
|
178
|
+
prompt = _ref$prompt === void 0 ? {} : _ref$prompt,
|
|
179
|
+
_ref$withRubric = _ref.withRubric,
|
|
180
|
+
withRubric = _ref$withRubric === void 0 ? {} : _ref$withRubric,
|
|
181
|
+
_ref$mathMlOptions = _ref.mathMlOptions,
|
|
182
|
+
mathMlOptions = _ref$mathMlOptions === void 0 ? {} : _ref$mathMlOptions,
|
|
183
|
+
_ref$language = _ref.language,
|
|
184
|
+
language = _ref$language === void 0 ? {} : _ref$language,
|
|
185
|
+
_ref$languageChoices = _ref.languageChoices,
|
|
186
|
+
languageChoices = _ref$languageChoices === void 0 ? {} : _ref$languageChoices;
|
|
187
|
+
|
|
188
|
+
var _ref2 = configuration || {},
|
|
189
|
+
maxAnswerChoices = _ref2.maxAnswerChoices;
|
|
190
|
+
|
|
191
|
+
var _ref3 = model || {},
|
|
192
|
+
limitChoicesNumber = _ref3.limitChoicesNumber,
|
|
193
|
+
teacherInstructionsEnabled = _ref3.teacherInstructionsEnabled,
|
|
194
|
+
rationaleEnabled = _ref3.rationaleEnabled,
|
|
195
|
+
feedbackEnabled = _ref3.feedbackEnabled,
|
|
196
|
+
promptEnabled = _ref3.promptEnabled,
|
|
197
|
+
spellCheckEnabled = _ref3.spellCheckEnabled,
|
|
198
|
+
choices = _ref3.choices,
|
|
199
|
+
errors = _ref3.errors,
|
|
200
|
+
toolbarEditorPosition = _ref3.toolbarEditorPosition,
|
|
201
|
+
extraCSSRules = _ref3.extraCSSRules;
|
|
202
|
+
|
|
203
|
+
var _ref4 = errors || {},
|
|
204
|
+
answerChoicesError = _ref4.answerChoices,
|
|
205
|
+
choicesErrors = _ref4.choices,
|
|
206
|
+
correctResponseError = _ref4.correctResponse,
|
|
207
|
+
promptError = _ref4.prompt,
|
|
208
|
+
rationaleErrors = _ref4.rationale,
|
|
209
|
+
teacherInstructionsError = _ref4.teacherInstructions;
|
|
210
|
+
|
|
211
|
+
var nrOfColumnsAvailable = choices !== null && choices !== void 0 && choices.length ? Array.from({
|
|
212
|
+
length: choices.length
|
|
213
|
+
}, function (_, i) {
|
|
214
|
+
return "".concat(i + 1);
|
|
215
|
+
}) : [];
|
|
216
|
+
var _configuration$baseIn = configuration.baseInputConfiguration,
|
|
217
|
+
baseInputConfiguration = _configuration$baseIn === void 0 ? {} : _configuration$baseIn;
|
|
218
|
+
var toolbarOpts = {
|
|
219
|
+
position: toolbarEditorPosition === 'top' ? 'top' : 'bottom'
|
|
220
|
+
}; // if old property is used, set maxAnswerChoices to 9
|
|
221
|
+
|
|
222
|
+
if (limitChoicesNumber) {
|
|
223
|
+
maxAnswerChoices = MAX_CHOICES;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
var getPluginProps = function getPluginProps() {
|
|
227
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
228
|
+
return _objectSpread(_objectSpread({}, baseInputConfiguration), props);
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
var validationMessage = (0, _utils.generateValidationMessage)(configuration);
|
|
232
|
+
var defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;
|
|
233
|
+
var defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;
|
|
234
|
+
var addChoiceButtonTooltip = maxAnswerChoices && (choices === null || choices === void 0 ? void 0 : choices.length) >= maxAnswerChoices ? "Only ".concat(maxAnswerChoices, " allowed maximum") : '';
|
|
235
|
+
var panelSettings = {
|
|
236
|
+
choiceMode: choiceMode.settings && radio(choiceMode.label, ['checkbox', 'radio']),
|
|
237
|
+
'sequentialChoiceLabels.enabled': sequentialChoiceLabels.settings && toggle(sequentialChoiceLabels.label, true),
|
|
238
|
+
choicePrefix: choicePrefix.settings && radio(choicePrefix.label, ['numbers', 'letters']),
|
|
239
|
+
partialScoring: partialScoring.settings && toggle(partialScoring.label),
|
|
240
|
+
lockChoiceOrder: lockChoiceOrder.settings && toggle(lockChoiceOrder.label),
|
|
241
|
+
feedbackEnabled: feedback.settings && toggle(feedback.label),
|
|
242
|
+
choicesLayout: choicesLayout.settings && dropdown(choicesLayout.label, ['vertical', 'grid', 'horizontal']),
|
|
243
|
+
gridColumns: choicesLayout.settings && model.choicesLayout === 'grid' && nrOfColumnsAvailable.length > 0 && dropdown(gridColumns.label, nrOfColumnsAvailable),
|
|
244
|
+
'language.enabled': language.settings && toggle(language.label, true),
|
|
245
|
+
language: language.settings && language.enabled && dropdown(languageChoices.label, languageChoices.options)
|
|
246
|
+
};
|
|
247
|
+
var panelProperties = {
|
|
248
|
+
teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),
|
|
249
|
+
studentInstructionsEnabled: studentInstructions.settings && toggle(studentInstructions.label),
|
|
250
|
+
promptEnabled: prompt.settings && toggle(prompt.label),
|
|
251
|
+
rationaleEnabled: rationale.settings && toggle(rationale.label),
|
|
252
|
+
spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),
|
|
253
|
+
scoringType: scoringType.settings && radio(scoringType.label, ['auto', 'rubric']),
|
|
254
|
+
rubricEnabled: (withRubric === null || withRubric === void 0 ? void 0 : withRubric.settings) && toggle(withRubric === null || withRubric === void 0 ? void 0 : withRubric.label)
|
|
255
|
+
};
|
|
256
|
+
return /*#__PURE__*/_react["default"].createElement(_configUi.layout.ConfigLayout, {
|
|
257
|
+
dimensions: contentDimensions,
|
|
258
|
+
hideSettings: settingsPanelDisabled,
|
|
259
|
+
extraCSSRules: extraCSSRules,
|
|
260
|
+
settings: /*#__PURE__*/_react["default"].createElement(Panel, {
|
|
261
|
+
model: model,
|
|
262
|
+
onChangeModel: onChangeModel,
|
|
263
|
+
configuration: configuration,
|
|
264
|
+
onChangeConfiguration: onConfigurationChanged,
|
|
265
|
+
groups: {
|
|
266
|
+
Settings: panelSettings,
|
|
267
|
+
Properties: panelProperties
|
|
268
|
+
}
|
|
269
|
+
})
|
|
270
|
+
}, teacherInstructionsEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
|
|
271
|
+
label: teacherInstructions.label,
|
|
272
|
+
className: classes.promptHolder
|
|
273
|
+
}, /*#__PURE__*/_react["default"].createElement(_editableHtml["default"], {
|
|
274
|
+
className: classes.prompt,
|
|
275
|
+
markup: model.teacherInstructions || '',
|
|
276
|
+
onChange: onTeacherInstructionsChanged,
|
|
277
|
+
imageSupport: imageSupport,
|
|
278
|
+
nonEmpty: false,
|
|
279
|
+
error: teacherInstructionsError,
|
|
280
|
+
toolbarOpts: toolbarOpts,
|
|
281
|
+
pluginProps: getPluginProps(configuration === null || configuration === void 0 ? void 0 : (_configuration$teache = configuration.teacherInstructions) === null || _configuration$teache === void 0 ? void 0 : _configuration$teache.inputConfiguration),
|
|
282
|
+
spellCheck: spellCheckEnabled,
|
|
283
|
+
maxImageWidth: maxImageWidth && maxImageWidth.teacherInstructions || defaultImageMaxWidth,
|
|
284
|
+
maxImageHeight: maxImageHeight && maxImageHeight.teacherInstructions || defaultImageMaxHeight,
|
|
285
|
+
uploadSoundSupport: uploadSoundSupport,
|
|
286
|
+
languageCharactersProps: [{
|
|
287
|
+
language: 'spanish'
|
|
288
|
+
}, {
|
|
289
|
+
language: 'special'
|
|
290
|
+
}],
|
|
291
|
+
mathMlOptions: mathMlOptions
|
|
292
|
+
}), teacherInstructionsError && /*#__PURE__*/_react["default"].createElement("div", {
|
|
293
|
+
className: classes.errorText
|
|
294
|
+
}, teacherInstructionsError)), promptEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
|
|
295
|
+
label: prompt.label,
|
|
296
|
+
className: classes.promptHolder
|
|
297
|
+
}, /*#__PURE__*/_react["default"].createElement(_editableHtml["default"], {
|
|
298
|
+
className: classes.prompt,
|
|
299
|
+
markup: model.prompt,
|
|
300
|
+
onChange: onPromptChanged,
|
|
301
|
+
imageSupport: imageSupport,
|
|
302
|
+
nonEmpty: false,
|
|
303
|
+
disableUnderline: true,
|
|
304
|
+
error: promptError,
|
|
305
|
+
toolbarOpts: toolbarOpts,
|
|
306
|
+
pluginProps: getPluginProps(configuration === null || configuration === void 0 ? void 0 : (_configuration$prompt = configuration.prompt) === null || _configuration$prompt === void 0 ? void 0 : _configuration$prompt.inputConfiguration),
|
|
307
|
+
spellCheck: spellCheckEnabled,
|
|
308
|
+
maxImageWidth: maxImageWidth && maxImageWidth.prompt,
|
|
309
|
+
maxImageHeight: maxImageHeight && maxImageHeight.prompt,
|
|
310
|
+
uploadSoundSupport: uploadSoundSupport,
|
|
311
|
+
languageCharactersProps: [{
|
|
312
|
+
language: 'spanish'
|
|
313
|
+
}, {
|
|
314
|
+
language: 'special'
|
|
315
|
+
}],
|
|
316
|
+
mathMlOptions: mathMlOptions
|
|
317
|
+
}), promptError && /*#__PURE__*/_react["default"].createElement("div", {
|
|
318
|
+
className: classes.errorText
|
|
319
|
+
}, promptError)), /*#__PURE__*/_react["default"].createElement("div", {
|
|
320
|
+
className: classes.flexContainer
|
|
321
|
+
}, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
322
|
+
className: classes.titleText,
|
|
323
|
+
component: 'div'
|
|
324
|
+
}, "Choices"), /*#__PURE__*/_react["default"].createElement(_Tooltip["default"], {
|
|
325
|
+
classes: {
|
|
326
|
+
tooltip: classes.tooltip
|
|
327
|
+
},
|
|
328
|
+
disableFocusListener: true,
|
|
329
|
+
disableTouchListener: true,
|
|
330
|
+
placement: 'right',
|
|
331
|
+
title: validationMessage
|
|
332
|
+
}, /*#__PURE__*/_react["default"].createElement(_Info["default"], {
|
|
333
|
+
fontSize: 'small',
|
|
334
|
+
color: 'primary'
|
|
335
|
+
}))), choices.map(function (choice, index) {
|
|
336
|
+
var _configuration$choice, _configuration$ration;
|
|
337
|
+
|
|
338
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
339
|
+
key: "choice-".concat(index),
|
|
340
|
+
className: classes.choiceConfigurationHolder
|
|
341
|
+
}, /*#__PURE__*/_react["default"].createElement(_configUi.ChoiceConfiguration, {
|
|
342
|
+
key: index,
|
|
343
|
+
index: index + 1,
|
|
344
|
+
useLetterOrdering: model.choicePrefix === 'letters',
|
|
345
|
+
className: classes.choiceConfiguration,
|
|
346
|
+
mode: model.choiceMode,
|
|
347
|
+
data: choice,
|
|
348
|
+
defaultFeedback: {},
|
|
349
|
+
imageSupport: imageSupport,
|
|
350
|
+
disableImageAlignmentButtons: true,
|
|
351
|
+
onDelete: function onDelete() {
|
|
352
|
+
return onRemoveChoice(index);
|
|
353
|
+
},
|
|
354
|
+
onChange: function onChange(c) {
|
|
355
|
+
return onChoiceChanged(index, c);
|
|
356
|
+
},
|
|
357
|
+
allowFeedBack: feedbackEnabled,
|
|
358
|
+
allowDelete: deleteChoice.settings,
|
|
359
|
+
noLabels: true,
|
|
360
|
+
pluginOpts: getPluginProps(configuration === null || configuration === void 0 ? void 0 : (_configuration$choice = configuration.choices) === null || _configuration$choice === void 0 ? void 0 : _configuration$choice.inputConfiguration),
|
|
361
|
+
toolbarOpts: toolbarOpts,
|
|
362
|
+
spellCheck: spellCheckEnabled,
|
|
363
|
+
error: (choicesErrors === null || choicesErrors === void 0 ? void 0 : choicesErrors[choice.value]) || null,
|
|
364
|
+
noCorrectAnswerError: correctResponseError,
|
|
365
|
+
maxImageWidth: maxImageWidth && maxImageWidth.choices || defaultImageMaxWidth,
|
|
366
|
+
maxImageHeight: maxImageHeight && maxImageHeight.choices || defaultImageMaxHeight,
|
|
367
|
+
uploadSoundSupport: uploadSoundSupport,
|
|
368
|
+
mathMlOptions: mathMlOptions
|
|
369
|
+
}), rationaleEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
|
|
370
|
+
key: "rationale-".concat(index),
|
|
371
|
+
label: rationale.label,
|
|
372
|
+
className: classes.rationaleHolder
|
|
373
|
+
}, /*#__PURE__*/_react["default"].createElement(_editableHtml["default"], {
|
|
374
|
+
className: classes.rationale,
|
|
375
|
+
markup: choice.rationale || '',
|
|
376
|
+
onChange: function onChange(c) {
|
|
377
|
+
return onChoiceChanged(index, _objectSpread(_objectSpread({}, choice), {}, {
|
|
378
|
+
rationale: c
|
|
379
|
+
}));
|
|
380
|
+
},
|
|
381
|
+
imageSupport: imageSupport,
|
|
382
|
+
error: (rationaleErrors === null || rationaleErrors === void 0 ? void 0 : rationaleErrors[choice.value]) || null,
|
|
383
|
+
toolbarOpts: toolbarOpts,
|
|
384
|
+
pluginProps: getPluginProps(configuration === null || configuration === void 0 ? void 0 : (_configuration$ration = configuration.rationale) === null || _configuration$ration === void 0 ? void 0 : _configuration$ration.inputConfiguration),
|
|
385
|
+
spellCheck: spellCheckEnabled,
|
|
386
|
+
maxImageWidth: maxImageWidth && maxImageWidth.rationale || defaultImageMaxWidth,
|
|
387
|
+
maxImageHeight: maxImageHeight && maxImageHeight.rationale || defaultImageMaxHeight,
|
|
388
|
+
uploadSoundSupport: uploadSoundSupport,
|
|
389
|
+
languageCharactersProps: [{
|
|
390
|
+
language: 'spanish'
|
|
391
|
+
}, {
|
|
392
|
+
language: 'special'
|
|
393
|
+
}],
|
|
394
|
+
mathMlOptions: mathMlOptions
|
|
395
|
+
}), (rationaleErrors === null || rationaleErrors === void 0 ? void 0 : rationaleErrors[choice.value]) && /*#__PURE__*/_react["default"].createElement("div", {
|
|
396
|
+
className: classes.errorText
|
|
397
|
+
}, rationaleErrors === null || rationaleErrors === void 0 ? void 0 : rationaleErrors[choice.value])));
|
|
398
|
+
}), correctResponseError && /*#__PURE__*/_react["default"].createElement("div", {
|
|
399
|
+
className: classes.errorText
|
|
400
|
+
}, correctResponseError), answerChoicesError && /*#__PURE__*/_react["default"].createElement("div", {
|
|
401
|
+
className: classes.errorText
|
|
402
|
+
}, answerChoicesError), addChoiceButton.settings && /*#__PURE__*/_react["default"].createElement(_Tooltip["default"], {
|
|
403
|
+
title: addChoiceButtonTooltip,
|
|
404
|
+
classes: {
|
|
405
|
+
tooltip: classes.tooltip
|
|
406
|
+
}
|
|
407
|
+
}, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
408
|
+
classes: {
|
|
409
|
+
root: maxAnswerChoices && (choices === null || choices === void 0 ? void 0 : choices.length) >= maxAnswerChoices && classes.disableButton
|
|
410
|
+
},
|
|
411
|
+
className: classes.addButton,
|
|
412
|
+
variant: "contained",
|
|
413
|
+
color: "primary",
|
|
414
|
+
onClick: onAddChoice
|
|
415
|
+
}, addChoiceButton.label)));
|
|
416
|
+
});
|
|
417
|
+
|
|
418
|
+
var Main = /*#__PURE__*/function (_React$Component) {
|
|
419
|
+
(0, _inherits2["default"])(Main, _React$Component);
|
|
420
|
+
|
|
421
|
+
var _super = _createSuper(Main);
|
|
422
|
+
|
|
423
|
+
function Main() {
|
|
424
|
+
var _this;
|
|
425
|
+
|
|
426
|
+
(0, _classCallCheck2["default"])(this, Main);
|
|
427
|
+
|
|
428
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
429
|
+
args[_key] = arguments[_key];
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
433
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "state", {
|
|
434
|
+
showWarning: false
|
|
435
|
+
});
|
|
436
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onRemoveChoice", function (index) {
|
|
437
|
+
var _this$props = _this.props,
|
|
438
|
+
model = _this$props.model,
|
|
439
|
+
configuration = _this$props.configuration,
|
|
440
|
+
onModelChanged = _this$props.onModelChanged;
|
|
441
|
+
|
|
442
|
+
var _ref5 = configuration || {},
|
|
443
|
+
minAnswerChoices = _ref5.minAnswerChoices;
|
|
444
|
+
|
|
445
|
+
if (minAnswerChoices && model.choices.length === minAnswerChoices) {
|
|
446
|
+
_this.setState({
|
|
447
|
+
showWarning: true
|
|
448
|
+
});
|
|
449
|
+
|
|
450
|
+
return;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
model.choices.splice(index, 1);
|
|
454
|
+
onModelChanged(model);
|
|
455
|
+
});
|
|
456
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onAddChoice", function () {
|
|
457
|
+
var _this$props2 = _this.props,
|
|
458
|
+
model = _this$props2.model,
|
|
459
|
+
configuration = _this$props2.configuration,
|
|
460
|
+
onModelChanged = _this$props2.onModelChanged;
|
|
461
|
+
|
|
462
|
+
var _ref6 = configuration || {},
|
|
463
|
+
maxAnswerChoices = _ref6.maxAnswerChoices;
|
|
464
|
+
|
|
465
|
+
var _ref7 = model || {},
|
|
466
|
+
limitChoicesNumber = _ref7.limitChoicesNumber; // if old property is used, set maxAnswerChoices to 9
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
if (limitChoicesNumber) {
|
|
470
|
+
maxAnswerChoices = MAX_CHOICES;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
if (maxAnswerChoices && model.choices.length >= maxAnswerChoices) {
|
|
474
|
+
return;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
model.choices.push({
|
|
478
|
+
label: '',
|
|
479
|
+
value: _configUi.choiceUtils.firstAvailableIndex(model.choices.map(function (c) {
|
|
480
|
+
return c.value;
|
|
481
|
+
}), 0),
|
|
482
|
+
feedback: {
|
|
483
|
+
type: 'none'
|
|
484
|
+
}
|
|
485
|
+
});
|
|
486
|
+
onModelChanged(model);
|
|
487
|
+
});
|
|
488
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onChoiceChanged", function (index, choice) {
|
|
489
|
+
var _this$props3 = _this.props,
|
|
490
|
+
model = _this$props3.model,
|
|
491
|
+
onModelChanged = _this$props3.onModelChanged;
|
|
492
|
+
|
|
493
|
+
if (choice.correct && model.choiceMode === 'radio') {
|
|
494
|
+
model.choices = model.choices.map(function (c) {
|
|
495
|
+
return (0, _merge["default"])({}, c, {
|
|
496
|
+
correct: false
|
|
497
|
+
});
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
model.choices.splice(index, 1, choice);
|
|
502
|
+
onModelChanged(model);
|
|
503
|
+
});
|
|
504
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onPromptChanged", function (prompt) {
|
|
505
|
+
_this.props.onModelChanged(_objectSpread(_objectSpread({}, _this.props.model), {}, {
|
|
506
|
+
prompt: prompt
|
|
507
|
+
}));
|
|
508
|
+
});
|
|
509
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onTeacherInstructionsChanged", function (teacherInstructions) {
|
|
510
|
+
_this.props.onModelChanged(_objectSpread(_objectSpread({}, _this.props.model), {}, {
|
|
511
|
+
teacherInstructions: teacherInstructions
|
|
512
|
+
}));
|
|
513
|
+
});
|
|
514
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onModelChanged", function (model, key) {
|
|
515
|
+
var onModelChanged = _this.props.onModelChanged;
|
|
516
|
+
|
|
517
|
+
switch (key) {
|
|
518
|
+
case 'choiceMode':
|
|
519
|
+
{
|
|
520
|
+
var value = model.choiceMode;
|
|
521
|
+
|
|
522
|
+
if (value === 'radio') {
|
|
523
|
+
var correctFound = false;
|
|
524
|
+
model.choices = model.choices.map(function (c) {
|
|
525
|
+
if (correctFound) {
|
|
526
|
+
c.correct = false;
|
|
527
|
+
return c;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
if (c.correct) {
|
|
531
|
+
correctFound = true;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
return c;
|
|
535
|
+
});
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
onModelChanged(model, true);
|
|
539
|
+
break;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
default:
|
|
543
|
+
onModelChanged(model);
|
|
544
|
+
break;
|
|
545
|
+
}
|
|
546
|
+
});
|
|
547
|
+
return _this;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
(0, _createClass2["default"])(Main, [{
|
|
551
|
+
key: "render",
|
|
552
|
+
value: function render() {
|
|
553
|
+
var _this2 = this;
|
|
554
|
+
|
|
555
|
+
var _this$props$configura = this.props.configuration;
|
|
556
|
+
_this$props$configura = _this$props$configura === void 0 ? {} : _this$props$configura;
|
|
557
|
+
var minAnswerChoices = _this$props$configura.minAnswerChoices;
|
|
558
|
+
var showWarning = this.state.showWarning;
|
|
559
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_configUi.AlertDialog, {
|
|
560
|
+
open: showWarning,
|
|
561
|
+
title: "Warning",
|
|
562
|
+
text: "There can't be less than ".concat(minAnswerChoices || 0, " choices."),
|
|
563
|
+
onConfirm: function onConfirm() {
|
|
564
|
+
return _this2.setState({
|
|
565
|
+
showWarning: false
|
|
566
|
+
});
|
|
567
|
+
}
|
|
568
|
+
}), /*#__PURE__*/_react["default"].createElement(Design, (0, _extends2["default"])({}, this.props, {
|
|
569
|
+
onChangeModel: this.onModelChanged,
|
|
570
|
+
onRemoveChoice: this.onRemoveChoice,
|
|
571
|
+
onChoiceChanged: this.onChoiceChanged,
|
|
572
|
+
onAddChoice: this.onAddChoice,
|
|
573
|
+
onPromptChanged: this.onPromptChanged,
|
|
574
|
+
onTeacherInstructionsChanged: this.onTeacherInstructionsChanged
|
|
575
|
+
})));
|
|
576
|
+
}
|
|
577
|
+
}]);
|
|
578
|
+
return Main;
|
|
579
|
+
}(_react["default"].Component);
|
|
580
|
+
|
|
581
|
+
exports.Main = Main;
|
|
582
|
+
(0, _defineProperty2["default"])(Main, "propTypes", {
|
|
583
|
+
model: _propTypes["default"].object.isRequired,
|
|
584
|
+
configuration: _propTypes["default"].object.isRequired,
|
|
585
|
+
disableSidePanel: _propTypes["default"].bool,
|
|
586
|
+
onModelChanged: _propTypes["default"].func.isRequired,
|
|
587
|
+
onConfigurationChanged: _propTypes["default"].func.isRequired,
|
|
588
|
+
classes: _propTypes["default"].object.isRequired,
|
|
589
|
+
imageSupport: _propTypes["default"].shape({
|
|
590
|
+
add: _propTypes["default"].func.isRequired,
|
|
591
|
+
"delete": _propTypes["default"].func.isRequired
|
|
592
|
+
})
|
|
593
|
+
});
|
|
594
|
+
var Styled = (0, _styles.withStyles)(styles)(Main);
|
|
595
|
+
var _default = Styled;
|
|
596
|
+
exports["default"] = _default;
|
|
597
|
+
//# sourceMappingURL=main.js.map
|