@pie-element/placement-ordering 13.1.1-next.4 → 13.2.0-next.0
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.md +10 -0
- package/controller/CHANGELOG.md +10 -0
- package/controller/lib/index.js +74 -2
- package/controller/lib/index.js.map +1 -1
- package/controller/package.json +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [13.2.0-next.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/placement-ordering@13.1.1-next.4...@pie-element/placement-ordering@13.2.0-next.0) (2026-03-18)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- tests ([bcea404](https://github.com/pie-framework/pie-elements/commit/bcea40428ae344270edf703186cbe83b85b1ead2))
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
- **placement-ordering:** add scoring trace in outcome function PD-5459 ([ddaeeea](https://github.com/pie-framework/pie-elements/commit/ddaeeea858dde5a462225798bdca4acc90cd7a39))
|
|
15
|
+
|
|
6
16
|
## [13.1.1-next.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/placement-ordering@13.1.1-next.3...@pie-element/placement-ordering@13.1.1-next.4) (2026-03-12)
|
|
7
17
|
|
|
8
18
|
### Bug Fixes
|
package/controller/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [10.2.0-next.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/placement-ordering-controller@10.1.1-next.1...@pie-element/placement-ordering-controller@10.2.0-next.0) (2026-03-18)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- tests ([bcea404](https://github.com/pie-framework/pie-elements/commit/bcea40428ae344270edf703186cbe83b85b1ead2))
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
- **placement-ordering:** add scoring trace in outcome function PD-5459 ([ddaeeea](https://github.com/pie-framework/pie-elements/commit/ddaeeea858dde5a462225798bdca4acc90cd7a39))
|
|
15
|
+
|
|
6
16
|
## [10.1.1-next.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/placement-ordering-controller@10.1.0-next.2...@pie-element/placement-ordering-controller@10.1.1-next.1) (2026-02-26)
|
|
7
17
|
|
|
8
18
|
**Note:** Version bump only for package @pie-element/placement-ordering-controller
|
package/controller/lib/index.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.createCorrectResponseSession = void 0;
|
|
8
8
|
exports.createDefaultModel = createDefaultModel;
|
|
9
|
+
exports.getLogTrace = void 0;
|
|
9
10
|
exports.model = model;
|
|
10
11
|
exports.normalize = void 0;
|
|
11
12
|
exports.outcome = outcome;
|
|
@@ -22,14 +23,84 @@ const {
|
|
|
22
23
|
translator
|
|
23
24
|
} = _translator.default;
|
|
24
25
|
const questionError = () => new Error('Question is missing required array: correctResponse');
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Generates detailed trace log for placement-ordering scoring evaluation
|
|
29
|
+
* @param {Object} question - the question model
|
|
30
|
+
* @param {Object} session - the student session
|
|
31
|
+
* @param {Object} env - the environment
|
|
32
|
+
* @returns {Array<string>} traceLog
|
|
33
|
+
*/
|
|
25
34
|
exports.questionError = questionError;
|
|
35
|
+
const getLogTrace = (question, session, env) => {
|
|
36
|
+
const traceLog = [];
|
|
37
|
+
const value = session?.value || [];
|
|
38
|
+
const correctResponse = question?.correctResponse || [];
|
|
39
|
+
const hasPlacementArea = question?.placementArea === true;
|
|
40
|
+
if (!value.length) {
|
|
41
|
+
if (hasPlacementArea) {
|
|
42
|
+
traceLog.push('Student did not place any tiles in the target area.');
|
|
43
|
+
} else {
|
|
44
|
+
traceLog.push('Student did not reorder any tiles.');
|
|
45
|
+
}
|
|
46
|
+
traceLog.push('Final score: 0.');
|
|
47
|
+
return traceLog;
|
|
48
|
+
}
|
|
49
|
+
const allCorrectResponses = (0, _scoring.getAllCorrectResponses)(question);
|
|
50
|
+
let bestMatch = {
|
|
51
|
+
score: 0,
|
|
52
|
+
response: []
|
|
53
|
+
};
|
|
54
|
+
allCorrectResponses.forEach(cr => {
|
|
55
|
+
let matchCount = 0;
|
|
56
|
+
value.forEach((v, idx) => {
|
|
57
|
+
if (cr[idx] === v) {
|
|
58
|
+
matchCount++;
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
if (matchCount > bestMatch.score) {
|
|
62
|
+
bestMatch = {
|
|
63
|
+
score: matchCount,
|
|
64
|
+
response: cr
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
const correctCount = bestMatch.score;
|
|
69
|
+
const incorrectCount = value.length - correctCount;
|
|
70
|
+
if (correctCount > 0) {
|
|
71
|
+
traceLog.push(`${correctCount} tile(s) placed in the correct order.`);
|
|
72
|
+
}
|
|
73
|
+
if (incorrectCount > 0) {
|
|
74
|
+
traceLog.push(`${incorrectCount} tile(s) placed in an incorrect order.`);
|
|
75
|
+
}
|
|
76
|
+
const isFullyCorrect = allCorrectResponses.some(cr => (0, _lodashEs.isEqual)(cr, value));
|
|
77
|
+
const partialScoringEnabled = _controllerUtils.partialScoring.enabled(question, env || {});
|
|
78
|
+
if (partialScoringEnabled) {
|
|
79
|
+
traceLog.push('Score calculated using partial scoring.');
|
|
80
|
+
traceLog.push('Each tile placed in the correct position contributes to the score.');
|
|
81
|
+
} else {
|
|
82
|
+
traceLog.push('Score calculated using all-or-nothing scoring.');
|
|
83
|
+
if (hasPlacementArea) {
|
|
84
|
+
traceLog.push('Student must place all tiles in the correct positions within the target area to receive full credit.');
|
|
85
|
+
} else {
|
|
86
|
+
traceLog.push('Student must arrange all tiles in the correct order to receive full credit.');
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
const rawScore = (0, _scoring.score)(question, session);
|
|
90
|
+
const finalScore = partialScoringEnabled ? rawScore : rawScore === 1 ? 1 : 0;
|
|
91
|
+
traceLog.push(`Final score: ${finalScore}.`);
|
|
92
|
+
return traceLog;
|
|
93
|
+
};
|
|
94
|
+
exports.getLogTrace = getLogTrace;
|
|
26
95
|
function outcome(question, session, env) {
|
|
27
96
|
return new Promise((resolve, reject) => {
|
|
28
97
|
if (!session || (0, _lodashEs.isEmpty)(session)) {
|
|
29
98
|
resolve({
|
|
30
99
|
score: 0,
|
|
31
|
-
empty: true
|
|
100
|
+
empty: true,
|
|
101
|
+
logTrace: ['Student did not interact with the placement-ordering item.']
|
|
32
102
|
});
|
|
103
|
+
return;
|
|
33
104
|
}
|
|
34
105
|
if (!question || !question.correctResponse || (0, _lodashEs.isEmpty)(question.correctResponse)) {
|
|
35
106
|
reject(questionError());
|
|
@@ -38,7 +109,8 @@ function outcome(question, session, env) {
|
|
|
38
109
|
const s = (0, _scoring.score)(question, session);
|
|
39
110
|
const finalScore = _controllerUtils.partialScoring.enabled(question, env || {}) ? s : s === 1 ? 1 : 0;
|
|
40
111
|
resolve({
|
|
41
|
-
score: finalScore
|
|
112
|
+
score: finalScore,
|
|
113
|
+
logTrace: getLogTrace(question, session, env)
|
|
42
114
|
});
|
|
43
115
|
} catch (e) {
|
|
44
116
|
reject(e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_scoring","require","_lodashEs","_feedback","_controllerUtils","_debug","_interopRequireDefault","_defaults","_translator","log","debug","translator","Translator","questionError","Error","exports","outcome","question","session","env","Promise","resolve","reject","isEmpty","score","empty","correctResponse","s","finalScore","partialScoring","enabled","e","createDefaultModel","model","defaults","normalize","rationaleEnabled","feedbackEnabled","promptEnabled","teacherInstructionsEnabled","studentInstructionsEnabled","normalizedQuestion","base","alternateResponses","every","isArray","console","error","extraCSSRules","outcomes","completeLength","length","choices","filter","choice","label","note","showNote","language","prompt","config","orientation","includeTargets","placementArea","choiceLabelEnabled","targetLabel","choiceLabel","showOrdering","numberedGuides","allowSameChoiceInTargets","removeTilesAfterPlacing","disabled","mode","t","lng","role","rationale","teacherInstructions","value","allCorrectResponses","getAllCorrectResponses","bestSetOfResponses","reduce","info","cr","currentScore","acc","c","idx","Array","arr","map","id","isResponseCorrect","some","response","isEqual","responseScore","isCorrect","isPartialCorrect","correctness","flattenCorrect","feedback","getFeedbackForCorrectness","undefined","createCorrectResponseSession","getInnerText","html","replaceAll","getContent","replace","validate","errors","forEach","field","required","reversedChoices","reverse","choicesErrors","index","identicalAnswer","slice","choicesIds","correctResponseIds","orderError"],"sources":["../src/index.js"],"sourcesContent":["import { flattenCorrect, getAllCorrectResponses, score } from './scoring';\n\nimport { every, isArray, isEmpty, isEqual, map, reduce } from 'lodash-es';\nimport { getFeedbackForCorrectness } from '@pie-lib/feedback';\nimport { partialScoring } from '@pie-lib/controller-utils';\nimport debug from 'debug';\n\nimport defaults from './defaults';\n\nconst log = debug('@pie-element:placement-ordering:controller');\nimport Translator from '@pie-lib/translator';\n\nconst { translator } = Translator;\n\nexport const questionError = () => new Error('Question is missing required array: correctResponse');\n\nexport function outcome(question, session, env) {\n return new Promise((resolve, reject) => {\n if (!session || isEmpty(session)) {\n resolve({ score: 0, empty: true });\n }\n\n if (!question || !question.correctResponse || isEmpty(question.correctResponse)) {\n reject(questionError());\n } else {\n try {\n const s = score(question, session);\n const finalScore = partialScoring.enabled(question, env || {}) ? s : s === 1 ? 1 : 0;\n resolve({\n score: finalScore,\n });\n } catch (e) {\n reject(e);\n }\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) => ({\n ...defaults,\n rationaleEnabled: true,\n feedbackEnabled: false,\n promptEnabled: true,\n teacherInstructionsEnabled: true,\n studentInstructionsEnabled: true,\n ...question,\n});\n\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 const base = {};\n\n if (question.alternateResponses && every(question.alternateResponses, isArray)) {\n log('Deprecated structure of alternateResponses is in use');\n // eslint-disable-next-line no-console\n console.error('Deprecated structure of alternateResponses is in use');\n }\n\n base.env = env;\n base.extraCSSRules = normalizedQuestion.extraCSSRules;\n base.outcomes = [];\n base.completeLength = (normalizedQuestion.correctResponse || []).length;\n base.choices = (normalizedQuestion.choices || []).filter((choice) => choice.label);\n base.note = normalizedQuestion.note;\n base.showNote = normalizedQuestion.alternateResponses && normalizedQuestion.alternateResponses.length > 0;\n base.language = normalizedQuestion.language;\n\n log('[model] removing tileSize for the moment.');\n\n base.prompt = normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null;\n base.config = {\n orientation: normalizedQuestion.orientation || 'vertical',\n includeTargets: normalizedQuestion.placementArea,\n choiceLabelEnabled: normalizedQuestion.choiceLabelEnabled,\n targetLabel: normalizedQuestion.targetLabel,\n choiceLabel: normalizedQuestion.choiceLabel,\n showOrdering: normalizedQuestion.numberedGuides,\n allowSameChoiceInTargets: !normalizedQuestion.removeTilesAfterPlacing,\n };\n\n base.disabled = env.mode !== 'gather';\n\n if (!base.note) {\n base.note = translator.t('common:commonCorrectAnswerWithAlternates', { lng: normalizedQuestion.language });\n }\n\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n base.rationale = normalizedQuestion.rationaleEnabled ? normalizedQuestion.rationale : null;\n base.teacherInstructions = normalizedQuestion.teacherInstructionsEnabled\n ? normalizedQuestion.teacherInstructions\n : null;\n } else {\n base.rationale = null;\n base.teacherInstructions = null;\n }\n\n if (env.mode === 'evaluate') {\n const value = (session && session.value) || [];\n const allCorrectResponses = getAllCorrectResponses(normalizedQuestion);\n\n const bestSetOfResponses = allCorrectResponses.reduce(\n (info, cr) => {\n const currentScore = reduce(value, (acc, c, idx) => acc + (Array.isArray(cr) && cr[idx] === c ? 1 : 0), 0);\n\n if (currentScore > info.score) {\n return {\n arr: cr,\n score: currentScore,\n };\n }\n\n return info;\n },\n { arr: [], score: 0 },\n );\n\n base.outcomes = map(value, (c, idx) => {\n return {\n id: c,\n outcome: bestSetOfResponses.arr[idx] === c ? 'correct' : 'incorrect',\n };\n });\n\n const isResponseCorrect = allCorrectResponses.some((response) => isEqual(response, value));\n const responseScore = score(question, session);\n const isCorrect = responseScore === 1;\n const isPartialCorrect = !isCorrect && partialScoring.enabled(normalizedQuestion, env || {}) && responseScore !== 0;\n\n base.correctness = isCorrect ? 'correct' : isPartialCorrect ? 'partial' : 'incorrect';\n\n if (!isResponseCorrect) {\n base.correctResponse = flattenCorrect(normalizedQuestion);\n }\n\n // requirement made in PD-2182\n if (!normalizedQuestion.feedback) {\n normalizedQuestion.feedbackEnabled = false;\n }\n\n const feedback = normalizedQuestion.feedbackEnabled\n ? await getFeedbackForCorrectness(base.correctness, normalizedQuestion.feedback)\n : undefined;\n\n base.feedback = feedback;\n return base;\n } else {\n return base;\n }\n}\n\nexport const createCorrectResponseSession = (question, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n resolve({\n id: '1',\n value: flattenCorrect(question),\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 { choices, correctResponse } = model;\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 const reversedChoices = [...(choices || [])].reverse();\n const choicesErrors = {};\n\n reversedChoices.forEach((choice, index) => {\n const { id, label } = choice;\n\n if (!getContent(label)) {\n choicesErrors[id] = 'Content should not be empty.';\n } else {\n const identicalAnswer = reversedChoices.slice(index + 1).some((c) => c.label === label);\n\n if (identicalAnswer) {\n choicesErrors[id] = 'Content should be unique.';\n }\n }\n });\n\n const choicesIds = (choices || []).map((choice) => choice.id);\n const correctResponseIds = (correctResponse || []).map((response) => response.id || response);\n\n if (isEqual(choicesIds, correctResponseIds)) {\n errors.orderError = 'The correct ordering should not be identical to the initial ordering.';\n }\n\n if (!isEmpty(choicesErrors)) {\n errors.choicesErrors = choicesErrors;\n }\n\n return errors;\n};\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAC,sBAAA,CAAAL,OAAA;AAEA,IAAAM,SAAA,GAAAD,sBAAA,CAAAL,OAAA;AAGA,IAAAO,WAAA,GAAAF,sBAAA,CAAAL,OAAA;AADA,MAAMQ,GAAG,GAAG,IAAAC,cAAK,EAAC,4CAA4C,CAAC;AAG/D,MAAM;EAAEC;AAAW,CAAC,GAAGC,mBAAU;AAE1B,MAAMC,aAAa,GAAGA,CAAA,KAAM,IAAIC,KAAK,CAAC,qDAAqD,CAAC;AAACC,OAAA,CAAAF,aAAA,GAAAA,aAAA;AAE7F,SAASG,OAAOA,CAACC,QAAQ,EAAEC,OAAO,EAAEC,GAAG,EAAE;EAC9C,OAAO,IAAIC,OAAO,CAAC,CAACC,OAAO,EAAEC,MAAM,KAAK;IACtC,IAAI,CAACJ,OAAO,IAAI,IAAAK,iBAAO,EAACL,OAAO,CAAC,EAAE;MAChCG,OAAO,CAAC;QAAEG,KAAK,EAAE,CAAC;QAAEC,KAAK,EAAE;MAAK,CAAC,CAAC;IACpC;IAEA,IAAI,CAAC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Aa,GAAGA,aAAa;EACtC;EAEA,OAAON,MAAM;AACf,CAAC;AAACjG,OAAA,CAAAgG,QAAA,GAAAA,QAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_scoring","require","_lodashEs","_feedback","_controllerUtils","_debug","_interopRequireDefault","_defaults","_translator","log","debug","translator","Translator","questionError","Error","exports","getLogTrace","question","session","env","traceLog","value","correctResponse","hasPlacementArea","placementArea","length","push","allCorrectResponses","getAllCorrectResponses","bestMatch","score","response","forEach","cr","matchCount","v","idx","correctCount","incorrectCount","isFullyCorrect","some","isEqual","partialScoringEnabled","partialScoring","enabled","rawScore","finalScore","outcome","Promise","resolve","reject","isEmpty","empty","logTrace","s","e","createDefaultModel","model","defaults","normalize","rationaleEnabled","feedbackEnabled","promptEnabled","teacherInstructionsEnabled","studentInstructionsEnabled","normalizedQuestion","base","alternateResponses","every","isArray","console","error","extraCSSRules","outcomes","completeLength","choices","filter","choice","label","note","showNote","language","prompt","config","orientation","includeTargets","choiceLabelEnabled","targetLabel","choiceLabel","showOrdering","numberedGuides","allowSameChoiceInTargets","removeTilesAfterPlacing","disabled","mode","t","lng","role","rationale","teacherInstructions","bestSetOfResponses","reduce","info","currentScore","acc","c","Array","arr","map","id","isResponseCorrect","responseScore","isCorrect","isPartialCorrect","correctness","flattenCorrect","feedback","getFeedbackForCorrectness","undefined","createCorrectResponseSession","getInnerText","html","replaceAll","getContent","replace","validate","errors","field","required","reversedChoices","reverse","choicesErrors","index","identicalAnswer","slice","choicesIds","correctResponseIds","orderError"],"sources":["../src/index.js"],"sourcesContent":["import { flattenCorrect, getAllCorrectResponses, score } from './scoring';\n\nimport { every, isArray, isEmpty, isEqual, map, reduce } from 'lodash-es';\nimport { getFeedbackForCorrectness } from '@pie-lib/feedback';\nimport { partialScoring } from '@pie-lib/controller-utils';\nimport debug from 'debug';\n\nimport defaults from './defaults';\n\nconst log = debug('@pie-element:placement-ordering:controller');\nimport Translator from '@pie-lib/translator';\n\nconst { translator } = Translator;\n\nexport const questionError = () => new Error('Question is missing required array: correctResponse');\n\n/**\n * Generates detailed trace log for placement-ordering scoring evaluation\n * @param {Object} question - the question model\n * @param {Object} session - the student session\n * @param {Object} env - the environment\n * @returns {Array<string>} traceLog\n */\nexport const getLogTrace = (question, session, env) => {\n const traceLog = [];\n\n const value = session?.value || [];\n const correctResponse = question?.correctResponse || [];\n const hasPlacementArea = question?.placementArea === true;\n\n if (!value.length) {\n if (hasPlacementArea) {\n traceLog.push('Student did not place any tiles in the target area.');\n } else {\n traceLog.push('Student did not reorder any tiles.');\n }\n traceLog.push('Final score: 0.');\n return traceLog;\n }\n\n const allCorrectResponses = getAllCorrectResponses(question);\n\n let bestMatch = { score: 0, response: [] };\n\n allCorrectResponses.forEach((cr) => {\n let matchCount = 0;\n value.forEach((v, idx) => {\n if (cr[idx] === v) {\n matchCount++;\n }\n });\n\n if (matchCount > bestMatch.score) {\n bestMatch = { score: matchCount, response: cr };\n }\n });\n\n const correctCount = bestMatch.score;\n const incorrectCount = value.length - correctCount;\n\n if (correctCount > 0) {\n traceLog.push(`${correctCount} tile(s) placed in the correct order.`);\n }\n\n if (incorrectCount > 0) {\n traceLog.push(`${incorrectCount} tile(s) placed in an incorrect order.`);\n }\n\n const isFullyCorrect = allCorrectResponses.some((cr) => isEqual(cr, value));\n\n const partialScoringEnabled = partialScoring.enabled(question, env || {});\n\n if (partialScoringEnabled) {\n traceLog.push('Score calculated using partial scoring.');\n traceLog.push(\n 'Each tile placed in the correct position contributes to the score.',\n );\n } else {\n traceLog.push('Score calculated using all-or-nothing scoring.');\n if (hasPlacementArea) {\n traceLog.push(\n 'Student must place all tiles in the correct positions within the target area to receive full credit.',\n );\n } else {\n traceLog.push(\n 'Student must arrange all tiles in the correct order to receive full credit.',\n );\n }\n }\n\n const rawScore = score(question, session);\n const finalScore = partialScoringEnabled ? rawScore : rawScore === 1 ? 1 : 0;\n\n traceLog.push(`Final score: ${finalScore}.`);\n\n return traceLog;\n};\n\nexport function outcome(question, session, env) {\n return new Promise((resolve, reject) => {\n if (!session || isEmpty(session)) {\n resolve({ \n score: 0, \n empty: true, \n logTrace: ['Student did not interact with the placement-ordering item.'] \n });\n return;\n }\n\n if (!question || !question.correctResponse || isEmpty(question.correctResponse)) {\n reject(questionError());\n } else {\n try {\n const s = score(question, session);\n const finalScore = partialScoring.enabled(question, env || {}) ? s : s === 1 ? 1 : 0;\n resolve({\n score: finalScore,\n logTrace: getLogTrace(question, session, env)\n });\n } catch (e) {\n reject(e);\n }\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) => ({\n ...defaults,\n rationaleEnabled: true,\n feedbackEnabled: false,\n promptEnabled: true,\n teacherInstructionsEnabled: true,\n studentInstructionsEnabled: true,\n ...question,\n});\n\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 const base = {};\n\n if (question.alternateResponses && every(question.alternateResponses, isArray)) {\n log('Deprecated structure of alternateResponses is in use');\n // eslint-disable-next-line no-console\n console.error('Deprecated structure of alternateResponses is in use');\n }\n\n base.env = env;\n base.extraCSSRules = normalizedQuestion.extraCSSRules;\n base.outcomes = [];\n base.completeLength = (normalizedQuestion.correctResponse || []).length;\n base.choices = (normalizedQuestion.choices || []).filter((choice) => choice.label);\n base.note = normalizedQuestion.note;\n base.showNote = normalizedQuestion.alternateResponses && normalizedQuestion.alternateResponses.length > 0;\n base.language = normalizedQuestion.language;\n\n log('[model] removing tileSize for the moment.');\n\n base.prompt = normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null;\n base.config = {\n orientation: normalizedQuestion.orientation || 'vertical',\n includeTargets: normalizedQuestion.placementArea,\n choiceLabelEnabled: normalizedQuestion.choiceLabelEnabled,\n targetLabel: normalizedQuestion.targetLabel,\n choiceLabel: normalizedQuestion.choiceLabel,\n showOrdering: normalizedQuestion.numberedGuides,\n allowSameChoiceInTargets: !normalizedQuestion.removeTilesAfterPlacing,\n };\n\n base.disabled = env.mode !== 'gather';\n\n if (!base.note) {\n base.note = translator.t('common:commonCorrectAnswerWithAlternates', { lng: normalizedQuestion.language });\n }\n\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n base.rationale = normalizedQuestion.rationaleEnabled ? normalizedQuestion.rationale : null;\n base.teacherInstructions = normalizedQuestion.teacherInstructionsEnabled\n ? normalizedQuestion.teacherInstructions\n : null;\n } else {\n base.rationale = null;\n base.teacherInstructions = null;\n }\n\n if (env.mode === 'evaluate') {\n const value = (session && session.value) || [];\n const allCorrectResponses = getAllCorrectResponses(normalizedQuestion);\n\n const bestSetOfResponses = allCorrectResponses.reduce(\n (info, cr) => {\n const currentScore = reduce(value, (acc, c, idx) => acc + (Array.isArray(cr) && cr[idx] === c ? 1 : 0), 0);\n\n if (currentScore > info.score) {\n return {\n arr: cr,\n score: currentScore,\n };\n }\n\n return info;\n },\n { arr: [], score: 0 },\n );\n\n base.outcomes = map(value, (c, idx) => {\n return {\n id: c,\n outcome: bestSetOfResponses.arr[idx] === c ? 'correct' : 'incorrect',\n };\n });\n\n const isResponseCorrect = allCorrectResponses.some((response) => isEqual(response, value));\n const responseScore = score(question, session);\n const isCorrect = responseScore === 1;\n const isPartialCorrect = !isCorrect && partialScoring.enabled(normalizedQuestion, env || {}) && responseScore !== 0;\n\n base.correctness = isCorrect ? 'correct' : isPartialCorrect ? 'partial' : 'incorrect';\n\n if (!isResponseCorrect) {\n base.correctResponse = flattenCorrect(normalizedQuestion);\n }\n\n // requirement made in PD-2182\n if (!normalizedQuestion.feedback) {\n normalizedQuestion.feedbackEnabled = false;\n }\n\n const feedback = normalizedQuestion.feedbackEnabled\n ? await getFeedbackForCorrectness(base.correctness, normalizedQuestion.feedback)\n : undefined;\n\n base.feedback = feedback;\n return base;\n } else {\n return base;\n }\n}\n\nexport const createCorrectResponseSession = (question, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n resolve({\n id: '1',\n value: flattenCorrect(question),\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 { choices, correctResponse } = model;\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 const reversedChoices = [...(choices || [])].reverse();\n const choicesErrors = {};\n\n reversedChoices.forEach((choice, index) => {\n const { id, label } = choice;\n\n if (!getContent(label)) {\n choicesErrors[id] = 'Content should not be empty.';\n } else {\n const identicalAnswer = reversedChoices.slice(index + 1).some((c) => c.label === label);\n\n if (identicalAnswer) {\n choicesErrors[id] = 'Content should be unique.';\n }\n }\n });\n\n const choicesIds = (choices || []).map((choice) => choice.id);\n const correctResponseIds = (correctResponse || []).map((response) => response.id || response);\n\n if (isEqual(choicesIds, correctResponseIds)) {\n errors.orderError = 'The correct ordering should not be identical to the initial ordering.';\n }\n\n if (!isEmpty(choicesErrors)) {\n errors.choicesErrors = choicesErrors;\n }\n\n return errors;\n};\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAC,sBAAA,CAAAL,OAAA;AAEA,IAAAM,SAAA,GAAAD,sBAAA,CAAAL,OAAA;AAGA,IAAAO,WAAA,GAAAF,sBAAA,CAAAL,OAAA;AADA,MAAMQ,GAAG,GAAG,IAAAC,cAAK,EAAC,4CAA4C,CAAC;AAG/D,MAAM;EAAEC;AA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C;EAEF,MAAM0B,UAAU,GAAG,CAAC5D,OAAO,IAAI,EAAE,EAAEiC,GAAG,CAAE/B,MAAM,IAAKA,MAAM,CAACgC,EAAE,CAAC;EAC7D,MAAM2B,kBAAkB,GAAG,CAAClH,eAAe,IAAI,EAAE,EAAEsF,GAAG,CAAE7E,QAAQ,IAAKA,QAAQ,CAAC8E,EAAE,IAAI9E,QAAQ,CAAC;EAE7F,IAAI,IAAAU,iBAAO,EAAC8F,UAAU,EAAEC,kBAAkB,CAAC,EAAE;IAC3CV,MAAM,CAACW,UAAU,GAAG,uEAAuE;EAC7F;EAEA,IAAI,CAAC,IAAAtF,iBAAO,EAACgF,aAAa,CAAC,EAAE;IAC3BL,MAAM,CAACK,aAAa,GAAGA,aAAa;EACtC;EAEA,OAAOL,MAAM;AACf,CAAC;AAAC/G,OAAA,CAAA8G,QAAA,GAAAA,QAAA","ignoreList":[]}
|
package/controller/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/placement-ordering",
|
|
3
3
|
"repository": "pie-framework/pie-elements",
|
|
4
|
-
"version": "13.
|
|
4
|
+
"version": "13.2.0-next.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"author": "",
|
|
30
30
|
"license": "ISC",
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "5052ddbf1c97a5a414330a25b453455ae56977e9",
|
|
32
32
|
"scripts": {
|
|
33
33
|
"postpublish": "../../scripts/postpublish"
|
|
34
34
|
},
|