@pie-element/complex-rubric 7.1.2-next.4 → 7.1.2-next.6
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/dist/author/index.js +2 -2
- package/dist/author/main.js +1 -1
- package/dist/browser/author/index.js +48598 -623
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/delivery/index.js +2 -2
- package/dist/browser/delivery/index.js.map +1 -1
- package/dist/browser/{delivery-Ennb1iec.js → delivery-BJfoUSKA.js} +121 -84
- package/dist/browser/delivery-BJfoUSKA.js.map +1 -0
- package/dist/browser/print/index.js +2 -2
- package/dist/browser/print/index.js.map +1 -1
- package/dist/browser/private-tags-Cpudy6vC.js +9226 -0
- package/dist/browser/private-tags-Cpudy6vC.js.map +1 -0
- package/dist/browser/rolldown-runtime-CWhphoD1.js +32 -0
- package/dist/index.iife.js +31 -31
- package/dist/private-tags.js +1 -1
- package/package.json +14 -8
- package/dist/browser/delivery-Ennb1iec.js.map +0 -1
- package/dist/browser/private-tags-DE5lm2KU.js +0 -60411
- package/dist/browser/private-tags-DE5lm2KU.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/controller/defaults.ts","../../../src/controller/utils.ts","../../../src/controller/index.ts"],"sourcesContent":["// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/complex-rubric/controller/src/defaults.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\n// todo the import from pie-lib/rubric WILL break pslb\n// so don't use it unless you also test \"yarn build\"\nconst RUBRIC_TYPES = {\n SIMPLE_RUBRIC: 'simpleRubric',\n MULTI_TRAIT_RUBRIC: 'multiTraitRubric',\n 'rubricless': 'rubricless',\n};\n\nconst multiTraitDefaultModel = {\n description: false,\n excludeZero: false,\n halfScoring: false,\n pointLabels: true,\n scales: [],\n standards: false,\n visibleToStudent: true,\n};\n\nconst rubricDefaultModel = {\n points: ['', '', '', ''],\n sampleAnswers: [null, null, null, null],\n maxPoints: 3,\n excludeZero: false,\n};\n\nconst rubriclessDefaultModel = {\n maxPoints: 100,\n excludeZero: false,\n rubriclessInstructionEnabled: true,\n};\n\nexport default {\n rubricType: 'simpleRubric',\n rubrics: {\n [RUBRIC_TYPES.SIMPLE_RUBRIC]: rubricDefaultModel,\n [RUBRIC_TYPES.MULTI_TRAIT_RUBRIC]: multiTraitDefaultModel,\n [RUBRIC_TYPES.RUBRICLESS]: rubriclessDefaultModel,\n },\n};\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/complex-rubric/controller/src/utils.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nexport const markupToText = (s) => {\n return (s || '').replace(/(<([^>]+)>)/ig, '');\n};\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/complex-rubric/controller/src/index.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport defaults from './defaults.js';\nimport { markupToText } from './utils.js';\n\n\n// todo the import from pie-lib/rubric WILL break pslb\n// so don't use it unless you also test \"yarn build\"\nconst RUBRIC_TYPES = {\n SIMPLE_RUBRIC: 'simpleRubric',\n MULTI_TRAIT_RUBRIC: 'multiTraitRubric',\n 'rubricless': 'rubricless',\n};\n\nexport function createDefaultModel(model = {}) {\n return new Promise((resolve) => resolve({ ...defaults, ...model }));\n}\n\nexport const normalize = (question) => ({ ...defaults, ...question });\n\n/**\n * @param {*} question\n * @param {*} session\n * @param {*} env\n */\nexport async function model(question, session, env) {\n const normalizedQuestion = normalize(question);\n\n if (\n normalizedQuestion.rubricType === RUBRIC_TYPES.SIMPLE_RUBRIC ||\n normalizedQuestion.rubricType === RUBRIC_TYPES.RUBRICLESS\n ) {\n return new Promise((resolve) => {\n resolve(\n env && env.role && env.role === 'instructor'\n ? {\n ...normalizedQuestion,\n rubrics: {\n ...normalizedQuestion.rubrics,\n multiTraitRubric: {\n ...normalizedQuestion.rubrics.multiTraitRubric,\n visible: false,\n },\n },\n }\n : {},\n );\n });\n } else {\n if (\n !env.role ||\n (env.role === 'student' && normalizedQuestion.rubrics && normalizedQuestion.rubrics.multiTraitRubric)\n ) {\n normalizedQuestion.rubrics.multiTraitRubric.visible = normalizedQuestion.visibleToStudent;\n } else {\n normalizedQuestion.rubrics.multiTraitRubric.visible = true;\n }\n\n // todo update pie-ui instead of parsing this here:\n const { scales, excludeZero } = normalizedQuestion.rubrics.multiTraitRubric || {};\n const parsedScales = (scales || []).map((scale) => ({ ...scale, excludeZero }));\n\n return {\n ...normalizedQuestion,\n rubrics: {\n ...normalizedQuestion.rubrics,\n simpleRubric: {\n ...normalizedQuestion.rubrics.simpleRubric,\n visible: false,\n },\n rubricless: {\n ...normalizedQuestion.rubrics.rubricless,\n visible: false,\n },\n multiTraitRubric: {\n ...normalizedQuestion.rubrics.multiTraitRubric,\n scales: parsedScales,\n },\n },\n };\n }\n}\n\nexport const getScore = () => 0;\n\n/**\n * @param {Object} model - the main model\n * @param {*} session\n * @param {Object} env\n */\nexport function outcome() {\n return new Promise((resolve) => resolve({ score: 0, empty: true }));\n}\n\nexport const createCorrectResponseSession = (question, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n resolve({ id: '1' });\n } else {\n resolve(null);\n }\n });\n};\n\n// IMPORTANT! This function is a duplicate of rubric/controller/validate function!\n// If you make any changes to this function, please make sure you also update rubric/controller/validate function!“.\nconst validateSimpleRubric = (model) => {\n const { points } = model;\n const errors = {};\n const pointsDescriptorsErrors = {};\n\n (points || []).forEach((point, index) => {\n\n if (!point || point === '<div></div>') {\n pointsDescriptorsErrors[index] = 'Points descriptors cannot be empty.';\n } else {\n const identicalPointDescr = points.slice(index + 1).some((p) => markupToText(p) === markupToText(point));\n\n if (identicalPointDescr) {\n pointsDescriptorsErrors[index] = 'Points descriptors should be unique.';\n }\n }\n });\n\n if (Object.keys(pointsDescriptorsErrors).length > 0) {\n errors.pointsDescriptorsErrors = pointsDescriptorsErrors;\n }\n\n return errors;\n};\n\n// IMPORTANT! This function is a duplicate of multi-trait-rubric/controller/validate function!\n// If you make any changes to this function, please make sure you also update multi-trait-rubric/controller/validate function!“.\nconst validateMultiTraitRubric = (model) => {\n const { scales, description = false, pointLabels = false } = model;\n const errors = {};\n const traitsErrors = {};\n const scorePointsErrors = {};\n\n (scales || []).forEach((scale, scaleIndex) => {\n const { traits = [] } = scale;\n const { scorePointsLabels = [] } = scale;\n const scaleErrors = {};\n const scorePointsLabelsErrors = {};\n\n if (pointLabels) {\n scorePointsLabels.forEach((scorePointLabel, scoreIndex) => {\n if (!scorePointLabel || scorePointLabel === '<div></div>') {\n scorePointsLabelsErrors[scoreIndex] = 'Points labels should not be empty.';\n } else {\n const identicalScorePointLabel = scorePointsLabels\n .slice(scoreIndex + 1)\n .some((s) => markupToText(s) === markupToText(scorePointLabel));\n\n if (identicalScorePointLabel) {\n scorePointsLabelsErrors[scoreIndex] = 'Points labels should be unique.';\n }\n }\n });\n }\n\n if (Object.keys(scorePointsLabelsErrors).length > 0) {\n scorePointsErrors[scaleIndex] = scorePointsLabelsErrors;\n }\n\n traits.forEach((trait, traitIndex) => {\n if (!trait.name || trait.name === '<div></div>') {\n scaleErrors[traitIndex] = { name: 'Trait names should not be empty.' };\n } else {\n const identicalTraitName = traits\n .slice(traitIndex + 1)\n .some((t) => markupToText(t.name) === markupToText(trait.name));\n\n if (identicalTraitName) {\n scaleErrors[traitIndex] = { name: 'Trait names should be unique.' };\n }\n }\n if (description && (!trait.description || trait.description === '<div></div>')) {\n scaleErrors[traitIndex] = { ...scaleErrors[traitIndex], description: 'Trait description should not be empty' };\n } else {\n const identicalTraitDescr = traits\n .slice(traitIndex + 1)\n .some((t) => markupToText(t.description) === markupToText(trait.description));\n\n if (description && identicalTraitDescr) {\n scaleErrors[traitIndex] = { ...scaleErrors[traitIndex], description: 'Trait descriptions should be unique.' };\n }\n }\n });\n if (Object.keys(scaleErrors).length > 0) {\n traitsErrors[scaleIndex] = scaleErrors;\n }\n });\n\n if (Object.keys(traitsErrors).length > 0) {\n errors.traitsErrors = traitsErrors;\n }\n\n if (Object.keys(scorePointsErrors).length > 0) {\n errors.scorePointsErrors = scorePointsErrors;\n }\n\n return errors;\n};\n\nexport const validate = (model = {}, config = {}) => {\n const { rubrics = {}, rubricType } = model;\n const { multiTraitRubric = {}, simpleRubric = {} } = rubrics;\n let errors = {};\n\n switch (rubricType) {\n case RUBRIC_TYPES.SIMPLE_RUBRIC:\n default:\n errors = validateSimpleRubric(simpleRubric);\n break;\n case RUBRIC_TYPES.MULTI_TRAIT_RUBRIC:\n errors = validateMultiTraitRubric(multiTraitRubric);\n break;\n }\n\n return errors;\n};\n"],"mappings":";AAYA,IAAM,IAAe;CACnB,eAAe;CACf,oBAAoB;CACpB,YAAc;AAChB,GAEM,IAAyB;CAC7B,aAAa;CACb,aAAa;CACb,aAAa;CACb,aAAa;CACb,QAAQ,CAAC;CACT,WAAW;CACX,kBAAkB;AACpB,GAEM,IAAqB;CACzB,QAAQ;EAAC;EAAI;EAAI;EAAI;CAAE;CACvB,eAAe;EAAC;EAAM;EAAM;EAAM;CAAI;CACtC,WAAW;CACX,aAAa;AACf,GAEM,IAAyB;CAC7B,WAAW;CACX,aAAa;CACb,8BAA8B;AAChC,GAEA,IAAe;CACb,YAAY;CACZ,SAAS;GACN,EAAa,gBAAgB;GAC7B,EAAa,qBAAqB;GAClC,EAAa,aAAa;CAC7B;AACF,GCtCa,KAAgB,OACjB,KAAK,IAAI,QAAQ,iBAAiB,EAAE,GCK1C,IAAe;CACnB,eAAe;CACf,oBAAoB;CACpB,YAAc;AAChB;AAEA,SAAgB,EAA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Aa,EAAM,IAAI,CAE3D,MACF,EAAY,KAAc,EAAE,MAAM,gCAAgC,IAGlE,MAAgB,CAAC,EAAM,eAAe,EAAM,gBAAgB,gBAC9D,EAAY,KAAc;IAAE,GAAG,EAAY;IAAa,aAAa;GAAwC;QACxG;IACL,IAAM,IAAsB,EACzB,MAAM,IAAa,CAAC,EACpB,MAAM,MAAM,EAAa,EAAE,WAAW,MAAM,EAAa,EAAM,WAAW,CAAC;IAE9E,AAAI,KAAe,MACjB,EAAY,KAAc;KAAE,GAAG,EAAY;KAAa,aAAa;IAAuC;GAEhH;EACF,CAAC,GACG,OAAO,KAAK,CAAW,EAAE,SAAS,MACpC,EAAa,KAAc;CAE/B,CAAC,GAEG,OAAO,KAAK,CAAY,EAAE,SAAS,MACrC,EAAO,eAAe,IAGpB,OAAO,KAAK,CAAiB,EAAE,SAAS,MAC1C,EAAO,oBAAoB,IAGtB;AACT,GAEa,KAAY,IAAQ,CAAC,GAAG,IAAS,CAAC,MAAM;CACnD,IAAM,EAAE,aAAU,CAAC,GAAG,kBAAe,GAC/B,EAAE,sBAAmB,CAAC,GAAG,kBAAe,CAAC,MAAM,GACjD,IAAS,CAAC;CAEd,QAAQ,GAAR;EACE,KAAK,EAAa;EAClB;GACE,IAAS,EAAqB,CAAY;GAC1C;EACF,KAAK,EAAa;GAChB,IAAS,EAAyB,CAAgB;GAClD;CACJ;CAEA,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/controller/defaults.ts","../../../src/controller/utils.ts","../../../src/controller/index.ts"],"sourcesContent":["// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/complex-rubric/controller/src/defaults.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\n// todo the import from pie-lib/rubric WILL break pslb\n// so don't use it unless you also test \"yarn build\"\nconst RUBRIC_TYPES = {\n SIMPLE_RUBRIC: 'simpleRubric',\n MULTI_TRAIT_RUBRIC: 'multiTraitRubric',\n 'rubricless': 'rubricless',\n};\n\nconst multiTraitDefaultModel = {\n description: false,\n excludeZero: false,\n halfScoring: false,\n pointLabels: true,\n scales: [],\n standards: false,\n visibleToStudent: true,\n};\n\nconst rubricDefaultModel = {\n points: ['', '', '', ''],\n sampleAnswers: [null, null, null, null],\n maxPoints: 3,\n excludeZero: false,\n};\n\nconst rubriclessDefaultModel = {\n maxPoints: 100,\n excludeZero: false,\n rubriclessInstructionEnabled: true,\n};\n\nexport default {\n rubricType: 'simpleRubric',\n rubrics: {\n [RUBRIC_TYPES.SIMPLE_RUBRIC]: rubricDefaultModel,\n [RUBRIC_TYPES.MULTI_TRAIT_RUBRIC]: multiTraitDefaultModel,\n [RUBRIC_TYPES.RUBRICLESS]: rubriclessDefaultModel,\n },\n};\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/complex-rubric/controller/src/utils.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nexport const markupToText = (s) => {\n return (s || '').replace(/(<([^>]+)>)/ig, '');\n};\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/complex-rubric/controller/src/index.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport defaults from './defaults.js';\nimport { markupToText } from './utils.js';\n\n\n// todo the import from pie-lib/rubric WILL break pslb\n// so don't use it unless you also test \"yarn build\"\nconst RUBRIC_TYPES = {\n SIMPLE_RUBRIC: 'simpleRubric',\n MULTI_TRAIT_RUBRIC: 'multiTraitRubric',\n 'rubricless': 'rubricless',\n};\n\nexport function createDefaultModel(model = {}) {\n return new Promise((resolve) => resolve({ ...defaults, ...model }));\n}\n\nexport const normalize = (question) => ({ ...defaults, ...question });\n\n/**\n * @param {*} question\n * @param {*} session\n * @param {*} env\n */\nexport async function model(question, session, env) {\n const normalizedQuestion = normalize(question);\n\n if (\n normalizedQuestion.rubricType === RUBRIC_TYPES.SIMPLE_RUBRIC ||\n normalizedQuestion.rubricType === RUBRIC_TYPES.RUBRICLESS\n ) {\n return new Promise((resolve) => {\n resolve(\n env && env.role && env.role === 'instructor'\n ? {\n ...normalizedQuestion,\n rubrics: {\n ...normalizedQuestion.rubrics,\n multiTraitRubric: {\n ...normalizedQuestion.rubrics.multiTraitRubric,\n visible: false,\n },\n },\n }\n : {},\n );\n });\n } else {\n if (\n !env.role ||\n (env.role === 'student' && normalizedQuestion.rubrics && normalizedQuestion.rubrics.multiTraitRubric)\n ) {\n normalizedQuestion.rubrics.multiTraitRubric.visible = normalizedQuestion.visibleToStudent;\n } else {\n normalizedQuestion.rubrics.multiTraitRubric.visible = true;\n }\n\n // todo update pie-ui instead of parsing this here:\n const { scales, excludeZero } = normalizedQuestion.rubrics.multiTraitRubric || {};\n const parsedScales = (scales || []).map((scale) => ({ ...scale, excludeZero }));\n\n return {\n ...normalizedQuestion,\n rubrics: {\n ...normalizedQuestion.rubrics,\n simpleRubric: {\n ...normalizedQuestion.rubrics.simpleRubric,\n visible: false,\n },\n rubricless: {\n ...normalizedQuestion.rubrics.rubricless,\n visible: false,\n },\n multiTraitRubric: {\n ...normalizedQuestion.rubrics.multiTraitRubric,\n scales: parsedScales,\n },\n },\n };\n }\n}\n\nexport const getScore = () => 0;\n\n/**\n * @param {Object} model - the main model\n * @param {*} session\n * @param {Object} env\n */\nexport function outcome() {\n return new Promise((resolve) => resolve({ score: 0, empty: true }));\n}\n\nexport const createCorrectResponseSession = (question, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n resolve({ id: '1' });\n } else {\n resolve(null);\n }\n });\n};\n\n// IMPORTANT! This function is a duplicate of rubric/controller/validate function!\n// If you make any changes to this function, please make sure you also update rubric/controller/validate function!“.\nconst validateSimpleRubric = (model) => {\n const { points } = model;\n const errors = {};\n const pointsDescriptorsErrors = {};\n\n (points || []).forEach((point, index) => {\n\n if (!point || point === '<div></div>') {\n pointsDescriptorsErrors[index] = 'Points descriptors cannot be empty.';\n } else {\n const identicalPointDescr = points.slice(index + 1).some((p) => markupToText(p) === markupToText(point));\n\n if (identicalPointDescr) {\n pointsDescriptorsErrors[index] = 'Points descriptors should be unique.';\n }\n }\n });\n\n if (Object.keys(pointsDescriptorsErrors).length > 0) {\n errors.pointsDescriptorsErrors = pointsDescriptorsErrors;\n }\n\n return errors;\n};\n\n// IMPORTANT! This function is a duplicate of multi-trait-rubric/controller/validate function!\n// If you make any changes to this function, please make sure you also update multi-trait-rubric/controller/validate function!“.\nconst validateMultiTraitRubric = (model) => {\n const { scales, description = false, pointLabels = false } = model;\n const errors = {};\n const traitsErrors = {};\n const scorePointsErrors = {};\n\n (scales || []).forEach((scale, scaleIndex) => {\n const { traits = [] } = scale;\n const { scorePointsLabels = [] } = scale;\n const scaleErrors = {};\n const scorePointsLabelsErrors = {};\n\n if (pointLabels) {\n scorePointsLabels.forEach((scorePointLabel, scoreIndex) => {\n if (!scorePointLabel || scorePointLabel === '<div></div>') {\n scorePointsLabelsErrors[scoreIndex] = 'Points labels should not be empty.';\n } else {\n const identicalScorePointLabel = scorePointsLabels\n .slice(scoreIndex + 1)\n .some((s) => markupToText(s) === markupToText(scorePointLabel));\n\n if (identicalScorePointLabel) {\n scorePointsLabelsErrors[scoreIndex] = 'Points labels should be unique.';\n }\n }\n });\n }\n\n if (Object.keys(scorePointsLabelsErrors).length > 0) {\n scorePointsErrors[scaleIndex] = scorePointsLabelsErrors;\n }\n\n traits.forEach((trait, traitIndex) => {\n if (!trait.name || trait.name === '<div></div>') {\n scaleErrors[traitIndex] = { name: 'Trait names should not be empty.' };\n } else {\n const identicalTraitName = traits\n .slice(traitIndex + 1)\n .some((t) => markupToText(t.name) === markupToText(trait.name));\n\n if (identicalTraitName) {\n scaleErrors[traitIndex] = { name: 'Trait names should be unique.' };\n }\n }\n if (description && (!trait.description || trait.description === '<div></div>')) {\n scaleErrors[traitIndex] = { ...scaleErrors[traitIndex], description: 'Trait description should not be empty' };\n } else {\n const identicalTraitDescr = traits\n .slice(traitIndex + 1)\n .some((t) => markupToText(t.description) === markupToText(trait.description));\n\n if (description && identicalTraitDescr) {\n scaleErrors[traitIndex] = { ...scaleErrors[traitIndex], description: 'Trait descriptions should be unique.' };\n }\n }\n });\n if (Object.keys(scaleErrors).length > 0) {\n traitsErrors[scaleIndex] = scaleErrors;\n }\n });\n\n if (Object.keys(traitsErrors).length > 0) {\n errors.traitsErrors = traitsErrors;\n }\n\n if (Object.keys(scorePointsErrors).length > 0) {\n errors.scorePointsErrors = scorePointsErrors;\n }\n\n return errors;\n};\n\nexport const validate = (model = {}, config = {}) => {\n const { rubrics = {}, rubricType } = model;\n const { multiTraitRubric = {}, simpleRubric = {} } = rubrics;\n let errors = {};\n\n switch (rubricType) {\n case RUBRIC_TYPES.SIMPLE_RUBRIC:\n default:\n errors = validateSimpleRubric(simpleRubric);\n break;\n case RUBRIC_TYPES.MULTI_TRAIT_RUBRIC:\n errors = validateMultiTraitRubric(multiTraitRubric);\n break;\n }\n\n return errors;\n};\n"],"mappings":";AAYA,IAAM,IAAe;CACnB,eAAe;CACf,oBAAoB;CACpB,YAAc;AAChB,GAEM,IAAyB;CAC7B,aAAa;CACb,aAAa;CACb,aAAa;CACb,aAAa;CACb,QAAQ,CAAC;CACT,WAAW;CACX,kBAAkB;AACpB,GAEM,IAAqB;CACzB,QAAQ;EAAC;EAAI;EAAI;EAAI;CAAE;CACvB,eAAe;EAAC;EAAM;EAAM;EAAM;CAAI;CACtC,WAAW;CACX,aAAa;AACf,GAEM,IAAyB;CAC7B,WAAW;CACX,aAAa;CACb,8BAA8B;AAChC,GAEA,IAAe;CACb,YAAY;CACZ,SAAS;GACN,EAAa,gBAAgB;GAC7B,EAAa,qBAAqB;GAClC,EAAa,aAAa;CAC7B;AACF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AAS,GAAO,MAAe;GAYpC,IAXI,CAAC,EAAM,QAAQ,EAAM,SAAS,gBAChC,EAAY,KAAc,EAAE,MAAM,mCAAmC,IAE1C,EACxB,MAAM,IAAa,CAAC,CAAC,CACrB,MAAM,MAAM,EAAa,EAAE,IAAI,MAAM,EAAa,EAAM,IAAI,CAE3D,MACF,EAAY,KAAc,EAAE,MAAM,gCAAgC,IAGlE,MAAgB,CAAC,EAAM,eAAe,EAAM,gBAAgB,gBAC9D,EAAY,KAAc;IAAE,GAAG,EAAY;IAAa,aAAa;GAAwC;QACxG;IACL,IAAM,IAAsB,EACzB,MAAM,IAAa,CAAC,CAAC,CACrB,MAAM,MAAM,EAAa,EAAE,WAAW,MAAM,EAAa,EAAM,WAAW,CAAC;IAE9E,AAAI,KAAe,MACjB,EAAY,KAAc;KAAE,GAAG,EAAY;KAAa,aAAa;IAAuC;GAEhH;EACF,CAAC,GACG,OAAO,KAAK,CAAW,CAAC,CAAC,SAAS,MACpC,EAAa,KAAc;CAE/B,CAAC,GAEG,OAAO,KAAK,CAAY,CAAC,CAAC,SAAS,MACrC,EAAO,eAAe,IAGpB,OAAO,KAAK,CAAiB,CAAC,CAAC,SAAS,MAC1C,EAAO,oBAAoB,IAGtB;AACT,GAEa,KAAY,IAAQ,CAAC,GAAG,IAAS,CAAC,MAAM;CACnD,IAAM,EAAE,aAAU,CAAC,GAAG,kBAAe,GAC/B,EAAE,sBAAmB,CAAC,GAAG,kBAAe,CAAC,MAAM,GACjD,IAAS,CAAC;CAEd,QAAQ,GAAR;EACE,KAAK,EAAa;EAClB;GACE,IAAS,EAAqB,CAAY;GAC1C;EACF,KAAK,EAAa;GAChB,IAAS,EAAyB,CAAgB;GAClD;CACJ;CAEA,OAAO;AACT"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as e, i as t, n } from "../private-tags-
|
|
2
|
-
import { n as r, t as i } from "../delivery-
|
|
1
|
+
import { a as e, i as t, n } from "../private-tags-Cpudy6vC.js";
|
|
2
|
+
import { n as r, t as i } from "../delivery-BJfoUSKA.js";
|
|
3
3
|
//#region src/delivery/index.ts
|
|
4
4
|
var a = t, o = n, s = class extends r {}, c = class extends i {};
|
|
5
5
|
customElements.get(a) || customElements.define(a, s), customElements.get(o) || customElements.define(o, c);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/delivery/index.ts"],"sourcesContent":["// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/complex-rubric/src/index.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport Rubric from '@pie-element/rubric';\nimport MultiTraitRubric from '@pie-element/multi-trait-rubric';\nimport { RUBRIC_TYPES } from '@pie-lib/rubric';\nimport { COMPLEX_RUBRIC_MULTI_TRAIT_TAG, COMPLEX_RUBRIC_SIMPLE_TAG } from '../private-tags.js';\n\nconst RUBRIC_TAG_NAME = COMPLEX_RUBRIC_SIMPLE_TAG;\nconst MULTI_TRAIT_RUBRIC_TAG_NAME = COMPLEX_RUBRIC_MULTI_TRAIT_TAG;\n\nclass ComplexRubricSimple extends Rubric {}\n\nclass ComplexRubricMultiTrait extends MultiTraitRubric {}\n\nconst defineRubrics = () => {\n if (!customElements.get(RUBRIC_TAG_NAME)) {\n customElements.define(RUBRIC_TAG_NAME, ComplexRubricSimple);\n }\n\n if (!customElements.get(MULTI_TRAIT_RUBRIC_TAG_NAME)) {\n customElements.define(MULTI_TRAIT_RUBRIC_TAG_NAME, ComplexRubricMultiTrait);\n }\n};\n\ndefineRubrics();\n\nclass ComplexRubric extends HTMLElement {\n constructor() {\n super();\n this._model = {};\n this._type = RUBRIC_TYPES.SIMPLE_RUBRIC;\n }\n\n set type(t) {\n this._type = t;\n }\n\n get type() {\n return this._type;\n }\n\n set model(m) {\n this._model = m;\n const oldType = this._type;\n this.type = m.rubricType;\n\n switch (this._type) {\n case RUBRIC_TYPES.SIMPLE_RUBRIC:\n default:\n customElements.whenDefined(RUBRIC_TAG_NAME).then(() => {\n this.setRubricModel(this.simpleRubric);\n });\n break;\n case RUBRIC_TYPES.MULTI_TRAIT_RUBRIC:\n customElements.whenDefined(MULTI_TRAIT_RUBRIC_TAG_NAME).then(() => {\n this.setMultiTraitRubricModel(this.multiTraitRubric);\n });\n break;\n case RUBRIC_TYPES.RUBRICLESS:\n customElements.whenDefined(RUBRIC_TAG_NAME).then(() => {\n this.setRubriclessModel(this.rubricless);\n });\n break;\n }\n\n if (oldType !== this.type) {\n this._render();\n }\n }\n\n setRubricModel(simpleRubric) {\n if (this._model && this._model.rubrics && this._model.rubrics.simpleRubric) {\n const { mode } = this._model;\n\n simpleRubric.model = {\n ...this._model.rubrics.simpleRubric,\n mode,\n };\n }\n }\n\n setMultiTraitRubricModel(multiTraitRubric) {\n if (this._model && this._model.rubrics && this._model.rubrics.multiTraitRubric) {\n const { mode } = this._model;\n\n multiTraitRubric.model = {\n ...this._model.rubrics.multiTraitRubric,\n mode,\n };\n }\n }\n\n setRubriclessModel(rubricless) {\n if (this._model && this._model.rubrics && this._model.rubrics.rubricless) {\n const { mode } = this._model;\n\n rubricless.model = {\n ...this._model.rubrics.rubricless,\n mode,\n };\n }\n }\n\n get multiTraitRubric() {\n return this.querySelector(`${MULTI_TRAIT_RUBRIC_TAG_NAME}#multiTraitRubric`);\n }\n\n get simpleRubric() {\n return this.querySelector(`${RUBRIC_TAG_NAME}#simpleRubric`);\n }\n\n get rubricless() {\n return this.querySelector(`${RUBRIC_TAG_NAME}#rubricless`);\n }\n\n connectedCallback() {\n this._render();\n }\n\n _render() {\n let rubricTag;\n if (this._type === RUBRIC_TYPES.SIMPLE_RUBRIC) {\n rubricTag = `<${RUBRIC_TAG_NAME} id=\"simpleRubric\" />`;\n } else if (this._type === RUBRIC_TYPES.RUBRICLESS) {\n rubricTag = `<${RUBRIC_TAG_NAME} id=\"rubricless\" />`;\n } else {\n rubricTag = `<${MULTI_TRAIT_RUBRIC_TAG_NAME} id=\"multiTraitRubric\" />`;\n }\n\n this.innerHTML = rubricTag;\n\n // when item is re-rendered (due to connectedCallback), if the custom element is already defined,\n // we need to set the model and session, otherwise the setters are not reached again\n switch (this._type) {\n case RUBRIC_TYPES.SIMPLE_RUBRIC:\n default:\n if (customElements.get(RUBRIC_TAG_NAME)) {\n this.setRubricModel(this.simpleRubric);\n }\n break;\n case RUBRIC_TYPES.MULTI_TRAIT_RUBRIC:\n if (customElements.get(MULTI_TRAIT_RUBRIC_TAG_NAME)) {\n this.setMultiTraitRubricModel(this.multiTraitRubric);\n }\n break;\n case RUBRIC_TYPES.RUBRICLESS:\n if (customElements.get(RUBRIC_TAG_NAME)) {\n this.setRubriclessModel(this.rubricless);\n }\n break;\n }\n }\n}\n\nexport default ComplexRubric;\n"],"mappings":";;;AAeA,IAAM,IAAkB,GAClB,IAA8B,GAE9B,IAAN,cAAkC,EAAO,CAAC,GAEpC,IAAN,cAAsC,EAAiB,CAAC;AAGjD,eAAe,IAAI,CAAe,KACrC,eAAe,OAAO,GAAiB,CAAmB,GAGvD,eAAe,IAAI,CAA2B,KACjD,eAAe,OAAO,GAA6B,CAAuB;AAM9E,IAAM,IAAN,cAA4B,YAAY;CACtC,cAAc;EAGZ,AAFA,MAAM,GACN,KAAK,SAAS,CAAC,GACf,KAAK,QAAQ,EAAa;CAC5B;CAEA,IAAI,KAAK,GAAG;EACV,KAAK,QAAQ;CACf;CAEA,IAAI,OAAO;EACT,OAAO,KAAK;CACd;CAEA,IAAI,MAAM,GAAG;EACX,KAAK,SAAS;EACd,IAAM,IAAU,KAAK;EAGrB,QAFA,KAAK,OAAO,EAAE,YAEN,KAAK,OAAb;GACE,KAAK,EAAa;GAClB;IACE,eAAe,YAAY,CAAe,
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/delivery/index.ts"],"sourcesContent":["// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/complex-rubric/src/index.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport Rubric from '@pie-element/rubric';\nimport MultiTraitRubric from '@pie-element/multi-trait-rubric';\nimport { RUBRIC_TYPES } from '@pie-lib/rubric';\nimport { COMPLEX_RUBRIC_MULTI_TRAIT_TAG, COMPLEX_RUBRIC_SIMPLE_TAG } from '../private-tags.js';\n\nconst RUBRIC_TAG_NAME = COMPLEX_RUBRIC_SIMPLE_TAG;\nconst MULTI_TRAIT_RUBRIC_TAG_NAME = COMPLEX_RUBRIC_MULTI_TRAIT_TAG;\n\nclass ComplexRubricSimple extends Rubric {}\n\nclass ComplexRubricMultiTrait extends MultiTraitRubric {}\n\nconst defineRubrics = () => {\n if (!customElements.get(RUBRIC_TAG_NAME)) {\n customElements.define(RUBRIC_TAG_NAME, ComplexRubricSimple);\n }\n\n if (!customElements.get(MULTI_TRAIT_RUBRIC_TAG_NAME)) {\n customElements.define(MULTI_TRAIT_RUBRIC_TAG_NAME, ComplexRubricMultiTrait);\n }\n};\n\ndefineRubrics();\n\nclass ComplexRubric extends HTMLElement {\n constructor() {\n super();\n this._model = {};\n this._type = RUBRIC_TYPES.SIMPLE_RUBRIC;\n }\n\n set type(t) {\n this._type = t;\n }\n\n get type() {\n return this._type;\n }\n\n set model(m) {\n this._model = m;\n const oldType = this._type;\n this.type = m.rubricType;\n\n switch (this._type) {\n case RUBRIC_TYPES.SIMPLE_RUBRIC:\n default:\n customElements.whenDefined(RUBRIC_TAG_NAME).then(() => {\n this.setRubricModel(this.simpleRubric);\n });\n break;\n case RUBRIC_TYPES.MULTI_TRAIT_RUBRIC:\n customElements.whenDefined(MULTI_TRAIT_RUBRIC_TAG_NAME).then(() => {\n this.setMultiTraitRubricModel(this.multiTraitRubric);\n });\n break;\n case RUBRIC_TYPES.RUBRICLESS:\n customElements.whenDefined(RUBRIC_TAG_NAME).then(() => {\n this.setRubriclessModel(this.rubricless);\n });\n break;\n }\n\n if (oldType !== this.type) {\n this._render();\n }\n }\n\n setRubricModel(simpleRubric) {\n if (this._model && this._model.rubrics && this._model.rubrics.simpleRubric) {\n const { mode } = this._model;\n\n simpleRubric.model = {\n ...this._model.rubrics.simpleRubric,\n mode,\n };\n }\n }\n\n setMultiTraitRubricModel(multiTraitRubric) {\n if (this._model && this._model.rubrics && this._model.rubrics.multiTraitRubric) {\n const { mode } = this._model;\n\n multiTraitRubric.model = {\n ...this._model.rubrics.multiTraitRubric,\n mode,\n };\n }\n }\n\n setRubriclessModel(rubricless) {\n if (this._model && this._model.rubrics && this._model.rubrics.rubricless) {\n const { mode } = this._model;\n\n rubricless.model = {\n ...this._model.rubrics.rubricless,\n mode,\n };\n }\n }\n\n get multiTraitRubric() {\n return this.querySelector(`${MULTI_TRAIT_RUBRIC_TAG_NAME}#multiTraitRubric`);\n }\n\n get simpleRubric() {\n return this.querySelector(`${RUBRIC_TAG_NAME}#simpleRubric`);\n }\n\n get rubricless() {\n return this.querySelector(`${RUBRIC_TAG_NAME}#rubricless`);\n }\n\n connectedCallback() {\n this._render();\n }\n\n _render() {\n let rubricTag;\n if (this._type === RUBRIC_TYPES.SIMPLE_RUBRIC) {\n rubricTag = `<${RUBRIC_TAG_NAME} id=\"simpleRubric\" />`;\n } else if (this._type === RUBRIC_TYPES.RUBRICLESS) {\n rubricTag = `<${RUBRIC_TAG_NAME} id=\"rubricless\" />`;\n } else {\n rubricTag = `<${MULTI_TRAIT_RUBRIC_TAG_NAME} id=\"multiTraitRubric\" />`;\n }\n\n this.innerHTML = rubricTag;\n\n // when item is re-rendered (due to connectedCallback), if the custom element is already defined,\n // we need to set the model and session, otherwise the setters are not reached again\n switch (this._type) {\n case RUBRIC_TYPES.SIMPLE_RUBRIC:\n default:\n if (customElements.get(RUBRIC_TAG_NAME)) {\n this.setRubricModel(this.simpleRubric);\n }\n break;\n case RUBRIC_TYPES.MULTI_TRAIT_RUBRIC:\n if (customElements.get(MULTI_TRAIT_RUBRIC_TAG_NAME)) {\n this.setMultiTraitRubricModel(this.multiTraitRubric);\n }\n break;\n case RUBRIC_TYPES.RUBRICLESS:\n if (customElements.get(RUBRIC_TAG_NAME)) {\n this.setRubriclessModel(this.rubricless);\n }\n break;\n }\n }\n}\n\nexport default ComplexRubric;\n"],"mappings":";;;AAeA,IAAM,IAAkB,GAClB,IAA8B,GAE9B,IAAN,cAAkC,EAAO,CAAC,GAEpC,IAAN,cAAsC,EAAiB,CAAC;AAGjD,eAAe,IAAI,CAAe,KACrC,eAAe,OAAO,GAAiB,CAAmB,GAGvD,eAAe,IAAI,CAA2B,KACjD,eAAe,OAAO,GAA6B,CAAuB;AAM9E,IAAM,IAAN,cAA4B,YAAY;CACtC,cAAc;EAGZ,AAFA,MAAM,GACN,KAAK,SAAS,CAAC,GACf,KAAK,QAAQ,EAAa;CAC5B;CAEA,IAAI,KAAK,GAAG;EACV,KAAK,QAAQ;CACf;CAEA,IAAI,OAAO;EACT,OAAO,KAAK;CACd;CAEA,IAAI,MAAM,GAAG;EACX,KAAK,SAAS;EACd,IAAM,IAAU,KAAK;EAGrB,QAFA,KAAK,OAAO,EAAE,YAEN,KAAK,OAAb;GACE,KAAK,EAAa;GAClB;IACE,eAAe,YAAY,CAAe,CAAC,CAAC,WAAW;KACrD,KAAK,eAAe,KAAK,YAAY;IACvC,CAAC;IACD;GACF,KAAK,EAAa;IAChB,eAAe,YAAY,CAA2B,CAAC,CAAC,WAAW;KACjE,KAAK,yBAAyB,KAAK,gBAAgB;IACrD,CAAC;IACD;GACF,KAAK,EAAa;IAChB,eAAe,YAAY,CAAe,CAAC,CAAC,WAAW;KACrD,KAAK,mBAAmB,KAAK,UAAU;IACzC,CAAC;IACD;EACJ;EAEA,AAAI,MAAY,KAAK,QACnB,KAAK,QAAQ;CAEjB;CAEA,eAAe,GAAc;EAC3B,IAAI,KAAK,UAAU,KAAK,OAAO,WAAW,KAAK,OAAO,QAAQ,cAAc;GAC1E,I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|
1
|
-
import {
|
|
1
|
+
import { i as e } from "./rolldown-runtime-CWhphoD1.js";
|
|
2
|
+
import { Ct as t, D as n, I as r, J as i, L as a, Ot as o, St as s, T as c, Tt as l, X as u, Y as d, _t as f, b as p, bt as m, c as h, dt as g, l as _, mt as v, o as y, ot as ee, s as te, st as ne, tt as b, w as re, wt as x } from "./private-tags-Cpudy6vC.js";
|
|
2
3
|
import * as S from "react";
|
|
3
4
|
import C from "react";
|
|
4
5
|
import { jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
5
6
|
import { createRoot as E } from "react-dom/client";
|
|
6
7
|
//#region ../rubric/dist/delivery/main.js
|
|
7
|
-
var D = /* @__PURE__ */
|
|
8
|
+
var D = /* @__PURE__ */ e(o(), 1);
|
|
8
9
|
function O(e) {
|
|
9
10
|
return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
|
|
10
11
|
}
|
|
11
12
|
function k(e, t) {
|
|
12
13
|
return !e || O(e) ? e : O(e.default) ? e.default : t && O(e[t]) ? e[t] : t && O(e[t]?.default) ? e[t].default : e;
|
|
13
14
|
}
|
|
14
|
-
var ie = k(
|
|
15
|
+
var ie = k(p, "UiLayout") || k(ae.UiLayout, "UiLayout"), A = _, j = A.default, ae = j && typeof j == "object" ? j : A, oe = g(ie)({
|
|
15
16
|
color: r.text(),
|
|
16
17
|
backgroundColor: r.background(),
|
|
17
18
|
"&:not(.MathJax) table": { borderCollapse: "collapse" },
|
|
@@ -24,24 +25,24 @@ var ie = k(c, "UiLayout") || k(ae.UiLayout, "UiLayout"), A = t, j = A.default, a
|
|
|
24
25
|
marginTop: 0,
|
|
25
26
|
lineHeight: "normal"
|
|
26
27
|
}
|
|
27
|
-
}), M = u
|
|
28
|
+
}), M = g(u)({
|
|
28
29
|
display: "flex",
|
|
29
30
|
flexDirection: "column",
|
|
30
31
|
alignItems: "flex-start",
|
|
31
32
|
padding: "12px 0px"
|
|
32
|
-
}), N =
|
|
33
|
+
}), N = g("div")({ color: r.text() }), se = g("h3")({
|
|
33
34
|
color: r.text(),
|
|
34
35
|
fontSize: "16px",
|
|
35
36
|
fontWeight: "700",
|
|
36
37
|
margin: 0,
|
|
37
38
|
paddingBottom: "6px"
|
|
38
|
-
}), ce =
|
|
39
|
+
}), ce = g("h4")({
|
|
39
40
|
color: r.text(),
|
|
40
41
|
fontSize: "16px",
|
|
41
42
|
fontWeight: "normal",
|
|
42
43
|
margin: 0,
|
|
43
44
|
paddingBottom: "6px"
|
|
44
|
-
}), le =
|
|
45
|
+
}), le = g("h2")(({ theme: e }) => ({
|
|
45
46
|
display: "flex",
|
|
46
47
|
alignItems: "center",
|
|
47
48
|
cursor: "pointer",
|
|
@@ -50,12 +51,12 @@ var ie = k(c, "UiLayout") || k(ae.UiLayout, "UiLayout"), A = t, j = A.default, a
|
|
|
50
51
|
fontWeight: "500",
|
|
51
52
|
color: r.tertiary(),
|
|
52
53
|
margin: 0
|
|
53
|
-
})), ue =
|
|
54
|
+
})), ue = g("span")({
|
|
54
55
|
display: "inline-flex",
|
|
55
56
|
transition: "transform 0.2s",
|
|
56
57
|
marginLeft: 2,
|
|
57
58
|
alignSelf: "center"
|
|
58
|
-
}), P =
|
|
59
|
+
}), P = g("h2")({
|
|
59
60
|
position: "absolute",
|
|
60
61
|
width: "1px",
|
|
61
62
|
height: "1px",
|
|
@@ -86,21 +87,21 @@ var ie = k(c, "UiLayout") || k(ae.UiLayout, "UiLayout"), A = t, j = A.default, a
|
|
|
86
87
|
toggleRubric() {
|
|
87
88
|
this.setState({ rubricOpen: !this.state.rubricOpen }), this.setState({ linkPrefix: this.state.rubricOpen ? "Show" : "Hide" });
|
|
88
89
|
}
|
|
89
|
-
shouldRenderPoint = (e, t) => t.excludeZero
|
|
90
|
+
shouldRenderPoint = (e, t) => !t.excludeZero || e !== 0;
|
|
90
91
|
render() {
|
|
91
|
-
let { model:
|
|
92
|
-
if (
|
|
93
|
-
let { extraCSSRules:
|
|
92
|
+
let { model: e, value: t } = this.props, { animationsDisabled: n } = this.props;
|
|
93
|
+
if (n ||= t.animationsDisabled, t && t.points) {
|
|
94
|
+
let { extraCSSRules: r } = e || {}, { points: i, sampleAnswers: o } = t, s = /* @__PURE__ */ w(d, {
|
|
94
95
|
component: "nav",
|
|
95
|
-
children:
|
|
96
|
-
|
|
97
|
-
let r =
|
|
98
|
-
return /* @__PURE__ */ T(C.Fragment, { children: [/* @__PURE__ */ T(M, { children: [/* @__PURE__ */ w(se, { children: r === 1 ? `${r} PT` : `${r} PTS` }), /* @__PURE__ */ w(N, { dangerouslySetInnerHTML: { __html: e } })] }, `P${
|
|
96
|
+
children: i.slice(0).reverse().map((e, n) => {
|
|
97
|
+
n = i.length - n - 1;
|
|
98
|
+
let r = t.excludeZero ? n + 1 : n;
|
|
99
|
+
return /* @__PURE__ */ T(C.Fragment, { children: [/* @__PURE__ */ T(M, { children: [/* @__PURE__ */ w(se, { children: r === 1 ? `${r} PT` : `${r} PTS` }), /* @__PURE__ */ w(N, { dangerouslySetInnerHTML: { __html: e } })] }, `P${n}`), o && o[n] && /* @__PURE__ */ T(M, { children: [/* @__PURE__ */ w(ce, { children: "Sample Answer" }), /* @__PURE__ */ w(N, { dangerouslySetInnerHTML: { __html: o[n] } })] }, `S${n}`)] }, n);
|
|
99
100
|
})
|
|
100
101
|
});
|
|
101
102
|
return /* @__PURE__ */ T(oe, {
|
|
102
|
-
extraCSSRules:
|
|
103
|
-
children: [/* @__PURE__ */ w(P, { children: "Rubric" }),
|
|
103
|
+
extraCSSRules: r,
|
|
104
|
+
children: [/* @__PURE__ */ w(P, { children: "Rubric" }), n ? s : /* @__PURE__ */ T(C.Fragment, { children: [/* @__PURE__ */ T(le, {
|
|
104
105
|
id: "rubric-toggle",
|
|
105
106
|
tabIndex: 0,
|
|
106
107
|
role: "button",
|
|
@@ -137,7 +138,7 @@ var ie = k(c, "UiLayout") || k(ae.UiLayout, "UiLayout"), A = t, j = A.default, a
|
|
|
137
138
|
})
|
|
138
139
|
})
|
|
139
140
|
]
|
|
140
|
-
}), /* @__PURE__ */ w(
|
|
141
|
+
}), /* @__PURE__ */ w(a, {
|
|
141
142
|
in: this.state.rubricOpen,
|
|
142
143
|
timeout: {
|
|
143
144
|
enter: 225,
|
|
@@ -148,9 +149,28 @@ var ie = k(c, "UiLayout") || k(ae.UiLayout, "UiLayout"), A = t, j = A.default, a
|
|
|
148
149
|
});
|
|
149
150
|
} else return null;
|
|
150
151
|
}
|
|
151
|
-
}, L = /* @__PURE__ */
|
|
152
|
+
}, L = /* @__PURE__ */ e(n(), 1), R = class extends HTMLElement {
|
|
152
153
|
constructor() {
|
|
153
|
-
super(), L.log("constructor called"), this.onModelChanged = this.onModelChanged.bind(this), this._root = null;
|
|
154
|
+
super(), L.log("constructor called"), this.onModelChanged = this.onModelChanged.bind(this), this._root = null, this._mathObserver = null, this._mathRenderPending = !1;
|
|
155
|
+
}
|
|
156
|
+
_scheduleMathRender = () => {
|
|
157
|
+
this._mathRenderPending || (this._mathRenderPending = !0, requestAnimationFrame(() => {
|
|
158
|
+
this._mathObserver && this._mathObserver.disconnect(), c(this), this._mathRenderPending = !1, setTimeout(() => {
|
|
159
|
+
this._mathObserver && this._mathObserver.observe(this, {
|
|
160
|
+
childList: !0,
|
|
161
|
+
subtree: !0
|
|
162
|
+
});
|
|
163
|
+
}, 50);
|
|
164
|
+
}));
|
|
165
|
+
};
|
|
166
|
+
_initMathObserver() {
|
|
167
|
+
this._mathObserver || (this._mathObserver = new MutationObserver(this._scheduleMathRender), this._mathObserver.observe(this, {
|
|
168
|
+
childList: !0,
|
|
169
|
+
subtree: !0
|
|
170
|
+
}));
|
|
171
|
+
}
|
|
172
|
+
_disconnectMathObserver() {
|
|
173
|
+
this._mathObserver &&= (this._mathObserver.disconnect(), null);
|
|
154
174
|
}
|
|
155
175
|
set model(e) {
|
|
156
176
|
this._model = e, this._render();
|
|
@@ -159,23 +179,22 @@ var ie = k(c, "UiLayout") || k(ae.UiLayout, "UiLayout"), A = t, j = A.default, a
|
|
|
159
179
|
this._model = e, this._render();
|
|
160
180
|
}
|
|
161
181
|
connectedCallback() {
|
|
162
|
-
this._render();
|
|
182
|
+
this._initMathObserver(), this._render();
|
|
163
183
|
}
|
|
164
184
|
_render() {
|
|
165
185
|
if (this._model) {
|
|
186
|
+
this._initMathObserver();
|
|
166
187
|
let e = C.createElement(I, { value: this._model });
|
|
167
|
-
this._root ||= E(this), this._root.render(e)
|
|
168
|
-
i(this);
|
|
169
|
-
});
|
|
188
|
+
this._root ||= E(this), this._root.render(e);
|
|
170
189
|
}
|
|
171
190
|
}
|
|
172
191
|
disconnectedCallback() {
|
|
173
|
-
this._root && this._root.unmount();
|
|
192
|
+
this._disconnectMathObserver(), this._root && this._root.unmount();
|
|
174
193
|
}
|
|
175
|
-
}, z =
|
|
194
|
+
}, z = g("td")({
|
|
176
195
|
color: r.primaryDark(),
|
|
177
196
|
verticalAlign: "middle"
|
|
178
|
-
}), B =
|
|
197
|
+
}), B = g("div")({
|
|
179
198
|
color: r.secondaryBackground(),
|
|
180
199
|
textAlign: "center"
|
|
181
200
|
}), V = (e) => {
|
|
@@ -210,13 +229,13 @@ V.propTypes = {
|
|
|
210
229
|
};
|
|
211
230
|
//#endregion
|
|
212
231
|
//#region ../multi-trait-rubric/dist/delivery/scale.js
|
|
213
|
-
var H =
|
|
232
|
+
var H = g("div")({
|
|
214
233
|
display: "flex",
|
|
215
234
|
position: "relative"
|
|
216
|
-
}), U =
|
|
235
|
+
}), U = g("div")({
|
|
217
236
|
width: "100%",
|
|
218
237
|
overflow: "auto"
|
|
219
|
-
}), de =
|
|
238
|
+
}), de = g("table")(({ theme: e }) => ({
|
|
220
239
|
borderSpacing: 0,
|
|
221
240
|
marginBottom: e.spacing(2),
|
|
222
241
|
borderRadius: "4px",
|
|
@@ -240,12 +259,12 @@ var H = u("div")({
|
|
|
240
259
|
padding: `${e.spacing(2)} ${e.spacing(1)}`,
|
|
241
260
|
verticalAlign: "top"
|
|
242
261
|
}
|
|
243
|
-
})), fe =
|
|
262
|
+
})), fe = g("table")({ "& td": {
|
|
244
263
|
border: 0,
|
|
245
264
|
padding: 0,
|
|
246
265
|
textAlign: "center",
|
|
247
266
|
minWidth: "200px"
|
|
248
|
-
} }), pe =
|
|
267
|
+
} }), pe = g("div")({ marginBottom: "4px" }), me = g("td")({ fontWeight: "normal" }), W = ({ show: e, onClick: t, extraStyles: n, children: r }) => /* @__PURE__ */ w("div", {
|
|
249
268
|
style: {
|
|
250
269
|
height: "calc(100% - 1px)",
|
|
251
270
|
top: "1px",
|
|
@@ -286,29 +305,29 @@ var G = class extends C.Component {
|
|
|
286
305
|
});
|
|
287
306
|
};
|
|
288
307
|
render() {
|
|
289
|
-
let { showRight: e, showLeft: t } = this.state, { scale: n, scaleIndex: i, showDescription: a, showPointsLabels: o, showStandards:
|
|
308
|
+
let { showRight: e, showLeft: t } = this.state, { scale: n, scaleIndex: i, showDescription: a, showPointsLabels: o, showStandards: s, arrowsDisabled: c } = this.props, { excludeZero: l, maxPoints: u, traitLabel: d, traits: f, scorePointsLabels: p } = n || {}, m = [], g, _, v;
|
|
290
309
|
try {
|
|
291
|
-
for (let e =
|
|
292
|
-
let { traitStandards: e, traitDescriptions: t } =
|
|
310
|
+
for (let e = u; +(e >= l); --e) m.push(e);
|
|
311
|
+
let { traitStandards: e, traitDescriptions: t } = f.reduce((e, t) => ({
|
|
293
312
|
traitStandards: [...e.traitStandards, ...t.standards || []],
|
|
294
313
|
traitDescriptions: [...e.traitDescriptions, ...t.description || []]
|
|
295
314
|
}), {
|
|
296
315
|
traitStandards: [],
|
|
297
316
|
traitDescriptions: []
|
|
298
317
|
});
|
|
299
|
-
g = a && t.length, _ = o &&
|
|
318
|
+
g = a && t.length, _ = o && p.length, v = s && e.length;
|
|
300
319
|
} catch {
|
|
301
320
|
g = !1, _ = !1, v = !1;
|
|
302
321
|
}
|
|
303
322
|
return /* @__PURE__ */ T(H, { children: [
|
|
304
323
|
/* @__PURE__ */ w(W, {
|
|
305
|
-
show: t && !
|
|
324
|
+
show: t && !c,
|
|
306
325
|
onClick: this.scrollLeft,
|
|
307
326
|
extraStyles: {
|
|
308
327
|
left: 0,
|
|
309
328
|
background: `linear-gradient(to right, white, ${r.background()})`
|
|
310
329
|
},
|
|
311
|
-
children: /* @__PURE__ */ w(
|
|
330
|
+
children: /* @__PURE__ */ w(h, {})
|
|
312
331
|
}),
|
|
313
332
|
/* @__PURE__ */ T(U, {
|
|
314
333
|
ref: (e) => {
|
|
@@ -320,37 +339,37 @@ var G = class extends C.Component {
|
|
|
320
339
|
showLeft: this.tableWrapper.scrollLeft < this.tableWrapper.scrollWidth && this.tableWrapper.scrollLeft > 0
|
|
321
340
|
});
|
|
322
341
|
},
|
|
323
|
-
children: [
|
|
324
|
-
/* @__PURE__ */ w("th", { children: /* @__PURE__ */ w("div", { dangerouslySetInnerHTML: { __html:
|
|
342
|
+
children: [c && (e || t) ? /* @__PURE__ */ w("div", { children: "The item is too large to fit in print mode." }) : null, /* @__PURE__ */ T(de, { children: [/* @__PURE__ */ w("thead", { children: /* @__PURE__ */ T("tr", { children: [
|
|
343
|
+
/* @__PURE__ */ w("th", { children: /* @__PURE__ */ w("div", { dangerouslySetInnerHTML: { __html: d } }) }),
|
|
325
344
|
v ? /* @__PURE__ */ w("th", { children: /* @__PURE__ */ w("div", { children: "Standard(s)" }) }) : null,
|
|
326
345
|
g ? /* @__PURE__ */ w("th", { children: /* @__PURE__ */ w("div", { children: "Description" }) }) : null,
|
|
327
|
-
|
|
346
|
+
m && m.map((e, t) => {
|
|
328
347
|
let n = "";
|
|
329
348
|
try {
|
|
330
|
-
n = m
|
|
349
|
+
n = p[m.length - t - 1] || "";
|
|
331
350
|
} catch {
|
|
332
351
|
n = "";
|
|
333
352
|
}
|
|
334
353
|
return /* @__PURE__ */ w("th", { children: /* @__PURE__ */ w(fe, { children: /* @__PURE__ */ T("thead", { children: [_ ? /* @__PURE__ */ w("tr", { children: /* @__PURE__ */ w("td", { children: /* @__PURE__ */ w(pe, { dangerouslySetInnerHTML: { __html: n } }) }) }) : null, /* @__PURE__ */ w("tr", { children: /* @__PURE__ */ w(me, { children: e === 1 ? `${e} point` : `${e} points` }) })] }) }) }, `table-header-${t}`);
|
|
335
354
|
})
|
|
336
|
-
] }) }), /* @__PURE__ */ w("tbody", { children:
|
|
355
|
+
] }) }), /* @__PURE__ */ w("tbody", { children: f && f.map((e, t) => /* @__PURE__ */ w(V, {
|
|
337
356
|
trait: e,
|
|
338
357
|
traitIndex: t,
|
|
339
358
|
showDescription: !!g,
|
|
340
359
|
showStandards: !!v,
|
|
341
360
|
scaleIndex: i,
|
|
342
|
-
scorePointsValues:
|
|
343
|
-
excludeZero:
|
|
361
|
+
scorePointsValues: m,
|
|
362
|
+
excludeZero: l
|
|
344
363
|
}, `trait_${i}_${t}`)) })] }, `scale-${i}`)]
|
|
345
364
|
}),
|
|
346
365
|
/* @__PURE__ */ w(W, {
|
|
347
|
-
show: e && !
|
|
366
|
+
show: e && !c,
|
|
348
367
|
onClick: this.scrollRight,
|
|
349
368
|
extraStyles: {
|
|
350
369
|
right: 0,
|
|
351
370
|
background: `linear-gradient(to left, white, ${r.background()})`
|
|
352
371
|
},
|
|
353
|
-
children: /* @__PURE__ */ w(
|
|
372
|
+
children: /* @__PURE__ */ w(te, {})
|
|
354
373
|
})
|
|
355
374
|
] });
|
|
356
375
|
}
|
|
@@ -377,9 +396,9 @@ G.propTypes = {
|
|
|
377
396
|
//#endregion
|
|
378
397
|
//#region ../../../node_modules/.bun/@mui+material@7.3.11+eb26afe407ed7030/node_modules/@mui/material/esm/Link/linkClasses.js
|
|
379
398
|
function he(e) {
|
|
380
|
-
return
|
|
399
|
+
return t("MuiLink", e);
|
|
381
400
|
}
|
|
382
|
-
var ge =
|
|
401
|
+
var ge = s("MuiLink", [
|
|
383
402
|
"root",
|
|
384
403
|
"underlineNone",
|
|
385
404
|
"underlineHover",
|
|
@@ -389,11 +408,11 @@ var ge = re("MuiLink", [
|
|
|
389
408
|
]), _e = ({ theme: e, ownerState: t }) => {
|
|
390
409
|
let n = t.color;
|
|
391
410
|
if ("colorSpace" in e && e.colorSpace) {
|
|
392
|
-
let r =
|
|
411
|
+
let r = l(e, `palette.${n}.main`) || l(e, `palette.${n}`) || t.color;
|
|
393
412
|
return e.alpha(r, .4);
|
|
394
413
|
}
|
|
395
|
-
let r =
|
|
396
|
-
return "vars" in e && i ? `rgba(${i} / 0.4)` :
|
|
414
|
+
let r = l(e, `palette.${n}.main`, !1) || l(e, `palette.${n}`, !1) || t.color, i = l(e, `palette.${n}.mainChannel`) || l(e, `palette.${n}Channel`);
|
|
415
|
+
return "vars" in e && i ? `rgba(${i} / 0.4)` : m(r, .4);
|
|
397
416
|
}, K = {
|
|
398
417
|
primary: !0,
|
|
399
418
|
secondary: !0,
|
|
@@ -405,25 +424,25 @@ var ge = re("MuiLink", [
|
|
|
405
424
|
textSecondary: !0,
|
|
406
425
|
textDisabled: !0
|
|
407
426
|
}, q = (e) => {
|
|
408
|
-
let { classes: t, component: n, focusVisible: r, underline:
|
|
409
|
-
return
|
|
427
|
+
let { classes: t, component: n, focusVisible: r, underline: a } = e;
|
|
428
|
+
return f({ root: [
|
|
410
429
|
"root",
|
|
411
|
-
`underline${
|
|
430
|
+
`underline${i(a)}`,
|
|
412
431
|
n === "button" && "button",
|
|
413
432
|
r && "focusVisible"
|
|
414
433
|
] }, he, t);
|
|
415
|
-
}, ve =
|
|
434
|
+
}, ve = g(y, {
|
|
416
435
|
name: "MuiLink",
|
|
417
436
|
slot: "Root",
|
|
418
437
|
overridesResolver: (e, t) => {
|
|
419
438
|
let { ownerState: n } = e;
|
|
420
439
|
return [
|
|
421
440
|
t.root,
|
|
422
|
-
t[`underline${
|
|
441
|
+
t[`underline${i(n.underline)}`],
|
|
423
442
|
n.component === "button" && t.button
|
|
424
443
|
];
|
|
425
444
|
}
|
|
426
|
-
})(
|
|
445
|
+
})(ne(({ theme: e }) => ({ variants: [
|
|
427
446
|
{
|
|
428
447
|
props: { underline: "none" },
|
|
429
448
|
style: { textDecoration: "none" }
|
|
@@ -450,7 +469,7 @@ var ge = re("MuiLink", [
|
|
|
450
469
|
props: ({ underline: e, ownerState: t }) => e === "always" && t.color === "inherit",
|
|
451
470
|
style: e.colorSpace ? { textDecorationColor: e.alpha("currentColor", .4) } : null
|
|
452
471
|
},
|
|
453
|
-
...Object.entries(e.palette).filter(
|
|
472
|
+
...Object.entries(e.palette).filter(re()).map(([t]) => ({
|
|
454
473
|
props: {
|
|
455
474
|
underline: "always",
|
|
456
475
|
color: t
|
|
@@ -499,28 +518,28 @@ var ge = re("MuiLink", [
|
|
|
499
518
|
}
|
|
500
519
|
}
|
|
501
520
|
] }))), ye = /*#__PURE__*/ S.forwardRef(function(e, t) {
|
|
502
|
-
let n =
|
|
521
|
+
let n = ee({
|
|
503
522
|
props: e,
|
|
504
523
|
name: "MuiLink"
|
|
505
|
-
}), r =
|
|
506
|
-
b(e.target) ||
|
|
507
|
-
},
|
|
508
|
-
b(e.target) &&
|
|
524
|
+
}), r = v(), { className: i, color: a = "primary", component: o = "a", onBlur: s, onFocus: c, TypographyClasses: l, underline: u = "always", variant: d = "inherit", sx: f, ...p } = n, [m, h] = S.useState(!1), g = (e) => {
|
|
525
|
+
b(e.target) || h(!1), s && s(e);
|
|
526
|
+
}, _ = (e) => {
|
|
527
|
+
b(e.target) && h(!0), c && c(e);
|
|
509
528
|
}, y = {
|
|
510
529
|
...n,
|
|
511
530
|
color: a,
|
|
512
531
|
component: o,
|
|
513
|
-
focusVisible:
|
|
532
|
+
focusVisible: m,
|
|
514
533
|
underline: u,
|
|
515
534
|
variant: d
|
|
516
535
|
};
|
|
517
536
|
return /*#__PURE__*/ w(ve, {
|
|
518
537
|
color: a,
|
|
519
|
-
className:
|
|
538
|
+
className: x(q(y).root, i),
|
|
520
539
|
classes: l,
|
|
521
540
|
component: o,
|
|
522
|
-
onBlur:
|
|
523
|
-
onFocus:
|
|
541
|
+
onBlur: g,
|
|
542
|
+
onFocus: _,
|
|
524
543
|
ref: t,
|
|
525
544
|
ownerState: y,
|
|
526
545
|
variant: d,
|
|
@@ -543,7 +562,7 @@ function J(e) {
|
|
|
543
562
|
function Y(e, t) {
|
|
544
563
|
return !e || J(e) ? e : J(e.default) ? e.default : t && J(e[t]) ? e[t] : t && J(e[t]?.default) ? e[t].default : e;
|
|
545
564
|
}
|
|
546
|
-
var X = Y(
|
|
565
|
+
var X = Y(p, "UiLayout") || Y(be.UiLayout, "UiLayout"), Z = _, Q = Z.default, be = Q && typeof Q == "object" ? Q : Z, $ = class extends C.Component {
|
|
547
566
|
constructor(e) {
|
|
548
567
|
super(e), this.state = {
|
|
549
568
|
rubricOpen: !1,
|
|
@@ -554,8 +573,8 @@ var X = Y(c, "UiLayout") || Y(be.UiLayout, "UiLayout"), Z = t, Q = Z.default, be
|
|
|
554
573
|
this.setState({ rubricOpen: !this.state.rubricOpen }), this.setState({ linkPrefix: this.state.rubricOpen ? "Show" : "Hide" });
|
|
555
574
|
}
|
|
556
575
|
render() {
|
|
557
|
-
let { model: e } = this.props, { animationsDisabled: t } = this.props, { extraCSSRules: n, halfScoring: i, scales:
|
|
558
|
-
if (t ||= e.animationsDisabled, !
|
|
576
|
+
let { model: e } = this.props, { animationsDisabled: t } = this.props, { extraCSSRules: n, halfScoring: i, scales: o, visible: s, pointLabels: c, description: l, standards: u, arrowsDisabled: d } = e || {};
|
|
577
|
+
if (t ||= e.animationsDisabled, !o || !s) return null;
|
|
559
578
|
let f = /* @__PURE__ */ T(X, {
|
|
560
579
|
extraCSSRules: n,
|
|
561
580
|
style: {
|
|
@@ -566,11 +585,11 @@ var X = Y(c, "UiLayout") || Y(be.UiLayout, "UiLayout"), Z = t, Q = Z.default, be
|
|
|
566
585
|
children: [i ? /* @__PURE__ */ w("div", {
|
|
567
586
|
style: { marginBottom: "16px" },
|
|
568
587
|
children: "* Half-point or in-between scores are permitted under this rubric."
|
|
569
|
-
}) : null,
|
|
588
|
+
}) : null, o.map((e, t) => /* @__PURE__ */ w(G, {
|
|
570
589
|
scale: e,
|
|
571
590
|
scaleIndex: t,
|
|
572
|
-
showPointsLabels:
|
|
573
|
-
showDescription:
|
|
591
|
+
showPointsLabels: c,
|
|
592
|
+
showDescription: l,
|
|
574
593
|
showStandards: u,
|
|
575
594
|
arrowsDisabled: d
|
|
576
595
|
}, `scale_${t}`))]
|
|
@@ -586,7 +605,7 @@ var X = Y(c, "UiLayout") || Y(be.UiLayout, "UiLayout"), Z = t, Q = Z.default, be
|
|
|
586
605
|
href: this.dudUrl,
|
|
587
606
|
onClick: this.toggleRubric,
|
|
588
607
|
children: [this.state.linkPrefix, " Rubric"]
|
|
589
|
-
}), /* @__PURE__ */ w(
|
|
608
|
+
}), /* @__PURE__ */ w(a, {
|
|
590
609
|
style: { marginTop: "16px" },
|
|
591
610
|
in: this.state.rubricOpen,
|
|
592
611
|
timeout: {
|
|
@@ -658,7 +677,26 @@ var xe = class e extends CustomEvent {
|
|
|
658
677
|
//#region ../multi-trait-rubric/dist/delivery/index.js
|
|
659
678
|
var Se = class extends HTMLElement {
|
|
660
679
|
constructor() {
|
|
661
|
-
super(), this._model = {}, this._session = null, this._root = null;
|
|
680
|
+
super(), this._model = {}, this._session = null, this._root = null, this._mathObserver = null, this._mathRenderPending = !1;
|
|
681
|
+
}
|
|
682
|
+
_scheduleMathRender = () => {
|
|
683
|
+
this._mathRenderPending || (this._mathRenderPending = !0, requestAnimationFrame(() => {
|
|
684
|
+
this._mathObserver && this._mathObserver.disconnect(), c(this), this._mathRenderPending = !1, setTimeout(() => {
|
|
685
|
+
this._mathObserver && this._mathObserver.observe(this, {
|
|
686
|
+
childList: !0,
|
|
687
|
+
subtree: !0
|
|
688
|
+
});
|
|
689
|
+
}, 50);
|
|
690
|
+
}));
|
|
691
|
+
};
|
|
692
|
+
_initMathObserver() {
|
|
693
|
+
this._mathObserver || (this._mathObserver = new MutationObserver(this._scheduleMathRender), this._mathObserver.observe(this, {
|
|
694
|
+
childList: !0,
|
|
695
|
+
subtree: !0
|
|
696
|
+
}));
|
|
697
|
+
}
|
|
698
|
+
_disconnectMathObserver() {
|
|
699
|
+
this._mathObserver &&= (this._mathObserver.disconnect(), null);
|
|
662
700
|
}
|
|
663
701
|
set model(e) {
|
|
664
702
|
this._model = e, this.dispatchEvent(new xe(this.tagName.toLowerCase(), this._session, !!this._model)), this._render();
|
|
@@ -670,22 +708,21 @@ var Se = class extends HTMLElement {
|
|
|
670
708
|
return this._session;
|
|
671
709
|
}
|
|
672
710
|
connectedCallback() {
|
|
673
|
-
this._render();
|
|
711
|
+
this._initMathObserver(), this._render();
|
|
674
712
|
}
|
|
675
713
|
_render() {
|
|
714
|
+
this._initMathObserver();
|
|
676
715
|
let e = C.createElement($, {
|
|
677
716
|
model: this._model,
|
|
678
717
|
session: this._session
|
|
679
718
|
});
|
|
680
|
-
this._root ||= E(this), this._root.render(e)
|
|
681
|
-
i(this);
|
|
682
|
-
});
|
|
719
|
+
this._root ||= E(this), this._root.render(e);
|
|
683
720
|
}
|
|
684
721
|
disconnectedCallback() {
|
|
685
|
-
this._root
|
|
722
|
+
this._disconnectMathObserver(), this._root &&= (this._root.unmount(), null);
|
|
686
723
|
}
|
|
687
724
|
};
|
|
688
725
|
//#endregion
|
|
689
726
|
export { R as n, Se as t };
|
|
690
727
|
|
|
691
|
-
//# sourceMappingURL=delivery-
|
|
728
|
+
//# sourceMappingURL=delivery-BJfoUSKA.js.map
|