@pie-element/explicit-constructed-response 12.0.4-next.20261011174919 → 12.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 +56 -54
- package/dist/author/index.d.ts +18 -28
- package/dist/author/index.js +6 -1
- package/dist/author/main.d.ts +43 -25
- package/dist/author/main.js +98 -111
- package/dist/browser/author/index.js +19 -29
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/controller/index.js +4 -4
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/editor-runtime/author/index.js +19 -29
- package/dist/browser/editor-runtime/author/index.js.map +1 -1
- package/dist/browser/editor-runtime/controller/index.js +4 -4
- package/dist/browser/editor-runtime/controller/index.js.map +1 -1
- package/dist/controller/defaults.d.ts +10 -9
- package/dist/controller/index.d.ts +83 -24
- package/dist/controller/index.js +4 -4
- package/dist/index.d.ts +1 -0
- package/dist/schemas/configuration.schema.json +426 -0
- package/dist/schemas/model.schema.json +605 -0
- package/dist/schemas/session.schema.json +23 -0
- package/dist/types.d.ts +186 -0
- package/package.json +20 -16
|
@@ -4023,7 +4023,7 @@ var m = {
|
|
|
4023
4023
|
if (e === "evaluate") {
|
|
4024
4024
|
r.correct = !0;
|
|
4025
4025
|
let e = n.feedback && n.feedback.type || "none";
|
|
4026
|
-
e === "default" ? r.feedback = t.correct : e === "custom" && (r.feedback = n.feedback
|
|
4026
|
+
e === "default" ? r.feedback = t.correct : e === "custom" && (r.feedback = n.feedback?.value);
|
|
4027
4027
|
}
|
|
4028
4028
|
return r;
|
|
4029
4029
|
}, v = (e) => e ? "correct" : "incorrect", y = (e) => Math.abs(e) === Infinity ? 2 : e <= 2 ? e + 2 : e <= 4 ? e + 3 : e <= 6 ? e + 4 : e + 5, b = (e) => e ? e.replace(/</g, "<").replace(/>/g, ">").replace(/"/g, "\"").replace(/'|'/g, "'").replace(/&/g, "&") : "", x = (e) => ({
|
|
@@ -4077,12 +4077,12 @@ var C = (e) => k(O(e).trim()), w = (e, n) => {
|
|
|
4077
4077
|
let o = e.markup && e.markup.match(/\{\{(.+?)\}\}/g), s = o ? o.length : 0, c = r(e.choices, (e, n, r) => {
|
|
4078
4078
|
let o = a && a[r];
|
|
4079
4079
|
return t(o) || !i(n, (e) => C(e.label) === C(o)) ? e : e + 1;
|
|
4080
|
-
}, 0), l = s ? (c / s).toFixed(2) : 0;
|
|
4080
|
+
}, 0), l = s ? (c / s).toFixed(2) : "0";
|
|
4081
4081
|
return parseFloat(l);
|
|
4082
4082
|
}, T = (e, n, r) => {
|
|
4083
4083
|
let i = [], { value: a } = n || {}, { choices: o, markup: s } = e || {}, c = s ? s.match(/\{\{(.+?)\}\}/g) : [], l = c ? c.length : 0;
|
|
4084
4084
|
if (i.push(`${l} response area(s) defined in this question.`), a && Object.keys(a).length > 0) {
|
|
4085
|
-
let e = Object.entries(a).filter(([
|
|
4085
|
+
let e = Object.entries(a).filter(([, e]) => e && e.trim()).length;
|
|
4086
4086
|
i.push(`Student filled ${e} out of ${l} response area(s).`), Object.keys(o || {}).forEach((e) => {
|
|
4087
4087
|
let n = a && a[e] || "", r = o[e] || [], s = !t(n.trim()) && r.some((e) => C(e.label) === C(n));
|
|
4088
4088
|
n.trim() ? i.push(`Response area ${parseInt(e) + 1}: ${s ? "CORRECT" : "INCORRECT"}.`) : i.push(`Response area ${parseInt(e) + 1}: left empty.`);
|
|
@@ -4143,7 +4143,7 @@ var D = (e, t) => new Promise((n) => {
|
|
|
4143
4143
|
}), t(i) || (o[e] = i);
|
|
4144
4144
|
});
|
|
4145
4145
|
let c = (i.match(/\{\{(\d+)\}\}/g) || []).length;
|
|
4146
|
-
return c > a ? s.responseAreas = `No more than ${a} response areas should be defined.` : c < 1 && (s.responseAreas = "There should be at least 1 response area defined."), t(o) || (s.choices = o), s;
|
|
4146
|
+
return a !== void 0 && c > a ? s.responseAreas = `No more than ${a} response areas should be defined.` : c < 1 && (s.responseAreas = "There should be at least 1 response area defined."), t(o) || (s.choices = o), s;
|
|
4147
4147
|
};
|
|
4148
4148
|
//#endregion
|
|
4149
4149
|
export { D as createCorrectResponseSession, T as getLogTrace, w as getScore, S as model, x as normalize, E as outcome, _ as prepareChoice, C as prepareVal, j as validate };
|