@pie-element/extended-text-entry 16.0.4-next.20261011174919 → 16.0.4
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/defaults.d.ts +62 -58
- package/dist/author/index.d.ts +15 -36
- package/dist/author/index.js +7 -3
- package/dist/author/main.d.ts +28 -13
- package/dist/author/main.js +46 -55
- package/dist/browser/author/index.js +13 -20
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/editor-runtime/author/index.js +13 -20
- package/dist/browser/editor-runtime/author/index.js.map +1 -1
- package/dist/browser/editor-runtime/controller/index.js.map +1 -1
- package/dist/controller/defaults.d.ts +18 -14
- package/dist/controller/index.d.ts +86 -39
- package/dist/index.d.ts +1 -0
- package/dist/schemas/configuration.schema.json +367 -0
- package/dist/schemas/model.schema.json +513 -0
- package/dist/schemas/session.schema.json +74 -0
- package/dist/types.d.ts +229 -0
- package/package.json +18 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../shared/feedback/dist/index.js","../../../src/controller/defaults.ts","../../../src/controller/index.ts"],"sourcesContent":["//#region src/defaults.ts\nvar e = {\n\tcorrect: {\n\t\ttype: \"default\",\n\t\tdefault: \"Correct\",\n\t\tcustom: \"Correct\"\n\t},\n\tincorrect: {\n\t\ttype: \"default\",\n\t\tdefault: \"Incorrect\",\n\t\tcustom: \"Incorrect\"\n\t},\n\tpartial: {\n\t\ttype: \"default\",\n\t\tdefault: \"Nearly\",\n\t\tcustom: \"Nearly\"\n\t},\n\tunanswered: {\n\t\ttype: \"default\",\n\t\tdefault: \"You have not entered a response\",\n\t\tcustom: \"You have not entered a response\"\n\t}\n};\n//#endregion\n//#region src/utils.ts\nfunction t(e) {\n\treturn e === \"partially-correct\" ? \"partial\" : e;\n}\n//#endregion\n//#region src/index.ts\nfunction n(n, r) {\n\tlet i = {\n\t\t...e,\n\t\t...r\n\t}, a = t(n), o = e[a] || {}, s = i[a] || o;\n\treturn {\n\t\tconfig: s,\n\t\tfallback: o[s.type || \"default\"]\n\t};\n}\nfunction r(e, t = {}) {\n\treturn new Promise((r) => {\n\t\tlet { config: a, fallback: o } = n(e, t);\n\t\ti(a, o).then(r);\n\t});\n}\nfunction i(e, t) {\n\treturn new Promise((n) => {\n\t\tif (!e || e.type === \"none\") {\n\t\t\tn(void 0);\n\t\t\treturn;\n\t\t}\n\t\tn(e[e.type] || t);\n\t});\n}\nfunction a(e, t = {}) {\n\tlet { config: r, fallback: i } = n(e, t);\n\treturn o(r, i);\n}\nfunction o(e, t) {\n\tif (!(!e || e.type === \"none\")) return e[e.type] || t;\n}\n//#endregion\nexport { e as defaultFeedback, o as getActualFeedback, a as getActualFeedbackForCorrectness, i as getFeedback, r as getFeedbackForCorrectness, t as normalizeCorrectness };\n","// @ts-nocheck\n\nexport default {\n annotationsEnabled: false,\n dimensions: { height: 100, width: 500 },\n equationEditor: 'Grade 8 - HS',\n feedbackEnabled: false,\n mathInput: false,\n playerPasteFormattingDisabled: false,\n playerSpellCheckDisabled: true,\n predefinedAnnotations: [\n { label: 'good', text: 'good', type: 'positive' },\n { label: '★', text: '★', type: 'positive' },\n { label: ':-)', text: ':-)', type: 'positive' },\n { label: 'creative', text: 'creative', type: 'positive' },\n { label: 'run-on', text: 'run-on', type: 'negative' },\n { label: 'frag', text: 'fragment', type: 'negative' },\n { label: 'tran', text: 'transition', type: 'negative' },\n { label: 'supp', text: 'support needed', type: 'negative' },\n { label: 'punc', text: 'punctuation', type: 'negative' },\n { label: 'agr', text: 'agreement wrong', type: 'negative' },\n { label: 'unclear', text: 'unclear', type: 'negative' },\n { label: 'cut', text: 'cut', type: 'negative' },\n { label: 'sp', text: 'spelling', type: 'negative' },\n { label: 'cap', text: 'capitalization', type: 'negative' },\n { label: 'inf', text: 'informal', type: 'negative' },\n { label: 'awk', text: 'awkward', type: 'negative' },\n ],\n prompt: '',\n promptEnabled: true,\n rationale: '',\n rationaleEnabled: true,\n studentInstructionsEnabled: true,\n teacherInstructions: '',\n teacherInstructionsEnabled: true,\n toolbarEditorPosition: 'bottom',\n};\n","// @ts-nocheck\n\nimport debug from 'debug';\nimport { getFeedback } from '@pie-element/shared-feedback';\nimport defaults from './defaults.js';\n\nconst log = debug('@pie-element:extended-text-entry:controller');\n\nexport async function createDefaultModel(model = {}) {\n log('[createDefaultModel]', model);\n\n return { ...defaults, ...model };\n}\n\nexport const normalize = (question) => ({ ...defaults, ...question });\n\nexport async function model(question, session, env) {\n log('[question]', question);\n const normalizedQuestion = normalize(question);\n\n const fb =\n env.mode === 'evaluate' && normalizedQuestion.feedbackEnabled\n ? getFeedback(normalizedQuestion.feedback, 'Your answer has been submitted')\n : Promise.resolve(undefined);\n\n let teacherInstructions = null;\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n teacherInstructions = normalizedQuestion.teacherInstructionsEnabled ? normalizedQuestion.teacherInstructions : null;\n } else {\n teacherInstructions = null;\n }\n\n let equationEditor = normalizedQuestion.equationEditor || 'miscellaneous';\n\n switch (normalizedQuestion.equationEditor) {\n case 'Grade 1 - 2':\n equationEditor = 1;\n break;\n case 'Grade 3 - 5':\n equationEditor = 3;\n break;\n case 'Grade 6 - 7':\n equationEditor = 6;\n break;\n case 'Grade 8 - HS':\n equationEditor = 8;\n break;\n default:\n break;\n }\n\n const annotatorMode = normalizedQuestion.annotationsEnabled && (env.role === 'instructor' || env.mode === 'evaluate');\n\n return fb.then((feedback) => ({\n prompt: normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null,\n dimensions: normalizedQuestion.dimensions,\n customKeys: normalizedQuestion.customKeys || [],\n id: normalizedQuestion.id,\n disabled: env.mode !== 'gather',\n feedback,\n teacherInstructions,\n language: normalizedQuestion.language,\n mathInput: normalizedQuestion.mathInput,\n spanishInput: normalizedQuestion.spanishInput,\n specialInput: normalizedQuestion.specialInput,\n equationEditor,\n // Spellcheck is off unless the author explicitly opted in: normalize's defaults cover a\n // missing key, but a key present as undefined/null overwrites them. See PIE-978.\n spellCheckEnabled: normalizedQuestion.playerSpellCheckDisabled === false,\n pasteFormattingDisabled: normalizedQuestion.playerPasteFormattingDisabled === true,\n playersToolbarPosition: normalizedQuestion.playersToolbarPosition || 'bottom',\n annotatorMode,\n disabledAnnotator: normalizedQuestion.annotationsEnabled ? env.role !== 'instructor' : true,\n predefinedAnnotations: normalizedQuestion.annotationsEnabled ? normalizedQuestion.predefinedAnnotations : [],\n extraCSSRules: normalizedQuestion.extraCSSRules,\n }));\n}\n\nexport async function outcome(/*question, session, env*/) {\n return {\n score: 0,\n completed: 'n/a',\n note: 'Requires manual scoring',\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 errors = {};\n\n ['teacherInstructions', 'prompt'].forEach((field) => {\n if (config[field]?.required && !getContent(model[field])) {\n errors[field] = 'This field is required.';\n }\n });\n\n return errors;\n};\n"],"mappings":";;;;AA8CA,SAAS,EAAE,GAAG,GAAG;CAChB,OAAO,IAAI,SAAS,MAAM;EACzB,IAAI,CAAC,KAAK,EAAE,SAAS,QAAQ;GAC5B,EAAE,KAAK,CAAC;GACR;EACD;EACA,EAAE,EAAE,EAAE,SAAS,CAAC;CACjB,CAAC;AACF;;;ACpDA,IAAA,IAAe;CACb,oBAAoB;CACpB,YAAY;EAAE,QAAQ;EAAK,OAAO;CAAI;CACtC,gBAAgB;CAChB,iBAAiB;CACjB,WAAW;CACX,+BAA+B;CAC/B,0BAA0B;CAC1B,uBAAuB;EACrB;GAAE,OAAO;GAAQ,MAAM;GAAQ,MAAM;EAAW;EAChD;GAAE,OAAO;GAAK,MAAM;GAAK,MAAM;EAAW;EAC1C;GAAE,OAAO;GAAO,MAAM;GAAO,MAAM;E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file":"index.js","names":[],"sources":["../../../../../shared/feedback/dist/index.js","../../../src/controller/defaults.ts","../../../src/controller/index.ts"],"sourcesContent":["//#region src/defaults.ts\nvar e = {\n\tcorrect: {\n\t\ttype: \"default\",\n\t\tdefault: \"Correct\",\n\t\tcustom: \"Correct\"\n\t},\n\tincorrect: {\n\t\ttype: \"default\",\n\t\tdefault: \"Incorrect\",\n\t\tcustom: \"Incorrect\"\n\t},\n\tpartial: {\n\t\ttype: \"default\",\n\t\tdefault: \"Nearly\",\n\t\tcustom: \"Nearly\"\n\t},\n\tunanswered: {\n\t\ttype: \"default\",\n\t\tdefault: \"You have not entered a response\",\n\t\tcustom: \"You have not entered a response\"\n\t}\n};\n//#endregion\n//#region src/utils.ts\nfunction t(e) {\n\treturn e === \"partially-correct\" ? \"partial\" : e;\n}\n//#endregion\n//#region src/index.ts\nfunction n(n, r) {\n\tlet i = {\n\t\t...e,\n\t\t...r\n\t}, a = t(n), o = e[a] || {}, s = i[a] || o;\n\treturn {\n\t\tconfig: s,\n\t\tfallback: o[s.type || \"default\"]\n\t};\n}\nfunction r(e, t = {}) {\n\treturn new Promise((r) => {\n\t\tlet { config: a, fallback: o } = n(e, t);\n\t\ti(a, o).then(r);\n\t});\n}\nfunction i(e, t) {\n\treturn new Promise((n) => {\n\t\tif (!e || e.type === \"none\") {\n\t\t\tn(void 0);\n\t\t\treturn;\n\t\t}\n\t\tn(e[e.type] || t);\n\t});\n}\nfunction a(e, t = {}) {\n\tlet { config: r, fallback: i } = n(e, t);\n\treturn o(r, i);\n}\nfunction o(e, t) {\n\tif (!(!e || e.type === \"none\")) return e[e.type] || t;\n}\n//#endregion\nexport { e as defaultFeedback, o as getActualFeedback, a as getActualFeedbackForCorrectness, i as getFeedback, r as getFeedbackForCorrectness, t as normalizeCorrectness };\n","import type { ExtendedTextEntryModel } from '../types.js';\n\nexport default {\n annotationsEnabled: false,\n dimensions: { height: 100, width: 500 },\n equationEditor: 'Grade 8 - HS',\n feedbackEnabled: false,\n mathInput: false,\n playerPasteFormattingDisabled: false,\n playerSpellCheckDisabled: true,\n predefinedAnnotations: [\n { label: 'good', text: 'good', type: 'positive' },\n { label: '★', text: '★', type: 'positive' },\n { label: ':-)', text: ':-)', type: 'positive' },\n { label: 'creative', text: 'creative', type: 'positive' },\n { label: 'run-on', text: 'run-on', type: 'negative' },\n { label: 'frag', text: 'fragment', type: 'negative' },\n { label: 'tran', text: 'transition', type: 'negative' },\n { label: 'supp', text: 'support needed', type: 'negative' },\n { label: 'punc', text: 'punctuation', type: 'negative' },\n { label: 'agr', text: 'agreement wrong', type: 'negative' },\n { label: 'unclear', text: 'unclear', type: 'negative' },\n { label: 'cut', text: 'cut', type: 'negative' },\n { label: 'sp', text: 'spelling', type: 'negative' },\n { label: 'cap', text: 'capitalization', type: 'negative' },\n { label: 'inf', text: 'informal', type: 'negative' },\n { label: 'awk', text: 'awkward', type: 'negative' },\n ],\n prompt: '',\n promptEnabled: true,\n rationale: '',\n rationaleEnabled: true,\n studentInstructionsEnabled: true,\n teacherInstructions: '',\n teacherInstructionsEnabled: true,\n toolbarEditorPosition: 'bottom',\n} satisfies Omit<ExtendedTextEntryModel, 'id' | 'element'>;\n","import debug from 'debug';\nimport { getFeedback, type FeedbackConfig } from '@pie-element/shared-feedback';\nimport type { ExtraCSSRules, PieEnvironment } from '@pie-element/shared-types';\nimport defaults from './defaults.js';\nimport type {\n ExtendedTextEntryConfiguration,\n ExtendedTextEntryDimensions,\n ExtendedTextEntryModel,\n ExtendedTextEntrySession,\n PredefinedAnnotation,\n} from '../types.js';\n\nconst log = debug('@pie-element:extended-text-entry:controller');\n\n/** The model the delivery renders. */\ntype ModelView = {\n prompt: string | null | undefined;\n dimensions: ExtendedTextEntryDimensions | undefined;\n customKeys: string[];\n id: string;\n disabled: boolean;\n feedback: string | undefined;\n teacherInstructions: string | null | undefined;\n language: string | undefined;\n mathInput: boolean | undefined;\n spanishInput: boolean | undefined;\n specialInput: boolean | undefined;\n equationEditor: string | number;\n spellCheckEnabled: boolean;\n pasteFormattingDisabled: boolean;\n playersToolbarPosition: 'bottom' | 'top';\n annotatorMode: boolean | undefined;\n disabledAnnotator: boolean;\n predefinedAnnotations: PredefinedAnnotation[] | undefined;\n extraCSSRules: ExtraCSSRules | undefined;\n};\n\nexport type ExtendedTextEntryValidationErrors = {\n teacherInstructions?: string;\n prompt?: string;\n};\n\nexport async function createDefaultModel(model: Partial<ExtendedTextEntryModel> = {}) {\n log('[createDefaultModel]', model);\n\n return { ...defaults, ...model };\n}\n\nexport const normalize = (question: ExtendedTextEntryModel) => ({ ...defaults, ...question });\n\nexport async function model(\n question: ExtendedTextEntryModel,\n _session: ExtendedTextEntrySession | undefined,\n env: PieEnvironment,\n): Promise<ModelView> {\n log('[question]', question);\n const normalizedQuestion = normalize(question);\n\n const fb =\n env.mode === 'evaluate' && normalizedQuestion.feedbackEnabled\n ? getFeedback(normalizedQuestion.feedback as FeedbackConfig, 'Your answer has been submitted')\n : Promise.resolve(undefined);\n\n let teacherInstructions: string | null | undefined = null;\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n teacherInstructions = normalizedQuestion.teacherInstructionsEnabled ? normalizedQuestion.teacherInstructions : null;\n } else {\n teacherInstructions = null;\n }\n\n let equationEditor: string | number = normalizedQuestion.equationEditor || 'miscellaneous';\n\n switch (normalizedQuestion.equationEditor) {\n case 'Grade 1 - 2':\n equationEditor = 1;\n break;\n case 'Grade 3 - 5':\n equationEditor = 3;\n break;\n case 'Grade 6 - 7':\n equationEditor = 6;\n break;\n case 'Grade 8 - HS':\n equationEditor = 8;\n break;\n default:\n break;\n }\n\n const annotatorMode = normalizedQuestion.annotationsEnabled && (env.role === 'instructor' || env.mode === 'evaluate');\n\n return fb.then((feedback): ModelView => ({\n prompt: normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null,\n dimensions: normalizedQuestion.dimensions,\n customKeys: normalizedQuestion.customKeys || [],\n id: normalizedQuestion.id,\n disabled: env.mode !== 'gather',\n feedback,\n teacherInstructions,\n language: normalizedQuestion.language,\n mathInput: normalizedQuestion.mathInput,\n spanishInput: normalizedQuestion.spanishInput,\n specialInput: normalizedQuestion.specialInput,\n equationEditor,\n // Spellcheck is off unless the author explicitly opted in: normalize's defaults cover a\n // missing key, but a key present as undefined/null overwrites them. See PIE-978.\n spellCheckEnabled: normalizedQuestion.playerSpellCheckDisabled === false,\n pasteFormattingDisabled: normalizedQuestion.playerPasteFormattingDisabled === true,\n playersToolbarPosition: normalizedQuestion.playersToolbarPosition || 'bottom',\n annotatorMode,\n disabledAnnotator: normalizedQuestion.annotationsEnabled ? env.role !== 'instructor' : true,\n predefinedAnnotations: normalizedQuestion.annotationsEnabled ? normalizedQuestion.predefinedAnnotations : [],\n extraCSSRules: normalizedQuestion.extraCSSRules,\n }));\n}\n\nexport async function outcome(/*question, session, env*/) {\n return {\n score: 0,\n completed: 'n/a',\n note: 'Requires manual scoring',\n };\n}\n\n// remove all html tags except img, iframe and source tag for audio\nconst getContent = (html: string | undefined) => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');\n\nexport const validate = (\n model: Partial<ExtendedTextEntryModel> = {},\n config: ExtendedTextEntryConfiguration = {},\n): ExtendedTextEntryValidationErrors => {\n const errors: ExtendedTextEntryValidationErrors = {};\n\n (['teacherInstructions', 'prompt'] as const).forEach((field) => {\n if (config[field]?.required && !getContent(model[field])) {\n errors[field] = 'This field is required.';\n }\n });\n\n return errors;\n};\n"],"mappings":";;;;AA8CA,SAAS,EAAE,GAAG,GAAG;CAChB,OAAO,IAAI,SAAS,MAAM;EACzB,IAAI,CAAC,KAAK,EAAE,SAAS,QAAQ;GAC5B,EAAE,KAAK,CAAC;GACR;EACD;EACA,EAAE,EAAE,EAAE,SAAS,CAAC;CACjB,CAAC;AACF;;;ACpDA,IAAA,IAAe;CACb,oBAAoB;CACpB,YAAY;EAAE,QAAQ;EAAK,OAAO;CAAI;CACtC,gBAAgB;CAChB,iBAAiB;CACjB,WAA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AA4C,CAAC;CAQnD,OANA,CAAE,uBAAuB,QAAQ,CAAC,CAAW,SAAS,MAAU;EAC9D,AAAI,EAAO,EAAM,EAAE,YAAY,CAAC,EAAW,EAAM,EAAM,MACrD,EAAO,KAAS;CAEpB,CAAC,GAEM;AACT"}
|
|
@@ -2093,15 +2093,12 @@ var mr = class extends V.Component {
|
|
|
2093
2093
|
}), vr = (e) => typeof e == "string" ? {
|
|
2094
2094
|
label: e,
|
|
2095
2095
|
value: e
|
|
2096
|
-
} : e, yr =
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
isConfigProperty: n
|
|
2103
|
-
};
|
|
2104
|
-
}, br = (e, t, n = !1) => ({
|
|
2096
|
+
} : e, yr = (e, t, n = !1) => ({
|
|
2097
|
+
type: "radio",
|
|
2098
|
+
label: e,
|
|
2099
|
+
choices: t && t.map((e) => vr(e)),
|
|
2100
|
+
isConfigProperty: n
|
|
2101
|
+
}), br = (e, t, n = !1) => ({
|
|
2105
2102
|
type: "dropdown",
|
|
2106
2103
|
label: e,
|
|
2107
2104
|
choices: t,
|
|
@@ -2200,14 +2197,6 @@ var mr = class extends V.Component {
|
|
|
2200
2197
|
color: e.palette.error.main,
|
|
2201
2198
|
paddingTop: e.spacing(1)
|
|
2202
2199
|
})), Lr = class extends V.Component {
|
|
2203
|
-
static propTypes = {
|
|
2204
|
-
onModelChanged: K.default.func.isRequired,
|
|
2205
|
-
onConfigurationChanged: K.default.func,
|
|
2206
|
-
model: K.default.object.isRequired,
|
|
2207
|
-
configuration: K.default.object.isRequired,
|
|
2208
|
-
imageSupport: K.default.object.isRequired,
|
|
2209
|
-
uploadSoundSupport: K.default.object.isRequired
|
|
2210
|
-
};
|
|
2211
2200
|
constructor(e) {
|
|
2212
2201
|
super(e), this.state = { setDimensions: !0 };
|
|
2213
2202
|
}
|
|
@@ -2554,6 +2543,9 @@ var mr = class extends V.Component {
|
|
|
2554
2543
|
}
|
|
2555
2544
|
}
|
|
2556
2545
|
}, zr = class e extends HTMLElement {
|
|
2546
|
+
_root;
|
|
2547
|
+
_model;
|
|
2548
|
+
_configuration;
|
|
2557
2549
|
static createDefaultModel = (e = {}, t) => {
|
|
2558
2550
|
let n = {
|
|
2559
2551
|
...Rr.model,
|
|
@@ -2568,12 +2560,13 @@ var mr = class extends V.Component {
|
|
|
2568
2560
|
this._model = e.createDefaultModel(t, this._configuration), this.render();
|
|
2569
2561
|
}
|
|
2570
2562
|
set configuration(e) {
|
|
2571
|
-
|
|
2563
|
+
let t = {
|
|
2572
2564
|
...Rr.configuration,
|
|
2573
2565
|
...e
|
|
2574
2566
|
};
|
|
2575
|
-
|
|
2576
|
-
|
|
2567
|
+
this._configuration = t;
|
|
2568
|
+
let { withRubric: n = {} } = e || {};
|
|
2569
|
+
n?.forceEnabled && (t.withRubric.settings = !1, this._model.rubricEnabled || (this._model.rubricEnabled = !0)), this.render();
|
|
2577
2570
|
}
|
|
2578
2571
|
onModelChanged(e) {
|
|
2579
2572
|
this._model = e, this.render(), this.dispatchEvent(new Tr(this._model, !1));
|