@pie-element/match 12.1.2-next.1 → 12.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +1462 -0
- package/CHANGELOG.md +2337 -0
- package/LICENSE.md +5 -0
- package/README.md +1 -0
- package/configure/CHANGELOG.json +892 -0
- package/configure/CHANGELOG.md +2040 -0
- package/configure/lib/add-row.js +40 -0
- package/configure/lib/add-row.js.map +1 -0
- package/configure/lib/answer-config-block.js +288 -0
- package/configure/lib/answer-config-block.js.map +1 -0
- package/configure/lib/common.js +31 -0
- package/configure/lib/common.js.map +1 -0
- package/configure/lib/configure.js +410 -0
- package/configure/lib/configure.js.map +1 -0
- package/configure/lib/defaults.js +201 -0
- package/configure/lib/defaults.js.map +1 -0
- package/configure/lib/general-config-block.js +144 -0
- package/configure/lib/general-config-block.js.map +1 -0
- package/configure/lib/index.js +152 -0
- package/configure/lib/index.js.map +1 -0
- package/configure/lib/row.js +321 -0
- package/configure/lib/row.js.map +1 -0
- package/configure/lib/utils.js +12 -0
- package/configure/lib/utils.js.map +1 -0
- package/configure/package.json +29 -0
- package/configure/utils.js +19 -0
- package/controller/CHANGELOG.json +502 -0
- package/controller/CHANGELOG.md +1363 -0
- package/controller/lib/defaults.js +25 -0
- package/controller/lib/defaults.js.map +1 -0
- package/controller/lib/index.js +424 -0
- package/controller/lib/index.js.map +1 -0
- package/controller/package.json +24 -0
- package/docs/config-schema.json +2929 -0
- package/docs/config-schema.json.md +2162 -0
- package/docs/demo/config.js +8 -0
- package/docs/demo/generate.js +49 -0
- package/docs/demo/index.html +1 -0
- package/docs/demo/session.js +11 -0
- package/docs/pie-schema.json +1530 -0
- package/docs/pie-schema.json.md +907 -0
- package/lib/answer-grid.js +166 -0
- package/lib/answer-grid.js.map +1 -0
- package/lib/index.js +85 -0
- package/lib/index.js.map +1 -0
- package/lib/main.js +163 -0
- package/lib/main.js.map +1 -0
- package/package.json +21 -88
- package/configure.js +0 -2
- package/controller.js +0 -1
- package/dist/author/add-row.d.ts +0 -17
- package/dist/author/add-row.js +0 -24
- package/dist/author/answer-config-block.d.ts +0 -36
- package/dist/author/answer-config-block.js +0 -176
- package/dist/author/common.d.ts +0 -22
- package/dist/author/configure.d.ts +0 -48
- package/dist/author/configure.js +0 -259
- package/dist/author/defaults.d.ts +0 -203
- package/dist/author/defaults.js +0 -151
- package/dist/author/general-config-block.d.ts +0 -22
- package/dist/author/general-config-block.js +0 -93
- package/dist/author/index.d.ts +0 -44
- package/dist/author/index.js +0 -76
- package/dist/author/row.d.ts +0 -51
- package/dist/author/row.js +0 -204
- package/dist/author/utils.d.ts +0 -10
- package/dist/author/utils.js +0 -10
- package/dist/browser/Typography-CbSskKxx.js +0 -9217
- package/dist/browser/Typography-CbSskKxx.js.map +0 -1
- package/dist/browser/author/index.js +0 -41596
- package/dist/browser/author/index.js.map +0 -1
- package/dist/browser/browser-kkT1XVKw.js +0 -219
- package/dist/browser/browser-kkT1XVKw.js.map +0 -1
- package/dist/browser/controller/index.js +0 -267
- package/dist/browser/controller/index.js.map +0 -1
- package/dist/browser/delivery/index.js +0 -1984
- package/dist/browser/delivery/index.js.map +0 -1
- package/dist/browser/dist-i687VHmY.js +0 -100
- package/dist/browser/dist-i687VHmY.js.map +0 -1
- package/dist/browser/match.css +0 -2
- package/dist/controller/defaults.d.ts +0 -27
- package/dist/controller/defaults.js +0 -25
- package/dist/controller/index.d.ts +0 -29
- package/dist/controller/index.js +0 -154
- package/dist/delivery/answer-grid.d.ts +0 -28
- package/dist/delivery/answer-grid.js +0 -99
- package/dist/delivery/index.d.ts +0 -21
- package/dist/delivery/index.js +0 -51
- package/dist/delivery/main.d.ts +0 -26
- package/dist/delivery/main.js +0 -112
- package/dist/index.d.ts +0 -1
- package/dist/index.iife.d.ts +0 -8
- package/dist/index.iife.js +0 -148
- package/dist/index.js +0 -2
- package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +0 -16
- package/dist/runtime-support.d.ts +0 -12
- package/dist/runtime-support.js +0 -12
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _default = exports.default = {
|
|
8
|
+
choiceMode: 'radio',
|
|
9
|
+
feedbackEnabled: false,
|
|
10
|
+
headers: ['Column 1', 'Column 2', 'Column 3'],
|
|
11
|
+
layout: 3,
|
|
12
|
+
lockChoiceOrder: true,
|
|
13
|
+
partialScoring: false,
|
|
14
|
+
prompt: '',
|
|
15
|
+
promptEnabled: true,
|
|
16
|
+
rationale: '',
|
|
17
|
+
rationaleEnabled: true,
|
|
18
|
+
rows: [],
|
|
19
|
+
scoringType: 'auto',
|
|
20
|
+
studentInstructionsEnabled: true,
|
|
21
|
+
teacherInstructions: '',
|
|
22
|
+
teacherInstructionsEnabled: true,
|
|
23
|
+
toolbarEditorPosition: 'bottom'
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=defaults.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.js","names":["choiceMode","feedbackEnabled","headers","layout","lockChoiceOrder","partialScoring","prompt","promptEnabled","rationale","rationaleEnabled","rows","scoringType","studentInstructionsEnabled","teacherInstructions","teacherInstructionsEnabled","toolbarEditorPosition"],"sources":["../src/defaults.js"],"sourcesContent":["export default {\n choiceMode: 'radio',\n feedbackEnabled: false,\n headers: ['Column 1', 'Column 2', 'Column 3'],\n layout: 3,\n lockChoiceOrder: true,\n partialScoring: false,\n prompt: '',\n promptEnabled: true,\n rationale: '',\n rationaleEnabled: true,\n rows: [],\n scoringType: 'auto',\n studentInstructionsEnabled: true,\n teacherInstructions: '',\n teacherInstructionsEnabled: true,\n toolbarEditorPosition: 'bottom',\n};\n"],"mappings":";;;;;;iCAAe;EACbA,UAAU,EAAE,OAAO;EACnBC,eAAe,EAAE,KAAK;EACtBC,OAAO,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC;EAC7CC,MAAM,EAAE,CAAC;EACTC,eAAe,EAAE,IAAI;EACrBC,cAAc,EAAE,KAAK;EACrBC,MAAM,EAAE,EAAE;EACVC,aAAa,EAAE,IAAI;EACnBC,SAAS,EAAE,EAAE;EACbC,gBAAgB,EAAE,IAAI;EACtBC,IAAI,EAAE,EAAE;EACRC,WAAW,EAAE,MAAM;EACnBC,0BAA0B,EAAE,IAAI;EAChCC,mBAAmB,EAAE,EAAE;EACvBC,0BAA0B,EAAE,IAAI;EAChCC,qBAAqB,EAAE;AACzB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.createCorrectResponseSession = void 0;
|
|
8
|
+
exports.createDefaultModel = createDefaultModel;
|
|
9
|
+
exports.getLogTrace = void 0;
|
|
10
|
+
exports.model = model;
|
|
11
|
+
exports.validate = exports.outcome = exports.normalize = void 0;
|
|
12
|
+
var _lodashEs = require("lodash-es");
|
|
13
|
+
var _feedback = require("@pie-lib/feedback");
|
|
14
|
+
var _controllerUtils = require("@pie-lib/controller-utils");
|
|
15
|
+
var _debug = _interopRequireDefault(require("debug"));
|
|
16
|
+
var _defaults = _interopRequireDefault(require("./defaults"));
|
|
17
|
+
const log = (0, _debug.default)('@pie-element:match:controller');
|
|
18
|
+
const getResponseCorrectness = (model, answers, env = {}) => {
|
|
19
|
+
const isPartialScoring = _controllerUtils.partialScoring.enabled(model, env);
|
|
20
|
+
const rows = model.rows;
|
|
21
|
+
const checkboxMode = model.choiceMode === 'checkbox';
|
|
22
|
+
if (!answers || Object.keys(answers).length === 0) {
|
|
23
|
+
return 'unanswered';
|
|
24
|
+
}
|
|
25
|
+
const totalCorrectAnswers = checkboxMode ? getTotalCorrectAnswers(model) : getTotalCorrect(model);
|
|
26
|
+
let correctAnswers;
|
|
27
|
+
let incorrectAnswers = 0;
|
|
28
|
+
if (checkboxMode) {
|
|
29
|
+
const checkboxes = getCheckboxes(rows, answers);
|
|
30
|
+
correctAnswers = checkboxes.correctAnswers;
|
|
31
|
+
incorrectAnswers = checkboxes.incorrectAnswers;
|
|
32
|
+
} else {
|
|
33
|
+
correctAnswers = getCorrectRadios(rows, answers);
|
|
34
|
+
}
|
|
35
|
+
if (totalCorrectAnswers === correctAnswers && !incorrectAnswers) {
|
|
36
|
+
return 'correct';
|
|
37
|
+
} else if (correctAnswers === 0) {
|
|
38
|
+
return 'incorrect';
|
|
39
|
+
} else if (isPartialScoring) {
|
|
40
|
+
return 'partial';
|
|
41
|
+
}
|
|
42
|
+
return 'incorrect';
|
|
43
|
+
};
|
|
44
|
+
const getCorrectness = (question, env, answers = {}) => {
|
|
45
|
+
if (env.mode === 'evaluate') {
|
|
46
|
+
return getResponseCorrectness(question, answers, env);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
const getCheckboxes = (rows, answers) => {
|
|
50
|
+
let correctAnswers = 0;
|
|
51
|
+
let incorrectAnswers = 0;
|
|
52
|
+
rows.forEach(row => {
|
|
53
|
+
const answer = answers[row.id];
|
|
54
|
+
if (answer) {
|
|
55
|
+
row.values.forEach((v, i) => {
|
|
56
|
+
if (answer[i] && answer[i] === v) {
|
|
57
|
+
correctAnswers += 1;
|
|
58
|
+
} else if (answer[i] && answer[i] !== v) {
|
|
59
|
+
incorrectAnswers += 1;
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
return {
|
|
65
|
+
correctAnswers,
|
|
66
|
+
incorrectAnswers
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
const getCorrectRadios = (rows, answers) => {
|
|
70
|
+
let correctAnswers = 0;
|
|
71
|
+
rows.forEach(row => {
|
|
72
|
+
if ((0, _lodashEs.isEqual)(row.values, answers[row.id])) {
|
|
73
|
+
correctAnswers += 1;
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
return correctAnswers;
|
|
77
|
+
};
|
|
78
|
+
const getTotalCorrect = question => {
|
|
79
|
+
const checkboxMode = question.choiceMode === 'checkbox';
|
|
80
|
+
const matchingTable = checkboxMode ? question.layout - 1 : 1;
|
|
81
|
+
return (question.rows.length || 0) * matchingTable;
|
|
82
|
+
};
|
|
83
|
+
const getTotalCorrectAnswers = question => {
|
|
84
|
+
let noOfTotalCorrectAnswers = 0;
|
|
85
|
+
question.rows.forEach(row => {
|
|
86
|
+
row.values.forEach(value => {
|
|
87
|
+
if (value) {
|
|
88
|
+
noOfTotalCorrectAnswers += 1;
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
return noOfTotalCorrectAnswers;
|
|
93
|
+
};
|
|
94
|
+
const getPartialScore = (question, answers) => {
|
|
95
|
+
const checkboxMode = question.choiceMode === 'checkbox';
|
|
96
|
+
if (checkboxMode) {
|
|
97
|
+
const {
|
|
98
|
+
correctAnswers,
|
|
99
|
+
incorrectAnswers
|
|
100
|
+
} = getCheckboxes(question.rows, answers);
|
|
101
|
+
const totalCorrect = getTotalCorrectAnswers(question);
|
|
102
|
+
const total = totalCorrect === 0 ? 1 : totalCorrect;
|
|
103
|
+
if (correctAnswers + incorrectAnswers > totalCorrect) {
|
|
104
|
+
const extraAnswers = correctAnswers + incorrectAnswers - totalCorrect;
|
|
105
|
+
const score = parseFloat(((correctAnswers - extraAnswers) / total).toFixed(2));
|
|
106
|
+
return score < 0 ? 0 : score;
|
|
107
|
+
} else {
|
|
108
|
+
return parseFloat((correctAnswers / total).toFixed(2));
|
|
109
|
+
}
|
|
110
|
+
} else {
|
|
111
|
+
const correctAnswers = getCorrectRadios(question.rows, answers);
|
|
112
|
+
const totalCorrect = getTotalCorrect(question) === 0 ? 1 : getTotalCorrect(question);
|
|
113
|
+
return parseFloat((correctAnswers / totalCorrect).toFixed(2));
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
const getOutComeScore = (question, env, answers = {}) => {
|
|
117
|
+
const correctness = getCorrectness(question, env, answers);
|
|
118
|
+
const isPartialScoring = _controllerUtils.partialScoring.enabled(question, env);
|
|
119
|
+
return correctness === 'correct' ? 1 : correctness === 'partial' && isPartialScoring ? getPartialScore(question, answers) : 0;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Generates detailed trace log for match item scoring evaluation
|
|
124
|
+
* @param {Object} question
|
|
125
|
+
* @param {Object} session
|
|
126
|
+
* @param {Object} env
|
|
127
|
+
* @returns {Array<string>} traceLog
|
|
128
|
+
*/
|
|
129
|
+
const getLogTrace = (question, session, env) => {
|
|
130
|
+
const traceLog = [];
|
|
131
|
+
const answers = session?.answers || {};
|
|
132
|
+
const rows = question?.rows || [];
|
|
133
|
+
const checkboxMode = question.choiceMode === 'checkbox';
|
|
134
|
+
if (!answers || Object.keys(answers).length === 0) {
|
|
135
|
+
traceLog.push('Student did not provide any answer.');
|
|
136
|
+
return traceLog;
|
|
137
|
+
}
|
|
138
|
+
traceLog.push(`Match item contains ${rows.length} row(s).`);
|
|
139
|
+
traceLog.push(`Matching mode: ${checkboxMode ? 'checkbox (multiple matches allowed)' : 'radio (single match per row)'}.`);
|
|
140
|
+
let correctCount = 0;
|
|
141
|
+
let incorrectCount = 0;
|
|
142
|
+
let totalCorrect = 0;
|
|
143
|
+
rows.forEach(row => {
|
|
144
|
+
const studentAnswer = answers[row.id];
|
|
145
|
+
const correctValues = row.values || [];
|
|
146
|
+
if (checkboxMode) {
|
|
147
|
+
correctValues.forEach((v, idx) => {
|
|
148
|
+
if (v) {
|
|
149
|
+
totalCorrect++;
|
|
150
|
+
}
|
|
151
|
+
if (studentAnswer && studentAnswer[idx]) {
|
|
152
|
+
if (studentAnswer[idx] === v) {
|
|
153
|
+
correctCount++;
|
|
154
|
+
} else {
|
|
155
|
+
incorrectCount++;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
} else {
|
|
160
|
+
totalCorrect++;
|
|
161
|
+
if (studentAnswer) {
|
|
162
|
+
if ((0, _lodashEs.isEqual)(correctValues, studentAnswer)) {
|
|
163
|
+
correctCount++;
|
|
164
|
+
} else {
|
|
165
|
+
incorrectCount++;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
if (correctCount > 0) {
|
|
171
|
+
traceLog.push(`${correctCount} correct match(es) selected.`);
|
|
172
|
+
}
|
|
173
|
+
if (incorrectCount > 0) {
|
|
174
|
+
traceLog.push(`${incorrectCount} incorrect match(es) selected.`);
|
|
175
|
+
}
|
|
176
|
+
if (correctCount === 0 && incorrectCount === 0) {
|
|
177
|
+
traceLog.push('Student provided answers, but none matched the correct responses.');
|
|
178
|
+
}
|
|
179
|
+
const partialScoringEnabled = _controllerUtils.partialScoring.enabled(question, env);
|
|
180
|
+
if (partialScoringEnabled) {
|
|
181
|
+
traceLog.push('Score calculated using partial scoring.');
|
|
182
|
+
if (checkboxMode) {
|
|
183
|
+
traceLog.push('Score is based on the number of correct minus extra incorrect matches, divided by the total number of correct matches.');
|
|
184
|
+
if (correctCount + incorrectCount > totalCorrect) {
|
|
185
|
+
traceLog.push('Extra selected matches beyond the correct set reduce the score.');
|
|
186
|
+
}
|
|
187
|
+
} else {
|
|
188
|
+
traceLog.push('Score is based on the number of correctly matched rows divided by the total number of rows.');
|
|
189
|
+
}
|
|
190
|
+
} else {
|
|
191
|
+
traceLog.push('Score calculated using all-or-nothing scoring.');
|
|
192
|
+
traceLog.push('Student must match all rows correctly to receive full credit.');
|
|
193
|
+
}
|
|
194
|
+
const rawScore = getOutComeScore(question, env, answers);
|
|
195
|
+
const finalScore = partialScoringEnabled ? rawScore : rawScore === 1 ? 1 : 0;
|
|
196
|
+
traceLog.push(`Final score: ${finalScore}.`);
|
|
197
|
+
return traceLog;
|
|
198
|
+
};
|
|
199
|
+
exports.getLogTrace = getLogTrace;
|
|
200
|
+
const outcome = (question, session, env) => {
|
|
201
|
+
return new Promise(resolve => {
|
|
202
|
+
if (env.mode !== 'evaluate') {
|
|
203
|
+
resolve({
|
|
204
|
+
score: undefined,
|
|
205
|
+
completed: undefined,
|
|
206
|
+
logTrace: []
|
|
207
|
+
});
|
|
208
|
+
} else {
|
|
209
|
+
if (!session || (0, _lodashEs.isEmpty)(session)) {
|
|
210
|
+
resolve({
|
|
211
|
+
score: 0,
|
|
212
|
+
empty: true,
|
|
213
|
+
logTrace: ['Student did not provide any answer.']
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
const out = {
|
|
217
|
+
score: getOutComeScore(question, env, session.answers),
|
|
218
|
+
empty: false,
|
|
219
|
+
logTrace: getLogTrace(question, session, env)
|
|
220
|
+
};
|
|
221
|
+
resolve(out);
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
};
|
|
225
|
+
exports.outcome = outcome;
|
|
226
|
+
function createDefaultModel(model = {}) {
|
|
227
|
+
return new Promise(resolve => {
|
|
228
|
+
resolve({
|
|
229
|
+
..._defaults.default,
|
|
230
|
+
...model
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
const normalize = question => ({
|
|
235
|
+
..._defaults.default,
|
|
236
|
+
...question
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
*
|
|
241
|
+
* @param {*} question
|
|
242
|
+
* @param {*} session
|
|
243
|
+
* @param {*} env
|
|
244
|
+
* @param {*} updateSession - optional - a function that will set the properties passed into it on the session.
|
|
245
|
+
*/
|
|
246
|
+
exports.normalize = normalize;
|
|
247
|
+
async function model(question, session, env, updateSession) {
|
|
248
|
+
const normalizedQuestion = (0, _lodashEs.cloneDeep)(normalize(question));
|
|
249
|
+
let correctness, score;
|
|
250
|
+
if ((!session || (0, _lodashEs.isEmpty)(session)) && env.mode === 'evaluate') {
|
|
251
|
+
correctness = 'unanswered';
|
|
252
|
+
score = '0%';
|
|
253
|
+
} else {
|
|
254
|
+
correctness = getCorrectness(normalizedQuestion, env, session && session.answers);
|
|
255
|
+
score = `${getOutComeScore(normalizedQuestion, env, session && session.answers) * 100}%`;
|
|
256
|
+
}
|
|
257
|
+
const correctResponse = {};
|
|
258
|
+
const correctInfo = {
|
|
259
|
+
score,
|
|
260
|
+
correctness
|
|
261
|
+
};
|
|
262
|
+
const lockChoiceOrder = (0, _controllerUtils.lockChoices)(normalizedQuestion, session, env);
|
|
263
|
+
if (!lockChoiceOrder) {
|
|
264
|
+
normalizedQuestion.rows = await (0, _controllerUtils.getShuffledChoices)(normalizedQuestion.rows, session, updateSession, 'id');
|
|
265
|
+
}
|
|
266
|
+
normalizedQuestion.rows.forEach(row => {
|
|
267
|
+
correctResponse[row.id] = row.values;
|
|
268
|
+
if (env.mode !== 'evaluate') {
|
|
269
|
+
delete row.values;
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
const feedback = env.mode === 'evaluate' && normalizedQuestion.feedbackEnabled ? await (0, _feedback.getFeedbackForCorrectness)(correctInfo.correctness, normalizedQuestion.feedback) : undefined;
|
|
273
|
+
const {
|
|
274
|
+
extraCSSRules,
|
|
275
|
+
feedbackEnabled,
|
|
276
|
+
promptEnabled,
|
|
277
|
+
prompt,
|
|
278
|
+
lockChoiceOrder: _,
|
|
279
|
+
...essentials
|
|
280
|
+
} = normalizedQuestion;
|
|
281
|
+
const out = {
|
|
282
|
+
...essentials,
|
|
283
|
+
extraCSSRules,
|
|
284
|
+
allowFeedback: feedbackEnabled,
|
|
285
|
+
prompt: promptEnabled ? prompt : null,
|
|
286
|
+
shuffled: !lockChoiceOrder,
|
|
287
|
+
feedback,
|
|
288
|
+
disabled: env.mode !== 'gather',
|
|
289
|
+
view: env.mode === 'view'
|
|
290
|
+
};
|
|
291
|
+
if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {
|
|
292
|
+
out.teacherInstructions = normalizedQuestion.teacherInstructionsEnabled ? normalizedQuestion.teacherInstructions : null;
|
|
293
|
+
out.rationale = normalizedQuestion.rationaleEnabled ? normalizedQuestion.rationale : null;
|
|
294
|
+
} else {
|
|
295
|
+
out.rationale = null;
|
|
296
|
+
out.teacherInstructions = null;
|
|
297
|
+
}
|
|
298
|
+
if (env.mode === 'evaluate') {
|
|
299
|
+
Object.assign(out, {
|
|
300
|
+
correctResponse,
|
|
301
|
+
correctness: correctInfo
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
log('out: ', out);
|
|
305
|
+
return out;
|
|
306
|
+
}
|
|
307
|
+
const createCorrectResponseSession = (question, env) => {
|
|
308
|
+
return new Promise(resolve => {
|
|
309
|
+
if (env.mode !== 'evaluate' && env.role === 'instructor') {
|
|
310
|
+
const {
|
|
311
|
+
rows
|
|
312
|
+
} = question;
|
|
313
|
+
const answers = {};
|
|
314
|
+
rows.forEach(r => {
|
|
315
|
+
answers[r.id] = r.values;
|
|
316
|
+
});
|
|
317
|
+
resolve({
|
|
318
|
+
answers,
|
|
319
|
+
id: '1'
|
|
320
|
+
});
|
|
321
|
+
} else {
|
|
322
|
+
resolve(null);
|
|
323
|
+
}
|
|
324
|
+
});
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
// remove all html tags
|
|
328
|
+
exports.createCorrectResponseSession = createCorrectResponseSession;
|
|
329
|
+
const getInnerText = html => (html || '').replaceAll(/<[^>]*>/g, '');
|
|
330
|
+
|
|
331
|
+
// remove all html tags except img, iframe and source tag for audio
|
|
332
|
+
const getContent = html => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');
|
|
333
|
+
const validate = (model = {}, config = {}) => {
|
|
334
|
+
const {
|
|
335
|
+
rows,
|
|
336
|
+
choiceMode,
|
|
337
|
+
headers
|
|
338
|
+
} = model;
|
|
339
|
+
const {
|
|
340
|
+
minQuestions,
|
|
341
|
+
maxQuestions,
|
|
342
|
+
maxLengthQuestionsHeading,
|
|
343
|
+
maxAnswers,
|
|
344
|
+
maxLengthAnswers,
|
|
345
|
+
maxLengthFirstColumnHeading
|
|
346
|
+
} = config;
|
|
347
|
+
const rowsErrors = {};
|
|
348
|
+
const columnsErrors = {};
|
|
349
|
+
const errors = {};
|
|
350
|
+
['teacherInstructions', 'prompt', 'rationale'].forEach(field => {
|
|
351
|
+
if (config[field]?.required && !getContent(model[field])) {
|
|
352
|
+
errors[field] = 'This field is required.';
|
|
353
|
+
}
|
|
354
|
+
});
|
|
355
|
+
if (rows.length < minQuestions) {
|
|
356
|
+
errors.noOfRowsError = `There should be at least ${minQuestions} question rows.`;
|
|
357
|
+
} else if (rows.length > maxQuestions) {
|
|
358
|
+
errors.noOfRowsError = `No more than ${maxQuestions} question rows should be defined.`;
|
|
359
|
+
}
|
|
360
|
+
(rows || []).forEach((row, index) => {
|
|
361
|
+
const {
|
|
362
|
+
id,
|
|
363
|
+
values = [],
|
|
364
|
+
title
|
|
365
|
+
} = row;
|
|
366
|
+
rowsErrors[id] = '';
|
|
367
|
+
if (maxLengthQuestionsHeading && getInnerText(title).length > maxLengthQuestionsHeading) {
|
|
368
|
+
rowsErrors[id] += `Content length should be maximum ${maxLengthQuestionsHeading} characters. `;
|
|
369
|
+
}
|
|
370
|
+
if (!getContent(title)) {
|
|
371
|
+
rowsErrors[id] += 'Content should not be empty. ';
|
|
372
|
+
} else {
|
|
373
|
+
// check for identical content with the previous answers
|
|
374
|
+
const identicalAnswer = rows.slice(0, index).some(r => getContent(r.title) === getContent(title));
|
|
375
|
+
if (identicalAnswer) {
|
|
376
|
+
rowsErrors[id] += 'Content should be unique. ';
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
const hasCorrectResponse = values.some(value => !!value);
|
|
380
|
+
if (!hasCorrectResponse) {
|
|
381
|
+
rowsErrors[id] += 'No correct response defined.';
|
|
382
|
+
}
|
|
383
|
+
});
|
|
384
|
+
if (maxAnswers && headers.length - 1 > maxAnswers) {
|
|
385
|
+
errors.columnsLengthError = `There should be maximum ${maxAnswers} answers.`;
|
|
386
|
+
}
|
|
387
|
+
if (maxLengthFirstColumnHeading && headers[0].length > maxLengthFirstColumnHeading) {
|
|
388
|
+
columnsErrors[0] = `Content length should be maximum ${maxLengthFirstColumnHeading} characters.`;
|
|
389
|
+
}
|
|
390
|
+
const headersContent = (headers || []).map(heading => getContent(heading));
|
|
391
|
+
headersContent.shift(); // remove first column since it does not require validation
|
|
392
|
+
|
|
393
|
+
headersContent.forEach((heading, index) => {
|
|
394
|
+
const headerIndex = index + 1; // we need to add 1 because we removed first header from validation
|
|
395
|
+
columnsErrors[headerIndex] = '';
|
|
396
|
+
if (maxLengthAnswers && getInnerText(heading).length > maxLengthAnswers) {
|
|
397
|
+
columnsErrors[headerIndex] += `Content length should be maximum ${maxLengthAnswers} characters. `;
|
|
398
|
+
}
|
|
399
|
+
if (!heading) {
|
|
400
|
+
columnsErrors[headerIndex] += 'Content should not be empty.';
|
|
401
|
+
} else {
|
|
402
|
+
// check for identical content with the previous headers
|
|
403
|
+
const identicalAnswer = headersContent.slice(0, index).some(head => head === heading);
|
|
404
|
+
if (identicalAnswer) {
|
|
405
|
+
columnsErrors[index + 1] += 'Content should be unique.';
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
});
|
|
409
|
+
const hasRowErrors = Object.values(rowsErrors).some(error => (error || '').length);
|
|
410
|
+
if (hasRowErrors) {
|
|
411
|
+
errors.rowsErrors = rowsErrors;
|
|
412
|
+
const noCorrectAnswer = Object.values(rowsErrors).some(error => (error || '').includes('No correct response defined.'));
|
|
413
|
+
if (noCorrectAnswer) {
|
|
414
|
+
errors.correctResponseError = choiceMode === 'radio' ? 'There should be a correct response defined for every row.' : 'There should be at least one correct response defined for every row.';
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
const hasColumnErrors = Object.values(columnsErrors).some(error => (error || '').length);
|
|
418
|
+
if (hasColumnErrors) {
|
|
419
|
+
errors.columnsErrors = columnsErrors;
|
|
420
|
+
}
|
|
421
|
+
return errors;
|
|
422
|
+
};
|
|
423
|
+
exports.validate = validate;
|
|
424
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_lodashEs","require","_feedback","_controllerUtils","_debug","_interopRequireDefault","_defaults","log","debug","getResponseCorrectness","model","answers","env","isPartialScoring","partialScoring","enabled","rows","checkboxMode","choiceMode","Object","keys","length","totalCorrectAnswers","getTotalCorrectAnswers","getTotalCorrect","correctAnswers","incorrectAnswers","checkboxes","getCheckboxes","getCorrectRadios","getCorrectness","question","mode","forEach","row","answer","id","values","v","i","isEqual","matchingTable","layout","noOfTotalCorrectAnswers","value","getPartialScore","totalCorrect","total","extraAnswers","score","parseFloat","toFixed","getOutComeScore","correctness","getLogTrace","session","traceLog","push","correctCount","incorrectCount","studentAnswer","correctValues","idx","partialScoringEnabled","rawScore","finalScore","exports","outcome","Promise","resolve","undefined","completed","logTrace","isEmpty","empty","out","createDefaultModel","defaults","normalize","updateSession","normalizedQuestion","cloneDeep","correctResponse","correctInfo","lockChoiceOrder","lockChoices","getShuffledChoices","feedback","feedbackEnabled","getFeedbackForCorrectness","extraCSSRules","promptEnabled","prompt","_","essentials","allowFeedback","shuffled","disabled","view","role","teacherInstructions","teacherInstructionsEnabled","rationale","rationaleEnabled","assign","createCorrectResponseSession","r","getInnerText","html","replaceAll","getContent","replace","validate","config","headers","minQuestions","maxQuestions","maxLengthQuestionsHeading","maxAnswers","maxLengthAnswers","maxLengthFirstColumnHeading","rowsErrors","columnsErrors","errors","field","required","noOfRowsError","index","title","identicalAnswer","slice","some","hasCorrectResponse","columnsLengthError","headersContent","map","heading","shift","headerIndex","head","hasRowErrors","error","noCorrectAnswer","includes","correctResponseError","hasColumnErrors"],"sources":["../src/index.js"],"sourcesContent":["import { cloneDeep, isEmpty, isEqual } from 'lodash-es';\nimport { getFeedbackForCorrectness } from '@pie-lib/feedback';\nimport { lockChoices, getShuffledChoices, partialScoring } from '@pie-lib/controller-utils';\nimport debug from 'debug';\n\nconst log = debug('@pie-element:match:controller');\n\nimport defaults from './defaults';\n\nconst getResponseCorrectness = (model, answers, env = {}) => {\n const isPartialScoring = partialScoring.enabled(model, env);\n const rows = model.rows;\n const checkboxMode = model.choiceMode === 'checkbox';\n\n if (!answers || Object.keys(answers).length === 0) {\n return 'unanswered';\n }\n\n const totalCorrectAnswers = checkboxMode ? getTotalCorrectAnswers(model) : getTotalCorrect(model);\n let correctAnswers;\n let incorrectAnswers = 0;\n\n if (checkboxMode) {\n const checkboxes = getCheckboxes(rows, answers);\n\n correctAnswers = checkboxes.correctAnswers;\n incorrectAnswers = checkboxes.incorrectAnswers;\n } else {\n correctAnswers = getCorrectRadios(rows, answers);\n }\n\n if (totalCorrectAnswers === correctAnswers && !incorrectAnswers) {\n return 'correct';\n } else if (correctAnswers === 0) {\n return 'incorrect';\n } else if (isPartialScoring) {\n return 'partial';\n }\n\n return 'incorrect';\n};\n\nconst getCorrectness = (question, env, answers = {}) => {\n if (env.mode === 'evaluate') {\n return getResponseCorrectness(question, answers, env);\n }\n};\n\nconst getCheckboxes = (rows, answers) => {\n let correctAnswers = 0;\n let incorrectAnswers = 0;\n\n rows.forEach((row) => {\n const answer = answers[row.id];\n\n if (answer) {\n row.values.forEach((v, i) => {\n if (answer[i] && answer[i] === v) {\n correctAnswers += 1;\n } else if (answer[i] && answer[i] !== v) {\n incorrectAnswers += 1;\n }\n });\n }\n });\n\n return { correctAnswers, incorrectAnswers };\n};\n\nconst getCorrectRadios = (rows, answers) => {\n let correctAnswers = 0;\n\n rows.forEach((row) => {\n if (isEqual(row.values, answers[row.id])) {\n correctAnswers += 1;\n }\n });\n\n return correctAnswers;\n};\n\nconst getTotalCorrect = (question) => {\n const checkboxMode = question.choiceMode === 'checkbox';\n const matchingTable = checkboxMode ? question.layout - 1 : 1;\n return (question.rows.length || 0) * matchingTable;\n};\n\nconst getTotalCorrectAnswers = (question) => {\n let noOfTotalCorrectAnswers = 0;\n\n question.rows.forEach((row) => {\n row.values.forEach((value) => {\n if (value) {\n noOfTotalCorrectAnswers += 1;\n }\n });\n });\n\n return noOfTotalCorrectAnswers;\n};\n\nconst getPartialScore = (question, answers) => {\n const checkboxMode = question.choiceMode === 'checkbox';\n\n if (checkboxMode) {\n const { correctAnswers, incorrectAnswers } = getCheckboxes(question.rows, answers);\n const totalCorrect = getTotalCorrectAnswers(question);\n\n const total = totalCorrect === 0 ? 1 : totalCorrect;\n\n if (correctAnswers + incorrectAnswers > totalCorrect) {\n const extraAnswers = correctAnswers + incorrectAnswers - totalCorrect;\n const score = parseFloat(((correctAnswers - extraAnswers) / total).toFixed(2));\n\n return score < 0 ? 0 : score;\n } else {\n return parseFloat((correctAnswers / total).toFixed(2));\n }\n } else {\n const correctAnswers = getCorrectRadios(question.rows, answers);\n const totalCorrect = getTotalCorrect(question) === 0 ? 1 : getTotalCorrect(question);\n\n return parseFloat((correctAnswers / totalCorrect).toFixed(2));\n }\n};\n\nconst getOutComeScore = (question, env, answers = {}) => {\n const correctness = getCorrectness(question, env, answers);\n const isPartialScoring = partialScoring.enabled(question, env);\n\n return correctness === 'correct'\n ? 1\n : correctness === 'partial' && isPartialScoring\n ? getPartialScore(question, answers)\n : 0;\n};\n\n/**\n * Generates detailed trace log for match item scoring evaluation\n * @param {Object} question\n * @param {Object} session\n * @param {Object} env\n * @returns {Array<string>} traceLog\n */\nexport const getLogTrace = (question, session, env) => {\n const traceLog = [];\n\n const answers = session?.answers || {};\n const rows = question?.rows || [];\n const checkboxMode = question.choiceMode === 'checkbox';\n\n if (!answers || Object.keys(answers).length === 0) {\n traceLog.push('Student did not provide any answer.');\n return traceLog;\n }\n\n traceLog.push(`Match item contains ${rows.length} row(s).`);\n traceLog.push(`Matching mode: ${checkboxMode ? 'checkbox (multiple matches allowed)' : 'radio (single match per row)'}.`);\n\n let correctCount = 0;\n let incorrectCount = 0;\n let totalCorrect = 0;\n\n rows.forEach((row) => {\n const studentAnswer = answers[row.id];\n const correctValues = row.values || [];\n\n if (checkboxMode) {\n correctValues.forEach((v, idx) => {\n if (v) {\n totalCorrect++;\n }\n\n if (studentAnswer && studentAnswer[idx]) {\n if (studentAnswer[idx] === v) {\n correctCount++;\n } else {\n incorrectCount++;\n }\n }\n });\n } else {\n totalCorrect++;\n if (studentAnswer) {\n if (isEqual(correctValues, studentAnswer)) {\n correctCount++;\n } else {\n incorrectCount++;\n }\n }\n }\n });\n\n if (correctCount > 0) {\n traceLog.push(`${correctCount} correct match(es) selected.`);\n }\n\n if (incorrectCount > 0) {\n traceLog.push(`${incorrectCount} incorrect match(es) selected.`);\n }\n\n if (correctCount === 0 && incorrectCount === 0) {\n traceLog.push('Student provided answers, but none matched the correct responses.');\n }\n\n const partialScoringEnabled = partialScoring.enabled(question, env);\n\n if (partialScoringEnabled) {\n traceLog.push('Score calculated using partial scoring.');\n\n if (checkboxMode) {\n traceLog.push(\n 'Score is based on the number of correct minus extra incorrect matches, divided by the total number of correct matches.',\n );\n\n if (correctCount + incorrectCount > totalCorrect) {\n traceLog.push('Extra selected matches beyond the correct set reduce the score.');\n }\n } else {\n traceLog.push(\n 'Score is based on the number of correctly matched rows divided by the total number of rows.',\n );\n }\n } else {\n traceLog.push('Score calculated using all-or-nothing scoring.');\n traceLog.push('Student must match all rows correctly to receive full credit.');\n }\n\n const rawScore = getOutComeScore(question, env, answers);\n const finalScore = partialScoringEnabled ? rawScore : rawScore === 1 ? 1 : 0;\n\n traceLog.push(`Final score: ${finalScore}.`);\n\n return traceLog;\n};\n\nexport const outcome = (question, session, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate') {\n resolve({ score: undefined, completed: undefined, logTrace: [] });\n } else {\n if (!session || isEmpty(session)) {\n resolve({ score: 0, empty: true, logTrace: ['Student did not provide any answer.'] });\n }\n\n const out = {\n score: getOutComeScore(question, env, session.answers),\n empty: false,\n logTrace: getLogTrace(question, session, env),\n };\n\n resolve(out);\n }\n });\n};\n\nexport function createDefaultModel(model = {}) {\n return new Promise((resolve) => {\n resolve({\n ...defaults,\n ...model,\n });\n });\n}\n\nexport const normalize = (question) => ({ ...defaults, ...question });\n\n/**\n *\n * @param {*} question\n * @param {*} session\n * @param {*} env\n * @param {*} updateSession - optional - a function that will set the properties passed into it on the session.\n */\nexport async function model(question, session, env, updateSession) {\n const normalizedQuestion = cloneDeep(normalize(question));\n let correctness, score;\n\n if ((!session || isEmpty(session)) && env.mode === 'evaluate') {\n correctness = 'unanswered';\n score = '0%';\n } else {\n correctness = getCorrectness(normalizedQuestion, env, session && session.answers);\n score = `${getOutComeScore(normalizedQuestion, env, session && session.answers) * 100}%`;\n }\n\n const correctResponse = {};\n const correctInfo = {\n score,\n correctness,\n };\n\n const lockChoiceOrder = lockChoices(normalizedQuestion, session, env);\n\n if (!lockChoiceOrder) {\n normalizedQuestion.rows = await getShuffledChoices(normalizedQuestion.rows, session, updateSession, 'id');\n }\n\n normalizedQuestion.rows.forEach((row) => {\n correctResponse[row.id] = row.values;\n\n if (env.mode !== 'evaluate') {\n delete row.values;\n }\n });\n\n const feedback =\n env.mode === 'evaluate' && normalizedQuestion.feedbackEnabled\n ? await getFeedbackForCorrectness(correctInfo.correctness, normalizedQuestion.feedback)\n : undefined;\n\n const {\n extraCSSRules,\n feedbackEnabled,\n promptEnabled,\n prompt,\n lockChoiceOrder: _,\n ...essentials\n } = normalizedQuestion;\n const out = {\n ...essentials,\n extraCSSRules,\n allowFeedback: feedbackEnabled,\n prompt: promptEnabled ? prompt : null,\n shuffled: !lockChoiceOrder,\n feedback,\n disabled: env.mode !== 'gather',\n view: env.mode === 'view',\n };\n\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n out.teacherInstructions = normalizedQuestion.teacherInstructionsEnabled\n ? normalizedQuestion.teacherInstructions\n : null;\n out.rationale = normalizedQuestion.rationaleEnabled ? normalizedQuestion.rationale : null;\n } else {\n out.rationale = null;\n out.teacherInstructions = null;\n }\n\n if (env.mode === 'evaluate') {\n Object.assign(out, {\n correctResponse,\n correctness: correctInfo,\n });\n }\n\n log('out: ', out);\n return out;\n}\n\nexport const createCorrectResponseSession = (question, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n const { rows } = question;\n const answers = {};\n\n rows.forEach((r) => {\n answers[r.id] = r.values;\n });\n\n resolve({\n answers,\n id: '1',\n });\n } else {\n resolve(null);\n }\n });\n};\n\n// remove all html tags\nconst getInnerText = (html) => (html || '').replaceAll(/<[^>]*>/g, '');\n\n// remove all html tags except img, iframe and source tag for audio\nconst getContent = (html) => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');\n\nexport const validate = (model = {}, config = {}) => {\n const { rows, choiceMode, headers } = model;\n const {\n minQuestions,\n maxQuestions,\n maxLengthQuestionsHeading,\n maxAnswers,\n maxLengthAnswers,\n maxLengthFirstColumnHeading,\n } = config;\n const rowsErrors = {};\n const columnsErrors = {};\n const errors = {};\n\n ['teacherInstructions', 'prompt', 'rationale'].forEach((field) => {\n if (config[field]?.required && !getContent(model[field])) {\n errors[field] = 'This field is required.';\n }\n });\n\n if (rows.length < minQuestions) {\n errors.noOfRowsError = `There should be at least ${minQuestions} question rows.`;\n } else if (rows.length > maxQuestions) {\n errors.noOfRowsError = `No more than ${maxQuestions} question rows should be defined.`;\n }\n\n (rows || []).forEach((row, index) => {\n const { id, values = [], title } = row;\n rowsErrors[id] = '';\n\n if (maxLengthQuestionsHeading && getInnerText(title).length > maxLengthQuestionsHeading) {\n rowsErrors[id] += `Content length should be maximum ${maxLengthQuestionsHeading} characters. `;\n }\n\n if (!getContent(title)) {\n rowsErrors[id] += 'Content should not be empty. ';\n } else {\n // check for identical content with the previous answers\n const identicalAnswer = rows.slice(0, index).some((r) => getContent(r.title) === getContent(title));\n\n if (identicalAnswer) {\n rowsErrors[id] += 'Content should be unique. ';\n }\n }\n\n const hasCorrectResponse = values.some((value) => !!value);\n\n if (!hasCorrectResponse) {\n rowsErrors[id] += 'No correct response defined.';\n }\n });\n\n if (maxAnswers && headers.length - 1 > maxAnswers) {\n errors.columnsLengthError = `There should be maximum ${maxAnswers} answers.`;\n }\n\n if (maxLengthFirstColumnHeading && headers[0].length > maxLengthFirstColumnHeading) {\n columnsErrors[0] = `Content length should be maximum ${maxLengthFirstColumnHeading} characters.`;\n }\n\n const headersContent = (headers || []).map((heading) => getContent(heading));\n headersContent.shift(); // remove first column since it does not require validation\n\n headersContent.forEach((heading, index) => {\n const headerIndex = index + 1; // we need to add 1 because we removed first header from validation\n columnsErrors[headerIndex] = '';\n\n if (maxLengthAnswers && getInnerText(heading).length > maxLengthAnswers) {\n columnsErrors[headerIndex] += `Content length should be maximum ${maxLengthAnswers} characters. `;\n }\n\n if (!heading) {\n columnsErrors[headerIndex] += 'Content should not be empty.';\n } else {\n // check for identical content with the previous headers\n const identicalAnswer = headersContent.slice(0, index).some((head) => head === heading);\n\n if (identicalAnswer) {\n columnsErrors[index + 1] += 'Content should be unique.';\n }\n }\n });\n\n const hasRowErrors = Object.values(rowsErrors).some((error) => (error || '').length);\n\n if (hasRowErrors) {\n errors.rowsErrors = rowsErrors;\n\n const noCorrectAnswer = Object.values(rowsErrors).some((error) =>\n (error || '').includes('No correct response defined.'),\n );\n\n if (noCorrectAnswer) {\n errors.correctResponseError =\n choiceMode === 'radio'\n ? 'There should be a correct response defined for every row.'\n : 'There should be at least one correct response defined for every row.';\n }\n }\n\n const hasColumnErrors = Object.values(columnsErrors).some((error) => (error || '').length);\n\n if (hasColumnErrors) {\n errors.columnsErrors = columnsErrors;\n }\n\n return errors;\n};\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,gBAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAIA,IAAAK,SAAA,GAAAD,sBAAA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MAAMa,YAAY,GAAGzH,MAAM,CAACkB,MAAM,CAACoF,UAAU,CAAC,CAACU,IAAI,CAAEU,KAAK,IAAK,CAACA,KAAK,IAAI,EAAE,EAAExH,MAAM,CAAC;EAEpF,IAAIuH,YAAY,EAAE;IAChBjB,MAAM,CAACF,UAAU,GAAGA,UAAU;IAE9B,MAAMqB,eAAe,GAAG3H,MAAM,CAACkB,MAAM,CAACoF,UAAU,CAAC,CAACU,IAAI,CAAEU,KAAK,IAC3D,CAACA,KAAK,IAAI,EAAE,EAAEE,QAAQ,CAAC,8BAA8B,CACvD,CAAC;IAED,IAAID,eAAe,EAAE;MACnBnB,MAAM,CAACqB,oBAAoB,GACzB9H,UAAU,KAAK,OAAO,GAClB,2DAA2D,GAC3D,sEAAsE;IAC9E;EACF;EAEA,MAAM+H,eAAe,GAAG9H,MAAM,CAACkB,MAAM,CAACqF,aAAa,CAAC,CAACS,IAAI,CAAEU,KAAK,IAAK,CAACA,KAAK,IAAI,EAAE,EAAExH,MAAM,CAAC;EAE1F,IAAI4H,eAAe,EAAE;IACnBtB,MAAM,CAACD,aAAa,GAAGA,aAAa;EACtC;EAEA,OAAOC,MAAM;AACf,CAAC;AAACzD,OAAA,CAAA8C,QAAA,GAAAA,QAAA","ignoreList":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pie-element/match-controller",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "10.1.1",
|
|
5
|
+
"description": "",
|
|
6
|
+
"main": "lib/index.js",
|
|
7
|
+
"module": "src/index.js",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"test": "./node_modules/.bin/jest"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@pie-lib/controller-utils": "2.0.2",
|
|
13
|
+
"@pie-lib/feedback": "2.0.2",
|
|
14
|
+
"debug": "^4.1.1"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"babel-jest": "^29.7.0",
|
|
18
|
+
"babel-preset-env": "^1.6.1",
|
|
19
|
+
"babel-preset-stage-0": "^6.24.1",
|
|
20
|
+
"jest": "^29.7.0"
|
|
21
|
+
},
|
|
22
|
+
"author": "",
|
|
23
|
+
"license": "ISC"
|
|
24
|
+
}
|