@pie-element/drag-in-the-blank 9.1.1-next.5 → 9.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 +16 -0
- package/configure/CHANGELOG.md +6 -0
- package/configure/package.json +3 -3
- package/controller/CHANGELOG.md +10 -0
- package/controller/lib/index.js +63 -8
- package/controller/lib/index.js.map +1 -1
- package/controller/package.json +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
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
|
+
# [9.2.0-next.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/drag-in-the-blank@9.1.1-next.6...@pie-element/drag-in-the-blank@9.2.0-next.0) (2026-03-18)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- test ([3117bc7](https://github.com/pie-framework/pie-elements/commit/3117bc7c72a1b7ce495e0ce2f8c60503911054ac))
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
- **drag-in-the-blank:** add trace log for scoring in outcome function PD-5435 ([6af6124](https://github.com/pie-framework/pie-elements/commit/6af612455507a3e2f2ed93b622a2f9d5ff3edaff))
|
|
15
|
+
|
|
16
|
+
## [9.1.1-next.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/drag-in-the-blank@9.1.1-next.5...@pie-element/drag-in-the-blank@9.1.1-next.6) (2026-03-12)
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
- bump libs, update mathquill, switch interface PD-5791 ([686a7c0](https://github.com/pie-framework/pie-elements/commit/686a7c0d41ff82f5ddad7cecd93cc0c18324a81b))
|
|
21
|
+
|
|
6
22
|
## [9.1.1-next.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/drag-in-the-blank@9.1.1-next.4...@pie-element/drag-in-the-blank@9.1.1-next.5) (2026-03-09)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @pie-element/drag-in-the-blank
|
package/configure/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
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
|
+
## [8.1.1-next.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/drag-in-the-blank-configure@8.1.1-next.4...@pie-element/drag-in-the-blank-configure@8.1.1-next.5) (2026-03-12)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- bump libs, update mathquill, switch interface PD-5791 ([686a7c0](https://github.com/pie-framework/pie-elements/commit/686a7c0d41ff82f5ddad7cecd93cc0c18324a81b))
|
|
11
|
+
|
|
6
12
|
## [8.1.1-next.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/drag-in-the-blank-configure@8.1.1-next.3...@pie-element/drag-in-the-blank-configure@8.1.1-next.4) (2026-03-06)
|
|
7
13
|
|
|
8
14
|
**Note:** Version bump only for package @pie-element/drag-in-the-blank-configure
|
package/configure/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/drag-in-the-blank-configure",
|
|
3
|
-
"version": "8.1.1-next.
|
|
3
|
+
"version": "8.1.1-next.5",
|
|
4
4
|
"private": true,
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "src/index.js",
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
"@mui/icons-material": "^7.3.4",
|
|
13
13
|
"@mui/material": "^7.3.4",
|
|
14
14
|
"@pie-framework/pie-configure-events": "^1.3.0",
|
|
15
|
-
"@pie-lib/config-ui": "12.2.0-next.
|
|
15
|
+
"@pie-lib/config-ui": "12.2.0-next.17",
|
|
16
16
|
"@pie-lib/drag": "3.2.0-next.4",
|
|
17
|
-
"@pie-lib/editable-html-tip-tap": "1.2.0-next.
|
|
17
|
+
"@pie-lib/editable-html-tip-tap": "1.2.0-next.16",
|
|
18
18
|
"@pie-lib/math-rendering": "4.2.0-next.3",
|
|
19
19
|
"debug": "^4.1.1",
|
|
20
20
|
"lodash-es": "^4.17.23",
|
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
|
+
# [8.2.0-next.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/drag-in-the-blank-controller@8.1.1-next.1...@pie-element/drag-in-the-blank-controller@8.2.0-next.0) (2026-03-18)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- test ([3117bc7](https://github.com/pie-framework/pie-elements/commit/3117bc7c72a1b7ce495e0ce2f8c60503911054ac))
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
- **drag-in-the-blank:** add trace log for scoring in outcome function PD-5435 ([6af6124](https://github.com/pie-framework/pie-elements/commit/6af612455507a3e2f2ed93b622a2f9d5ff3edaff))
|
|
15
|
+
|
|
6
16
|
## [8.1.1-next.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/drag-in-the-blank-controller@8.1.0-next.1...@pie-element/drag-in-the-blank-controller@8.1.1-next.1) (2026-02-26)
|
|
7
17
|
|
|
8
18
|
**Note:** Version bump only for package @pie-element/drag-in-the-blank-controller
|
package/controller/lib/index.js
CHANGED
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.getScore = exports.createCorrectResponseSession = void 0;
|
|
7
|
+
exports.getScore = exports.getLogTrace = exports.createCorrectResponseSession = void 0;
|
|
8
8
|
exports.model = model;
|
|
9
9
|
exports.normalize = void 0;
|
|
10
10
|
exports.outcome = outcome;
|
|
@@ -115,6 +115,51 @@ const getScore = (config, session) => {
|
|
|
115
115
|
return parseFloat(str);
|
|
116
116
|
};
|
|
117
117
|
|
|
118
|
+
/**
|
|
119
|
+
* Generates detailed trace log for scoring evaluation
|
|
120
|
+
* @param {Object} model - the question model
|
|
121
|
+
* @param {Object} session - the student session
|
|
122
|
+
* @param {Object} env - the environment
|
|
123
|
+
* @returns {Array} traceLog - array of trace messages
|
|
124
|
+
*/
|
|
125
|
+
exports.getScore = getScore;
|
|
126
|
+
const getLogTrace = (model, session, env) => {
|
|
127
|
+
const traceLog = [];
|
|
128
|
+
const {
|
|
129
|
+
value
|
|
130
|
+
} = session || {};
|
|
131
|
+
const responseAreas = Object.keys(model.correctResponse || {});
|
|
132
|
+
const totalAreas = responseAreas.length;
|
|
133
|
+
traceLog.push(`${totalAreas} response area(s) defined in this question.`);
|
|
134
|
+
if (value && Object.keys(value).length > 0) {
|
|
135
|
+
const filledAreas = Object.entries(value).filter(([key, val]) => val && val.trim()).length;
|
|
136
|
+
traceLog.push(`Student added choices to ${filledAreas} out of ${totalAreas} response area(s).`);
|
|
137
|
+
responseAreas.forEach(areaKey => {
|
|
138
|
+
const studentAnswer = value && value[areaKey] || '';
|
|
139
|
+
const correctAnswer = model.correctResponse[areaKey] || '';
|
|
140
|
+
if (studentAnswer.trim()) {
|
|
141
|
+
traceLog.push(`Response area ${areaKey}: student placed '${studentAnswer}' (correct answer: '${correctAnswer}').`);
|
|
142
|
+
} else {
|
|
143
|
+
traceLog.push(`Response area ${areaKey}: left empty (correct answer: '${correctAnswer}').`);
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
} else {
|
|
147
|
+
traceLog.push('Student did not add any choices to response areas.');
|
|
148
|
+
}
|
|
149
|
+
const responses = (0, _utils.getAllCorrectResponses)(model);
|
|
150
|
+
const allCorrectResponses = responses.possibleResponses;
|
|
151
|
+
const numberOfPossibleResponses = responses.numberOfPossibleResponses || 0;
|
|
152
|
+
if (numberOfPossibleResponses > 1) {
|
|
153
|
+
traceLog.push(`${numberOfPossibleResponses} alternate response combinations are accepted for this question.`);
|
|
154
|
+
}
|
|
155
|
+
const partialScoringEnabled = _controllerUtils.partialScoring.enabled(model, env);
|
|
156
|
+
const scoringMethod = partialScoringEnabled ? 'partial scoring' : 'all-or-nothing scoring';
|
|
157
|
+
traceLog.push(`Score calculated using ${scoringMethod}.`);
|
|
158
|
+
const score = getScore(model, session);
|
|
159
|
+
traceLog.push(`Final score: ${score}.`);
|
|
160
|
+
return traceLog;
|
|
161
|
+
};
|
|
162
|
+
|
|
118
163
|
/**
|
|
119
164
|
*
|
|
120
165
|
* The score is partial by default for checkbox mode, allOrNothing for radio mode.
|
|
@@ -127,15 +172,25 @@ const getScore = (config, session) => {
|
|
|
127
172
|
* @param {boolean} env.partialScoring - is partial scoring enabled (if undefined default to true) This overrides
|
|
128
173
|
* `model.partialScoring`.
|
|
129
174
|
*/
|
|
130
|
-
exports.
|
|
175
|
+
exports.getLogTrace = getLogTrace;
|
|
131
176
|
function outcome(model, session, env = {}) {
|
|
132
177
|
return new Promise(resolve => {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
178
|
+
if (!session || (0, _lodashEs.isEmpty)(session)) {
|
|
179
|
+
resolve({
|
|
180
|
+
score: 0,
|
|
181
|
+
empty: true,
|
|
182
|
+
traceLog: ['Student did not add any choices to response areas. Score is 0.']
|
|
183
|
+
});
|
|
184
|
+
} else {
|
|
185
|
+
const traceLog = getLogTrace(model, session, env);
|
|
186
|
+
const score = getScore(model, session);
|
|
187
|
+
const partialScoringEnabled = _controllerUtils.partialScoring.enabled(model, env);
|
|
188
|
+
resolve({
|
|
189
|
+
score: partialScoringEnabled ? score : score === 1 ? 1 : 0,
|
|
190
|
+
empty: false,
|
|
191
|
+
traceLog
|
|
192
|
+
});
|
|
193
|
+
}
|
|
139
194
|
});
|
|
140
195
|
}
|
|
141
196
|
const createCorrectResponseSession = (question, env) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_lodashEs","require","_utils","_controllerUtils","_defaults","_interopRequireDefault","normalize","question","defaults","exports","model","session","env","updateSession","normalizedQuestion","feedback","mode","responses","getAllCorrectResponses","allCorrectResponses","possibleResponses","numberOfPossibleResponses","correctResponses","undefined","value","i","result","Object","keys","reduce","obj","key","choices","answer","filter","choice","choiceIsEmpty","lockChoiceOrder","lockChoices","getShuffledChoices","responseAreasToBeFilled","values","correctResponse","length","shouldIncludeCorrectResponse","out","prompt","promptEnabled","disabled","responseCorrect","getScore","role","rationale","rationaleEnabled","teacherInstructions","teacherInstructionsEnabled","config","maxScore","correctCount","total","str","toFixed","parseFloat","outcome","Promise","resolve","partialScoringEnabled","partialScoring","enabled","score","empty","isEmpty","createCorrectResponseSession","id","getInnerText","html","replaceAll","getContent","replace","validate","markup","minChoices","maxChoices","maxResponseAreas","errors","forEach","field","required","nbOfResponseAreas","match","nbOfChoices","emptyResponseAreas","response","correctResponseError","responseAreasError","choicesError"],"sources":["../src/index.js"],"sourcesContent":["import { isEmpty } from 'lodash-es';\nimport { getAllCorrectResponses, choiceIsEmpty } from './utils';\nimport { lockChoices, getShuffledChoices, partialScoring } from '@pie-lib/controller-utils';\nimport defaults from './defaults';\n\nexport const normalize = (question) => ({\n ...defaults,\n ...question,\n});\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 = normalize(question);\n let feedback = {};\n\n if (env.mode === 'evaluate') {\n const responses = getAllCorrectResponses(normalizedQuestion) || {};\n const allCorrectResponses = responses.possibleResponses;\n const numberOfPossibleResponses = responses.numberOfPossibleResponses || 0;\n let correctResponses = undefined;\n const { value } = session || {};\n\n for (let i = 0; i < numberOfPossibleResponses; i++) {\n const result = Object.keys(allCorrectResponses).reduce(\n (obj, key) => {\n const choices = allCorrectResponses[key];\n const answer = (value && value[key]) || '';\n\n obj.feedback[key] = choices[i] === answer;\n\n if (obj.feedback[key]) {\n obj.correctResponses += 1;\n }\n\n return obj;\n },\n { correctResponses: 0, feedback: {} },\n );\n\n if (correctResponses === undefined || result.correctResponses > correctResponses) {\n correctResponses = result.correctResponses;\n feedback = result.feedback;\n }\n }\n }\n\n let choices = normalizedQuestion.choices && normalizedQuestion.choices.filter((choice) => !choiceIsEmpty(choice));\n\n const lockChoiceOrder = lockChoices(normalizedQuestion, session, env);\n\n if (!lockChoiceOrder) {\n choices = await getShuffledChoices(choices, session, updateSession, 'id');\n }\n\n // we don't need to check for fewer areas to be filled in the alternateResponses\n // because the alternates are an option in the default correct response (for scoring)\n const responseAreasToBeFilled = Object.values(normalizedQuestion.correctResponse || {}).filter(\n (value) => !!value,\n ).length;\n\n const shouldIncludeCorrectResponse = env.mode === 'evaluate';\n\n const out = {\n ...normalizedQuestion,\n prompt: normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null,\n choices,\n feedback,\n mode: env.mode,\n disabled: env.mode !== 'gather',\n responseCorrect: shouldIncludeCorrectResponse ? getScore(normalizedQuestion, session) === 1 : undefined,\n correctResponse: shouldIncludeCorrectResponse ? normalizedQuestion.correctResponse : undefined,\n responseAreasToBeFilled,\n };\n\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n out.rationale = normalizedQuestion.rationaleEnabled ? normalizedQuestion.rationale : null;\n out.teacherInstructions = normalizedQuestion.teacherInstructionsEnabled\n ? normalizedQuestion.teacherInstructions\n : null;\n } else {\n out.rationale = null;\n out.teacherInstructions = null;\n }\n\n return out;\n}\n\nexport const getScore = (config, session) => {\n const responses = getAllCorrectResponses(config);\n const allCorrectResponses = responses.possibleResponses;\n const maxScore = Object.keys(config.correctResponse).length;\n const numberOfPossibleResponses = responses.numberOfPossibleResponses || 0;\n let correctCount = 0;\n const { value } = session || {};\n\n for (let i = 0; i < numberOfPossibleResponses; i++) {\n const result = Object.keys(allCorrectResponses).reduce((total, key) => {\n const choices = allCorrectResponses[key];\n const answer = (value && value[key]) || '';\n\n if (choices[i] === answer) {\n return total;\n }\n\n return total - 1;\n }, maxScore);\n\n if (result > correctCount) {\n correctCount = result;\n }\n\n if (result === maxScore) {\n break;\n }\n }\n\n const str = maxScore ? (correctCount / maxScore).toFixed(2) : 0;\n\n return parseFloat(str);\n};\n\n/**\n *\n * The score is partial by default for checkbox mode, allOrNothing for radio mode.\n * To disable partial scoring for checkbox mode you either set model.partialScoring = false or env.partialScoring =\n * false. the value in `env` will override the value in `model`.\n * @param {Object} model - the main model\n * @param {boolean} model.partialScoring - is partial scoring enabled (if undefined set to to true)\n * @param {*} session\n * @param {Object} env\n * @param {boolean} env.partialScoring - is partial scoring enabled (if undefined default to true) This overrides\n * `model.partialScoring`.\n */\nexport function outcome(model, session, env = {}) {\n return new Promise((resolve) => {\n const partialScoringEnabled = partialScoring.enabled(model, env);\n const score = getScore(model, session);\n\n resolve({\n score: partialScoringEnabled ? score : score === 1 ? 1 : 0,\n empty: !session || isEmpty(session),\n });\n });\n}\n\nexport const createCorrectResponseSession = (question, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n resolve({\n value: question.correctResponse,\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 { choices, correctResponse, markup } = model;\n const { minChoices = 2, maxChoices, maxResponseAreas } = config;\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 nbOfResponseAreas = ((markup || '').match(/\\{\\{(\\d+)\\}\\}/g) || []).length;\n const nbOfChoices = (choices || []).length;\n const emptyResponseAreas = Object.values(correctResponse)?.filter((response) => !response);\n\n if (emptyResponseAreas.length) {\n errors.correctResponseError = 'There should be a choice defined for each response area.';\n }\n\n if (nbOfResponseAreas > maxResponseAreas) {\n errors.responseAreasError = `No more than ${maxResponseAreas} response areas should be defined.`;\n } else if (nbOfResponseAreas < 1) {\n errors.responseAreasError = 'There should be at least 1 response area defined.';\n }\n\n if (nbOfChoices < minChoices) {\n errors.choicesError = `There should be at least ${minChoices} tokens defined.`;\n } else if (nbOfChoices > maxChoices) {\n errors.choicesError = `No more than ${maxChoices} tokens should be defined.`;\n }\n\n return errors;\n};\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,gBAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAEO,MAAMK,SAAS,GAAIC,QAAQ,KAAM;EACtC,GAAGC,iBAAQ;EACX,GAAGD;AACL,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AANAE,OAAA,CAAAH,SAAA,GAAAA,SAAA;AAOO,eAAeI,KAAKA,CAACH,QAAQ,EAAEI,OAAO,EAAEC,GAAG,EAAEC,aAAa,EAAE;EACjE,MAAMC,kBAAkB,GAAGR,SAAS,CAACC,QAAQ,CAAC;EAC9C,IAAIQ,QAAQ,GAAG,CAAC,CAAC;EAEjB,IAAIH,GAAG,CAACI,IAAI,KAAK,UAAU,EAAE;IAC3B,MAAMC,SAAS,GAAG,IAAAC,6BAAsB,EAACJ,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAClE,MAAMK,mBAAmB,GAAGF,SAAS,CAACG,iBAAiB;IACvD,MAAMC,yBAAyB,GAAGJ,SAAS,CAACI,yBAAyB,IAAI,CAAC;IAC1E,IA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ACW,YAAY,GAAG,4BAA4Bd,UAAU,kBAAkB;EAChF,CAAC,MAAM,IAAIS,WAAW,GAAGR,UAAU,EAAE;IACnCE,MAAM,CAACW,YAAY,GAAG,gBAAgBb,UAAU,4BAA4B;EAC9E;EAEA,OAAOE,MAAM;AACf,CAAC;AAAC3E,OAAA,CAAAsE,QAAA,GAAAA,QAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_lodashEs","require","_utils","_controllerUtils","_defaults","_interopRequireDefault","normalize","question","defaults","exports","model","session","env","updateSession","normalizedQuestion","feedback","mode","responses","getAllCorrectResponses","allCorrectResponses","possibleResponses","numberOfPossibleResponses","correctResponses","undefined","value","i","result","Object","keys","reduce","obj","key","choices","answer","filter","choice","choiceIsEmpty","lockChoiceOrder","lockChoices","getShuffledChoices","responseAreasToBeFilled","values","correctResponse","length","shouldIncludeCorrectResponse","out","prompt","promptEnabled","disabled","responseCorrect","getScore","role","rationale","rationaleEnabled","teacherInstructions","teacherInstructionsEnabled","config","maxScore","correctCount","total","str","toFixed","parseFloat","getLogTrace","traceLog","responseAreas","totalAreas","push","filledAreas","entries","val","trim","forEach","areaKey","studentAnswer","correctAnswer","partialScoringEnabled","partialScoring","enabled","scoringMethod","score","outcome","Promise","resolve","isEmpty","empty","createCorrectResponseSession","id","getInnerText","html","replaceAll","getContent","replace","validate","markup","minChoices","maxChoices","maxResponseAreas","errors","field","required","nbOfResponseAreas","match","nbOfChoices","emptyResponseAreas","response","correctResponseError","responseAreasError","choicesError"],"sources":["../src/index.js"],"sourcesContent":["import { isEmpty } from 'lodash-es';\nimport { getAllCorrectResponses, choiceIsEmpty } from './utils';\nimport { lockChoices, getShuffledChoices, partialScoring } from '@pie-lib/controller-utils';\nimport defaults from './defaults';\n\nexport const normalize = (question) => ({\n ...defaults,\n ...question,\n});\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 = normalize(question);\n let feedback = {};\n\n if (env.mode === 'evaluate') {\n const responses = getAllCorrectResponses(normalizedQuestion) || {};\n const allCorrectResponses = responses.possibleResponses;\n const numberOfPossibleResponses = responses.numberOfPossibleResponses || 0;\n let correctResponses = undefined;\n const { value } = session || {};\n\n for (let i = 0; i < numberOfPossibleResponses; i++) {\n const result = Object.keys(allCorrectResponses).reduce(\n (obj, key) => {\n const choices = allCorrectResponses[key];\n const answer = (value && value[key]) || '';\n\n obj.feedback[key] = choices[i] === answer;\n\n if (obj.feedback[key]) {\n obj.correctResponses += 1;\n }\n\n return obj;\n },\n { correctResponses: 0, feedback: {} },\n );\n\n if (correctResponses === undefined || result.correctResponses > correctResponses) {\n correctResponses = result.correctResponses;\n feedback = result.feedback;\n }\n }\n }\n\n let choices = normalizedQuestion.choices && normalizedQuestion.choices.filter((choice) => !choiceIsEmpty(choice));\n\n const lockChoiceOrder = lockChoices(normalizedQuestion, session, env);\n\n if (!lockChoiceOrder) {\n choices = await getShuffledChoices(choices, session, updateSession, 'id');\n }\n\n // we don't need to check for fewer areas to be filled in the alternateResponses\n // because the alternates are an option in the default correct response (for scoring)\n const responseAreasToBeFilled = Object.values(normalizedQuestion.correctResponse || {}).filter(\n (value) => !!value,\n ).length;\n\n const shouldIncludeCorrectResponse = env.mode === 'evaluate';\n\n const out = {\n ...normalizedQuestion,\n prompt: normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null,\n choices,\n feedback,\n mode: env.mode,\n disabled: env.mode !== 'gather',\n responseCorrect: shouldIncludeCorrectResponse ? getScore(normalizedQuestion, session) === 1 : undefined,\n correctResponse: shouldIncludeCorrectResponse ? normalizedQuestion.correctResponse : undefined,\n responseAreasToBeFilled,\n };\n\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n out.rationale = normalizedQuestion.rationaleEnabled ? normalizedQuestion.rationale : null;\n out.teacherInstructions = normalizedQuestion.teacherInstructionsEnabled\n ? normalizedQuestion.teacherInstructions\n : null;\n } else {\n out.rationale = null;\n out.teacherInstructions = null;\n }\n\n return out;\n}\n\nexport const getScore = (config, session) => {\n const responses = getAllCorrectResponses(config);\n const allCorrectResponses = responses.possibleResponses;\n const maxScore = Object.keys(config.correctResponse).length;\n const numberOfPossibleResponses = responses.numberOfPossibleResponses || 0;\n let correctCount = 0;\n const { value } = session || {};\n\n for (let i = 0; i < numberOfPossibleResponses; i++) {\n const result = Object.keys(allCorrectResponses).reduce((total, key) => {\n const choices = allCorrectResponses[key];\n const answer = (value && value[key]) || '';\n\n if (choices[i] === answer) {\n return total;\n }\n\n return total - 1;\n }, maxScore);\n\n if (result > correctCount) {\n correctCount = result;\n }\n\n if (result === maxScore) {\n break;\n }\n }\n\n const str = maxScore ? (correctCount / maxScore).toFixed(2) : 0;\n\n return parseFloat(str);\n};\n\n/**\n * Generates detailed trace log for scoring evaluation\n * @param {Object} model - the question model\n * @param {Object} session - the student session\n * @param {Object} env - the environment\n * @returns {Array} traceLog - array of trace messages\n */\nexport const getLogTrace = (model, session, env) => {\n const traceLog = [];\n const { value } = session || {};\n \n const responseAreas = Object.keys(model.correctResponse || {});\n const totalAreas = responseAreas.length;\n traceLog.push(`${totalAreas} response area(s) defined in this question.`);\n \n if (value && Object.keys(value).length > 0) {\n const filledAreas = Object.entries(value).filter(([key, val]) => val && val.trim()).length;\n traceLog.push(`Student added choices to ${filledAreas} out of ${totalAreas} response area(s).`);\n \n responseAreas.forEach((areaKey) => {\n const studentAnswer = (value && value[areaKey]) || '';\n const correctAnswer = model.correctResponse[areaKey] || '';\n \n if (studentAnswer.trim()) {\n traceLog.push(`Response area ${areaKey}: student placed '${studentAnswer}' (correct answer: '${correctAnswer}').`);\n } else {\n traceLog.push(`Response area ${areaKey}: left empty (correct answer: '${correctAnswer}').`);\n }\n });\n } else {\n traceLog.push('Student did not add any choices to response areas.');\n }\n\n const responses = getAllCorrectResponses(model);\n const allCorrectResponses = responses.possibleResponses;\n const numberOfPossibleResponses = responses.numberOfPossibleResponses || 0;\n \n if (numberOfPossibleResponses > 1) {\n traceLog.push(`${numberOfPossibleResponses} alternate response combinations are accepted for this question.`);\n }\n\n const partialScoringEnabled = partialScoring.enabled(model, env);\n const scoringMethod = partialScoringEnabled ? 'partial scoring' : 'all-or-nothing scoring';\n traceLog.push(`Score calculated using ${scoringMethod}.`);\n\n const score = getScore(model, session);\n traceLog.push(`Final score: ${score}.`);\n\n return traceLog;\n};\n\n/**\n *\n * The score is partial by default for checkbox mode, allOrNothing for radio mode.\n * To disable partial scoring for checkbox mode you either set model.partialScoring = false or env.partialScoring =\n * false. the value in `env` will override the value in `model`.\n * @param {Object} model - the main model\n * @param {boolean} model.partialScoring - is partial scoring enabled (if undefined set to to true)\n * @param {*} session\n * @param {Object} env\n * @param {boolean} env.partialScoring - is partial scoring enabled (if undefined default to true) This overrides\n * `model.partialScoring`.\n */\nexport function outcome(model, session, env = {}) {\n return new Promise((resolve) => {\n if (!session || isEmpty(session)) {\n resolve({ \n score: 0, \n empty: true, \n traceLog: ['Student did not add any choices to response areas. Score is 0.'] \n });\n } else {\n const traceLog = getLogTrace(model, session, env);\n const score = getScore(model, session);\n const partialScoringEnabled = partialScoring.enabled(model, env);\n\n resolve({\n score: partialScoringEnabled ? score : score === 1 ? 1 : 0,\n empty: false,\n traceLog\n });\n }\n });\n}\n\nexport const createCorrectResponseSession = (question, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n resolve({\n value: question.correctResponse,\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 { choices, correctResponse, markup } = model;\n const { minChoices = 2, maxChoices, maxResponseAreas } = config;\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 nbOfResponseAreas = ((markup || '').match(/\\{\\{(\\d+)\\}\\}/g) || []).length;\n const nbOfChoices = (choices || []).length;\n const emptyResponseAreas = Object.values(correctResponse)?.filter((response) => !response);\n\n if (emptyResponseAreas.length) {\n errors.correctResponseError = 'There should be a choice defined for each response area.';\n }\n\n if (nbOfResponseAreas > maxResponseAreas) {\n errors.responseAreasError = `No more than ${maxResponseAreas} response areas should be defined.`;\n } else if (nbOfResponseAreas < 1) {\n errors.responseAreasError = 'There should be at least 1 response area defined.';\n }\n\n if (nbOfChoices < minChoices) {\n errors.choicesError = `There should be at least ${minChoices} tokens defined.`;\n } else if (nbOfChoices > maxChoices) {\n errors.choicesError = `No more than ${maxChoices} tokens should be defined.`;\n }\n\n return errors;\n};\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,gBAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAEO,MAAMK,SAAS,GAAIC,QAAQ,KAAM;EACtC,GAAGC,iBAAQ;EACX,GAAGD;AACL,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AANAE,OAAA,CAAAH,SAAA,GAAAA,SAAA;AAOO,eAAeI,KAAKA,CAACH,QAAQ,EAAEI,OAAO,EAAEC,GAAG,EAAEC,aAAa,EAAE;EACjE,MAAMC,kBAAkB,GAAGR,SAAS,CAACC,QAAQ,CAAC;EAC9C,IAAIQ,QAAQ,GAAG,CAAC,CAAC;EAEjB,IAAIH,GAAG,CAACI,IAAI,KAAK,UAAU,EAAE;IAC3B,MAAMC,SAAS,GAAG,IAAAC,6BAAsB,EAACJ,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAClE,MAAMK,mBAAmB,GAAGF,SAAS,CAACG,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E,MAAM,CAACU,YAAY,GAAG,gBAAgBZ,UAAU,4BAA4B;EAC9E;EAEA,OAAOE,MAAM;AACf,CAAC;AAACzF,OAAA,CAAAoF,QAAA,GAAAA,QAAA","ignoreList":[]}
|
package/controller/package.json
CHANGED
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "9.
|
|
7
|
+
"version": "9.2.0-next.0",
|
|
8
8
|
"description": "",
|
|
9
9
|
"scripts": {
|
|
10
10
|
"postpublish": "../../scripts/postpublish"
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"@pie-framework/pie-player-events": "^0.1.0",
|
|
18
18
|
"@pie-lib/correct-answer-toggle": "3.2.0-next.4",
|
|
19
19
|
"@pie-lib/drag": "3.2.0-next.4",
|
|
20
|
-
"@pie-lib/mask-markup": "2.2.0-next.
|
|
20
|
+
"@pie-lib/mask-markup": "2.2.0-next.17",
|
|
21
21
|
"@pie-lib/math-rendering": "4.2.0-next.3",
|
|
22
22
|
"@pie-lib/render-ui": "5.2.0-next.4",
|
|
23
23
|
"lodash-es": "^4.17.23",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"author": "",
|
|
29
29
|
"license": "ISC",
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "11169f258ac462817f622c5272b360009b6675ab",
|
|
31
31
|
"main": "lib/index.js",
|
|
32
32
|
"module": "src/index.js"
|
|
33
33
|
}
|