@pie-element/extended-text-entry 15.1.2-next.6 → 15.1.2-next.8
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/browser/author/index.js +1 -1
- package/dist/browser/controller/index.js +1 -1
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/delivery/index.js +2 -2
- package/dist/browser/{dist-BbUdUT_D.js → dist-BgIZCJg9.js} +349 -262
- package/dist/browser/dist-BgIZCJg9.js.map +1 -0
- package/dist/browser/{main-CXlds066.js → main-D2VwE_Cm.js} +2 -2
- package/dist/browser/{main-CXlds066.js.map → main-D2VwE_Cm.js.map} +1 -1
- package/dist/browser/print/index.js +2 -2
- package/dist/controller/index.js +1 -1
- package/dist/index.iife.js +49 -49
- package/package.json +6 -4
- package/dist/browser/dist-BbUdUT_D.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as e, t } from "../browser-kkT1XVKw.js";
|
|
2
|
-
import { A as n, B as r, C as i, D as a, E as o, F as s, G as c, H as l, I as u, J as d, L as f, M as p, N as m, O as h, P as g, R as _, S as v, T as y, U as b, V as x, W as S, Y as C, a as w, b as T, c as E, d as D, f as O, h as k, i as A, j, k as M, l as N, m as P, n as F, o as I, p as L, r as R, s as z, t as ee, w as te, z as B } from "../dist-
|
|
2
|
+
import { A as n, B as r, C as i, D as a, E as o, F as s, G as c, H as l, I as u, J as d, L as f, M as p, N as m, O as h, P as g, R as _, S as v, T as y, U as b, V as x, W as S, Y as C, a as w, b as T, c as E, d as D, f as O, h as k, i as A, j, k as M, l as N, m as P, n as F, o as I, p as L, r as R, s as z, t as ee, w as te, z as B } from "../dist-BgIZCJg9.js";
|
|
3
3
|
import * as V from "react";
|
|
4
4
|
import H, { Component as ne, createElement as re } from "react";
|
|
5
5
|
import { jsx as U, jsxs as W } from "react/jsx-runtime";
|
|
@@ -157,7 +157,7 @@ async function c(e, t, n) {
|
|
|
157
157
|
spanishInput: i.spanishInput,
|
|
158
158
|
specialInput: i.specialInput,
|
|
159
159
|
equationEditor: l,
|
|
160
|
-
spellCheckEnabled:
|
|
160
|
+
spellCheckEnabled: i.playerSpellCheckDisabled === !1,
|
|
161
161
|
playersToolbarPosition: i.playersToolbarPosition || "bottom",
|
|
162
162
|
annotatorMode: u,
|
|
163
163
|
disabledAnnotator: !i.annotationsEnabled || n.role !== "instructor",
|
|
@@ -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, i = {}) {\n\treturn new Promise((a) => {\n\t\tlet o = {\n\t\t\t...e,\n\t\t\t...i\n\t\t}, s = t(n), c = o[s], l = e[s];\n\t\tr(c, l[c.type]).then(a);\n\t});\n}\nfunction r(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 i(n, r = {}) {\n\tlet i = {\n\t\t...e,\n\t\t...r\n\t}, o = t(n), s = i[o], c = e[o];\n\treturn a(s, c[s.type]);\n}\nfunction a(e, t) {\n\tif (!(!e || e.type === \"none\")) return e[e.type] || t;\n}\n//#endregion\nexport { e as defaultFeedback, a as getActualFeedback, i as getActualFeedbackForCorrectness, r as getFeedback, n as getFeedbackForCorrectness, t as normalizeCorrectness };\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/extended-text-entry/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\nexport default {\n annotationsEnabled: false,\n dimensions: { height: 100, width: 500 },\n equationEditor: 'Grade 8 - HS',\n feedbackEnabled: false,\n mathInput: 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/**\n * @synced-from pie-elements/packages/extended-text-entry/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 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 spellCheckEnabled:
|
|
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, i = {}) {\n\treturn new Promise((a) => {\n\t\tlet o = {\n\t\t\t...e,\n\t\t\t...i\n\t\t}, s = t(n), c = o[s], l = e[s];\n\t\tr(c, l[c.type]).then(a);\n\t});\n}\nfunction r(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 i(n, r = {}) {\n\tlet i = {\n\t\t...e,\n\t\t...r\n\t}, o = t(n), s = i[o], c = e[o];\n\treturn a(s, c[s.type]);\n}\nfunction a(e, t) {\n\tif (!(!e || e.type === \"none\")) return e[e.type] || t;\n}\n//#endregion\nexport { e as defaultFeedback, a as getActualFeedback, i as getActualFeedbackForCorrectness, r as getFeedback, n as getFeedbackForCorrectness, t as normalizeCorrectness };\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/extended-text-entry/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\nexport default {\n annotationsEnabled: false,\n dimensions: { height: 100, width: 500 },\n equationEditor: 'Grade 8 - HS',\n feedbackEnabled: false,\n mathInput: 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/**\n * @synced-from pie-elements/packages/extended-text-entry/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 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 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":";;;AAuCA,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;;;ACrCA,IAAA,IAAe;CACb,oBAAoB;CACpB,YAAY;EAAE,QAAQ;EAAK,OAAO;CAAI;CACtC,gBAAgB;CAChB,iBAAiB;CACjB,WAAW;CACX,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;EAAW;EAC9C;GAAE,OAAO;GAAY,MAAM;GAAY,MAAM;EAAW;EACxD;GAAE,OAAO;GAAU,MAAM;GAAU,MAAM;EAAW;EACpD;GAAE,OAAO;GAAQ,MAAM;GAAY,MAAM;EAAW;EACpD;GAAE,OAAO;GAAQ,MAAM;GAAc,MAAM;EAAW;EACtD;GAAE,OAAO;GAAQ,MAAM;GAAkB,MAAM;EAAW;EAC1D;GAAE,OAAO;GAAQ,MAAM;GAAe,MAAM;EAAW;EACvD;GAAE,OAAO;GAAO,MAAM;GAAmB,MAAM;EAAW;EAC1D;GAAE,OAAO;GAAW,MAAM;GAAW,MAAM;EAAW;EACtD;GAAE,OAAO;GAAO,MAAM;GAAO,MAAM;EAAW;EAC9C;GAAE,OAAO;GAAM,MAAM;GAAY,MAAM;EAAW;EAClD;GAAE,OAAO;GAAO,MAAM;GAAkB,MAAM;EAAW;EACzD;GAAE,OAAO;GAAO,MAAM;GAAY,MAAM;EAAW;EACnD;GAAE,OAAO;GAAO,MAAM;GAAW,MAAM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EACnE,wBAAwB,EAAmB,0BAA0B;EACrE;EACA,mBAAmB,GAAmB,sBAAqB,EAAI,SAAS;EACxE,uBAAuB,EAAmB,qBAAqB,EAAmB,wBAAwB,CAAC;EAC3G,eAAe,EAAmB;CACpC,EAAE;AACJ;AAEA,eAAsB,IAAoC;CACxD,OAAO;EACL,OAAO;EACP,WAAW;EACX,MAAM;CACR;AACF;AAMA,IAAM,KAAc,OAAU,KAAQ,GAAA,CAAI,QAAQ,sCAAsC,EAAE,GAE7E,KAAY,IAAQ,CAAC,GAAG,IAAS,CAAC,MAAM;CACnD,IAAM,IAAS,CAAC;CAQhB,OANA,CAAC,uBAAuB,QAAQ,CAAC,CAAC,SAAS,MAAU;EACnD,AAAI,EAAO,EAAM,EAAE,YAAY,CAAC,EAAW,EAAM,EAAM,MACrD,EAAO,KAAS;CAEpB,CAAC,GAEM;AACT"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as e, t } from "../browser-kkT1XVKw.js";
|
|
2
|
-
import { v as n } from "../dist-
|
|
3
|
-
import { t as r } from "../main-
|
|
2
|
+
import { v as n } from "../dist-BgIZCJg9.js";
|
|
3
|
+
import { t as r } from "../main-D2VwE_Cm.js";
|
|
4
4
|
import i from "react";
|
|
5
5
|
import { createRoot as a } from "react-dom/client";
|
|
6
6
|
//#region ../../shared/player-events/dist/index.js
|