@pie-element/categorize 12.0.0-beta.0 → 12.0.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -11
- package/configure/CHANGELOG.md +0 -11
- package/configure/lib/defaults.js +3 -0
- package/configure/lib/defaults.js.map +1 -1
- package/configure/lib/design/builder.js +2 -3
- package/configure/lib/design/builder.js.map +1 -1
- package/configure/lib/design/categories/RowLabel.js +2 -2
- package/configure/lib/design/categories/RowLabel.js.map +1 -1
- package/configure/lib/design/index.js +4 -4
- package/configure/lib/design/index.js.map +1 -1
- package/configure/lib/design/input-header.js +2 -2
- package/configure/lib/design/input-header.js.map +1 -1
- package/configure/package.json +13 -13
- package/controller/CHANGELOG.md +0 -11
- package/controller/lib/index.js +4 -4
- package/controller/lib/index.js.map +1 -1
- package/controller/package.json +6 -6
- package/lib/categorize/category.js +1 -24
- package/lib/categorize/category.js.map +1 -1
- package/lib/categorize/droppable-placeholder.js +28 -3
- package/lib/categorize/droppable-placeholder.js.map +1 -1
- package/package.json +13 -13
package/CHANGELOG.md
CHANGED
|
@@ -3,17 +3,6 @@
|
|
|
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
|
-
## [11.3.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize@11.3.2...@pie-element/categorize@11.3.3) (2025-11-27)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
### Bug Fixes
|
|
10
|
-
|
|
11
|
-
* bump libs PD-5274, PD-5211, PD-5248 ([7610b25](https://github.com/pie-framework/pie-elements/commit/7610b25423956b6492f33322513b3430051fca77))
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
6
|
## [11.3.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize@11.3.1...@pie-element/categorize@11.3.2) (2025-10-22)
|
|
18
7
|
|
|
19
8
|
|
package/configure/CHANGELOG.md
CHANGED
|
@@ -3,17 +3,6 @@
|
|
|
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
|
-
## [9.3.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-configure@9.3.2...@pie-element/categorize-configure@9.3.3) (2025-11-27)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
### Bug Fixes
|
|
10
|
-
|
|
11
|
-
* bump libs PD-5274, PD-5211, PD-5248 ([7610b25](https://github.com/pie-framework/pie-elements/commit/7610b25423956b6492f33322513b3430051fca77))
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
6
|
## [9.3.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-configure@9.3.1...@pie-element/categorize-configure@9.3.2) (2025-10-22)
|
|
18
7
|
|
|
19
8
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.js","names":["_utils","require","_default","exports","default","model","allowAlternateEnabled","allowMaxChoicesPerCategory","allowMultiplePlacementsEnabled","multiplePlacements","enabled","alternates","categories","categoriesPerRow","choices","choicesLabel","choicesPosition","correctResponse","feedbackEnabled","lockChoiceOrder","maxAnswerChoices","maxChoicesPerCategory","partialScoring","promptEnabled","rationaleEnabled","rowLabels","studentInstructionsEnabled","teacherInstructionsEnabled","toolbarEditorPosition","minRowHeight","configuration","baseInputConfiguration","
|
|
1
|
+
{"version":3,"file":"defaults.js","names":["_utils","require","_default","exports","default","model","allowAlternateEnabled","allowMaxChoicesPerCategory","allowMultiplePlacementsEnabled","multiplePlacements","enabled","alternates","categories","categoriesPerRow","choices","choicesLabel","choicesPosition","correctResponse","feedbackEnabled","lockChoiceOrder","maxAnswerChoices","maxChoicesPerCategory","partialScoring","promptEnabled","rationaleEnabled","rowLabels","studentInstructionsEnabled","teacherInstructionsEnabled","toolbarEditorPosition","minRowHeight","configuration","baseInputConfiguration","h3","disabled","audio","video","image","textAlign","showParagraphs","separateParagraphs","spellCheck","label","settings","feedback","allowMultiplePlacements","maxPlacements","allowAlternate","prompt","required","inputConfiguration","rationale","scoringType","settingsPanelDisabled","studentInstructions","teacherInstructions","headers","maxImageWidth","rowLabel","categoryLabel","maxImageHeight","withRubric","minCategoriesPerRow","allowMaxAnswerChoices","mathMlOptions","mmlOutput","mmlEditing","language","languageChoices","options"],"sources":["../src/defaults.js"],"sourcesContent":["import { multiplePlacements } from './utils';\n\nexport default {\n model: {\n allowAlternateEnabled: true,\n allowMaxChoicesPerCategory: false,\n allowMultiplePlacementsEnabled: multiplePlacements.enabled,\n alternates: [],\n categories: [],\n categoriesPerRow: 2,\n choices: [],\n choicesLabel: '',\n choicesPosition: 'below',\n correctResponse: [],\n feedbackEnabled: false,\n lockChoiceOrder: true,\n maxAnswerChoices: 6,\n maxChoicesPerCategory: 0,\n partialScoring: true,\n promptEnabled: true,\n rationaleEnabled: true,\n rowLabels: [''],\n studentInstructionsEnabled: true,\n teacherInstructionsEnabled: true,\n toolbarEditorPosition: 'bottom',\n minRowHeight: '80px',\n },\n configuration: {\n baseInputConfiguration: {\n h3: { disabled: true },\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n textAlign: { disabled: true },\n showParagraphs: { disabled: false },\n separateParagraphs: { disabled: true },\n },\n spellCheck: {\n label: 'Spellcheck',\n settings: false,\n enabled: true,\n },\n feedback: {\n settings: true,\n label: 'Feedback',\n enabled: true,\n },\n lockChoiceOrder: {\n settings: true,\n label: 'Lock Choice Order',\n },\n choicesPosition: {\n settings: true,\n label: 'Choices Position',\n },\n allowMultiplePlacements: {\n settings: true,\n label: 'Allow Multiple Placements',\n },\n maxPlacements: {\n settings: true,\n label: 'Max choices per category',\n },\n allowAlternate: {\n settings: true,\n label: 'Allow Alternate Correct Answers',\n },\n categoriesPerRow: {\n settings: true,\n label: 'Categories per row',\n },\n partialScoring: {\n settings: false,\n label: 'Allow Partial Scoring',\n },\n prompt: {\n settings: true,\n label: 'Prompt',\n required: false,\n inputConfiguration: {\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n },\n },\n rationale: {\n settings: true,\n label: 'Rationale',\n required: false,\n inputConfiguration: {\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n },\n },\n scoringType: {\n settings: false,\n label: 'Scoring Type',\n },\n settingsPanelDisabled: false,\n studentInstructions: {\n settings: false,\n label: 'Student Instructions',\n },\n teacherInstructions: {\n settings: true,\n label: 'Teacher Instructions',\n required: false,\n inputConfiguration: {\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n },\n },\n headers: {\n inputConfiguration: {\n audio: { disabled: true },\n video: { disabled: true },\n image: { disabled: false },\n },\n },\n rowLabels: {\n inputConfiguration: {\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n },\n },\n toolbarEditorPosition: {\n settings: false,\n label: 'Toolbar Editor Position',\n },\n maxImageWidth: {\n teacherInstructions: 300,\n prompt: 300,\n rationale: 300,\n rowLabel: 200,\n categoryLabel: 260,\n choices: 240,\n },\n maxImageHeight: {\n teacherInstructions: 300,\n prompt: 300,\n rationale: 300,\n rowLabel: 100,\n categoryLabel: 100,\n choices: 150,\n },\n withRubric: {\n settings: false,\n label: 'Add Rubric',\n },\n minCategoriesPerRow: 1,\n allowMaxAnswerChoices: {\n settings: true,\n label: 'Max answer choices',\n },\n mathMlOptions: {\n mmlOutput: false,\n mmlEditing: false,\n },\n language: {\n settings: false,\n label: 'Specify Language',\n enabled: false,\n },\n languageChoices: {\n label: 'Language Choices',\n options: [],\n },\n },\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAA6C,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAE9B;EACbC,KAAK,EAAE;IACLC,qBAAqB,EAAE,IAAI;IAC3BC,0BAA0B,EAAE,KAAK;IACjCC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AAQ,EAAE,IAAI;MACdD,KAAK,EAAE;IACT,CAAC;IACDsB,aAAa,EAAE;MACbC,SAAS,EAAE,KAAK;MAChBC,UAAU,EAAE;IACd,CAAC;IACDC,QAAQ,EAAE;MACRxB,QAAQ,EAAE,KAAK;MACfD,KAAK,EAAE,kBAAkB;MACzB/B,OAAO,EAAE;IACX,CAAC;IACDyD,eAAe,EAAE;MACf1B,KAAK,EAAE,kBAAkB;MACzB2B,OAAO,EAAE;IACX;EACF;AACF,CAAC","ignoreList":[]}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.buildCategories = exports.buildAlternateResponses = void 0;
|
|
8
|
-
var
|
|
7
|
+
var _lodashEs = require("lodash-es");
|
|
9
8
|
const buildCategories = (categories, choices, correctResponse) => {
|
|
10
|
-
const clonedCategories = (0,
|
|
9
|
+
const clonedCategories = (0, _lodashEs.cloneDeep)(categories);
|
|
11
10
|
return clonedCategories.map(category => {
|
|
12
11
|
const cr = correctResponse.find(cr => cr.category === category.id);
|
|
13
12
|
if (cr) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder.js","names":["
|
|
1
|
+
{"version":3,"file":"builder.js","names":["_lodashEs","require","buildCategories","categories","choices","correctResponse","clonedCategories","cloneDeep","map","category","cr","find","id","choiceId","choice","h","Object","assign","content","exports","getChoices","cat","index","alternateResponses","length","alt","ch","buildAlternateResponses","mostAlternates","reduce","mostAlt","alternatesArray","Array","fill","val","catIndex","currentCategory","label"],"sources":["../../src/design/builder.js"],"sourcesContent":["import { cloneDeep } from 'lodash-es';\n\nexport const buildCategories = (categories, choices, correctResponse) => {\n const clonedCategories = cloneDeep(categories);\n\n return clonedCategories.map((category) => {\n const cr = correctResponse.find((cr) => cr.category === category.id);\n\n if (cr) {\n category.choices = (cr.choices || []).map((choiceId) => {\n const choice = choices.find((h) => h.id === choiceId);\n if (choice) {\n return Object.assign({}, { id: choice.id, content: choice.content });\n }\n });\n }\n\n return category;\n });\n};\n\nconst getChoices = (cat, choices, index) => {\n if (!cat.alternateResponses || cat.alternateResponses.length === 0) {\n return [];\n }\n\n return (cat.alternateResponses[index] || []).map((alt) => {\n return choices.find((ch) => ch.id === alt);\n });\n};\n\nexport const buildAlternateResponses = (categories, choices, correctResponse) => {\n const mostAlternates = correctResponse.reduce((mostAlt, cat) => {\n if (cat.alternateResponses && cat.alternateResponses.length >= mostAlt) {\n return cat.alternateResponses.length;\n }\n\n return mostAlt;\n }, 0);\n const alternatesArray = new Array(mostAlternates).fill(0);\n\n return alternatesArray.map((val, index) => {\n return correctResponse.map((cat, catIndex) => {\n const currentCategory = categories[catIndex];\n\n return {\n id: currentCategory.id,\n label: currentCategory.label,\n choices: getChoices(cat, choices, index),\n };\n });\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAEO,MAAMC,eAAe,GAAGA,CAACC,UAAU,EAAEC,OAAO,EAAEC,eAAe,KAAK;EACvE,MAAMC,gBAAgB,GAAG,IAAAC,mBAAS,EAACJ,UAAU,CAAC;EAE9C,OAAOG,gBAAgB,CAACE,GAAG,CAAEC,QAAQ,IAAK;IACxC,MAAMC,EAAE,GAAGL,eAAe,CAACM,IAAI,CAAED,EAAE,IAAKA,EAAE,CAACD,QAAQ,KAAKA,QAAQ,CAACG,EAAE,CAAC;IAEpE,IAAIF,EAAE,EAAE;MACND,QAAQ,CAACL,OAAO,GAAG,CAACM,EAAE,CAACN,OAAO,IAAI,EAAE,EAAEI,GAAG,CAAEK,QAAQ,IAAK;QACtD,MAAMC,MAAM,GAAGV,OAAO,CAACO,IAAI,CAAEI,CAAC,IAAKA,CAAC,CAACH,EAAE,KAAKC,QAAQ,CAAC;QACrD,IAAIC,MAAM,EAAE;UACV,O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AACa,GAAG,EAAEc,QAAQ,KAAK;MAC5C,MAAMC,eAAe,GAAGjC,UAAU,CAACgC,QAAQ,CAAC;MAE5C,OAAO;QACLvB,EAAE,EAAEwB,eAAe,CAACxB,EAAE;QACtByB,KAAK,EAAED,eAAe,CAACC,KAAK;QAC5BjC,OAAO,EAAEgB,UAAU,CAACC,GAAG,EAAEjB,OAAO,EAAEkB,KAAK;MACzC,CAAC;IACH,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC;AAACH,OAAA,CAAAQ,uBAAA,GAAAA,uBAAA","ignoreList":[]}
|
|
@@ -8,7 +8,7 @@ exports.RowLabel = void 0;
|
|
|
8
8
|
var _utils = require("../utils");
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
var _styles = require("@mui/material/styles");
|
|
11
|
-
var
|
|
11
|
+
var _editableHtmlTipTap = _interopRequireDefault(require("@pie-lib/editable-html-tip-tap"));
|
|
12
12
|
var _renderUi = require("@pie-lib/render-ui");
|
|
13
13
|
const RowLabelContainer = (0, _styles.styled)(_renderUi.InputContainer)(({
|
|
14
14
|
theme
|
|
@@ -41,7 +41,7 @@ const RowLabel = ({
|
|
|
41
41
|
}
|
|
42
42
|
}, /*#__PURE__*/_react.default.createElement(RowLabelContainer, {
|
|
43
43
|
label: "Row Label"
|
|
44
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
44
|
+
}, /*#__PURE__*/_react.default.createElement(_editableHtmlTipTap.default, {
|
|
45
45
|
disabled: disabled,
|
|
46
46
|
markup: markup,
|
|
47
47
|
onChange: onChange,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RowLabel.js","names":["_utils","require","_react","_interopRequireDefault","_styles","
|
|
1
|
+
{"version":3,"file":"RowLabel.js","names":["_utils","require","_react","_interopRequireDefault","_styles","_editableHtmlTipTap","_renderUi","RowLabelContainer","styled","InputContainer","theme","paddingTop","spacing","width","RowLabel","categoriesPerRow","configuration","disabled","markup","imageSupport","onChange","toolbarOpts","spellCheck","maxImageWidth","maxImageHeight","uploadSoundSupport","mathMlOptions","rowLabels","baseInputConfiguration","default","createElement","style","gridColumn","label","nonEmpty","pluginProps","getPluginProps","inputConfiguration","languageCharactersProps","language","exports"],"sources":["../../../src/design/categories/RowLabel.jsx"],"sourcesContent":["import { getPluginProps } from '../utils';\nimport React from 'react';\nimport { styled } from '@mui/material/styles';\nimport EditableHtml from '@pie-lib/editable-html-tip-tap';\nimport { InputContainer } from '@pie-lib/render-ui';\n\nconst RowLabelContainer = styled(InputContainer)(({ theme }) => ({\n paddingTop: theme.spacing(2),\n width: '100%',\n}));\n\nexport const RowLabel = ({\n categoriesPerRow,\n configuration,\n disabled,\n markup,\n imageSupport,\n onChange,\n toolbarOpts,\n spellCheck,\n maxImageWidth,\n maxImageHeight,\n uploadSoundSupport,\n mathMlOptions = {},\n }) => {\n const { rowLabels, baseInputConfiguration } = configuration;\n\n return (\n <div\n style={{\n gridColumn: `1/${categoriesPerRow + 1}`,\n width: '100%',\n }}\n >\n <RowLabelContainer label=\"Row Label\">\n <EditableHtml\n disabled={disabled}\n markup={markup}\n onChange={onChange}\n imageSupport={imageSupport}\n nonEmpty={false}\n toolbarOpts={toolbarOpts}\n pluginProps={getPluginProps(rowLabels?.inputConfiguration, baseInputConfiguration)}\n spellCheck={spellCheck}\n maxImageWidth={maxImageWidth}\n maxImageHeight={maxImageHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n />\n </RowLabelContainer>\n </div>\n );\n };\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,mBAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAEA,MAAMM,iBAAiB,GAAG,IAAAC,cA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c,CAC9B,CACgB,CAChB,CAAC;AAEV,CAAC;AAACc,OAAA,CAAA1B,QAAA,GAAAA,QAAA","ignoreList":[]}
|
|
@@ -13,7 +13,7 @@ var _styles = require("@mui/material/styles");
|
|
|
13
13
|
var _core = require("@dnd-kit/core");
|
|
14
14
|
var _configUi = require("@pie-lib/config-ui");
|
|
15
15
|
var _categorize = require("@pie-lib/categorize");
|
|
16
|
-
var
|
|
16
|
+
var _editableHtmlTipTap = _interopRequireDefault(require("@pie-lib/editable-html-tip-tap"));
|
|
17
17
|
var _drag = require("@pie-lib/drag");
|
|
18
18
|
var _mathRendering = require("@pie-lib/math-rendering");
|
|
19
19
|
var _categories = _interopRequireDefault(require("./categories"));
|
|
@@ -568,7 +568,7 @@ class Design extends _react.default.Component {
|
|
|
568
568
|
})
|
|
569
569
|
}, teacherInstructionsEnabled && /*#__PURE__*/_react.default.createElement(StyledInputContainer, {
|
|
570
570
|
label: teacherInstructions.label
|
|
571
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
571
|
+
}, /*#__PURE__*/_react.default.createElement(_editableHtmlTipTap.default, {
|
|
572
572
|
markup: model.teacherInstructions || '',
|
|
573
573
|
onChange: this.changeTeacherInstructions,
|
|
574
574
|
imageSupport: imageSupport,
|
|
@@ -588,7 +588,7 @@ class Design extends _react.default.Component {
|
|
|
588
588
|
mathMlOptions: mathMlOptions
|
|
589
589
|
}), teacherInstructionsError && /*#__PURE__*/_react.default.createElement(ErrorText, null, teacherInstructionsError)), promptEnabled && /*#__PURE__*/_react.default.createElement(StyledInputContainer, {
|
|
590
590
|
label: prompt.label
|
|
591
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
591
|
+
}, /*#__PURE__*/_react.default.createElement(_editableHtmlTipTap.default, {
|
|
592
592
|
markup: model.prompt || '',
|
|
593
593
|
onChange: this.onPromptChanged,
|
|
594
594
|
imageSupport: imageSupport,
|
|
@@ -654,7 +654,7 @@ class Design extends _react.default.Component {
|
|
|
654
654
|
}));
|
|
655
655
|
}), rationaleEnabled && /*#__PURE__*/_react.default.createElement(StyledInputContainer, {
|
|
656
656
|
label: rationale.label
|
|
657
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
657
|
+
}, /*#__PURE__*/_react.default.createElement(_editableHtmlTipTap.default, {
|
|
658
658
|
markup: model.rationale || '',
|
|
659
659
|
onChange: this.changeRationale,
|
|
660
660
|
imageSupport: imageSupport,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_utils","require","_react","_interopRequireDefault","_propTypes","_styles","_core","_configUi","_categorize","_editableHtml","_drag","_mathRendering","_categories","_alternateResponses","_choices","_choice","_choicePreview","_builder","_header","_utils2","_translator","translator","Translator","dropdown","Panel","toggle","radio","numberField","settings","Provider","IdProvider","uid","DragPreviewWrapper","React","Component","constructor","args","_defineProperty2","default","createRef","componentDidMount","containerRef","current","setTimeout","renderMath","render","createElement","ref","props","children","StyledHeader","styled","Header","theme","marginBottom","spacing","StyledInputContainer","InputContainer","width","paddingTop","ErrorText","fontSize","typography","color","palette","error","main","Design","model","onChange","updatedModel","choices","map","c","categoryCount","checkAllowMultiplePlacements","allowMultiplePlacementsEnabled","correctResponse","ensureNoExtraChoicesInAnswer","ensureNoExtraChoicesInAlternate","categories","id","label","h","content","maxChoicesPerCategory","allowMaxChoicesPerCategory","rationale","teacherInstructions","feedback","updateModel","cr","alternateResponses","prompt","index","filter","alt","altIndex","choice","countInAnswer","allowMultiplePlacements","multiplePlacements","enabled","disabled","maxChoices","getMaxCategoryChoices","event","active","draggedItem","data","setState","activeDragItem","over","allowAlternateEnabled","activeData","overData","type","choiceId","split","moveChoice","categoryId","choiceIndex","addChoiceToCategory","toAlternateIndex","alternateResponseIndex","moveChoiceInAlternate","toAlternateResponseIndex","addChoiceToAlternateCategory","addedChoice","find","newCorrectResponse","moveChoiceToCategory","undefined","verifyAllowMultiplePlacements","maxCategoryChoices","category","removeChoiceFromCategory","from","to","forEach","a","push","reduce","acc","currentValue","foundIndex","findIndex","alternateIndex","moveChoiceToAlternate","removeChoiceFromAlternate","state","configuration","generateId","imageSupport","uploadSoundSupport","onConfigurationChanged","allowAlternate","baseInputConfiguration","categoriesPerRow","choicesPosition","contentDimensions","lockChoiceOrder","maxImageHeight","maxImageWidth","maxPlacements","minCategoriesPerRow","partialScoring","scoringType","settingsPanelDisabled","spellCheck","studentInstructions","withRubric","mathMlOptions","language","languageChoices","allowMaxAnswerChoices","errors","feedbackEnabled","promptEnabled","rationaleEnabled","spellCheckEnabled","teacherInstructionsEnabled","toolbarEditorPosition","extraCSSRules","promptError","rationaleError","teacherInstructionsError","toolbarOpts","position","config","columns","buildCategories","buildAlternateResponses","correctResponseCount","countChoiceInCorrectResponse","defaultImageMaxWidth","defaultImageMaxHeight","panelSettings","min","max","perChoice","maxAnswerChoices","length","options","panelProperties","studentInstructionsEnabled","rubricEnabled","isOpened","isAlertModalOpened","alertMaxChoicesMsg","t","lng","DragProvider","onDragStart","onDragEnd","value","layout","ConfigLayout","dimensions","hideSettings","onChangeModel","onChangeConfiguration","groups","Settings","Properties","modal","AlertDialog","title","text","open","onClose","onAlertModalCancel","markup","changeTeacherInstructions","nonEmpty","pluginProps","getPluginProps","inputConfiguration","languageCharactersProps","onPromptChanged","disableUnderline","onModelChanged","buttonLabel","onAdd","onAddAlternateResponse","categoriesList","Fragment","key","variant","onRemoveAlternateResponse","changeRationale","FeedbackConfig","changeFeedback","DragOverlay","renderDragOverlay","exports","PropTypes","object","className","string","func","isRequired","shape","add","delete","_default"],"sources":["../../src/design/index.jsx"],"sourcesContent":["import { getPluginProps } from './utils';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@mui/material/styles';\nimport { DragOverlay } from '@dnd-kit/core';\nimport { FeedbackConfig, InputContainer, layout, settings } from '@pie-lib/config-ui';\nimport {\n countInAnswer,\n ensureNoExtraChoicesInAnswer,\n ensureNoExtraChoicesInAlternate,\n moveChoiceToCategory,\n moveChoiceToAlternate,\n removeChoiceFromCategory,\n removeChoiceFromAlternate,\n verifyAllowMultiplePlacements,\n} from '@pie-lib/categorize';\nimport EditableHtml from '@pie-lib/editable-html';\nimport { DragProvider, uid } from '@pie-lib/drag';\nimport { renderMath } from '@pie-lib/math-rendering';\n\nimport Categories from './categories';\nimport AlternateResponses from './categories/alternateResponses';\nimport Choices from './choices';\nimport Choice from './choices/choice';\nimport ChoicePreview from './categories/choice-preview';\nimport { buildAlternateResponses, buildCategories } from './builder';\nimport Header from './header';\nimport { getMaxCategoryChoices, multiplePlacements } from '../utils';\nimport { AlertDialog } from '@pie-lib/config-ui';\nimport Translator from '@pie-lib/translator';\n\nconst { translator } = Translator;\nconst { dropdown, Panel, toggle, radio, numberField } = settings;\nconst { Provider: IdProvider } = uid;\n\n// Simple wrapper to render math in DragOverlay portal\nclass DragPreviewWrapper extends React.Component {\n containerRef = React.createRef();\n\n componentDidMount() {\n if (this.containerRef.current) {\n setTimeout(() => renderMath(this.containerRef.current), 0);\n }\n }\n\n render() {\n return <div ref={this.containerRef}>{this.props.children}</div>;\n }\n}\n\nconst StyledHeader = styled(Header)(({ theme }) => ({\n marginBottom: theme.spacing(2),\n}));\n\nconst StyledInputContainer = styled(InputContainer)(({ theme }) => ({\n width: '100%',\n paddingTop: theme.spacing(2),\n marginBottom: theme.spacing(2),\n}));\n\nconst ErrorText = styled('div')(({ theme }) => ({\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingTop: theme.spacing(1),\n}));\n\nexport class Design extends React.Component {\n static propTypes = {\n configuration: PropTypes.object,\n className: PropTypes.string,\n onConfigurationChanged: PropTypes.func,\n model: PropTypes.object.isRequired,\n onChange: PropTypes.func.isRequired,\n uid: PropTypes.string,\n imageSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n uploadSoundSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n };\n\n constructor(props) {\n super(props);\n this.uid = props.uid || uid.generateId();\n this.state = {\n activeDragItem: null,\n };\n }\n\n updateModel = (props) => {\n const { model, onChange } = this.props;\n\n const updatedModel = {\n ...model,\n ...props,\n };\n\n updatedModel.choices = updatedModel.choices.map((c) => ({\n ...c,\n categoryCount: this.checkAllowMultiplePlacements(updatedModel.allowMultiplePlacementsEnabled, c),\n }));\n\n //Ensure that there are no extra choices in correctResponse, if the user has decided that only one choice may be used.\n updatedModel.correctResponse = ensureNoExtraChoicesInAnswer(\n updatedModel.correctResponse || [],\n updatedModel.choices,\n );\n\n //Ensure that there are no extra choices in alternate responses, if the user has decided that only one choice may be used.\n updatedModel.correctResponse = ensureNoExtraChoicesInAlternate(\n updatedModel.correctResponse || [],\n updatedModel.choices,\n );\n\n //clean categories\n updatedModel.categories = updatedModel.categories.map((c) => ({\n id: c.id,\n label: c.label,\n }));\n\n updatedModel.choices = updatedModel.choices.map((h) => ({\n id: h.id,\n content: h.content,\n categoryCount: h.categoryCount,\n }));\n\n // ensure that maxChoicesPerCategory is reset if author switch back the corresponding switch (allowMaxChoicesPerCategory)\n updatedModel.maxChoicesPerCategory = updatedModel.allowMaxChoicesPerCategory\n ? updatedModel.maxChoicesPerCategory\n : 0;\n\n onChange(updatedModel);\n };\n\n changeRationale = (rationale) => {\n const { model, onChange } = this.props;\n\n onChange({\n ...model,\n rationale,\n });\n };\n\n changeTeacherInstructions = (teacherInstructions) => {\n const { model, onChange } = this.props;\n\n onChange({\n ...model,\n teacherInstructions,\n });\n };\n\n changeFeedback = (feedback) => {\n this.updateModel({ feedback });\n };\n\n onAddAlternateResponse = () => {\n const {\n model: { correctResponse },\n } = this.props;\n\n this.updateModel({\n correctResponse: (correctResponse || []).map((cr) => ({\n ...cr,\n alternateResponses: [...(cr.alternateResponses || []), []],\n })),\n });\n };\n\n onPromptChanged = (prompt) => this.updateModel({ prompt });\n\n onRemoveAlternateResponse = (index) => {\n const {\n model: { correctResponse },\n } = this.props;\n\n this.updateModel({\n correctResponse: (correctResponse || []).map((cr) => ({\n ...cr,\n alternateResponses: (cr.alternateResponses || []).filter((alt, altIndex) => altIndex !== index),\n })),\n });\n };\n\n countChoiceInCorrectResponse = (choice) => {\n const { model } = this.props;\n\n return countInAnswer(choice.id, model.correctResponse);\n };\n\n checkAllowMultiplePlacements = (allowMultiplePlacements, c) => {\n if (allowMultiplePlacements === multiplePlacements.enabled) {\n return 0;\n }\n\n if (allowMultiplePlacements === multiplePlacements.disabled) {\n return 1;\n }\n\n return c.categoryCount || 0;\n };\n\n isAlertModalOpened = () => {\n const { model } = this.props;\n const { maxChoicesPerCategory = 0 } = model || {};\n const maxChoices = getMaxCategoryChoices(model);\n // when maxChoicesPerCategory is set to 0, there is no limit so modal should not be opened\n return maxChoicesPerCategory !== 0 ? maxChoices > maxChoicesPerCategory : false;\n };\n\n onAlertModalCancel = () => {\n const { model } = this.props;\n const maxChoices = getMaxCategoryChoices(model);\n this.updateModel({ maxChoicesPerCategory: maxChoices });\n };\n\n onDragStart = (event) => {\n const { active } = event;\n const draggedItem = active.data.current;\n\n this.setState({\n activeDragItem: draggedItem,\n });\n };\n\n onDragEnd = (event) => {\n const { active, over } = event;\n\n this.setState({ activeDragItem: null });\n\n if (!over || !active) {\n return;\n }\n\n const { model } = this.props;\n const { allowAlternateEnabled } = model;\n const activeData = active.data.current;\n const overData = over.data.current;\n\n // moving a choice between categories (correct response)\n if (activeData.type === 'choice-preview' && overData.type === 'category') {\n // Extract original choice.id - if DraggableChoice uses the unique id in data, extract the first part\n // Format: ${choice.id}-${categoryId}-${choiceIndex} or ${choice.id}-${categoryId}-${choiceIndex}-alt-${alternateResponseIndex}\n const choiceId =\n activeData.choice?.id || (typeof activeData.id === 'string' ? activeData.id.split('-')[0] : activeData.id);\n this.moveChoice(choiceId, activeData.categoryId, overData.id, activeData.choiceIndex || 0);\n }\n\n // placing a choice into a category (correct response)\n if (activeData.type === 'choice' && overData.type === 'category') {\n this.addChoiceToCategory({ id: activeData.id }, overData.id);\n }\n\n // moving a choice between categories (alternate response)\n if (activeData.type === 'choice-preview' && overData.type === 'category-alternate') {\n const toAlternateIndex = overData.alternateResponseIndex;\n // Extract original choice.id - if DraggableChoice uses the unique id in data, extract the first part\n const choiceId =\n activeData.choice?.id || (typeof activeData.id === 'string' ? activeData.id.split('-')[0] : activeData.id);\n this.moveChoiceInAlternate(\n choiceId,\n activeData.categoryId,\n overData.id,\n activeData.choiceIndex || 0,\n toAlternateIndex,\n );\n }\n\n // placing a choice into a category (alternate response)\n if (allowAlternateEnabled && activeData.type === 'choice' && overData.type === 'category-alternate') {\n const choiceId = activeData.id;\n const categoryId = overData.id;\n const toAlternateResponseIndex = overData.alternateResponseIndex;\n this.addChoiceToAlternateCategory({ id: choiceId }, categoryId, toAlternateResponseIndex);\n }\n };\n\n addChoiceToCategory = (addedChoice, categoryId) => {\n const { model } = this.props;\n let { choices = [], correctResponse = [], maxChoicesPerCategory = 0 } = model || {};\n const choice = (choices || []).find((choice) => choice.id === addedChoice.id);\n\n let newCorrectResponse = moveChoiceToCategory(addedChoice.id, undefined, categoryId, 0, correctResponse);\n\n if (choice.categoryCount !== 0) {\n newCorrectResponse = verifyAllowMultiplePlacements(addedChoice, categoryId, newCorrectResponse);\n }\n const maxCategoryChoices = getMaxCategoryChoices(model);\n\n this.updateModel({\n correctResponse: newCorrectResponse,\n maxChoicesPerCategory:\n maxChoicesPerCategory !== 0 && maxChoicesPerCategory < maxCategoryChoices\n ? maxChoicesPerCategory + 1\n : maxChoicesPerCategory,\n });\n };\n\n deleteChoiceFromCategory = (category, choice, choiceIndex) => {\n const { model } = this.props;\n const correctResponse = removeChoiceFromCategory(choice.id, category.id, choiceIndex, model.correctResponse);\n\n this.updateModel({ correctResponse });\n };\n\n moveChoice = (choiceId, from, to, choiceIndex) => {\n const { model } = this.props;\n let { choices, correctResponse = [], maxChoicesPerCategory = 0 } = model || {};\n const choice = (choices || []).find((choice) => choice.id === choiceId);\n if (to === from || !choice) {\n return;\n }\n if (choice.categoryCount !== 0) {\n correctResponse = moveChoiceToCategory(choice.id, from, to, choiceIndex, correctResponse);\n correctResponse = verifyAllowMultiplePlacements(choice, to, correctResponse);\n } else if (choice.categoryCount === 0) {\n correctResponse = moveChoiceToCategory(choice.id, undefined, to, 0, correctResponse);\n }\n const maxCategoryChoices = getMaxCategoryChoices(model);\n // when maxChoicesPerCategory is set to 0, there is no limit so it should not be updated\n this.updateModel({\n correctResponse,\n maxChoicesPerCategory:\n maxChoicesPerCategory !== 0 && maxChoicesPerCategory < maxCategoryChoices\n ? maxChoicesPerCategory + 1\n : maxChoicesPerCategory,\n });\n };\n\n // methods for alternate responses\n addChoiceToAlternateCategory = (addedChoice, categoryId, altIndex) => {\n const { model } = this.props;\n const { correctResponse, choices, maxChoicesPerCategory = 0 } = model;\n\n const choice = choices.find((c) => c.id === addedChoice.id);\n\n correctResponse.forEach((a) => {\n if (a.category === categoryId) {\n a.alternateResponses = a.alternateResponses || [];\n\n if (a.alternateResponses[altIndex] === undefined) {\n a.alternateResponses[altIndex] = [];\n }\n\n a.alternateResponses[altIndex].push(addedChoice.id);\n if (choice.categoryCount && choice.categoryCount !== 0) {\n a.alternateResponses[altIndex] = a.alternateResponses[altIndex].reduce((acc, currentValue) => {\n if (currentValue === choice.id) {\n const foundIndex = acc.findIndex((c) => c === choice.id);\n if (foundIndex === -1) {\n acc.push(currentValue);\n }\n } else {\n acc.push(currentValue);\n }\n\n return acc;\n }, []);\n }\n\n return a;\n } else {\n if (a.alternateResponses[altIndex] && choice.categoryCount !== 0) {\n a.alternateResponses[altIndex] = a.alternateResponses[altIndex].filter((c) => c !== addedChoice.id);\n return a;\n }\n }\n\n return a;\n });\n\n const maxCategoryChoices = getMaxCategoryChoices(model);\n // when maxChoicesPerCategory is set to 0, there is no limit so it should not be updated\n this.updateModel({\n correctResponse,\n maxChoicesPerCategory:\n maxChoicesPerCategory !== 0 && maxChoicesPerCategory < maxCategoryChoices\n ? maxChoicesPerCategory + 1\n : maxChoicesPerCategory,\n });\n };\n\n moveChoiceInAlternate = (choiceId, from, to, choiceIndex, alternateIndex) => {\n const { model } = this.props;\n let { choices, correctResponse = [], maxChoicesPerCategory = 0 } = model || {};\n const choice = (choices || []).find((choice) => choice.id === choiceId);\n correctResponse = moveChoiceToAlternate(\n choiceId,\n from,\n to,\n choiceIndex,\n correctResponse,\n alternateIndex,\n choice?.categoryCount,\n );\n\n const maxCategoryChoices = getMaxCategoryChoices(model);\n // when maxChoicesPerCategory is set to 0, there is no limit so it should not be updated\n this.updateModel({\n correctResponse,\n maxChoicesPerCategory:\n maxChoicesPerCategory !== 0 && maxChoicesPerCategory < maxCategoryChoices\n ? maxChoicesPerCategory + 1\n : maxChoicesPerCategory,\n });\n };\n\n deleteChoiceFromAlternateCategory = (category, choice, choiceIndex, altIndex) => {\n const { model } = this.props;\n\n const correctResponse = removeChoiceFromAlternate(\n choice.id,\n category.id,\n choiceIndex,\n altIndex,\n model.correctResponse,\n );\n\n this.updateModel({ correctResponse });\n };\n\n renderDragOverlay = () => {\n const { activeDragItem } = this.state;\n const { model, configuration } = this.props;\n\n if (!activeDragItem) return null;\n\n if (activeDragItem.type === 'choice') {\n const choice = model.choices?.find((c) => c.id === activeDragItem.id);\n if (!choice) return null;\n\n return <Choice choice={choice} configuration={configuration} />;\n } else if (activeDragItem.type === 'choice-preview' && activeDragItem.alternateResponseIndex === undefined) {\n const choice = model.choices?.find((c) => c.id === activeDragItem.id);\n if (!choice) return null;\n return <ChoicePreview choice={choice} />;\n } else if (activeDragItem.type === 'choice-preview' && activeDragItem.alternateResponseIndex !== undefined) {\n const choice = model.choices?.find((c) => c.id === activeDragItem.id);\n if (!choice) return null;\n return <ChoicePreview choice={choice} alternateResponseIndex={activeDragItem.alternateResponseIndex} />;\n }\n\n return null;\n };\n\n render() {\n const { configuration, imageSupport, model, uploadSoundSupport, onConfigurationChanged } = this.props;\n const {\n allowAlternate = {},\n allowMultiplePlacements = {},\n baseInputConfiguration = {},\n categoriesPerRow = {},\n choicesPosition = {},\n contentDimensions = {},\n feedback = {},\n lockChoiceOrder = {},\n maxImageHeight = {},\n maxImageWidth = {},\n maxPlacements = {},\n minCategoriesPerRow = 1,\n partialScoring = {},\n prompt = {},\n rationale = {},\n scoringType = {},\n settingsPanelDisabled,\n spellCheck = {},\n studentInstructions = {},\n teacherInstructions = {},\n withRubric = {},\n mathMlOptions = {},\n language = {},\n languageChoices = {},\n allowMaxAnswerChoices = {},\n } = configuration || {};\n const {\n allowAlternateEnabled,\n allowMaxChoicesPerCategory,\n errors,\n feedbackEnabled,\n maxChoicesPerCategory,\n promptEnabled,\n rationaleEnabled,\n spellCheckEnabled,\n teacherInstructionsEnabled,\n toolbarEditorPosition,\n extraCSSRules,\n } = model || {};\n const {\n prompt: promptError,\n rationale: rationaleError,\n teacherInstructions: teacherInstructionsError,\n } = errors || {};\n\n const toolbarOpts = {\n position: toolbarEditorPosition === 'top' ? 'top' : 'bottom',\n };\n\n const config = model.config || {};\n config.choices = config.choices || { label: '', columns: 2 };\n\n const categories = buildCategories(model.categories || [], model.choices || [], model.correctResponse || []);\n\n const alternateResponses = buildAlternateResponses(\n model.categories || [],\n model.choices || [],\n model.correctResponse || [],\n );\n\n const choices = model.choices.map((c) => {\n c.correctResponseCount = this.countChoiceInCorrectResponse(c);\n // ensure categoryCount is set even though updatedModel hasn't been called\n c.categoryCount = this.checkAllowMultiplePlacements(model.allowMultiplePlacementsEnabled, c);\n return c;\n });\n\n const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;\n const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;\n\n const panelSettings = {\n partialScoring: partialScoring.settings && toggle(partialScoring.label),\n lockChoiceOrder: lockChoiceOrder.settings && toggle(lockChoiceOrder.label),\n categoriesPerRow:\n categoriesPerRow.settings &&\n numberField(categoriesPerRow.label, {\n label: categoriesPerRow.label,\n min: minCategoriesPerRow,\n max: 6,\n }),\n choicesPosition: choicesPosition.settings && radio(choicesPosition.label, ['below', 'above', 'left', 'right']),\n allowMultiplePlacementsEnabled:\n allowMultiplePlacements.settings &&\n dropdown(allowMultiplePlacements.label, [\n multiplePlacements.enabled,\n multiplePlacements.disabled,\n multiplePlacements.perChoice,\n ]),\n maxAnswerChoices:\n allowMaxAnswerChoices.settings &&\n numberField(allowMaxAnswerChoices.label, {\n label: '',\n min: choices?.length || 0,\n max: 30,\n }),\n allowMaxChoicesPerCategory: maxPlacements.settings && toggle(maxPlacements.label),\n maxChoicesPerCategory:\n allowMaxChoicesPerCategory === true &&\n numberField(maxPlacements.label, {\n label: '',\n min: 0,\n max: 30,\n }),\n promptEnabled: prompt.settings && toggle(prompt.label),\n feedbackEnabled: feedback.settings && toggle(feedback.label),\n allowAlternateEnabled: allowAlternate.settings && toggle(allowAlternate.label),\n 'language.enabled': language.settings && toggle(language.label, true),\n language: language.settings && language.enabled && dropdown(languageChoices.label, languageChoices.options),\n };\n\n const panelProperties = {\n teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),\n studentInstructionsEnabled: studentInstructions.settings && toggle(studentInstructions.label),\n rationaleEnabled: rationale.settings && toggle(rationale.label),\n spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),\n scoringType: scoringType.settings && radio(scoringType.label, ['auto', 'rubric']),\n rubricEnabled: withRubric?.settings && toggle(withRubric?.label),\n };\n\n const isOpened = this.isAlertModalOpened();\n const alertMaxChoicesMsg = translator.t('translation:categorize:maxChoicesPerCategoryRestriction', {\n lng: model.language,\n maxChoicesPerCategory,\n });\n\n return (\n <DragProvider onDragStart={this.onDragStart} onDragEnd={this.onDragEnd}>\n <IdProvider value={this.uid}>\n <layout.ConfigLayout\n extraCSSRules={extraCSSRules}\n dimensions={contentDimensions}\n hideSettings={settingsPanelDisabled}\n settings={\n <Panel\n model={model}\n onChangeModel={this.updateModel}\n configuration={configuration}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n Settings: panelSettings,\n Properties: panelProperties,\n }}\n modal={\n <AlertDialog\n title={'Warning'}\n text={alertMaxChoicesMsg}\n open={isOpened}\n onClose={this.onAlertModalCancel}\n />\n }\n />\n }\n >\n {teacherInstructionsEnabled && (\n <StyledInputContainer label={teacherInstructions.label}>\n <EditableHtml\n markup={model.teacherInstructions || ''}\n onChange={this.changeTeacherInstructions}\n imageSupport={imageSupport}\n error={teacherInstructionsError}\n nonEmpty={false}\n toolbarOpts={toolbarOpts}\n pluginProps={getPluginProps(teacherInstructions?.inputConfiguration, baseInputConfiguration)}\n spellCheck={spellCheckEnabled}\n maxImageWidth={(maxImageWidth && maxImageWidth.teacherInstructions) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.teacherInstructions) || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n />\n {teacherInstructionsError && <ErrorText>{teacherInstructionsError}</ErrorText>}\n </StyledInputContainer>\n )}\n\n {promptEnabled && (\n <StyledInputContainer label={prompt.label}>\n <EditableHtml\n markup={model.prompt || ''}\n onChange={this.onPromptChanged}\n imageSupport={imageSupport}\n error={promptError}\n nonEmpty={false}\n disableUnderline\n toolbarOpts={toolbarOpts}\n pluginProps={getPluginProps(prompt?.inputConfiguration, baseInputConfiguration)}\n spellCheck={spellCheckEnabled}\n maxImageWidth={maxImageWidth && maxImageWidth.prompt}\n maxImageHeight={maxImageHeight && maxImageHeight.prompt}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n />\n {promptError && <ErrorText>{promptError}</ErrorText>}\n </StyledInputContainer>\n )}\n\n <Categories\n imageSupport={imageSupport}\n uploadSoundSupport={uploadSoundSupport}\n model={model}\n categories={categories || []}\n onModelChanged={this.updateModel}\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheckEnabled}\n configuration={configuration}\n defaultImageMaxWidth={defaultImageMaxWidth}\n defaultImageMaxHeight={defaultImageMaxHeight}\n mathMlOptions={mathMlOptions}\n />\n\n <Choices\n imageSupport={imageSupport}\n uploadSoundSupport={uploadSoundSupport}\n choices={choices}\n model={model}\n onModelChanged={this.updateModel}\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheckEnabled}\n configuration={configuration}\n defaultImageMaxWidth={defaultImageMaxWidth}\n defaultImageMaxHeight={defaultImageMaxHeight}\n />\n\n {allowAlternateEnabled && (\n <StyledHeader\n label=\"Alternate Responses\"\n buttonLabel=\"ADD AN ALTERNATE RESPONSE\"\n onAdd={this.onAddAlternateResponse}\n />\n )}\n {allowAlternateEnabled &&\n alternateResponses.map((categoriesList, index) => {\n return (\n <React.Fragment key={index}>\n <StyledHeader\n variant={'subtitle1'}\n label=\"Alternate Response\"\n buttonLabel=\"REMOVE ALTERNATE RESPONSE\"\n onAdd={() => this.onRemoveAlternateResponse(index)}\n />\n <AlternateResponses\n altIndex={index}\n imageSupport={imageSupport}\n model={model}\n configuration={configuration}\n categories={categoriesList}\n onModelChanged={this.updateModel}\n uploadSoundSupport={uploadSoundSupport}\n mathMlOptions={mathMlOptions}\n />\n </React.Fragment>\n );\n })}\n\n {rationaleEnabled && (\n <StyledInputContainer label={rationale.label}>\n <EditableHtml\n markup={model.rationale || ''}\n onChange={this.changeRationale}\n imageSupport={imageSupport}\n error={rationaleError}\n nonEmpty={false}\n toolbarOpts={toolbarOpts}\n pluginProps={getPluginProps(prompt?.inputConfiguration, baseInputConfiguration)}\n spellCheck={spellCheckEnabled}\n maxImageWidth={(maxImageWidth && maxImageWidth.rationale) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.rationale) || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n />\n {rationaleError && <ErrorText>{rationaleError}</ErrorText>}\n </StyledInputContainer>\n )}\n\n {feedbackEnabled && (\n <FeedbackConfig feedback={model.feedback} onChange={this.changeFeedback} toolbarOpts={toolbarOpts} />\n )}\n </layout.ConfigLayout>\n <DragOverlay>\n <DragPreviewWrapper>{this.renderDragOverlay()}</DragPreviewWrapper>\n </DragOverlay>\n </IdProvider>\n </DragProvider>\n );\n }\n}\n\nexport default Design;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,UAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAUA,IAAAQ,aAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,KAAA,GAAAT,OAAA;AACA,IAAAU,cAAA,GAAAV,OAAA;AAEA,IAAAW,WAAA,GAAAT,sBAAA,CAAAF,OAAA;AACA,IAAAY,mBAAA,GAAAV,sBAAA,CAAAF,OAAA;AACA,IAAAa,QAAA,GAAAX,sBAAA,CAAAF,OAAA;AACA,IAAAc,OAAA,GAAAZ,sBAAA,CAAAF,OAAA;AACA,IAAAe,cAAA,GAAAb,sBAAA,CAAAF,OAAA;AACA,IAAAgB,QAAA,GAAAhB,OAAA;AACA,IAAAiB,OAAA,GAAAf,sBAAA,CAAAF,OAAA;AACA,IAAAkB,OAAA,GAAAlB,OAAA;AAEA,IAAAmB,WAAA,GAAAjB,sBAAA,CAAAF,OAAA;AAEA,MAAM;EAAEoB;AAAW,CAAC,GAAGC,mBAAU;AACjC,MAAM;EAAEC,QAAQ;EAAEC,KAAK;EAAEC,MAAM;EAAEC,KAAK;EAAEC;AAAY,CAAC,GAAGC,kBAAQ;AAChE,MAAM;EAAEC,QAAQ,EAAEC;AAAW,CAAC,GAAGC,SAAG;;AAEpC;AACA,MAAMC,kBAAkB,SAASC,cAAK,CAACC,SAAS,CAAC;EAAAC,YAAA,GAAAC,IAAA;IAAA,SAAA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EF,kBAAS,CAACG,MAAM;EAC3BxG,sBAAsB,EAAEqG,kBAAS,CAACI,IAAI;EACtChM,KAAK,EAAE4L,kBAAS,CAACC,MAAM,CAACI,UAAU;EAClChM,QAAQ,EAAE2L,kBAAS,CAACI,IAAI,CAACC,UAAU;EACnCtO,GAAG,EAAEiO,kBAAS,CAACG,MAAM;EACrB1G,YAAY,EAAEuG,kBAAS,CAACM,KAAK,CAAC;IAC5BC,GAAG,EAAEP,kBAAS,CAACI,IAAI,CAACC,UAAU;IAC9BG,MAAM,EAAER,kBAAS,CAACI,IAAI,CAACC;EACzB,CAAC,CAAC;EACF3G,kBAAkB,EAAEsG,kBAAS,CAACM,KAAK,CAAC;IAClCC,GAAG,EAAEP,kBAAS,CAACI,IAAI,CAACC,UAAU;IAC9BG,MAAM,EAAER,kBAAS,CAACI,IAAI,CAACC;EACzB,CAAC;AACH,CAAC;AAAA,IAAAI,QAAA,GAAAV,OAAA,CAAAzN,OAAA,GAipBY6B,MAAM","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_utils","require","_react","_interopRequireDefault","_propTypes","_styles","_core","_configUi","_categorize","_editableHtmlTipTap","_drag","_mathRendering","_categories","_alternateResponses","_choices","_choice","_choicePreview","_builder","_header","_utils2","_translator","translator","Translator","dropdown","Panel","toggle","radio","numberField","settings","Provider","IdProvider","uid","DragPreviewWrapper","React","Component","constructor","args","_defineProperty2","default","createRef","componentDidMount","containerRef","current","setTimeout","renderMath","render","createElement","ref","props","children","StyledHeader","styled","Header","theme","marginBottom","spacing","StyledInputContainer","InputContainer","width","paddingTop","ErrorText","fontSize","typography","color","palette","error","main","Design","model","onChange","updatedModel","choices","map","c","categoryCount","checkAllowMultiplePlacements","allowMultiplePlacementsEnabled","correctResponse","ensureNoExtraChoicesInAnswer","ensureNoExtraChoicesInAlternate","categories","id","label","h","content","maxChoicesPerCategory","allowMaxChoicesPerCategory","rationale","teacherInstructions","feedback","updateModel","cr","alternateResponses","prompt","index","filter","alt","altIndex","choice","countInAnswer","allowMultiplePlacements","multiplePlacements","enabled","disabled","maxChoices","getMaxCategoryChoices","event","active","draggedItem","data","setState","activeDragItem","over","allowAlternateEnabled","activeData","overData","type","choiceId","split","moveChoice","categoryId","choiceIndex","addChoiceToCategory","toAlternateIndex","alternateResponseIndex","moveChoiceInAlternate","toAlternateResponseIndex","addChoiceToAlternateCategory","addedChoice","find","newCorrectResponse","moveChoiceToCategory","undefined","verifyAllowMultiplePlacements","maxCategoryChoices","category","removeChoiceFromCategory","from","to","forEach","a","push","reduce","acc","currentValue","foundIndex","findIndex","alternateIndex","moveChoiceToAlternate","removeChoiceFromAlternate","state","configuration","generateId","imageSupport","uploadSoundSupport","onConfigurationChanged","allowAlternate","baseInputConfiguration","categoriesPerRow","choicesPosition","contentDimensions","lockChoiceOrder","maxImageHeight","maxImageWidth","maxPlacements","minCategoriesPerRow","partialScoring","scoringType","settingsPanelDisabled","spellCheck","studentInstructions","withRubric","mathMlOptions","language","languageChoices","allowMaxAnswerChoices","errors","feedbackEnabled","promptEnabled","rationaleEnabled","spellCheckEnabled","teacherInstructionsEnabled","toolbarEditorPosition","extraCSSRules","promptError","rationaleError","teacherInstructionsError","toolbarOpts","position","config","columns","buildCategories","buildAlternateResponses","correctResponseCount","countChoiceInCorrectResponse","defaultImageMaxWidth","defaultImageMaxHeight","panelSettings","min","max","perChoice","maxAnswerChoices","length","options","panelProperties","studentInstructionsEnabled","rubricEnabled","isOpened","isAlertModalOpened","alertMaxChoicesMsg","t","lng","DragProvider","onDragStart","onDragEnd","value","layout","ConfigLayout","dimensions","hideSettings","onChangeModel","onChangeConfiguration","groups","Settings","Properties","modal","AlertDialog","title","text","open","onClose","onAlertModalCancel","markup","changeTeacherInstructions","nonEmpty","pluginProps","getPluginProps","inputConfiguration","languageCharactersProps","onPromptChanged","disableUnderline","onModelChanged","buttonLabel","onAdd","onAddAlternateResponse","categoriesList","Fragment","key","variant","onRemoveAlternateResponse","changeRationale","FeedbackConfig","changeFeedback","DragOverlay","renderDragOverlay","exports","PropTypes","object","className","string","func","isRequired","shape","add","delete","_default"],"sources":["../../src/design/index.jsx"],"sourcesContent":["import { getPluginProps } from './utils';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@mui/material/styles';\nimport { DragOverlay } from '@dnd-kit/core';\nimport { FeedbackConfig, InputContainer, layout, settings } from '@pie-lib/config-ui';\nimport {\n countInAnswer,\n ensureNoExtraChoicesInAnswer,\n ensureNoExtraChoicesInAlternate,\n moveChoiceToCategory,\n moveChoiceToAlternate,\n removeChoiceFromCategory,\n removeChoiceFromAlternate,\n verifyAllowMultiplePlacements,\n} from '@pie-lib/categorize';\nimport EditableHtml from '@pie-lib/editable-html-tip-tap';\nimport { DragProvider, uid } from '@pie-lib/drag';\nimport { renderMath } from '@pie-lib/math-rendering';\n\nimport Categories from './categories';\nimport AlternateResponses from './categories/alternateResponses';\nimport Choices from './choices';\nimport Choice from './choices/choice';\nimport ChoicePreview from './categories/choice-preview';\nimport { buildAlternateResponses, buildCategories } from './builder';\nimport Header from './header';\nimport { getMaxCategoryChoices, multiplePlacements } from '../utils';\nimport { AlertDialog } from '@pie-lib/config-ui';\nimport Translator from '@pie-lib/translator';\n\nconst { translator } = Translator;\nconst { dropdown, Panel, toggle, radio, numberField } = settings;\nconst { Provider: IdProvider } = uid;\n\n// Simple wrapper to render math in DragOverlay portal\nclass DragPreviewWrapper extends React.Component {\n containerRef = React.createRef();\n\n componentDidMount() {\n if (this.containerRef.current) {\n setTimeout(() => renderMath(this.containerRef.current), 0);\n }\n }\n\n render() {\n return <div ref={this.containerRef}>{this.props.children}</div>;\n }\n}\n\nconst StyledHeader = styled(Header)(({ theme }) => ({\n marginBottom: theme.spacing(2),\n}));\n\nconst StyledInputContainer = styled(InputContainer)(({ theme }) => ({\n width: '100%',\n paddingTop: theme.spacing(2),\n marginBottom: theme.spacing(2),\n}));\n\nconst ErrorText = styled('div')(({ theme }) => ({\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingTop: theme.spacing(1),\n}));\n\nexport class Design extends React.Component {\n static propTypes = {\n configuration: PropTypes.object,\n className: PropTypes.string,\n onConfigurationChanged: PropTypes.func,\n model: PropTypes.object.isRequired,\n onChange: PropTypes.func.isRequired,\n uid: PropTypes.string,\n imageSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n uploadSoundSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n };\n\n constructor(props) {\n super(props);\n this.uid = props.uid || uid.generateId();\n this.state = {\n activeDragItem: null,\n };\n }\n\n updateModel = (props) => {\n const { model, onChange } = this.props;\n\n const updatedModel = {\n ...model,\n ...props,\n };\n\n updatedModel.choices = updatedModel.choices.map((c) => ({\n ...c,\n categoryCount: this.checkAllowMultiplePlacements(updatedModel.allowMultiplePlacementsEnabled, c),\n }));\n\n //Ensure that there are no extra choices in correctResponse, if the user has decided that only one choice may be used.\n updatedModel.correctResponse = ensureNoExtraChoicesInAnswer(\n updatedModel.correctResponse || [],\n updatedModel.choices,\n );\n\n //Ensure that there are no extra choices in alternate responses, if the user has decided that only one choice may be used.\n updatedModel.correctResponse = ensureNoExtraChoicesInAlternate(\n updatedModel.correctResponse || [],\n updatedModel.choices,\n );\n\n //clean categories\n updatedModel.categories = updatedModel.categories.map((c) => ({\n id: c.id,\n label: c.label,\n }));\n\n updatedModel.choices = updatedModel.choices.map((h) => ({\n id: h.id,\n content: h.content,\n categoryCount: h.categoryCount,\n }));\n\n // ensure that maxChoicesPerCategory is reset if author switch back the corresponding switch (allowMaxChoicesPerCategory)\n updatedModel.maxChoicesPerCategory = updatedModel.allowMaxChoicesPerCategory\n ? updatedModel.maxChoicesPerCategory\n : 0;\n\n onChange(updatedModel);\n };\n\n changeRationale = (rationale) => {\n const { model, onChange } = this.props;\n\n onChange({\n ...model,\n rationale,\n });\n };\n\n changeTeacherInstructions = (teacherInstructions) => {\n const { model, onChange } = this.props;\n\n onChange({\n ...model,\n teacherInstructions,\n });\n };\n\n changeFeedback = (feedback) => {\n this.updateModel({ feedback });\n };\n\n onAddAlternateResponse = () => {\n const {\n model: { correctResponse },\n } = this.props;\n\n this.updateModel({\n correctResponse: (correctResponse || []).map((cr) => ({\n ...cr,\n alternateResponses: [...(cr.alternateResponses || []), []],\n })),\n });\n };\n\n onPromptChanged = (prompt) => this.updateModel({ prompt });\n\n onRemoveAlternateResponse = (index) => {\n const {\n model: { correctResponse },\n } = this.props;\n\n this.updateModel({\n correctResponse: (correctResponse || []).map((cr) => ({\n ...cr,\n alternateResponses: (cr.alternateResponses || []).filter((alt, altIndex) => altIndex !== index),\n })),\n });\n };\n\n countChoiceInCorrectResponse = (choice) => {\n const { model } = this.props;\n\n return countInAnswer(choice.id, model.correctResponse);\n };\n\n checkAllowMultiplePlacements = (allowMultiplePlacements, c) => {\n if (allowMultiplePlacements === multiplePlacements.enabled) {\n return 0;\n }\n\n if (allowMultiplePlacements === multiplePlacements.disabled) {\n return 1;\n }\n\n return c.categoryCount || 0;\n };\n\n isAlertModalOpened = () => {\n const { model } = this.props;\n const { maxChoicesPerCategory = 0 } = model || {};\n const maxChoices = getMaxCategoryChoices(model);\n // when maxChoicesPerCategory is set to 0, there is no limit so modal should not be opened\n return maxChoicesPerCategory !== 0 ? maxChoices > maxChoicesPerCategory : false;\n };\n\n onAlertModalCancel = () => {\n const { model } = this.props;\n const maxChoices = getMaxCategoryChoices(model);\n this.updateModel({ maxChoicesPerCategory: maxChoices });\n };\n\n onDragStart = (event) => {\n const { active } = event;\n const draggedItem = active.data.current;\n\n this.setState({\n activeDragItem: draggedItem,\n });\n };\n\n onDragEnd = (event) => {\n const { active, over } = event;\n\n this.setState({ activeDragItem: null });\n\n if (!over || !active) {\n return;\n }\n\n const { model } = this.props;\n const { allowAlternateEnabled } = model;\n const activeData = active.data.current;\n const overData = over.data.current;\n\n // moving a choice between categories (correct response)\n if (activeData.type === 'choice-preview' && overData.type === 'category') {\n // Extract original choice.id - if DraggableChoice uses the unique id in data, extract the first part\n // Format: ${choice.id}-${categoryId}-${choiceIndex} or ${choice.id}-${categoryId}-${choiceIndex}-alt-${alternateResponseIndex}\n const choiceId =\n activeData.choice?.id || (typeof activeData.id === 'string' ? activeData.id.split('-')[0] : activeData.id);\n this.moveChoice(choiceId, activeData.categoryId, overData.id, activeData.choiceIndex || 0);\n }\n\n // placing a choice into a category (correct response)\n if (activeData.type === 'choice' && overData.type === 'category') {\n this.addChoiceToCategory({ id: activeData.id }, overData.id);\n }\n\n // moving a choice between categories (alternate response)\n if (activeData.type === 'choice-preview' && overData.type === 'category-alternate') {\n const toAlternateIndex = overData.alternateResponseIndex;\n // Extract original choice.id - if DraggableChoice uses the unique id in data, extract the first part\n const choiceId =\n activeData.choice?.id || (typeof activeData.id === 'string' ? activeData.id.split('-')[0] : activeData.id);\n this.moveChoiceInAlternate(\n choiceId,\n activeData.categoryId,\n overData.id,\n activeData.choiceIndex || 0,\n toAlternateIndex,\n );\n }\n\n // placing a choice into a category (alternate response)\n if (allowAlternateEnabled && activeData.type === 'choice' && overData.type === 'category-alternate') {\n const choiceId = activeData.id;\n const categoryId = overData.id;\n const toAlternateResponseIndex = overData.alternateResponseIndex;\n this.addChoiceToAlternateCategory({ id: choiceId }, categoryId, toAlternateResponseIndex);\n }\n };\n\n addChoiceToCategory = (addedChoice, categoryId) => {\n const { model } = this.props;\n let { choices = [], correctResponse = [], maxChoicesPerCategory = 0 } = model || {};\n const choice = (choices || []).find((choice) => choice.id === addedChoice.id);\n\n let newCorrectResponse = moveChoiceToCategory(addedChoice.id, undefined, categoryId, 0, correctResponse);\n\n if (choice.categoryCount !== 0) {\n newCorrectResponse = verifyAllowMultiplePlacements(addedChoice, categoryId, newCorrectResponse);\n }\n const maxCategoryChoices = getMaxCategoryChoices(model);\n\n this.updateModel({\n correctResponse: newCorrectResponse,\n maxChoicesPerCategory:\n maxChoicesPerCategory !== 0 && maxChoicesPerCategory < maxCategoryChoices\n ? maxChoicesPerCategory + 1\n : maxChoicesPerCategory,\n });\n };\n\n deleteChoiceFromCategory = (category, choice, choiceIndex) => {\n const { model } = this.props;\n const correctResponse = removeChoiceFromCategory(choice.id, category.id, choiceIndex, model.correctResponse);\n\n this.updateModel({ correctResponse });\n };\n\n moveChoice = (choiceId, from, to, choiceIndex) => {\n const { model } = this.props;\n let { choices, correctResponse = [], maxChoicesPerCategory = 0 } = model || {};\n const choice = (choices || []).find((choice) => choice.id === choiceId);\n if (to === from || !choice) {\n return;\n }\n if (choice.categoryCount !== 0) {\n correctResponse = moveChoiceToCategory(choice.id, from, to, choiceIndex, correctResponse);\n correctResponse = verifyAllowMultiplePlacements(choice, to, correctResponse);\n } else if (choice.categoryCount === 0) {\n correctResponse = moveChoiceToCategory(choice.id, undefined, to, 0, correctResponse);\n }\n const maxCategoryChoices = getMaxCategoryChoices(model);\n // when maxChoicesPerCategory is set to 0, there is no limit so it should not be updated\n this.updateModel({\n correctResponse,\n maxChoicesPerCategory:\n maxChoicesPerCategory !== 0 && maxChoicesPerCategory < maxCategoryChoices\n ? maxChoicesPerCategory + 1\n : maxChoicesPerCategory,\n });\n };\n\n // methods for alternate responses\n addChoiceToAlternateCategory = (addedChoice, categoryId, altIndex) => {\n const { model } = this.props;\n const { correctResponse, choices, maxChoicesPerCategory = 0 } = model;\n\n const choice = choices.find((c) => c.id === addedChoice.id);\n\n correctResponse.forEach((a) => {\n if (a.category === categoryId) {\n a.alternateResponses = a.alternateResponses || [];\n\n if (a.alternateResponses[altIndex] === undefined) {\n a.alternateResponses[altIndex] = [];\n }\n\n a.alternateResponses[altIndex].push(addedChoice.id);\n if (choice.categoryCount && choice.categoryCount !== 0) {\n a.alternateResponses[altIndex] = a.alternateResponses[altIndex].reduce((acc, currentValue) => {\n if (currentValue === choice.id) {\n const foundIndex = acc.findIndex((c) => c === choice.id);\n if (foundIndex === -1) {\n acc.push(currentValue);\n }\n } else {\n acc.push(currentValue);\n }\n\n return acc;\n }, []);\n }\n\n return a;\n } else {\n if (a.alternateResponses[altIndex] && choice.categoryCount !== 0) {\n a.alternateResponses[altIndex] = a.alternateResponses[altIndex].filter((c) => c !== addedChoice.id);\n return a;\n }\n }\n\n return a;\n });\n\n const maxCategoryChoices = getMaxCategoryChoices(model);\n // when maxChoicesPerCategory is set to 0, there is no limit so it should not be updated\n this.updateModel({\n correctResponse,\n maxChoicesPerCategory:\n maxChoicesPerCategory !== 0 && maxChoicesPerCategory < maxCategoryChoices\n ? maxChoicesPerCategory + 1\n : maxChoicesPerCategory,\n });\n };\n\n moveChoiceInAlternate = (choiceId, from, to, choiceIndex, alternateIndex) => {\n const { model } = this.props;\n let { choices, correctResponse = [], maxChoicesPerCategory = 0 } = model || {};\n const choice = (choices || []).find((choice) => choice.id === choiceId);\n correctResponse = moveChoiceToAlternate(\n choiceId,\n from,\n to,\n choiceIndex,\n correctResponse,\n alternateIndex,\n choice?.categoryCount,\n );\n\n const maxCategoryChoices = getMaxCategoryChoices(model);\n // when maxChoicesPerCategory is set to 0, there is no limit so it should not be updated\n this.updateModel({\n correctResponse,\n maxChoicesPerCategory:\n maxChoicesPerCategory !== 0 && maxChoicesPerCategory < maxCategoryChoices\n ? maxChoicesPerCategory + 1\n : maxChoicesPerCategory,\n });\n };\n\n deleteChoiceFromAlternateCategory = (category, choice, choiceIndex, altIndex) => {\n const { model } = this.props;\n\n const correctResponse = removeChoiceFromAlternate(\n choice.id,\n category.id,\n choiceIndex,\n altIndex,\n model.correctResponse,\n );\n\n this.updateModel({ correctResponse });\n };\n\n renderDragOverlay = () => {\n const { activeDragItem } = this.state;\n const { model, configuration } = this.props;\n\n if (!activeDragItem) return null;\n\n if (activeDragItem.type === 'choice') {\n const choice = model.choices?.find((c) => c.id === activeDragItem.id);\n if (!choice) return null;\n\n return <Choice choice={choice} configuration={configuration} />;\n } else if (activeDragItem.type === 'choice-preview' && activeDragItem.alternateResponseIndex === undefined) {\n const choice = model.choices?.find((c) => c.id === activeDragItem.id);\n if (!choice) return null;\n return <ChoicePreview choice={choice} />;\n } else if (activeDragItem.type === 'choice-preview' && activeDragItem.alternateResponseIndex !== undefined) {\n const choice = model.choices?.find((c) => c.id === activeDragItem.id);\n if (!choice) return null;\n return <ChoicePreview choice={choice} alternateResponseIndex={activeDragItem.alternateResponseIndex} />;\n }\n\n return null;\n };\n\n render() {\n const { configuration, imageSupport, model, uploadSoundSupport, onConfigurationChanged } = this.props;\n const {\n allowAlternate = {},\n allowMultiplePlacements = {},\n baseInputConfiguration = {},\n categoriesPerRow = {},\n choicesPosition = {},\n contentDimensions = {},\n feedback = {},\n lockChoiceOrder = {},\n maxImageHeight = {},\n maxImageWidth = {},\n maxPlacements = {},\n minCategoriesPerRow = 1,\n partialScoring = {},\n prompt = {},\n rationale = {},\n scoringType = {},\n settingsPanelDisabled,\n spellCheck = {},\n studentInstructions = {},\n teacherInstructions = {},\n withRubric = {},\n mathMlOptions = {},\n language = {},\n languageChoices = {},\n allowMaxAnswerChoices = {},\n } = configuration || {};\n const {\n allowAlternateEnabled,\n allowMaxChoicesPerCategory,\n errors,\n feedbackEnabled,\n maxChoicesPerCategory,\n promptEnabled,\n rationaleEnabled,\n spellCheckEnabled,\n teacherInstructionsEnabled,\n toolbarEditorPosition,\n extraCSSRules,\n } = model || {};\n const {\n prompt: promptError,\n rationale: rationaleError,\n teacherInstructions: teacherInstructionsError,\n } = errors || {};\n\n const toolbarOpts = {\n position: toolbarEditorPosition === 'top' ? 'top' : 'bottom',\n };\n\n const config = model.config || {};\n config.choices = config.choices || { label: '', columns: 2 };\n\n const categories = buildCategories(model.categories || [], model.choices || [], model.correctResponse || []);\n\n const alternateResponses = buildAlternateResponses(\n model.categories || [],\n model.choices || [],\n model.correctResponse || [],\n );\n\n const choices = model.choices.map((c) => {\n c.correctResponseCount = this.countChoiceInCorrectResponse(c);\n // ensure categoryCount is set even though updatedModel hasn't been called\n c.categoryCount = this.checkAllowMultiplePlacements(model.allowMultiplePlacementsEnabled, c);\n return c;\n });\n\n const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;\n const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;\n\n const panelSettings = {\n partialScoring: partialScoring.settings && toggle(partialScoring.label),\n lockChoiceOrder: lockChoiceOrder.settings && toggle(lockChoiceOrder.label),\n categoriesPerRow:\n categoriesPerRow.settings &&\n numberField(categoriesPerRow.label, {\n label: categoriesPerRow.label,\n min: minCategoriesPerRow,\n max: 6,\n }),\n choicesPosition: choicesPosition.settings && radio(choicesPosition.label, ['below', 'above', 'left', 'right']),\n allowMultiplePlacementsEnabled:\n allowMultiplePlacements.settings &&\n dropdown(allowMultiplePlacements.label, [\n multiplePlacements.enabled,\n multiplePlacements.disabled,\n multiplePlacements.perChoice,\n ]),\n maxAnswerChoices:\n allowMaxAnswerChoices.settings &&\n numberField(allowMaxAnswerChoices.label, {\n label: '',\n min: choices?.length || 0,\n max: 30,\n }),\n allowMaxChoicesPerCategory: maxPlacements.settings && toggle(maxPlacements.label),\n maxChoicesPerCategory:\n allowMaxChoicesPerCategory === true &&\n numberField(maxPlacements.label, {\n label: '',\n min: 0,\n max: 30,\n }),\n promptEnabled: prompt.settings && toggle(prompt.label),\n feedbackEnabled: feedback.settings && toggle(feedback.label),\n allowAlternateEnabled: allowAlternate.settings && toggle(allowAlternate.label),\n 'language.enabled': language.settings && toggle(language.label, true),\n language: language.settings && language.enabled && dropdown(languageChoices.label, languageChoices.options),\n };\n\n const panelProperties = {\n teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),\n studentInstructionsEnabled: studentInstructions.settings && toggle(studentInstructions.label),\n rationaleEnabled: rationale.settings && toggle(rationale.label),\n spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),\n scoringType: scoringType.settings && radio(scoringType.label, ['auto', 'rubric']),\n rubricEnabled: withRubric?.settings && toggle(withRubric?.label),\n };\n\n const isOpened = this.isAlertModalOpened();\n const alertMaxChoicesMsg = translator.t('translation:categorize:maxChoicesPerCategoryRestriction', {\n lng: model.language,\n maxChoicesPerCategory,\n });\n\n return (\n <DragProvider onDragStart={this.onDragStart} onDragEnd={this.onDragEnd}>\n <IdProvider value={this.uid}>\n <layout.ConfigLayout\n extraCSSRules={extraCSSRules}\n dimensions={contentDimensions}\n hideSettings={settingsPanelDisabled}\n settings={\n <Panel\n model={model}\n onChangeModel={this.updateModel}\n configuration={configuration}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n Settings: panelSettings,\n Properties: panelProperties,\n }}\n modal={\n <AlertDialog\n title={'Warning'}\n text={alertMaxChoicesMsg}\n open={isOpened}\n onClose={this.onAlertModalCancel}\n />\n }\n />\n }\n >\n {teacherInstructionsEnabled && (\n <StyledInputContainer label={teacherInstructions.label}>\n <EditableHtml\n markup={model.teacherInstructions || ''}\n onChange={this.changeTeacherInstructions}\n imageSupport={imageSupport}\n error={teacherInstructionsError}\n nonEmpty={false}\n toolbarOpts={toolbarOpts}\n pluginProps={getPluginProps(teacherInstructions?.inputConfiguration, baseInputConfiguration)}\n spellCheck={spellCheckEnabled}\n maxImageWidth={(maxImageWidth && maxImageWidth.teacherInstructions) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.teacherInstructions) || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n />\n {teacherInstructionsError && <ErrorText>{teacherInstructionsError}</ErrorText>}\n </StyledInputContainer>\n )}\n\n {promptEnabled && (\n <StyledInputContainer label={prompt.label}>\n <EditableHtml\n markup={model.prompt || ''}\n onChange={this.onPromptChanged}\n imageSupport={imageSupport}\n error={promptError}\n nonEmpty={false}\n disableUnderline\n toolbarOpts={toolbarOpts}\n pluginProps={getPluginProps(prompt?.inputConfiguration, baseInputConfiguration)}\n spellCheck={spellCheckEnabled}\n maxImageWidth={maxImageWidth && maxImageWidth.prompt}\n maxImageHeight={maxImageHeight && maxImageHeight.prompt}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n />\n {promptError && <ErrorText>{promptError}</ErrorText>}\n </StyledInputContainer>\n )}\n\n <Categories\n imageSupport={imageSupport}\n uploadSoundSupport={uploadSoundSupport}\n model={model}\n categories={categories || []}\n onModelChanged={this.updateModel}\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheckEnabled}\n configuration={configuration}\n defaultImageMaxWidth={defaultImageMaxWidth}\n defaultImageMaxHeight={defaultImageMaxHeight}\n mathMlOptions={mathMlOptions}\n />\n\n <Choices\n imageSupport={imageSupport}\n uploadSoundSupport={uploadSoundSupport}\n choices={choices}\n model={model}\n onModelChanged={this.updateModel}\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheckEnabled}\n configuration={configuration}\n defaultImageMaxWidth={defaultImageMaxWidth}\n defaultImageMaxHeight={defaultImageMaxHeight}\n />\n\n {allowAlternateEnabled && (\n <StyledHeader\n label=\"Alternate Responses\"\n buttonLabel=\"ADD AN ALTERNATE RESPONSE\"\n onAdd={this.onAddAlternateResponse}\n />\n )}\n {allowAlternateEnabled &&\n alternateResponses.map((categoriesList, index) => {\n return (\n <React.Fragment key={index}>\n <StyledHeader\n variant={'subtitle1'}\n label=\"Alternate Response\"\n buttonLabel=\"REMOVE ALTERNATE RESPONSE\"\n onAdd={() => this.onRemoveAlternateResponse(index)}\n />\n <AlternateResponses\n altIndex={index}\n imageSupport={imageSupport}\n model={model}\n configuration={configuration}\n categories={categoriesList}\n onModelChanged={this.updateModel}\n uploadSoundSupport={uploadSoundSupport}\n mathMlOptions={mathMlOptions}\n />\n </React.Fragment>\n );\n })}\n\n {rationaleEnabled && (\n <StyledInputContainer label={rationale.label}>\n <EditableHtml\n markup={model.rationale || ''}\n onChange={this.changeRationale}\n imageSupport={imageSupport}\n error={rationaleError}\n nonEmpty={false}\n toolbarOpts={toolbarOpts}\n pluginProps={getPluginProps(prompt?.inputConfiguration, baseInputConfiguration)}\n spellCheck={spellCheckEnabled}\n maxImageWidth={(maxImageWidth && maxImageWidth.rationale) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.rationale) || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n />\n {rationaleError && <ErrorText>{rationaleError}</ErrorText>}\n </StyledInputContainer>\n )}\n\n {feedbackEnabled && (\n <FeedbackConfig feedback={model.feedback} onChange={this.changeFeedback} toolbarOpts={toolbarOpts} />\n )}\n </layout.ConfigLayout>\n <DragOverlay>\n <DragPreviewWrapper>{this.renderDragOverlay()}</DragPreviewWrapper>\n </DragOverlay>\n </IdProvider>\n </DragProvider>\n );\n }\n}\n\nexport default Design;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,UAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAUA,IAAAQ,mBAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,KAAA,GAAAT,OAAA;AACA,IAAAU,cAAA,GAAAV,OAAA;AAEA,IAAAW,WAAA,GAAAT,sBAAA,CAAAF,OAAA;AACA,IAAAY,mBAAA,GAAAV,sBAAA,CAAAF,OAAA;AACA,IAAAa,QAAA,GAAAX,sBAAA,CAAAF,OAAA;AACA,IAAAc,OAAA,GAAAZ,sBAAA,CAAAF,OAAA;AACA,IAAAe,cAAA,GAAAb,sBAAA,CAAAF,OAAA;AACA,IAAAgB,QAAA,GAAAhB,OAAA;AACA,IAAAiB,OAAA,GAAAf,sBAAA,CAAAF,OAAA;AACA,IAAAkB,OAAA,GAA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CAAC,eACtBzL,MAAA,CAAAoC,OAAA,CAAAQ,aAAA,CAACxC,KAAA,CAAAuP,WAAW,qBACV3P,MAAA,CAAAoC,OAAA,CAAAQ,aAAA,CAACd,kBAAkB,QAAE,IAAI,CAAC8N,iBAAiB,CAAC,CAAsB,CACvD,CACH,CACA,CAAC;EAEnB;AACF;AAACC,OAAA,CAAA5L,MAAA,GAAAA,MAAA;AAAA,IAAA9B,gBAAA,CAAAC,OAAA,EA/pBY6B,MAAM,eACE;EACjBoF,aAAa,EAAEyG,kBAAS,CAACC,MAAM;EAC/BC,SAAS,EAAEF,kBAAS,CAACG,MAAM;EAC3BxG,sBAAsB,EAAEqG,kBAAS,CAACI,IAAI;EACtChM,KAAK,EAAE4L,kBAAS,CAACC,MAAM,CAACI,UAAU;EAClChM,QAAQ,EAAE2L,kBAAS,CAACI,IAAI,CAACC,UAAU;EACnCtO,GAAG,EAAEiO,kBAAS,CAACG,MAAM;EACrB1G,YAAY,EAAEuG,kBAAS,CAACM,KAAK,CAAC;IAC5BC,GAAG,EAAEP,kBAAS,CAACI,IAAI,CAACC,UAAU;IAC9BG,MAAM,EAAER,kBAAS,CAACI,IAAI,CAACC;EACzB,CAAC,CAAC;EACF3G,kBAAkB,EAAEsG,kBAAS,CAACM,KAAK,CAAC;IAClCC,GAAG,EAAEP,kBAAS,CAACI,IAAI,CAACC,UAAU;IAC9BG,MAAM,EAAER,kBAAS,CAACI,IAAI,CAACC;EACzB,CAAC;AACH,CAAC;AAAA,IAAAI,QAAA,GAAAV,OAAA,CAAAzN,OAAA,GAipBY6B,MAAM","ignoreList":[]}
|
|
@@ -10,8 +10,8 @@ var _utils = require("./utils");
|
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
12
|
var _styles = require("@mui/material/styles");
|
|
13
|
-
var
|
|
14
|
-
const StyledEditableHtml = (0, _styles.styled)(
|
|
13
|
+
var _editableHtmlTipTap = _interopRequireDefault(require("@pie-lib/editable-html-tip-tap"));
|
|
14
|
+
const StyledEditableHtml = (0, _styles.styled)(_editableHtmlTipTap.default)(({
|
|
15
15
|
theme
|
|
16
16
|
}) => ({
|
|
17
17
|
flex: '1',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-header.js","names":["_utils","require","_react","_interopRequireDefault","_propTypes","_styles","
|
|
1
|
+
{"version":3,"file":"input-header.js","names":["_utils","require","_react","_interopRequireDefault","_propTypes","_styles","_editableHtmlTipTap","StyledEditableHtml","styled","EditableHtml","theme","flex","paddingBottom","spacing","maxWidth","InputHeaderContainer","display","justifyContent","InputHeader","React","Component","constructor","props","componentDidMount","focusedEl","index","inputRef","focus","render","onChange","configuration","label","deleteFocusedEl","disabled","imageSupport","toolbarOpts","spellCheck","error","maxImageWidth","maxImageHeight","uploadSoundSupport","mathMlOptions","headers","baseInputConfiguration","default","createElement","ref","autoWidthToolbar","markup","pluginProps","getPluginProps","inputConfiguration","languageCharactersProps","language","onDone","exports","_defineProperty2","PropTypes","object","isRequired","func","bool","number","string","onDelete","shape","add","delete","_default"],"sources":["../../src/design/input-header.jsx"],"sourcesContent":["import { getPluginProps } from './utils';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@mui/material/styles';\nimport EditableHtml from '@pie-lib/editable-html-tip-tap';\n\nconst StyledEditableHtml = styled(EditableHtml)(({ theme }) => ({\n flex: '1',\n paddingBottom: theme.spacing(1),\n maxWidth: '100%',\n}));\n\nconst InputHeaderContainer = styled('div')({\n display: 'flex',\n justifyContent: 'space-between',\n});\n\nexport class InputHeader extends React.Component {\n static propTypes = {\n configuration: PropTypes.object.isRequired,\n deleteFocusedEl: PropTypes.func,\n disabled: PropTypes.bool,\n focusedEl: PropTypes.number,\n index: PropTypes.number,\n label: PropTypes.string,\n maxImageWidth: PropTypes.object,\n maxImageHeight: PropTypes.object,\n onChange: PropTypes.func,\n onDelete: PropTypes.func,\n imageSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n uploadSoundSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n toolbarOpts: PropTypes.object,\n error: PropTypes.string,\n spellCheck: PropTypes.bool,\n };\n\n static defaultProps = {};\n\n constructor(props) {\n super(props);\n }\n\n componentDidMount() {\n const { focusedEl, index } = this.props;\n if (focusedEl && index && focusedEl === index) {\n this.inputRef.focus('end', null, true);\n }\n }\n\n render() {\n const {\n onChange,\n configuration,\n label,\n deleteFocusedEl,\n disabled,\n imageSupport,\n toolbarOpts,\n spellCheck,\n error,\n maxImageWidth,\n maxImageHeight,\n uploadSoundSupport,\n mathMlOptions = {},\n } = this.props;\n\n const { headers, baseInputConfiguration } = configuration;\n\n return (\n <InputHeaderContainer>\n <StyledEditableHtml\n imageSupport={imageSupport}\n disabled={disabled}\n ref={(ref) => (this.inputRef = ref)}\n autoWidthToolbar\n label={'label'}\n markup={label}\n onChange={onChange}\n pluginProps={getPluginProps(headers?.inputConfiguration, baseInputConfiguration)}\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheck}\n error={error}\n maxImageWidth={maxImageWidth}\n maxImageHeight={maxImageHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n onDone={() => {\n deleteFocusedEl && deleteFocusedEl();\n }}\n mathMlOptions={mathMlOptions}\n />\n </InputHeaderContainer>\n );\n }\n}\n\nexport default InputHeader;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,UAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,mBAAA,GAAAH,sBAAA,CAAAF,OAAA;AAEA,MAAMM,kBAAkB,GAAG,IAAAC,cAAM,EAACC,2BAAY,CAAC,CAAC,CAAC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CAACG,IAAI,CAACD;EACzB,CAAC,CAAC;EACFnB,kBAAkB,EAAEiB,kBAAS,CAACQ,KAAK,CAAC;IAClCC,GAAG,EAAET,kBAAS,CAACG,IAAI,CAACD,UAAU;IAC9BQ,MAAM,EAAEV,kBAAS,CAACG,IAAI,CAACD;EACzB,CAAC,CAAC;EACFxB,WAAW,EAAEsB,kBAAS,CAACC,MAAM;EAC7BrB,KAAK,EAAEoB,kBAAS,CAACM,MAAM;EACvB3B,UAAU,EAAEqB,kBAAS,CAACI;AACxB,CAAC;AAAA,IAAAL,gBAAA,CAAAZ,OAAA,EAvBU1B,WAAW,kBAyBA,CAAC,CAAC;AAAA,IAAAkD,QAAA,GAAAb,OAAA,CAAAX,OAAA,GA4DX1B,WAAW","ignoreList":[]}
|
package/configure/package.json
CHANGED
|
@@ -3,30 +3,30 @@
|
|
|
3
3
|
"private": true,
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"module": "src/index.js",
|
|
6
|
-
"version": "10.0.0-beta.
|
|
6
|
+
"version": "10.0.0-beta.1",
|
|
7
7
|
"description": "",
|
|
8
8
|
"scripts": {},
|
|
9
9
|
"author": "pie framework developers",
|
|
10
10
|
"license": "ISC",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@dnd-kit/core": "6.1
|
|
12
|
+
"@dnd-kit/core": "6.3.1",
|
|
13
13
|
"@emotion/react": "^11.14.0",
|
|
14
14
|
"@emotion/style": "^0.8.0",
|
|
15
15
|
"@mui/icons-material": "^7.3.4",
|
|
16
16
|
"@mui/material": "^7.3.4",
|
|
17
17
|
"@pie-framework/pie-configure-events": "^1.3.0",
|
|
18
|
-
"@pie-lib/categorize": "
|
|
19
|
-
"@pie-lib/config-ui": "
|
|
20
|
-
"@pie-lib/drag": "
|
|
21
|
-
"@pie-lib/editable-html": "
|
|
22
|
-
"@pie-lib/math-rendering": "
|
|
23
|
-
"@pie-lib/render-ui": "
|
|
24
|
-
"@pie-lib/translator": "
|
|
25
|
-
"debug": "^
|
|
26
|
-
"lodash": "^4.17.
|
|
18
|
+
"@pie-lib/categorize": "1.1.1-next.1",
|
|
19
|
+
"@pie-lib/config-ui": "12.1.1-next.3",
|
|
20
|
+
"@pie-lib/drag": "3.1.1-next.1",
|
|
21
|
+
"@pie-lib/editable-html-tip-tap": "1.1.1-next.3",
|
|
22
|
+
"@pie-lib/math-rendering": "4.1.1-next.1",
|
|
23
|
+
"@pie-lib/render-ui": "5.1.1-next.1",
|
|
24
|
+
"@pie-lib/translator": "3.1.1-next.1",
|
|
25
|
+
"debug": "^4.1.1",
|
|
26
|
+
"lodash-es": "^4.17.23",
|
|
27
27
|
"prop-types": "^15.6.2",
|
|
28
|
-
"react": "18.
|
|
29
|
-
"react-dom": "18.
|
|
28
|
+
"react": "18.3.1",
|
|
29
|
+
"react-dom": "18.3.1"
|
|
30
30
|
},
|
|
31
31
|
"gitHead": "a53e5e851a76da9c1d1a919b277ca0c4c8a8bff2"
|
|
32
32
|
}
|
package/controller/CHANGELOG.md
CHANGED
|
@@ -3,17 +3,6 @@
|
|
|
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.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-controller@8.3.2...@pie-element/categorize-controller@8.3.3) (2025-11-27)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
### Bug Fixes
|
|
10
|
-
|
|
11
|
-
* bump libs PD-5274, PD-5211, PD-5248 ([7610b25](https://github.com/pie-framework/pie-elements/commit/7610b25423956b6492f33322513b3430051fca77))
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
6
|
## [8.3.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-controller@8.3.1...@pie-element/categorize-controller@8.3.2) (2025-10-22)
|
|
18
7
|
|
|
19
8
|
|
package/controller/lib/index.js
CHANGED
|
@@ -12,7 +12,7 @@ Object.defineProperty(exports, "score", {
|
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
14
|
exports.validate = void 0;
|
|
15
|
-
var
|
|
15
|
+
var _lodashEs = require("lodash-es");
|
|
16
16
|
var _categorize = require("@pie-lib/categorize");
|
|
17
17
|
var _feedback = require("@pie-lib/feedback");
|
|
18
18
|
var _controllerUtils = require("@pie-lib/controller-utils");
|
|
@@ -241,7 +241,7 @@ const outcome = (question, session, env) => {
|
|
|
241
241
|
return new Promise(resolve => {
|
|
242
242
|
resolve({
|
|
243
243
|
score: getTotalScore(question, session, env),
|
|
244
|
-
empty: !session || (0,
|
|
244
|
+
empty: !session || (0, _lodashEs.isEmpty)(session)
|
|
245
245
|
});
|
|
246
246
|
});
|
|
247
247
|
}
|
|
@@ -377,10 +377,10 @@ const validate = (model = {}, config = {}) => {
|
|
|
377
377
|
errors.associationError = 'At least one token should be assigned to at least one category.';
|
|
378
378
|
}
|
|
379
379
|
}
|
|
380
|
-
if (!(0,
|
|
380
|
+
if (!(0, _lodashEs.isEmpty)(choicesErrors)) {
|
|
381
381
|
errors.choicesErrors = choicesErrors;
|
|
382
382
|
}
|
|
383
|
-
if (!(0,
|
|
383
|
+
if (!(0, _lodashEs.isEmpty)(categoriesErrors)) {
|
|
384
384
|
errors.categoriesErrors = categoriesErrors;
|
|
385
385
|
}
|
|
386
386
|
return errors;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_isEmpty","_interopRequireDefault","require","_categorize","_feedback","_controllerUtils","_translator","_defaults","_utils","translator","Translator","getPartialScore","correctResponse","builtCategories","placements","score","reduce","acc","choices","length","filter","ch","correct","maxScore","extraPlacements","totalScore","parseFloat","toFixed","exports","getAlternates","map","c","alternateResponses","alternate","getTotalScore","question","session","env","Object","keys","categories","answers","buildState","alternates","enabled","partialScoring","getCorrectness","Promise","resolve","mode","undefined","createDefaultModel","model","defaults","normalize","updateSession","normalizedQuestion","answerCorrectness","role","categoriesPerRow","choicesLabel","choicesPosition","feedback","feedbackEnabled","promptEnabled","prompt","rowLabels","rationaleEnabled","rationale","teacherInstructionsEnabled","teacherInstructions","language","maxChoicesPerCategory","extraCSSRules","minRowHeight","fontSizeFactor","autoplayAudioEnabled","completeAudioEnabled","customAudioButton","note","fb","lockChoiceOrder","lockChoices","filteredCorrectResponse","response","filteredChoices","choice","getFeedbackForCorrectness","getShuffledChoices","t","lng","responseAreasToBeFilled","possibleResponses","hasUnplacedChoices","getCompleteResponseDetails","allowAlternateEnabled","out","correctness","disabled","showNote","outcome","reject","Error","empty","isEmpty","createCorrectResponseSession","id","getInnerText","html","replaceAll","getContent","replace","validate","config","maxAnswerChoices","minChoices","minCategories","maxCategories","maxLengthPerChoice","maxLengthPerCategory","reversedChoices","reverse","errors","choicesErrors","categoriesErrors","forEach","field","required","category","label","index","content","identicalAnswer","slice","some","nbOfCategories","nbOfChoices","categoriesError","choicesError","hasAssociations","duplicateAlternateIndex","duplicateCategory","isCorrectResponseDuplicated","isAlternateDuplicated","duplicateAlternate","associationError"],"sources":["../src/index.js"],"sourcesContent":["import isEmpty from 'lodash/isEmpty';\nimport { buildState, score } from '@pie-lib/categorize';\nimport { getFeedbackForCorrectness } from '@pie-lib/feedback';\nimport { lockChoices, getShuffledChoices, partialScoring } from '@pie-lib/controller-utils';\nimport Translator from '@pie-lib/translator';\n\nconst { translator } = Translator;\nimport defaults from './defaults';\nimport { getCompleteResponseDetails, isAlternateDuplicated, isCorrectResponseDuplicated } from './utils';\n\n// eslint-disable-next-line no-console\n\nexport { score };\n\nexport const getPartialScore = (correctResponse, builtCategories) => {\n // in the resulted best scenario we make a sum with all the correct responses\n // and all the placements\n const { placements, score } = builtCategories.reduce(\n (acc, { choices = [] }) => ({\n placements: acc.placements + choices.length,\n score: acc.score + choices.filter((ch) => ch.correct).length,\n }),\n { placements: 0, score: 0 },\n );\n\n // in the correct response, we make a sum of the max possible score\n const { maxScore } = correctResponse.reduce(\n (acc, { choices }) => ({\n maxScore: acc.maxScore + choices.length,\n }),\n { maxScore: 0 },\n );\n\n // if there are any extra placements, we subtract from the obtained score\n const extraPlacements = placements > maxScore ? placements - maxScore : 0;\n const totalScore = (score - extraPlacements) / maxScore;\n\n return totalScore < 0 ? 0 : parseFloat(totalScore.toFixed(2));\n};\n\nconst getAlternates = (correctResponse) =>\n correctResponse.map((c) => c.alternateResponses).filter((alternate) => alternate);\n\nexport const getTotalScore = (question, session, env) => {\n if (!session) {\n return 0;\n }\n\n if (Object.keys(session).length === 0) {\n return 0;\n }\n const { categories, choices } = question || {};\n let { correctResponse } = question || {};\n let { answers } = session || {};\n answers = answers || [];\n correctResponse = correctResponse || [];\n\n // this function is used in pie-ui/categorize as well, in order to get the best scenario\n // so we get the best scenario and calculate the score\n const { categories: builtCategories, correct } = buildState(categories, choices, answers, correctResponse);\n\n const alternates = getAlternates(correctResponse);\n const enabled = partialScoring.enabled(question, env);\n\n // if there are any alternates, there will be no partial scoring!\n if (enabled && !alternates.length) {\n // we apply partial scoring\n return getPartialScore(correctResponse, builtCategories);\n }\n\n // else we apply dichotomous\n return correct ? 1 : 0;\n};\n\nexport const getCorrectness = (question, session, env) => {\n return new Promise((resolve) => {\n if (env.mode === 'evaluate') {\n const score = getTotalScore(question, session, env);\n if (score === 1) {\n resolve('correct');\n } else if (score === 0) {\n resolve('incorrect');\n } else {\n resolve('partially-correct');\n }\n } else {\n resolve(undefined);\n }\n });\n};\n\nexport const createDefaultModel = (model = {}) =>\n new Promise((resolve) => {\n resolve({\n ...defaults,\n ...model,\n });\n });\n\nexport const normalize = (question) => ({ ...defaults, ...question });\n\n/**\n *\n * @param {*} question\n * @param {*} session\n * @param {*} env\n * @param {*} updateSession - optional - a function that will set the properties passed into it on the session.\n */\nexport const model = async (question, session, env, updateSession) => {\n const normalizedQuestion = normalize(question);\n const answerCorrectness = await getCorrectness(normalizedQuestion, session, env);\n\n const { mode, role } = env || {};\n\n const {\n categories,\n categoriesPerRow,\n choicesLabel,\n choicesPosition,\n correctResponse,\n feedback,\n feedbackEnabled,\n promptEnabled,\n prompt,\n rowLabels,\n rationaleEnabled,\n rationale,\n teacherInstructionsEnabled,\n teacherInstructions,\n language,\n maxChoicesPerCategory,\n extraCSSRules,\n minRowHeight,\n fontSizeFactor,\n autoplayAudioEnabled,\n completeAudioEnabled,\n customAudioButton,\n } = normalizedQuestion;\n let { choices, note } = normalizedQuestion;\n let fb;\n\n const lockChoiceOrder = lockChoices(normalizedQuestion, session, env);\n\n const filteredCorrectResponse = correctResponse.map((response) => {\n const filteredChoices = (response.choices || []).filter((choice) => choice !== 'null');\n return { ...response, choices: filteredChoices };\n });\n\n if (mode === 'evaluate' && feedbackEnabled) {\n fb = await getFeedbackForCorrectness(answerCorrectness, feedback);\n }\n\n if (!lockChoiceOrder) {\n choices = await getShuffledChoices(choices, session, updateSession, 'id');\n }\n\n if (!note) {\n note = translator.t('common:commonCorrectAnswerWithAlternates', { lng: language });\n }\n\n const alternates = getAlternates(filteredCorrectResponse);\n const { responseAreasToBeFilled, possibleResponses, hasUnplacedChoices } = getCompleteResponseDetails(\n filteredCorrectResponse,\n normalizedQuestion.allowAlternateEnabled ? alternates : [],\n normalizedQuestion.choices,\n );\n const out = {\n categories: categories || [],\n categoriesPerRow: categoriesPerRow || 2,\n maxChoicesPerCategory,\n correctness: answerCorrectness,\n choices: choices || [],\n choicesLabel: choicesLabel || '',\n choicesPosition,\n disabled: mode !== 'gather',\n feedback: fb,\n lockChoiceOrder,\n prompt: promptEnabled ? prompt : null,\n rowLabels,\n note,\n env,\n showNote: alternates && alternates.length > 0,\n correctResponse: mode === 'evaluate' ? filteredCorrectResponse : undefined,\n language,\n extraCSSRules,\n fontSizeFactor,\n minRowHeight: minRowHeight,\n autoplayAudioEnabled,\n completeAudioEnabled,\n customAudioButton,\n possibleResponses,\n responseAreasToBeFilled,\n hasUnplacedChoices,\n };\n\n if (role === 'instructor' && (mode === 'view' || mode === 'evaluate')) {\n out.rationale = rationaleEnabled ? rationale : null;\n out.teacherInstructions = teacherInstructionsEnabled ? teacherInstructions : null;\n } else {\n out.rationale = null;\n out.teacherInstructions = null;\n }\n\n return out;\n};\n\nexport const outcome = (question, session, env) => {\n if (env.mode !== 'evaluate') {\n return Promise.reject(new Error('Can not call outcome when mode is not evaluate'));\n } else {\n return new Promise((resolve) => {\n resolve({\n score: getTotalScore(question, session, env),\n empty: !session || isEmpty(session),\n });\n });\n }\n};\n\nexport const createCorrectResponseSession = (question, env) => {\n return new Promise((resolve) => {\n const { mode, role } = env || {};\n\n if (mode !== 'evaluate' && role === 'instructor') {\n const { correctResponse } = question;\n\n resolve({ answers: correctResponse, id: 1 });\n } else {\n return resolve(null);\n }\n });\n};\n\n// remove all html tags\nconst getInnerText = (html) => (html || '').replaceAll(/<[^>]*>/g, '');\n\n// remove all html tags except img, iframe and source tag for audio\nconst getContent = (html) => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');\n\nexport const validate = (model = {}, config = {}) => {\n const { categories, choices, correctResponse, maxAnswerChoices } = model;\n const {\n minChoices = 1,\n minCategories = 1,\n maxCategories = 12,\n maxLengthPerChoice = 300,\n maxLengthPerCategory = 150,\n } = config;\n const reversedChoices = [...(choices || [])].reverse();\n const errors = {};\n const choicesErrors = {};\n const categoriesErrors = {};\n\n ['teacherInstructions', 'prompt', 'rationale'].forEach((field) => {\n if (config[field]?.required && !getContent(model[field])) {\n errors[field] = 'This field is required.';\n }\n });\n\n (categories || []).forEach((category) => {\n const { id, label } = category;\n\n if (getInnerText(label).length > maxLengthPerCategory) {\n categoriesErrors[id] = `Category labels should be no more than ${maxLengthPerCategory} characters long.`;\n }\n });\n\n (reversedChoices || []).forEach((choice, index) => {\n const { id, content } = choice;\n\n if (getInnerText(content).length > maxLengthPerChoice) {\n choicesErrors[id] = `Tokens should be no more than ${maxLengthPerChoice} characters long.`;\n }\n\n if (!getContent(content)) {\n choicesErrors[id] = 'Tokens should not be empty.';\n } else {\n const identicalAnswer = reversedChoices.slice(index + 1).some((c) => c.content === content);\n\n if (identicalAnswer) {\n choicesErrors[id] = 'Tokens content should be unique.';\n }\n }\n });\n\n const nbOfCategories = (categories || []).length;\n const nbOfChoices = (choices || []).length;\n\n if (nbOfCategories > maxCategories) {\n errors.categoriesError = `No more than ${maxCategories} categories should be defined.`;\n } else if (nbOfCategories < minCategories) {\n errors.categoriesError = `There should be at least ${minCategories} category defined.`;\n }\n\n if (nbOfChoices < minChoices) {\n errors.choicesError = `There should be at least ${minChoices} choices defined.`;\n } else if (nbOfChoices > maxAnswerChoices) {\n errors.choicesError = `No more than ${maxAnswerChoices} choices should be defined.`;\n }\n\n if (nbOfChoices && nbOfCategories) {\n let hasAssociations = false;\n\n (correctResponse || []).forEach((response) => {\n const { choices = [], alternateResponses = [] } = response;\n\n if (choices.length) {\n hasAssociations = true;\n } else {\n alternateResponses.forEach((alternate) => {\n if ((alternate || []).length) {\n hasAssociations = true;\n }\n });\n }\n });\n\n let duplicateAlternateIndex = -1;\n let duplicateCategory = '';\n (correctResponse || []).forEach((response) => {\n const { choices = [], alternateResponses = [], category } = response;\n\n if (duplicateAlternateIndex === -1) {\n duplicateAlternateIndex = isCorrectResponseDuplicated(choices, alternateResponses);\n\n if (duplicateAlternateIndex === -1) {\n duplicateAlternateIndex = isAlternateDuplicated(alternateResponses);\n }\n\n duplicateCategory = category;\n }\n });\n\n if (duplicateAlternateIndex > -1) {\n errors.duplicateAlternate = { index: duplicateAlternateIndex, category: duplicateCategory };\n }\n\n if (!hasAssociations) {\n errors.associationError = 'At least one token should be assigned to at least one category.';\n }\n }\n\n if (!isEmpty(choicesErrors)) {\n errors.choicesErrors = choicesErrors;\n }\n\n if (!isEmpty(categoriesErrors)) {\n errors.categoriesErrors = categoriesErrors;\n }\n\n return errors;\n};\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,I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a;MAAkB,CAAC;IAC7F;IAEA,IAAI,CAACF,eAAe,EAAE;MACpBjB,MAAM,CAACuB,gBAAgB,GAAG,iEAAiE;IAC7F;EACF;EAEA,IAAI,CAAC,IAAAzC,gBAAO,EAACmB,aAAa,CAAC,EAAE;IAC3BD,MAAM,CAACC,aAAa,GAAGA,aAAa;EACtC;EAEA,IAAI,CAAC,IAAAnB,gBAAO,EAACoB,gBAAgB,CAAC,EAAE;IAC9BF,MAAM,CAACE,gBAAgB,GAAGA,gBAAgB;EAC5C;EAEA,OAAOF,MAAM;AACf,CAAC;AAAC9F,OAAA,CAAAoF,QAAA,GAAAA,QAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_lodashEs","require","_categorize","_feedback","_controllerUtils","_translator","_interopRequireDefault","_defaults","_utils","translator","Translator","getPartialScore","correctResponse","builtCategories","placements","score","reduce","acc","choices","length","filter","ch","correct","maxScore","extraPlacements","totalScore","parseFloat","toFixed","exports","getAlternates","map","c","alternateResponses","alternate","getTotalScore","question","session","env","Object","keys","categories","answers","buildState","alternates","enabled","partialScoring","getCorrectness","Promise","resolve","mode","undefined","createDefaultModel","model","defaults","normalize","updateSession","normalizedQuestion","answerCorrectness","role","categoriesPerRow","choicesLabel","choicesPosition","feedback","feedbackEnabled","promptEnabled","prompt","rowLabels","rationaleEnabled","rationale","teacherInstructionsEnabled","teacherInstructions","language","maxChoicesPerCategory","extraCSSRules","minRowHeight","fontSizeFactor","autoplayAudioEnabled","completeAudioEnabled","customAudioButton","note","fb","lockChoiceOrder","lockChoices","filteredCorrectResponse","response","filteredChoices","choice","getFeedbackForCorrectness","getShuffledChoices","t","lng","responseAreasToBeFilled","possibleResponses","hasUnplacedChoices","getCompleteResponseDetails","allowAlternateEnabled","out","correctness","disabled","showNote","outcome","reject","Error","empty","isEmpty","createCorrectResponseSession","id","getInnerText","html","replaceAll","getContent","replace","validate","config","maxAnswerChoices","minChoices","minCategories","maxCategories","maxLengthPerChoice","maxLengthPerCategory","reversedChoices","reverse","errors","choicesErrors","categoriesErrors","forEach","field","required","category","label","index","content","identicalAnswer","slice","some","nbOfCategories","nbOfChoices","categoriesError","choicesError","hasAssociations","duplicateAlternateIndex","duplicateCategory","isCorrectResponseDuplicated","isAlternateDuplicated","duplicateAlternate","associationError"],"sources":["../src/index.js"],"sourcesContent":["import { isEmpty } from 'lodash-es';\nimport { buildState, score } from '@pie-lib/categorize';\nimport { getFeedbackForCorrectness } from '@pie-lib/feedback';\nimport { lockChoices, getShuffledChoices, partialScoring } from '@pie-lib/controller-utils';\nimport Translator from '@pie-lib/translator';\n\nconst { translator } = Translator;\nimport defaults from './defaults';\nimport { getCompleteResponseDetails, isAlternateDuplicated, isCorrectResponseDuplicated } from './utils';\n\n// eslint-disable-next-line no-console\n\nexport { score };\n\nexport const getPartialScore = (correctResponse, builtCategories) => {\n // in the resulted best scenario we make a sum with all the correct responses\n // and all the placements\n const { placements, score } = builtCategories.reduce(\n (acc, { choices = [] }) => ({\n placements: acc.placements + choices.length,\n score: acc.score + choices.filter((ch) => ch.correct).length,\n }),\n { placements: 0, score: 0 },\n );\n\n // in the correct response, we make a sum of the max possible score\n const { maxScore } = correctResponse.reduce(\n (acc, { choices }) => ({\n maxScore: acc.maxScore + choices.length,\n }),\n { maxScore: 0 },\n );\n\n // if there are any extra placements, we subtract from the obtained score\n const extraPlacements = placements > maxScore ? placements - maxScore : 0;\n const totalScore = (score - extraPlacements) / maxScore;\n\n return totalScore < 0 ? 0 : parseFloat(totalScore.toFixed(2));\n};\n\nconst getAlternates = (correctResponse) =>\n correctResponse.map((c) => c.alternateResponses).filter((alternate) => alternate);\n\nexport const getTotalScore = (question, session, env) => {\n if (!session) {\n return 0;\n }\n\n if (Object.keys(session).length === 0) {\n return 0;\n }\n const { categories, choices } = question || {};\n let { correctResponse } = question || {};\n let { answers } = session || {};\n answers = answers || [];\n correctResponse = correctResponse || [];\n\n // this function is used in pie-ui/categorize as well, in order to get the best scenario\n // so we get the best scenario and calculate the score\n const { categories: builtCategories, correct } = buildState(categories, choices, answers, correctResponse);\n\n const alternates = getAlternates(correctResponse);\n const enabled = partialScoring.enabled(question, env);\n\n // if there are any alternates, there will be no partial scoring!\n if (enabled && !alternates.length) {\n // we apply partial scoring\n return getPartialScore(correctResponse, builtCategories);\n }\n\n // else we apply dichotomous\n return correct ? 1 : 0;\n};\n\nexport const getCorrectness = (question, session, env) => {\n return new Promise((resolve) => {\n if (env.mode === 'evaluate') {\n const score = getTotalScore(question, session, env);\n if (score === 1) {\n resolve('correct');\n } else if (score === 0) {\n resolve('incorrect');\n } else {\n resolve('partially-correct');\n }\n } else {\n resolve(undefined);\n }\n });\n};\n\nexport const createDefaultModel = (model = {}) =>\n new Promise((resolve) => {\n resolve({\n ...defaults,\n ...model,\n });\n });\n\nexport const normalize = (question) => ({ ...defaults, ...question });\n\n/**\n *\n * @param {*} question\n * @param {*} session\n * @param {*} env\n * @param {*} updateSession - optional - a function that will set the properties passed into it on the session.\n */\nexport const model = async (question, session, env, updateSession) => {\n const normalizedQuestion = normalize(question);\n const answerCorrectness = await getCorrectness(normalizedQuestion, session, env);\n\n const { mode, role } = env || {};\n\n const {\n categories,\n categoriesPerRow,\n choicesLabel,\n choicesPosition,\n correctResponse,\n feedback,\n feedbackEnabled,\n promptEnabled,\n prompt,\n rowLabels,\n rationaleEnabled,\n rationale,\n teacherInstructionsEnabled,\n teacherInstructions,\n language,\n maxChoicesPerCategory,\n extraCSSRules,\n minRowHeight,\n fontSizeFactor,\n autoplayAudioEnabled,\n completeAudioEnabled,\n customAudioButton,\n } = normalizedQuestion;\n let { choices, note } = normalizedQuestion;\n let fb;\n\n const lockChoiceOrder = lockChoices(normalizedQuestion, session, env);\n\n const filteredCorrectResponse = correctResponse.map((response) => {\n const filteredChoices = (response.choices || []).filter((choice) => choice !== 'null');\n return { ...response, choices: filteredChoices };\n });\n\n if (mode === 'evaluate' && feedbackEnabled) {\n fb = await getFeedbackForCorrectness(answerCorrectness, feedback);\n }\n\n if (!lockChoiceOrder) {\n choices = await getShuffledChoices(choices, session, updateSession, 'id');\n }\n\n if (!note) {\n note = translator.t('common:commonCorrectAnswerWithAlternates', { lng: language });\n }\n\n const alternates = getAlternates(filteredCorrectResponse);\n const { responseAreasToBeFilled, possibleResponses, hasUnplacedChoices } = getCompleteResponseDetails(\n filteredCorrectResponse,\n normalizedQuestion.allowAlternateEnabled ? alternates : [],\n normalizedQuestion.choices,\n );\n const out = {\n categories: categories || [],\n categoriesPerRow: categoriesPerRow || 2,\n maxChoicesPerCategory,\n correctness: answerCorrectness,\n choices: choices || [],\n choicesLabel: choicesLabel || '',\n choicesPosition,\n disabled: mode !== 'gather',\n feedback: fb,\n lockChoiceOrder,\n prompt: promptEnabled ? prompt : null,\n rowLabels,\n note,\n env,\n showNote: alternates && alternates.length > 0,\n correctResponse: mode === 'evaluate' ? filteredCorrectResponse : undefined,\n language,\n extraCSSRules,\n fontSizeFactor,\n minRowHeight: minRowHeight,\n autoplayAudioEnabled,\n completeAudioEnabled,\n customAudioButton,\n possibleResponses,\n responseAreasToBeFilled,\n hasUnplacedChoices,\n };\n\n if (role === 'instructor' && (mode === 'view' || mode === 'evaluate')) {\n out.rationale = rationaleEnabled ? rationale : null;\n out.teacherInstructions = teacherInstructionsEnabled ? teacherInstructions : null;\n } else {\n out.rationale = null;\n out.teacherInstructions = null;\n }\n\n return out;\n};\n\nexport const outcome = (question, session, env) => {\n if (env.mode !== 'evaluate') {\n return Promise.reject(new Error('Can not call outcome when mode is not evaluate'));\n } else {\n return new Promise((resolve) => {\n resolve({\n score: getTotalScore(question, session, env),\n empty: !session || isEmpty(session),\n });\n });\n }\n};\n\nexport const createCorrectResponseSession = (question, env) => {\n return new Promise((resolve) => {\n const { mode, role } = env || {};\n\n if (mode !== 'evaluate' && role === 'instructor') {\n const { correctResponse } = question;\n\n resolve({ answers: correctResponse, id: 1 });\n } else {\n return resolve(null);\n }\n });\n};\n\n// remove all html tags\nconst getInnerText = (html) => (html || '').replaceAll(/<[^>]*>/g, '');\n\n// remove all html tags except img, iframe and source tag for audio\nconst getContent = (html) => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');\n\nexport const validate = (model = {}, config = {}) => {\n const { categories, choices, correctResponse, maxAnswerChoices } = model;\n const {\n minChoices = 1,\n minCategories = 1,\n maxCategories = 12,\n maxLengthPerChoice = 300,\n maxLengthPerCategory = 150,\n } = config;\n const reversedChoices = [...(choices || [])].reverse();\n const errors = {};\n const choicesErrors = {};\n const categoriesErrors = {};\n\n ['teacherInstructions', 'prompt', 'rationale'].forEach((field) => {\n if (config[field]?.required && !getContent(model[field])) {\n errors[field] = 'This field is required.';\n }\n });\n\n (categories || []).forEach((category) => {\n const { id, label } = category;\n\n if (getInnerText(label).length > maxLengthPerCategory) {\n categoriesErrors[id] = `Category labels should be no more than ${maxLengthPerCategory} characters long.`;\n }\n });\n\n (reversedChoices || []).forEach((choice, index) => {\n const { id, content } = choice;\n\n if (getInnerText(content).length > maxLengthPerChoice) {\n choicesErrors[id] = `Tokens should be no more than ${maxLengthPerChoice} characters long.`;\n }\n\n if (!getContent(content)) {\n choicesErrors[id] = 'Tokens should not be empty.';\n } else {\n const identicalAnswer = reversedChoices.slice(index + 1).some((c) => c.content === content);\n\n if (identicalAnswer) {\n choicesErrors[id] = 'Tokens content should be unique.';\n }\n }\n });\n\n const nbOfCategories = (categories || []).length;\n const nbOfChoices = (choices || []).length;\n\n if (nbOfCategories > maxCategories) {\n errors.categoriesError = `No more than ${maxCategories} categories should be defined.`;\n } else if (nbOfCategories < minCategories) {\n errors.categoriesError = `There should be at least ${minCategories} category defined.`;\n }\n\n if (nbOfChoices < minChoices) {\n errors.choicesError = `There should be at least ${minChoices} choices defined.`;\n } else if (nbOfChoices > maxAnswerChoices) {\n errors.choicesError = `No more than ${maxAnswerChoices} choices should be defined.`;\n }\n\n if (nbOfChoices && nbOfCategories) {\n let hasAssociations = false;\n\n (correctResponse || []).forEach((response) => {\n const { choices = [], alternateResponses = [] } = response;\n\n if (choices.length) {\n hasAssociations = true;\n } else {\n alternateResponses.forEach((alternate) => {\n if ((alternate || []).length) {\n hasAssociations = true;\n }\n });\n }\n });\n\n let duplicateAlternateIndex = -1;\n let duplicateCategory = '';\n (correctResponse || []).forEach((response) => {\n const { choices = [], alternateResponses = [], category } = response;\n\n if (duplicateAlternateIndex === -1) {\n duplicateAlternateIndex = isCorrectResponseDuplicated(choices, alternateResponses);\n\n if (duplicateAlternateIndex === -1) {\n duplicateAlternateIndex = isAlternateDuplicated(alternateResponses);\n }\n\n duplicateCategory = category;\n }\n });\n\n if (duplicateAlternateIndex > -1) {\n errors.duplicateAlternate = { index: duplicateAlternateIndex, category: duplicateCategory };\n }\n\n if (!hasAssociations) {\n errors.associationError = 'At least one token should be assigned to at least one category.';\n }\n }\n\n if (!isEmpty(choicesErrors)) {\n errors.choicesErrors = choicesErrors;\n }\n\n if (!isEmpty(categoriesErrors)) {\n errors.categoriesErrors = categoriesErrors;\n }\n\n return errors;\n};\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAC,sBAAA,CAAAL,OAAA;AAGA,IAAAM,SAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAFA,MAAM;EAAEQ;AAAW,CAAC,GAAGC,mBAAU;;AAIjC;;AAIO,MAAMC,eAAe,GAAGA,CAACC,eAAe,EAAEC,eAAe,KAAK;EACnE;EACA;EACA,MAAM;IAAEC,UAAU;IAAEC;EAAM,CAAC,GAAGF,eAAe,CAACG,MAAM,CAClD,CAACC,GAAG,EAAE;IAAEC,OAAO,GAAG;EAAG,CAAC,MAAM;IAC1BJ,UAAU,EAAEG,GAAG,CAACH,UAAU,GAAGI,OAAO,CAACC,MAAM;IAC3CJ,K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orize-controller",
|
|
3
3
|
"private": true,
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@pie-lib/categorize": "
|
|
6
|
-
"@pie-lib/controller-utils": "
|
|
7
|
-
"@pie-lib/feedback": "
|
|
8
|
-
"@pie-lib/translator": "
|
|
9
|
-
"lodash": "^4.17.
|
|
5
|
+
"@pie-lib/categorize": "1.1.1-next.1",
|
|
6
|
+
"@pie-lib/controller-utils": "1.1.1-next.1",
|
|
7
|
+
"@pie-lib/feedback": "1.1.1-next.1",
|
|
8
|
+
"@pie-lib/translator": "3.1.1-next.1",
|
|
9
|
+
"lodash-es": "^4.17.23"
|
|
10
10
|
},
|
|
11
|
-
"version": "9.0.0-beta.
|
|
11
|
+
"version": "9.0.0-beta.1",
|
|
12
12
|
"description": "",
|
|
13
13
|
"scripts": {},
|
|
14
14
|
"main": "lib/index.js",
|
|
@@ -10,7 +10,6 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
12
|
var _styles = require("@mui/material/styles");
|
|
13
|
-
var _renderUi = require("@pie-lib/render-ui");
|
|
14
13
|
var _choice = _interopRequireDefault(require("./choice"));
|
|
15
14
|
var _droppablePlaceholder = _interopRequireDefault(require("./droppable-placeholder"));
|
|
16
15
|
const CategoryType = exports.CategoryType = {
|
|
@@ -32,7 +31,7 @@ class Category extends _react.default.Component {
|
|
|
32
31
|
return /*#__PURE__*/_react.default.createElement(StyledDiv, {
|
|
33
32
|
className: className,
|
|
34
33
|
id: id
|
|
35
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
34
|
+
}, /*#__PURE__*/_react.default.createElement(_droppablePlaceholder.default, {
|
|
36
35
|
id: id,
|
|
37
36
|
onDropChoice: onDropChoice,
|
|
38
37
|
disabled: disabled,
|
|
@@ -64,27 +63,5 @@ const StyledDiv = (0, _styles.styled)('div')(({
|
|
|
64
63
|
flexDirection: 'column',
|
|
65
64
|
flex: 2
|
|
66
65
|
}));
|
|
67
|
-
const StyledPlaceHolder = (0, _styles.styled)(_droppablePlaceholder.default, {
|
|
68
|
-
shouldForwardProp: prop => prop !== 'correct'
|
|
69
|
-
})(({
|
|
70
|
-
theme,
|
|
71
|
-
correct
|
|
72
|
-
}) => ({
|
|
73
|
-
padding: theme.spacing(0.5),
|
|
74
|
-
borderRadius: theme.spacing(0.5),
|
|
75
|
-
gridColumnGap: 0,
|
|
76
|
-
gridRowGap: 0,
|
|
77
|
-
display: 'flex',
|
|
78
|
-
flexWrap: 'wrap',
|
|
79
|
-
justifyContent: 'center',
|
|
80
|
-
alignItems: 'center',
|
|
81
|
-
alignContent: 'flex-start',
|
|
82
|
-
...(correct === false && {
|
|
83
|
-
border: `solid 2px ${_renderUi.color.incorrect()}`
|
|
84
|
-
}),
|
|
85
|
-
...(correct === true && {
|
|
86
|
-
border: `solid 2px ${_renderUi.color.correct()}`
|
|
87
|
-
})
|
|
88
|
-
}));
|
|
89
66
|
var _default = exports.default = Category;
|
|
90
67
|
//# sourceMappingURL=category.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"category.js","names":["_react","_interopRequireDefault","require","_propTypes","_styles","
|
|
1
|
+
{"version":3,"file":"category.js","names":["_react","_interopRequireDefault","require","_propTypes","_styles","_choice","_droppablePlaceholder","CategoryType","exports","id","PropTypes","string","isRequired","categoryId","Category","React","Component","render","className","choices","disabled","onDropChoice","onRemoveChoice","correct","minRowHeight","props","default","createElement","StyledDiv","map","c","index","_extends2","key","choiceIndex","_defineProperty2","bool","func","styled","theme","display","flexDirection","flex","_default"],"sources":["../../src/categorize/category.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@mui/material/styles';\n\nimport Choice from './choice';\nimport PlaceHolder from './droppable-placeholder';\n\nexport const CategoryType = {\n id: PropTypes.string.isRequired,\n categoryId: PropTypes.string,\n};\n\nexport class Category extends React.Component {\n static propTypes = {\n ...CategoryType,\n className: PropTypes.string,\n disabled: PropTypes.bool,\n onDropChoice: PropTypes.func,\n onRemoveChoice: PropTypes.func,\n minRowHeight: PropTypes.string,\n };\n\n static defaultProps = {};\n\n render() {\n const {\n className,\n choices = [],\n disabled,\n onDropChoice,\n onRemoveChoice,\n id,\n correct,\n minRowHeight,\n } = this.props;\n\n return (\n <StyledDiv className={className} id={id}>\n <PlaceHolder\n id={id}\n onDropChoice={onDropChoice}\n disabled={disabled}\n correct={correct}\n minRowHeight={minRowHeight}\n >\n {choices.map((c, index) => (\n <Choice\n onRemoveChoice={onRemoveChoice}\n disabled={disabled}\n key={index}\n choiceIndex={index}\n categoryId={id}\n {...c}\n />\n ))}\n </PlaceHolder>\n </StyledDiv>\n );\n }\n}\n\nconst StyledDiv = styled('div')(({ theme }) => ({\n display: 'flex',\n flexDirection: 'column',\n flex: 2,\n}));\n\nexport default Category;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAEA,IAAAG,OAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,qBAAA,GAAAL,sBAAA,CAAAC,OAAA;AAEO,MAAMK,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG;EAC1BE,EAAE,EAAEC,kBAAS,CAACC,MAAM,CAACC,UAAU;EAC/BC,UAAU,EAAEH,kBAAS,CAACC;AACxB,CAAC;AAEM,MAAMG,QAAQ,SAASC,cAAK,CAACC,SAAS,CAAC;EAY5CC,MAAMA,CAAA,EAAG;IACP,MAAM;MACJC,SAAS;MACTC,OAAO,GAAG,EAAE;MACZC,QAAQ;MACRC,YAAY;MACZC,cAAc;MACdb,EAAE;MACFc,OAAO;MACPC;IACF,CAAC,GAAG,IAAI,CAACC,KAAK;IAEd,oBACEzB,MAAA,CAAA0B,OAAA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QAAA,GAAAnC,OAAA,CAAAkB,OAAA,GAEWZ,QAAQ","ignoreList":[]}
|
|
@@ -8,8 +8,10 @@ exports.default = void 0;
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
10
|
var _debug = _interopRequireDefault(require("debug"));
|
|
11
|
+
var _styles = require("@mui/material/styles");
|
|
11
12
|
var _core = require("@dnd-kit/core");
|
|
12
13
|
var _drag = require("@pie-lib/drag");
|
|
14
|
+
var _renderUi = require("@pie-lib/render-ui");
|
|
13
15
|
const log = (0, _debug.default)('@pie-ui:categorize:droppable-placeholder');
|
|
14
16
|
const DroppablePlaceholder = ({
|
|
15
17
|
children,
|
|
@@ -17,8 +19,10 @@ const DroppablePlaceholder = ({
|
|
|
17
19
|
disabled,
|
|
18
20
|
choiceBoard,
|
|
19
21
|
minRowHeight,
|
|
20
|
-
id
|
|
22
|
+
id,
|
|
23
|
+
correct
|
|
21
24
|
}) => {
|
|
25
|
+
const theme = (0, _styles.useTheme)();
|
|
22
26
|
const {
|
|
23
27
|
setNodeRef,
|
|
24
28
|
isOver
|
|
@@ -30,6 +34,25 @@ const DroppablePlaceholder = ({
|
|
|
30
34
|
},
|
|
31
35
|
disabled
|
|
32
36
|
});
|
|
37
|
+
const extraStyles = {
|
|
38
|
+
padding: theme.spacing(0.5),
|
|
39
|
+
borderRadius: theme.spacing(0.5),
|
|
40
|
+
gridColumnGap: 0,
|
|
41
|
+
gridRowGap: 0,
|
|
42
|
+
display: 'flex',
|
|
43
|
+
flexWrap: 'wrap',
|
|
44
|
+
justifyContent: 'center',
|
|
45
|
+
alignItems: 'center',
|
|
46
|
+
alignContent: 'flex-start',
|
|
47
|
+
width: '100%',
|
|
48
|
+
height: '100%',
|
|
49
|
+
...(correct === false && {
|
|
50
|
+
border: `solid 2px ${_renderUi.color.incorrect()}`
|
|
51
|
+
}),
|
|
52
|
+
...(correct === true && {
|
|
53
|
+
border: `solid 2px ${_renderUi.color.correct()}`
|
|
54
|
+
})
|
|
55
|
+
};
|
|
33
56
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
34
57
|
ref: setNodeRef,
|
|
35
58
|
style: {
|
|
@@ -42,7 +65,8 @@ const DroppablePlaceholder = ({
|
|
|
42
65
|
grid: grid,
|
|
43
66
|
disabled: disabled,
|
|
44
67
|
choiceBoard: choiceBoard,
|
|
45
|
-
isCategorize: true
|
|
68
|
+
isCategorize: true,
|
|
69
|
+
extraStyles: extraStyles
|
|
46
70
|
}, children));
|
|
47
71
|
};
|
|
48
72
|
DroppablePlaceholder.propTypes = {
|
|
@@ -52,7 +76,8 @@ DroppablePlaceholder.propTypes = {
|
|
|
52
76
|
disabled: _propTypes.default.bool,
|
|
53
77
|
minRowHeight: _propTypes.default.string,
|
|
54
78
|
onDropChoice: _propTypes.default.func,
|
|
55
|
-
id: _propTypes.default.string.isRequired
|
|
79
|
+
id: _propTypes.default.string.isRequired,
|
|
80
|
+
correct: _propTypes.default.bool
|
|
56
81
|
};
|
|
57
82
|
var _default = exports.default = DroppablePlaceholder;
|
|
58
83
|
//# sourceMappingURL=droppable-placeholder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"droppable-placeholder.js","names":["_react","_interopRequireDefault","require","_propTypes","_debug","_core","_drag","log","debug","DroppablePlaceholder","children","grid","disabled","choiceBoard","minRowHeight","id","setNodeRef","isOver","useDroppable","data","itemType","categoryId","default","createElement","ref","style","flex","minHeight","position","PlaceHolder","isCategorize","propTypes","PropTypes","bool","node","isRequired","object","string","onDropChoice","func","_default","exports"],"sources":["../../src/categorize/droppable-placeholder.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport debug from 'debug';\nimport { useDroppable } from '@dnd-kit/core';\nimport { PlaceHolder } from '@pie-lib/drag';\n\nconst log = debug('@pie-ui:categorize:droppable-placeholder');\n\nconst DroppablePlaceholder = ({\n children,\n grid,\n disabled,\n choiceBoard,\n minRowHeight,\n id\n}) => {\n const { setNodeRef, isOver } = useDroppable({\n id,\n data: {\n itemType: 'categorize',\n categoryId: id\n },\n disabled,\n });\n\n return (\n <div\n ref={setNodeRef}\n style={{\n flex: 1,\n minHeight: minRowHeight || '80px',\n position: 'relative'\n }}\n >\n <PlaceHolder\n isOver={isOver}\n grid={grid}\n disabled={disabled}\n choiceBoard={choiceBoard}\n isCategorize\n >\n {children}\n </PlaceHolder>\n </div>\n );\n};\n\nDroppablePlaceholder.propTypes = {\n choiceBoard: PropTypes.bool,\n children: PropTypes.node.isRequired,\n grid: PropTypes.object,\n disabled: PropTypes.bool,\n minRowHeight: PropTypes.string,\n onDropChoice: PropTypes.func,\n id: PropTypes.string.isRequired\n};\n\nexport default DroppablePlaceholder;\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,MAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,
|
|
1
|
+
{"version":3,"file":"droppable-placeholder.js","names":["_react","_interopRequireDefault","require","_propTypes","_debug","_styles","_core","_drag","_renderUi","log","debug","DroppablePlaceholder","children","grid","disabled","choiceBoard","minRowHeight","id","correct","theme","useTheme","setNodeRef","isOver","useDroppable","data","itemType","categoryId","extraStyles","padding","spacing","borderRadius","gridColumnGap","gridRowGap","display","flexWrap","justifyContent","alignItems","alignContent","width","height","border","color","incorrect","default","createElement","ref","style","flex","minHeight","position","PlaceHolder","isCategorize","propTypes","PropTypes","bool","node","isRequired","object","string","onDropChoice","func","_default","exports"],"sources":["../../src/categorize/droppable-placeholder.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport debug from 'debug';\nimport { useTheme } from '@mui/material/styles';\nimport { useDroppable } from '@dnd-kit/core';\nimport { PlaceHolder } from '@pie-lib/drag';\nimport { color } from '@pie-lib/render-ui';\n\nconst log = debug('@pie-ui:categorize:droppable-placeholder');\n\nconst DroppablePlaceholder = ({\n children,\n grid,\n disabled,\n choiceBoard,\n minRowHeight,\n id,\n correct\n}) => {\n const theme = useTheme();\n const { setNodeRef, isOver } = useDroppable({\n id,\n data: {\n itemType: 'categorize',\n categoryId: id\n },\n disabled,\n });\n\n const extraStyles = {\n padding: theme.spacing(0.5),\n borderRadius: theme.spacing(0.5),\n gridColumnGap: 0,\n gridRowGap: 0,\n display: 'flex',\n flexWrap: 'wrap',\n justifyContent: 'center',\n alignItems: 'center',\n alignContent: 'flex-start',\n width: '100%',\n height: '100%',\n ...(correct === false && {\n border: `solid 2px ${color.incorrect()}`,\n }),\n ...(correct === true && {\n border: `solid 2px ${color.correct()}`,\n }),\n };\n\n return (\n <div\n ref={setNodeRef}\n style={{\n flex: 1,\n minHeight: minRowHeight || '80px',\n position: 'relative'\n }}\n >\n <PlaceHolder\n isOver={isOver}\n grid={grid}\n disabled={disabled}\n choiceBoard={choiceBoard}\n isCategorize\n extraStyles={extraStyles}\n >\n {children}\n </PlaceHolder>\n </div>\n );\n};\n\nDroppablePlaceholder.propTypes = {\n choiceBoard: PropTypes.bool,\n children: PropTypes.node.isRequired,\n grid: PropTypes.object,\n disabled: PropTypes.bool,\n minRowHeight: PropTypes.string,\n onDropChoice: PropTypes.func,\n id: PropTypes.string.isRequired,\n correct: PropTypes.bool\n};\n\nexport default DroppablePlaceholder;\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,MAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AAEA,MAAMO,GAAG,GAAG,IAAAC,cAAK,EAAC,0CAA0C,CAAC;AAE7D,MAAMC,oBAAoB,GAAG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IAAI,EAAEA,IAAK;IACXC,QAAQ,EAAEA,QAAS;IACnBC,WAAW,EAAEA,WAAY;IACzBoC,YAAY;IACZxB,WAAW,EAAEA;EAAY,GAExBf,QACU,CACV,CAAC;AAEV,CAAC;AAEDD,oBAAoB,CAACyC,SAAS,GAAG;EAC/BrC,WAAW,EAAEsC,kBAAS,CAACC,IAAI;EAC3B1C,QAAQ,EAAEyC,kBAAS,CAACE,IAAI,CAACC,UAAU;EACnC3C,IAAI,EAAEwC,kBAAS,CAACI,MAAM;EACtB3C,QAAQ,EAAEuC,kBAAS,CAACC,IAAI;EACxBtC,YAAY,EAAEqC,kBAAS,CAACK,MAAM;EAC9BC,YAAY,EAAEN,kBAAS,CAACO,IAAI;EAC5B3C,EAAE,EAAEoC,kBAAS,CAACK,MAAM,CAACF,UAAU;EAC/BtC,OAAO,EAAEmC,kBAAS,CAACC;AACrB,CAAC;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAAnB,OAAA,GAEahC,oBAAoB","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -4,31 +4,31 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "12.0.0-
|
|
7
|
+
"version": "12.0.0-next.0+67da381",
|
|
8
8
|
"description": "",
|
|
9
9
|
"author": "pie framework developers",
|
|
10
10
|
"license": "ISC",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@dnd-kit/core": "6.1
|
|
12
|
+
"@dnd-kit/core": "6.3.1",
|
|
13
13
|
"@emotion/react": "^11.14.0",
|
|
14
14
|
"@emotion/style": "^0.8.0",
|
|
15
15
|
"@mui/icons-material": "^7.3.4",
|
|
16
16
|
"@mui/material": "^7.3.4",
|
|
17
17
|
"@pie-framework/pie-player-events": "^0.1.0",
|
|
18
|
-
"@pie-lib/categorize": "
|
|
19
|
-
"@pie-lib/config-ui": "
|
|
20
|
-
"@pie-lib/correct-answer-toggle": "
|
|
21
|
-
"@pie-lib/drag": "
|
|
22
|
-
"@pie-lib/math-rendering": "
|
|
23
|
-
"@pie-lib/render-ui": "
|
|
24
|
-
"@pie-lib/translator": "
|
|
18
|
+
"@pie-lib/categorize": "1.1.1-next.1",
|
|
19
|
+
"@pie-lib/config-ui": "12.1.1-next.3",
|
|
20
|
+
"@pie-lib/correct-answer-toggle": "3.1.1-next.1",
|
|
21
|
+
"@pie-lib/drag": "3.1.1-next.1",
|
|
22
|
+
"@pie-lib/math-rendering": "4.1.1-next.1",
|
|
23
|
+
"@pie-lib/render-ui": "5.1.1-next.1",
|
|
24
|
+
"@pie-lib/translator": "3.1.1-next.1",
|
|
25
25
|
"debug": "^4.1.1",
|
|
26
|
-
"lodash": "^4.17.
|
|
26
|
+
"lodash-es": "^4.17.23",
|
|
27
27
|
"prop-types": "^15.6.1",
|
|
28
|
-
"react": "18.
|
|
29
|
-
"react-dom": "18.
|
|
28
|
+
"react": "18.3.1",
|
|
29
|
+
"react-dom": "18.3.1"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "67da3818d2af966110c6e85f6e8e238b79515eb2",
|
|
32
32
|
"scripts": {
|
|
33
33
|
"postpublish": "../../scripts/postpublish"
|
|
34
34
|
},
|