@pie-element/fraction-model 4.3.4-next.3 → 5.0.0-beta.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/configure/lib/card-bar.js +45 -66
- package/configure/lib/card-bar.js.map +1 -1
- package/configure/lib/defaults.js +4 -5
- package/configure/lib/defaults.js.map +1 -1
- package/configure/lib/index.js +127 -193
- package/configure/lib/index.js.map +1 -1
- package/configure/lib/main.js +216 -276
- package/configure/lib/main.js.map +1 -1
- package/configure/lib/model-options.js +119 -196
- package/configure/lib/model-options.js.map +1 -1
- package/configure/lib/number-text-field.js +31 -90
- package/configure/lib/number-text-field.js.map +1 -1
- package/configure/package.json +9 -6
- package/controller/lib/defaults.js +2 -3
- package/controller/lib/defaults.js.map +1 -1
- package/controller/lib/index.js +66 -111
- package/controller/lib/index.js.map +1 -1
- package/controller/package.json +2 -2
- package/lib/answer-fraction.js +94 -159
- package/lib/answer-fraction.js.map +1 -1
- package/lib/fraction-model-chart.js +140 -219
- package/lib/fraction-model-chart.js.map +1 -1
- package/lib/index.js +68 -108
- package/lib/index.js.map +1 -1
- package/lib/main.js +150 -204
- package/lib/main.js.map +1 -1
- package/package.json +14 -17
- package/esm/configure.js +0 -26289
- package/esm/configure.js.map +0 -1
- package/esm/controller.js +0 -1224
- package/esm/controller.js.map +0 -1
- package/esm/element.js +0 -45827
- package/esm/element.js.map +0 -1
- package/esm/package.json +0 -3
package/controller/lib/index.js
CHANGED
|
@@ -1,22 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.validate = exports.outcome = exports.model = exports.getResponseCorrectness = exports.createDefaultModel = exports.createCorrectResponseSession = void 0;
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
8
|
var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
|
|
13
|
-
|
|
14
9
|
var _defaults = _interopRequireDefault(require("./defaults"));
|
|
15
|
-
|
|
16
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
17
|
-
|
|
18
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
19
|
-
|
|
20
10
|
/*
|
|
21
11
|
* Function to check the correctness of the response
|
|
22
12
|
* @param {model} model contains the model object
|
|
@@ -24,18 +14,16 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
24
14
|
* @param {env} env contains the environment object
|
|
25
15
|
* @returns {string} returns the correctness of the response
|
|
26
16
|
* */
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var correct;
|
|
30
|
-
|
|
17
|
+
const getResponseCorrectness = (model, answers, env = {}) => {
|
|
18
|
+
let correct;
|
|
31
19
|
if (model.allowedStudentConfig) {
|
|
32
20
|
correct = !!(answers.partsPerModel === model.partsPerModel && partialFillCheck(answers.response, model.partsPerModel) && numeratorCheck(model.correctResponse, answers.response));
|
|
33
21
|
} else {
|
|
34
22
|
correct = !!(partialFillCheck(answers.response, model.partsPerModel) && numeratorCheck(model.correctResponse, answers.response));
|
|
35
23
|
}
|
|
36
|
-
|
|
37
24
|
return correct ? 'correct' : 'incorrect';
|
|
38
25
|
};
|
|
26
|
+
|
|
39
27
|
/*
|
|
40
28
|
* Function to get the correctness of the response
|
|
41
29
|
* @param {question} question contains the question object
|
|
@@ -43,17 +31,13 @@ var getResponseCorrectness = function getResponseCorrectness(model, answers) {
|
|
|
43
31
|
* @param {answers} answers contains the answers object
|
|
44
32
|
* @returns {string} returns the correctness
|
|
45
33
|
* */
|
|
46
|
-
|
|
47
|
-
|
|
48
34
|
exports.getResponseCorrectness = getResponseCorrectness;
|
|
49
|
-
|
|
50
|
-
var getCorrectness = function getCorrectness(question, env) {
|
|
51
|
-
var answers = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
52
|
-
|
|
35
|
+
const getCorrectness = (question, env, answers = {}) => {
|
|
53
36
|
if (env.mode === 'evaluate') {
|
|
54
37
|
return getResponseCorrectness(question, answers, env);
|
|
55
38
|
}
|
|
56
39
|
};
|
|
40
|
+
|
|
57
41
|
/*
|
|
58
42
|
* Function to get the outcome score
|
|
59
43
|
* @param {question} question contains the question object
|
|
@@ -61,13 +45,11 @@ var getCorrectness = function getCorrectness(question, env) {
|
|
|
61
45
|
* @param {answers} answers contains the answers object
|
|
62
46
|
* @returns {number} returns the score
|
|
63
47
|
* */
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
var getOutComeScore = function getOutComeScore(question, env) {
|
|
67
|
-
var answers = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
68
|
-
var correctness = getCorrectness(question, env, answers);
|
|
48
|
+
const getOutComeScore = (question, env, answers = {}) => {
|
|
49
|
+
const correctness = getCorrectness(question, env, answers);
|
|
69
50
|
return correctness === 'correct' ? 1 : 0;
|
|
70
51
|
};
|
|
52
|
+
|
|
71
53
|
/*
|
|
72
54
|
* Function to check outcome of the session
|
|
73
55
|
* @param {model} model contains the model object
|
|
@@ -75,64 +57,54 @@ var getOutComeScore = function getOutComeScore(question, env) {
|
|
|
75
57
|
* @param {env} env contains the environment object
|
|
76
58
|
* @returns {Promise} returns the score
|
|
77
59
|
*/
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
60
|
+
const outcome = (model, session, env) => new Promise(resolve => {
|
|
61
|
+
if (!session || (0, _isEmpty.default)(session)) {
|
|
62
|
+
resolve({
|
|
63
|
+
score: 0,
|
|
64
|
+
empty: true
|
|
65
|
+
});
|
|
66
|
+
} else {
|
|
67
|
+
if (env.mode !== 'evaluate') {
|
|
83
68
|
resolve({
|
|
84
|
-
score:
|
|
85
|
-
|
|
69
|
+
score: undefined,
|
|
70
|
+
completed: undefined
|
|
86
71
|
});
|
|
87
72
|
} else {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
completed: undefined
|
|
92
|
-
});
|
|
93
|
-
} else {
|
|
94
|
-
resolve({
|
|
95
|
-
score: getOutComeScore(model, env, session.answers)
|
|
96
|
-
});
|
|
97
|
-
}
|
|
73
|
+
resolve({
|
|
74
|
+
score: getOutComeScore(model, env, session.answers)
|
|
75
|
+
});
|
|
98
76
|
}
|
|
99
|
-
}
|
|
100
|
-
};
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
|
|
101
80
|
/*
|
|
102
81
|
* Function to check if the numerator of the response matches the numerator of the correct response
|
|
103
82
|
* @param {correctResponse} correctResponse contains the correct response object
|
|
104
83
|
* @param {response} response contains the response object
|
|
105
84
|
* @returns {boolean} returns true if the numerators match
|
|
106
85
|
* */
|
|
107
|
-
|
|
108
|
-
|
|
109
86
|
exports.outcome = outcome;
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
for (var i = 0; i < correctResponse.length; i++) {
|
|
87
|
+
const numeratorCheck = (correctResponse, response) => {
|
|
88
|
+
let correctNumerator = 0;
|
|
89
|
+
let responseNumerator = 0;
|
|
90
|
+
for (let i = 0; i < correctResponse.length; i++) {
|
|
116
91
|
correctNumerator += correctResponse[i].value;
|
|
117
92
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
responseNumerator += response[_i].value;
|
|
93
|
+
for (let i = 0; i < response.length; i++) {
|
|
94
|
+
responseNumerator += response[i].value;
|
|
121
95
|
}
|
|
122
|
-
|
|
123
96
|
return correctNumerator === responseNumerator;
|
|
124
97
|
};
|
|
98
|
+
|
|
125
99
|
/*
|
|
126
100
|
* Function to check if the response contains more than one partially-filled model
|
|
127
101
|
* @param {response} response contains the response object
|
|
128
102
|
* @param {partsPerModel} partsPerModel contains the number of parts per model
|
|
129
103
|
* */
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
var partialFillCheck = function partialFillCheck(response, partsPerModel) {
|
|
104
|
+
const partialFillCheck = (response, partsPerModel) => {
|
|
133
105
|
if (response.length > 0) {
|
|
134
|
-
|
|
135
|
-
response.forEach(
|
|
106
|
+
let partialModelCount = 0;
|
|
107
|
+
response.forEach(selection => {
|
|
136
108
|
if (selection.value !== partsPerModel) {
|
|
137
109
|
partialModelCount++;
|
|
138
110
|
}
|
|
@@ -142,78 +114,70 @@ var partialFillCheck = function partialFillCheck(response, partsPerModel) {
|
|
|
142
114
|
return false;
|
|
143
115
|
}
|
|
144
116
|
};
|
|
117
|
+
|
|
145
118
|
/*
|
|
146
119
|
* Function to create a default model
|
|
147
120
|
* @param {model} model contains the model object
|
|
148
121
|
* */
|
|
122
|
+
const createDefaultModel = (model = {}) => ({
|
|
123
|
+
..._defaults.default.model,
|
|
124
|
+
...model
|
|
125
|
+
});
|
|
149
126
|
|
|
150
|
-
|
|
151
|
-
var createDefaultModel = function createDefaultModel() {
|
|
152
|
-
var model = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
153
|
-
return _objectSpread(_objectSpread({}, _defaults["default"].model), model);
|
|
154
|
-
};
|
|
155
127
|
/*
|
|
156
128
|
* Return the model object
|
|
157
129
|
* */
|
|
158
|
-
|
|
159
|
-
|
|
160
130
|
exports.createDefaultModel = createDefaultModel;
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
return new Promise(function (resolve) {
|
|
131
|
+
const model = (question, session, env) => {
|
|
132
|
+
return new Promise(resolve => {
|
|
164
133
|
session = session || {};
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
if ((!session || (0, _isEmpty["default"])(session)) && env.mode === 'evaluate') {
|
|
134
|
+
const model = createDefaultModel(question);
|
|
135
|
+
let correctness, score;
|
|
136
|
+
if ((!session || (0, _isEmpty.default)(session)) && env.mode === 'evaluate') {
|
|
169
137
|
correctness = 'unanswered';
|
|
170
138
|
score = '0%';
|
|
171
139
|
} else {
|
|
172
140
|
correctness = getCorrectness(model, env, session && session.answers);
|
|
173
|
-
score =
|
|
141
|
+
score = `${getOutComeScore(model, env, session && session.answers) * 100}%`;
|
|
174
142
|
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
correctness: correctness
|
|
143
|
+
const correctInfo = {
|
|
144
|
+
score,
|
|
145
|
+
correctness
|
|
179
146
|
};
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
}, model), {}, {
|
|
147
|
+
const out = {
|
|
148
|
+
env,
|
|
149
|
+
...model,
|
|
184
150
|
view: env.mode === 'view' || env.mode === 'evaluate'
|
|
185
|
-
}
|
|
186
|
-
|
|
151
|
+
};
|
|
187
152
|
if (env.mode === 'evaluate') {
|
|
188
153
|
Object.assign(out, {
|
|
189
154
|
correctness: correctInfo
|
|
190
155
|
});
|
|
191
156
|
}
|
|
192
|
-
|
|
193
157
|
resolve(out);
|
|
194
158
|
});
|
|
195
159
|
};
|
|
160
|
+
|
|
196
161
|
/*
|
|
197
162
|
* Function to create a correct response session
|
|
198
163
|
* @param {model} model contains the model object
|
|
199
164
|
* @param {env} env contains the environment object
|
|
200
165
|
* @returns {Promise} returns the correct response session
|
|
201
166
|
* */
|
|
202
|
-
|
|
203
|
-
|
|
204
167
|
exports.model = model;
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
return new Promise(function (resolve) {
|
|
168
|
+
const createCorrectResponseSession = (model, env) => {
|
|
169
|
+
return new Promise(resolve => {
|
|
208
170
|
if (env.mode !== 'evaluate' && env.role === 'instructor') {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
171
|
+
const {
|
|
172
|
+
correctResponse,
|
|
173
|
+
maxModelSelected,
|
|
174
|
+
partsPerModel
|
|
175
|
+
} = model;
|
|
212
176
|
resolve({
|
|
213
177
|
answers: {
|
|
214
178
|
response: correctResponse,
|
|
215
179
|
noOfModel: maxModelSelected,
|
|
216
|
-
partsPerModel
|
|
180
|
+
partsPerModel
|
|
217
181
|
},
|
|
218
182
|
id: '1'
|
|
219
183
|
});
|
|
@@ -222,39 +186,30 @@ var createCorrectResponseSession = function createCorrectResponseSession(model,
|
|
|
222
186
|
}
|
|
223
187
|
});
|
|
224
188
|
};
|
|
189
|
+
|
|
225
190
|
/*
|
|
226
191
|
* Function to validate the model
|
|
227
192
|
* @param {model} model contains the model object
|
|
228
193
|
* @param {config} config contains the config object
|
|
229
194
|
* */
|
|
230
|
-
|
|
231
|
-
|
|
232
195
|
exports.createCorrectResponseSession = createCorrectResponseSession;
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
var model = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
236
|
-
var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
237
|
-
var errors = {};
|
|
238
|
-
|
|
196
|
+
const validate = (model = {}, config = {}) => {
|
|
197
|
+
const errors = {};
|
|
239
198
|
if (model.correctResponse.length === 0) {
|
|
240
199
|
errors.correctResponse = 'To save the item, at least one section must be marked as correct.';
|
|
241
200
|
}
|
|
242
|
-
|
|
243
201
|
if (model.correctResponse.length > 0) {
|
|
244
|
-
|
|
245
|
-
model.correctResponse.forEach(
|
|
202
|
+
let partialModelCount = 0;
|
|
203
|
+
model.correctResponse.forEach(selection => {
|
|
246
204
|
if (selection.value !== model.partsPerModel) {
|
|
247
205
|
partialModelCount++;
|
|
248
206
|
}
|
|
249
207
|
});
|
|
250
|
-
|
|
251
208
|
if (partialModelCount > 1) {
|
|
252
209
|
errors.correctResponse = 'The correct answer should include no more than one partially-filled model';
|
|
253
210
|
}
|
|
254
211
|
}
|
|
255
|
-
|
|
256
212
|
return errors;
|
|
257
213
|
};
|
|
258
|
-
|
|
259
214
|
exports.validate = validate;
|
|
260
215
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.js"],"names":["getResponseCorrectness","model","answers","env","correct","allowedStudentConfig","partsPerModel","partialFillCheck","response","numeratorCheck","correctResponse","getCorrectness","question","mode","getOutComeScore","correctness","outcome","session","Promise","resolve","score","empty","undefined","completed","correctNumerator","responseNumerator","i","length","value","partialModelCount","forEach","selection","createDefaultModel","defaults","correctInfo","out","view","Object","assign","createCorrectResponseSession","role","maxModelSelected","noOfModel","id","validate","config","errors"],"mappings":";;;;;;;;;;;AAAA;;AACA;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMA,sBAAsB,GAAG,SAAzBA,sBAAyB,CAACC,KAAD,EAAQC,OAAR,EAA8B;AAAA,MAAbC,GAAa,uEAAP,EAAO;AAClE,MAAIC,OAAJ;;AACA,MAAIH,KAAK,CAACI,oBAAV,EAAgC;AAC9BD,IAAAA,OAAO,GAAG,CAAC,EACTF,OAAO,CAACI,aAAR,KAA0BL,KAAK,CAACK,aAAhC,IACAC,gBAAgB,CAACL,OAAO,CAACM,QAAT,EAAmBP,KAAK,CAACK,aAAzB,CADhB,IAEAG,cAAc,CAACR,KAAK,CAACS,eAAP,EAAwBR,OAAO,CAACM,QAAhC,CAHL,CAAX;AAKD,GAND,MAMO;AACLJ,IAAAA,OAAO,GAAG,CAAC,EACTG,gBAAgB,CAACL,OAAO,CAACM,QAAT,EAAmBP,KAAK,CAACK,aAAzB,CAAhB,IAA2DG,cAAc,CAACR,KAAK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AAG,CAAxB;AACA5B,IAAAA,KAAK,CAACS,eAAN,CAAsBoB,OAAtB,CAA8B,UAACC,SAAD,EAAe;AAC3C,UAAIA,SAAS,CAACH,KAAV,KAAoB3B,KAAK,CAACK,aAA9B,EAA6C;AAC3CuB,QAAAA,iBAAiB;AAClB;AACF,KAJD;;AAKA,QAAIA,iBAAiB,GAAG,CAAxB,EAA2B;AACzBiB,MAAAA,MAAM,CAACpC,eAAP,GAAyB,2EAAzB;AACD;AACF;;AACD,SAAOoC,MAAP;AACD,CAjBM","sourcesContent":["import isEmpty from 'lodash/isEmpty';\nimport defaults from './defaults';\n\n/*\n * Function to check the correctness of the response\n * @param {model} model contains the model object\n * @param {answers} answers contains the answers object\n * @param {env} env contains the environment object\n * @returns {string} returns the correctness of the response\n * */\nexport const getResponseCorrectness = (model, answers, env = {}) => {\n let correct;\n if (model.allowedStudentConfig) {\n correct = !!(\n answers.partsPerModel === model.partsPerModel &&\n partialFillCheck(answers.response, model.partsPerModel) &&\n numeratorCheck(model.correctResponse, answers.response)\n );\n } else {\n correct = !!(\n partialFillCheck(answers.response, model.partsPerModel) && numeratorCheck(model.correctResponse, answers.response)\n );\n }\n return correct ? 'correct' : 'incorrect';\n};\n\n/*\n * Function to get the correctness of the response\n * @param {question} question contains the question object\n * @param {env} env contains the environment object\n * @param {answers} answers contains the answers object\n * @returns {string} returns the correctness\n * */\nconst getCorrectness = (question, env, answers = {}) => {\n if (env.mode === 'evaluate') {\n return getResponseCorrectness(question, answers, env);\n }\n};\n\n/*\n * Function to get the outcome score\n * @param {question} question contains the question object\n * @param {env} env contains the environment object\n * @param {answers} answers contains the answers object\n * @returns {number} returns the score\n * */\nconst getOutComeScore = (question, env, answers = {}) => {\n const correctness = getCorrectness(question, env, answers);\n return correctness === 'correct' ? 1 : 0;\n};\n\n/*\n * Function to check outcome of the session\n * @param {model} model contains the model object\n * @param {session} session contains the session object\n * @param {env} env contains the environment object\n * @returns {Promise} returns the score\n */\nexport const outcome = (model, session, env) =>\n new Promise((resolve) => {\n if (!session || isEmpty(session)) {\n resolve({ score: 0, empty: true });\n } else {\n if (env.mode !== 'evaluate') {\n resolve({ score: undefined, completed: undefined });\n } else {\n resolve({ score: getOutComeScore(model, env, session.answers) });\n }\n }\n });\n\n/*\n * Function to check if the numerator of the response matches the numerator of the correct response\n * @param {correctResponse} correctResponse contains the correct response object\n * @param {response} response contains the response object\n * @returns {boolean} returns true if the numerators match\n * */\nconst numeratorCheck = (correctResponse, response) => {\n let correctNumerator = 0;\n let responseNumerator = 0;\n for (let i = 0; i < correctResponse.length; i++) {\n correctNumerator += correctResponse[i].value;\n }\n for (let i = 0; i < response.length; i++) {\n responseNumerator += response[i].value;\n }\n return correctNumerator === responseNumerator;\n};\n\n/*\n * Function to check if the response contains more than one partially-filled model\n * @param {response} response contains the response object\n * @param {partsPerModel} partsPerModel contains the number of parts per model\n * */\nconst partialFillCheck = (response, partsPerModel) => {\n if (response.length > 0) {\n let partialModelCount = 0;\n response.forEach((selection) => {\n if (selection.value !== partsPerModel) {\n partialModelCount++;\n }\n });\n return partialModelCount <= 1;\n } else {\n return false;\n }\n};\n\n/*\n * Function to create a default model\n * @param {model} model contains the model object\n * */\nexport const createDefaultModel = (model = {}) => ({\n ...defaults.model,\n ...model,\n});\n\n/*\n * Return the model object\n * */\nexport const model = (question, session, env) => {\n return new Promise((resolve) => {\n session = session || {};\n const model = createDefaultModel(question);\n let correctness, score;\n if ((!session || isEmpty(session)) && env.mode === 'evaluate') {\n correctness = 'unanswered';\n score = '0%';\n } else {\n correctness = getCorrectness(model, env, session && session.answers);\n score = `${getOutComeScore(model, env, session && session.answers) * 100}%`;\n }\n const correctInfo = {\n score,\n correctness,\n };\n const out = {\n env,\n ...model,\n view: env.mode === 'view' || env.mode === 'evaluate',\n };\n if (env.mode === 'evaluate') {\n Object.assign(out, {\n correctness: correctInfo,\n });\n }\n resolve(out);\n });\n};\n\n/*\n * Function to create a correct response session\n * @param {model} model contains the model object\n * @param {env} env contains the environment object\n * @returns {Promise} returns the correct response session\n * */\nexport const createCorrectResponseSession = (model, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n const { correctResponse, maxModelSelected, partsPerModel } = model;\n resolve({\n answers: {\n response: correctResponse,\n noOfModel: maxModelSelected,\n partsPerModel,\n },\n id: '1',\n });\n } else {\n resolve(null);\n }\n });\n};\n\n/*\n * Function to validate the model\n * @param {model} model contains the model object\n * @param {config} config contains the config object\n * */\nexport const validate = (model = {}, config = {}) => {\n const errors = {};\n if (model.correctResponse.length === 0) {\n errors.correctResponse = 'To save the item, at least one section must be marked as correct.';\n }\n if (model.correctResponse.length > 0) {\n let partialModelCount = 0;\n model.correctResponse.forEach((selection) => {\n if (selection.value !== model.partsPerModel) {\n partialModelCount++;\n }\n });\n if (partialModelCount > 1) {\n errors.correctResponse = 'The correct answer should include no more than one partially-filled model';\n }\n }\n return errors;\n};\n"],"file":"index.js"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_isEmpty","_interopRequireDefault","require","_defaults","getResponseCorrectness","model","answers","env","correct","allowedStudentConfig","partsPerModel","partialFillCheck","response","numeratorCheck","correctResponse","exports","getCorrectness","question","mode","getOutComeScore","correctness","outcome","session","Promise","resolve","isEmpty","score","empty","undefined","completed","correctNumerator","responseNumerator","i","length","value","partialModelCount","forEach","selection","createDefaultModel","defaults","correctInfo","out","view","Object","assign","createCorrectResponseSession","role","maxModelSelected","noOfModel","id","validate","config","errors"],"sources":["../src/index.js"],"sourcesContent":["import isEmpty from 'lodash/isEmpty';\nimport defaults from './defaults';\n\n/*\n * Function to check the correctness of the response\n * @param {model} model contains the model object\n * @param {answers} answers contains the answers object\n * @param {env} env contains the environment object\n * @returns {string} returns the correctness of the response\n * */\nexport const getResponseCorrectness = (model, answers, env = {}) => {\n let correct;\n if (model.allowedStudentConfig) {\n correct = !!(\n answers.partsPerModel === model.partsPerModel &&\n partialFillCheck(answers.response, model.partsPerModel) &&\n numeratorCheck(model.correctResponse, answers.response)\n );\n } else {\n correct = !!(\n partialFillCheck(answers.response, model.partsPerModel) && numeratorCheck(model.correctResponse, answers.response)\n );\n }\n return correct ? 'correct' : 'incorrect';\n};\n\n/*\n * Function to get the correctness of the response\n * @param {question} question contains the question object\n * @param {env} env contains the environment object\n * @param {answers} answers contains the answers object\n * @returns {string} returns the correctness\n * */\nconst getCorrectness = (question, env, answers = {}) => {\n if (env.mode === 'evaluate') {\n return getResponseCorrectness(question, answers, env);\n }\n};\n\n/*\n * Function to get the outcome score\n * @param {question} question contains the question object\n * @param {env} env contains the environment object\n * @param {answers} answers contains the answers object\n * @returns {number} returns the score\n * */\nconst getOutComeScore = (question, env, answers = {}) => {\n const correctness = getCorrectness(question, env, answers);\n return correctness === 'correct' ? 1 : 0;\n};\n\n/*\n * Function to check outcome of the session\n * @param {model} model contains the model object\n * @param {session} session contains the session object\n * @param {env} env contains the environment object\n * @returns {Promise} returns the score\n */\nexport const outcome = (model, session, env) =>\n new Promise((resolve) => {\n if (!session || isEmpty(session)) {\n resolve({ score: 0, empty: true });\n } else {\n if (env.mode !== 'evaluate') {\n resolve({ score: undefined, completed: undefined });\n } else {\n resolve({ score: getOutComeScore(model, env, session.answers) });\n }\n }\n });\n\n/*\n * Function to check if the numerator of the response matches the numerator of the correct response\n * @param {correctResponse} correctResponse contains the correct response object\n * @param {response} response contains the response object\n * @returns {boolean} returns true if the numerators match\n * */\nconst numeratorCheck = (correctResponse, response) => {\n let correctNumerator = 0;\n let responseNumerator = 0;\n for (let i = 0; i < correctResponse.length; i++) {\n correctNumerator += correctResponse[i].value;\n }\n for (let i = 0; i < response.length; i++) {\n responseNumerator += response[i].value;\n }\n return correctNumerator === responseNumerator;\n};\n\n/*\n * Function to check if the response contains more than one partially-filled model\n * @param {response} response contains the response object\n * @param {partsPerModel} partsPerModel contains the number of parts per model\n * */\nconst partialFillCheck = (response, partsPerModel) => {\n if (response.length > 0) {\n let partialModelCount = 0;\n response.forEach((selection) => {\n if (selection.value !== partsPerModel) {\n partialModelCount++;\n }\n });\n return partialModelCount <= 1;\n } else {\n return false;\n }\n};\n\n/*\n * Function to create a default model\n * @param {model} model contains the model object\n * */\nexport const createDefaultModel = (model = {}) => ({\n ...defaults.model,\n ...model,\n});\n\n/*\n * Return the model object\n * */\nexport const model = (question, session, env) => {\n return new Promise((resolve) => {\n session = session || {};\n const model = createDefaultModel(question);\n let correctness, score;\n if ((!session || isEmpty(session)) && env.mode === 'evaluate') {\n correctness = 'unanswered';\n score = '0%';\n } else {\n correctness = getCorrectness(model, env, session && session.answers);\n score = `${getOutComeScore(model, env, session && session.answers) * 100}%`;\n }\n const correctInfo = {\n score,\n correctness,\n };\n const out = {\n env,\n ...model,\n view: env.mode === 'view' || env.mode === 'evaluate',\n };\n if (env.mode === 'evaluate') {\n Object.assign(out, {\n correctness: correctInfo,\n });\n }\n resolve(out);\n });\n};\n\n/*\n * Function to create a correct response session\n * @param {model} model contains the model object\n * @param {env} env contains the environment object\n * @returns {Promise} returns the correct response session\n * */\nexport const createCorrectResponseSession = (model, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n const { correctResponse, maxModelSelected, partsPerModel } = model;\n resolve({\n answers: {\n response: correctResponse,\n noOfModel: maxModelSelected,\n partsPerModel,\n },\n id: '1',\n });\n } else {\n resolve(null);\n }\n });\n};\n\n/*\n * Function to validate the model\n * @param {model} model contains the model object\n * @param {config} config contains the config object\n * */\nexport const validate = (model = {}, config = {}) => {\n const errors = {};\n if (model.correctResponse.length === 0) {\n errors.correctResponse = 'To save the item, at least one section must be marked as correct.';\n }\n if (model.correctResponse.length > 0) {\n let partialModelCount = 0;\n model.correctResponse.forEach((selection) => {\n if (selection.value !== model.partsPerModel) {\n partialModelCount++;\n }\n });\n if (partialModelCount > 1) {\n errors.correctResponse = 'The correct answer should include no more than one partially-filled model';\n }\n }\n return errors;\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,QAAA,GAAAC,sBAAA,CAAAC,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,GAAG,CAAC,CAAC;EACjB,IAAI/C,KAAK,CAACS,eAAe,CAACmB,MAAM,KAAK,CAAC,EAAE;IACtCmB,MAAM,CAACtC,eAAe,GAAG,mEAAmE;EAC9F;EACA,IAAIT,KAAK,CAACS,eAAe,CAACmB,MAAM,GAAG,CAAC,EAAE;IACpC,IAAIE,iBAAiB,GAAG,CAAC;IACzB9B,KAAK,CAACS,eAAe,CAACsB,OAAO,CAAEC,SAAS,IAAK;MAC3C,IAAIA,SAAS,CAACH,KAAK,KAAK7B,KAAK,CAACK,aAAa,EAAE;QAC3CyB,iBAAiB,EAAE;MACrB;IACF,CAAC,CAAC;IACF,IAAIA,iBAAiB,GAAG,CAAC,EAAE;MACzBiB,MAAM,CAACtC,eAAe,GAAG,2EAA2E;IACtG;EACF;EACA,OAAOsC,MAAM;AACf,CAAC;AAACrC,OAAA,CAAAmC,QAAA,GAAAA,QAAA","ignoreList":[]}
|
package/controller/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/fraction-model-controller",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "4.0.0-beta.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "src/index.js",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@pie-lib/text-select": "1.32.
|
|
9
|
+
"@pie-lib/text-select": "1.32.4-next.0",
|
|
10
10
|
"debug": "^3.1.0",
|
|
11
11
|
"lodash": "^4.17.15"
|
|
12
12
|
},
|