@pie-element/charting 12.1.1-next.1 → 12.1.1-next.29
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 +487 -0
- package/CHANGELOG.md +1991 -0
- package/LICENSE.md +5 -0
- package/README.md +1 -0
- package/configure/CHANGELOG.json +292 -0
- package/configure/CHANGELOG.md +1758 -0
- package/configure/lib/charting-config.js +192 -0
- package/configure/lib/charting-config.js.map +1 -0
- package/configure/lib/configure.js +312 -0
- package/configure/lib/configure.js.map +1 -0
- package/configure/lib/correct-response.js +244 -0
- package/configure/lib/correct-response.js.map +1 -0
- package/configure/lib/defaults.js +233 -0
- package/configure/lib/defaults.js.map +1 -0
- package/configure/lib/index.js +120 -0
- package/configure/lib/index.js.map +1 -0
- package/configure/lib/utils.js +80 -0
- package/configure/lib/utils.js.map +1 -0
- package/configure/package.json +29 -0
- package/controller/CHANGELOG.json +262 -0
- package/controller/CHANGELOG.md +1208 -0
- package/controller/lib/defaults.js +42 -0
- package/controller/lib/defaults.js.map +1 -0
- package/controller/lib/index.js +434 -0
- package/controller/lib/index.js.map +1 -0
- package/controller/package.json +24 -0
- package/docs/config-schema.json +2440 -0
- package/docs/config-schema.json.md +1802 -0
- package/docs/demo/config.js +8 -0
- package/docs/demo/generate.js +63 -0
- package/docs/demo/index.html +1 -0
- package/docs/demo/session.js +26 -0
- package/docs/pie-schema.json +1731 -0
- package/docs/pie-schema.json.md +945 -0
- package/lib/index.js +78 -0
- package/lib/index.js.map +1 -0
- package/lib/main.js +167 -0
- package/lib/main.js.map +1 -0
- package/package.json +20 -57
- package/dist/author/charting-config.d.ts +0 -30
- package/dist/author/charting-config.js +0 -126
- package/dist/author/configure.d.ts +0 -29
- package/dist/author/configure.js +0 -205
- package/dist/author/correct-response.d.ts +0 -27
- package/dist/author/correct-response.js +0 -116
- package/dist/author/defaults.d.ts +0 -229
- package/dist/author/defaults.js +0 -186
- package/dist/author/index.d.ts +0 -51
- package/dist/author/index.js +0 -74
- package/dist/author/utils.d.ts +0 -42
- package/dist/author/utils.js +0 -244
- package/dist/charting.css +0 -2
- package/dist/controller/defaults.d.ts +0 -44
- package/dist/controller/defaults.js +0 -33
- package/dist/controller/index.d.ts +0 -28
- package/dist/controller/index.js +0 -155
- package/dist/delivery/index.d.ts +0 -21
- package/dist/delivery/index.js +0 -46
- package/dist/delivery/main.d.ts +0 -23
- package/dist/delivery/main.js +0 -128
- package/dist/index.d.ts +0 -1
- package/dist/index.iife.d.ts +0 -8
- package/dist/index.iife.js +0 -368
- package/dist/index.js +0 -2
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_DataView.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Promise.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Set.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_SetCache.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Stack.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_apply.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEach.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js +0 -15
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayMap.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arraySome.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assignValue.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssign.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignIn.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseClone.js +0 -57
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFlatten.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGet.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseHasIn.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqual.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqualDeep.js +0 -30
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMap.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsSet.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_basePick.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_basePickBy.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseSet.js +0 -22
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseSetToString.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseToString.js +0 -15
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cacheHas.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_castPath.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneArrayBuffer.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneDataView.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneRegExp.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneSymbol.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbols.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbolsIn.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalArrays.js +0 -35
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalByTag.js +0 -35
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalObjects.js +0 -32
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_flatRest.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js +0 -4
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeys.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeysIn.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbolsIn.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getTag.js +0 -23
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hasPath.js +0 -18
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneArray.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneByTag.js +0 -33
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isFlattenable.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKey.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapToArray.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_memoizeCapped.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overArg.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overRest.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheAdd.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheHas.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToArray.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToString.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_shortOut.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stringToPath.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toKey.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js +0 -15
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/constant.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/flatten.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/hasIn.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/identity.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js +0 -4
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js +0 -21
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEqual.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isLength.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isMap.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSet.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSymbol.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keys.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keysIn.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/memoize.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/pick.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubArray.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toString.js +0 -7
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* NOTE: There's no functionality described for graphTitle,
|
|
9
|
+
* rationale, scoringType, studentInstructions, teacherInstructions
|
|
10
|
+
* so there's no implementation (they are only added in model)
|
|
11
|
+
*/
|
|
12
|
+
var _default = exports.default = {
|
|
13
|
+
addCategoryEnabled: true,
|
|
14
|
+
changeAddCategoryEnabled: false,
|
|
15
|
+
changeEditableEnabled: false,
|
|
16
|
+
changeInteractiveEnabled: false,
|
|
17
|
+
chartType: 'lineCross',
|
|
18
|
+
correctAnswer: {},
|
|
19
|
+
data: [],
|
|
20
|
+
domain: {},
|
|
21
|
+
graph: {
|
|
22
|
+
width: 480,
|
|
23
|
+
height: 480
|
|
24
|
+
},
|
|
25
|
+
prompt: '',
|
|
26
|
+
promptEnabled: true,
|
|
27
|
+
range: {
|
|
28
|
+
label: '',
|
|
29
|
+
max: 1,
|
|
30
|
+
min: 0,
|
|
31
|
+
labelStep: 1
|
|
32
|
+
},
|
|
33
|
+
rationale: '',
|
|
34
|
+
rationaleEnabled: true,
|
|
35
|
+
scoringType: 'all or nothing',
|
|
36
|
+
studentInstructionsEnabled: true,
|
|
37
|
+
studentNewCategoryDefaultLabel: 'New Category',
|
|
38
|
+
teacherInstructions: '',
|
|
39
|
+
teacherInstructionsEnabled: true,
|
|
40
|
+
title: ''
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=defaults.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.js","names":["_default","exports","default","addCategoryEnabled","changeAddCategoryEnabled","changeEditableEnabled","changeInteractiveEnabled","chartType","correctAnswer","data","domain","graph","width","height","prompt","promptEnabled","range","label","max","min","labelStep","rationale","rationaleEnabled","scoringType","studentInstructionsEnabled","studentNewCategoryDefaultLabel","teacherInstructions","teacherInstructionsEnabled","title"],"sources":["../src/defaults.js"],"sourcesContent":["/**\n * NOTE: There's no functionality described for graphTitle,\n * rationale, scoringType, studentInstructions, teacherInstructions\n * so there's no implementation (they are only added in model)\n */\n\nexport default {\n addCategoryEnabled: true,\n changeAddCategoryEnabled: false,\n changeEditableEnabled: false,\n changeInteractiveEnabled: false,\n chartType: 'lineCross',\n correctAnswer: {},\n data: [],\n domain: {},\n graph: { width: 480, height: 480 },\n prompt: '',\n promptEnabled: true,\n range: { label: '', max: 1, min: 0, labelStep: 1 },\n rationale: '',\n rationaleEnabled: true,\n scoringType: 'all or nothing',\n studentInstructionsEnabled: true,\n studentNewCategoryDefaultLabel: 'New Category',\n teacherInstructions: '',\n teacherInstructionsEnabled: true,\n title: '',\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AAJA,IAAAA,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAMe;EACbC,kBAAkB,EAAE,IAAI;EACxBC,wBAAwB,EAAE,KAAK;EAC/BC,qBAAqB,EAAE,KAAK;EAC5BC,wBAAwB,EAAE,KAAK;EAC/BC,SAAS,EAAE,WAAW;EACtBC,aAAa,EAAE,CAAC,CAAC;EACjBC,IAAI,EAAE,EAAE;EACRC,MAAM,EAAE,CAAC,CAAC;EACVC,KAAK,EAAE;IAAEC,KAAK,EAAE,GAAG;IAAEC,MAAM,EAAE;EAAI,CAAC;EAClCC,MAAM,EAAE,EAAE;EACVC,aAAa,EAAE,IAAI;EACnBC,KAAK,EAAE;IAAEC,KAAK,EAAE,EAAE;IAAEC,GAAG,EAAE,CAAC;IAAEC,GAAG,EAAE,CAAC;IAAEC,SAAS,EAAE;EAAE,CAAC;EAClDC,SAAS,EAAE,EAAE;EACbC,gBAAgB,EAAE,IAAI;EACtBC,WAAW,EAAE,gBAAgB;EAC7BC,0BAA0B,EAAE,IAAI;EAChCC,8BAA8B,EAAE,cAAc;EAC9CC,mBAAmB,EAAE,EAAE;EACvBC,0BAA0B,EAAE,IAAI;EAChCC,KAAK,EAAE;AACT,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,434 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.getScore = exports.getLogTrace = exports.filterCategories = exports.createCorrectResponseSession = exports.checkLabelsEquality = void 0;
|
|
8
|
+
exports.model = model;
|
|
9
|
+
exports.normalize = void 0;
|
|
10
|
+
exports.outcome = outcome;
|
|
11
|
+
exports.validate = exports.setCorrectness = void 0;
|
|
12
|
+
var _debug = _interopRequireDefault(require("debug"));
|
|
13
|
+
var _lodashEs = require("lodash-es");
|
|
14
|
+
var _defaults = _interopRequireDefault(require("./defaults"));
|
|
15
|
+
var _controllerUtils = require("@pie-lib/controller-utils");
|
|
16
|
+
const log = (0, _debug.default)('@pie-element:graphing:controller');
|
|
17
|
+
const lowerCase = string => (string || '').toLowerCase();
|
|
18
|
+
const checkLabelsEquality = (givenAnswerLabel, correctAnswerLabel) => lowerCase(givenAnswerLabel) === lowerCase(correctAnswerLabel);
|
|
19
|
+
exports.checkLabelsEquality = checkLabelsEquality;
|
|
20
|
+
const setCorrectness = (answers, partialScoring) => answers ? answers.map(answer => ({
|
|
21
|
+
...answer,
|
|
22
|
+
correctness: {
|
|
23
|
+
value: partialScoring ? 'incorrect' : 'correct',
|
|
24
|
+
label: partialScoring ? 'incorrect' : 'correct'
|
|
25
|
+
}
|
|
26
|
+
})) : [];
|
|
27
|
+
exports.setCorrectness = setCorrectness;
|
|
28
|
+
const normalize = question => ({
|
|
29
|
+
..._defaults.default,
|
|
30
|
+
...question
|
|
31
|
+
});
|
|
32
|
+
exports.normalize = normalize;
|
|
33
|
+
const getScore = (question, session, env = {}) => {
|
|
34
|
+
const {
|
|
35
|
+
correctAnswer,
|
|
36
|
+
data: initialData = [],
|
|
37
|
+
scoringType
|
|
38
|
+
} = question;
|
|
39
|
+
let correctResponses = [];
|
|
40
|
+
const isPartialScoring = _controllerUtils.partialScoring.enabled({
|
|
41
|
+
partialScoring: scoringType !== undefined ? scoringType === 'partial scoring' : scoringType
|
|
42
|
+
}, env);
|
|
43
|
+
const {
|
|
44
|
+
data: correctAnswers = []
|
|
45
|
+
} = correctAnswer || {};
|
|
46
|
+
const defaultAnswers = filterCategories(initialData);
|
|
47
|
+
let answers = setCorrectness(session && session.answer || defaultAnswers, isPartialScoring);
|
|
48
|
+
let result = 0;
|
|
49
|
+
if (isPartialScoring) {
|
|
50
|
+
// if score type is "partial scoring"
|
|
51
|
+
// maxScore is calculated based on the correct response
|
|
52
|
+
// score is calculated based on the given response
|
|
53
|
+
let maxScore = 0;
|
|
54
|
+
let score = 0;
|
|
55
|
+
const scoreForLabelAndValueEditable = (answer, corrAnswer) => {
|
|
56
|
+
const {
|
|
57
|
+
value,
|
|
58
|
+
label,
|
|
59
|
+
index
|
|
60
|
+
} = answer;
|
|
61
|
+
const valueIsCorrect = value === corrAnswer.value;
|
|
62
|
+
const labelIsCorrect = checkLabelsEquality(label, corrAnswer.label);
|
|
63
|
+
maxScore += 2;
|
|
64
|
+
if (valueIsCorrect) {
|
|
65
|
+
score += 1;
|
|
66
|
+
answer.correctness.value = 'correct';
|
|
67
|
+
}
|
|
68
|
+
if (labelIsCorrect) {
|
|
69
|
+
score += 1;
|
|
70
|
+
answer.correctness.label = 'correct';
|
|
71
|
+
}
|
|
72
|
+
if (valueIsCorrect && labelIsCorrect) {
|
|
73
|
+
correctResponses.push({
|
|
74
|
+
label: label,
|
|
75
|
+
index: index
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
// if given answer has more categories than the correct answers, the "extra" will be ignored
|
|
81
|
+
correctAnswers.forEach((corrAnswer, index) => {
|
|
82
|
+
const defaultAnswer = defaultAnswers[index];
|
|
83
|
+
const answer = answers[index];
|
|
84
|
+
|
|
85
|
+
// if there is a corresponding category at the same position in the given answer
|
|
86
|
+
if (answer) {
|
|
87
|
+
// if there is a corresponding category at the same position in the default answer
|
|
88
|
+
if (defaultAnswer) {
|
|
89
|
+
// if category's label (in default answer) was not editable
|
|
90
|
+
// it means that this category values only one point (only the value can be changed)
|
|
91
|
+
if (!defaultAnswer.editable && answer.interactive) {
|
|
92
|
+
maxScore += 1;
|
|
93
|
+
if (answer.value === corrAnswer.value) {
|
|
94
|
+
score += 1;
|
|
95
|
+
answer.correctness.value = 'correct';
|
|
96
|
+
correctResponses.push({
|
|
97
|
+
label: answer.label,
|
|
98
|
+
index: index
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
answer.correctness.label = 'correct';
|
|
102
|
+
|
|
103
|
+
// if category's label (in default answer) was editable
|
|
104
|
+
// it means that this category values 2 points (both label and value can be changed)
|
|
105
|
+
} else if (defaultAnswer.editable && answer.interactive) {
|
|
106
|
+
scoreForLabelAndValueEditable(answer, corrAnswer);
|
|
107
|
+
} else if (!answer.interactive) {
|
|
108
|
+
answer.correctness.value = 'correct';
|
|
109
|
+
answer.correctness.label = 'correct';
|
|
110
|
+
correctResponses.push({
|
|
111
|
+
label: answer.label,
|
|
112
|
+
index: index
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
} else {
|
|
116
|
+
// if there is not a corresponding category at the same position in the default answer
|
|
117
|
+
scoreForLabelAndValueEditable(answer, corrAnswer);
|
|
118
|
+
}
|
|
119
|
+
} else {
|
|
120
|
+
// if there is not a corresponding category at the same position in the given answer
|
|
121
|
+
// it means that the given answer has less categories than the correct answer
|
|
122
|
+
maxScore += 2;
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
result = maxScore ? score / maxScore : 0;
|
|
126
|
+
} else {
|
|
127
|
+
// all-or-nothing scoring: overall score is 1 only if lengths and all values/labels match
|
|
128
|
+
result = correctAnswers.length === answers.length ? 1 : 0;
|
|
129
|
+
|
|
130
|
+
// regardless of overall result, mark each answer individually for user feedback
|
|
131
|
+
answers = answers.map((answer, index) => {
|
|
132
|
+
const correctAnswer = correctAnswers[index];
|
|
133
|
+
const valueIsCorrect = correctAnswer ? answer.value === correctAnswer.value : false;
|
|
134
|
+
const labelIsCorrect = correctAnswer ? lowerCase(answer.label) === lowerCase(correctAnswer.label) : false;
|
|
135
|
+
if (!valueIsCorrect || !labelIsCorrect) {
|
|
136
|
+
result = 0;
|
|
137
|
+
}
|
|
138
|
+
if (valueIsCorrect && labelIsCorrect) {
|
|
139
|
+
correctResponses.push({
|
|
140
|
+
label: answer.label,
|
|
141
|
+
index
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
return {
|
|
145
|
+
...answer,
|
|
146
|
+
correctness: {
|
|
147
|
+
value: valueIsCorrect ? 'correct' : 'incorrect',
|
|
148
|
+
label: labelIsCorrect ? 'correct' : 'incorrect'
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
const score = {
|
|
154
|
+
score: parseFloat(result.toFixed(2)),
|
|
155
|
+
answers
|
|
156
|
+
};
|
|
157
|
+
if (env.extraProps && env.extraProps.correctResponseEnabled) {
|
|
158
|
+
score.correctResponses = correctResponses;
|
|
159
|
+
}
|
|
160
|
+
return score;
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Generates detailed trace log for scoring evaluation
|
|
165
|
+
* @param {Object} model - the question model
|
|
166
|
+
* @param {Object} session - the student session
|
|
167
|
+
* @param {Object} env - the environment
|
|
168
|
+
* @returns {Array} traceLog - array of trace messages
|
|
169
|
+
*/
|
|
170
|
+
exports.getScore = getScore;
|
|
171
|
+
const getLogTrace = (model, session, env) => {
|
|
172
|
+
const traceLog = [];
|
|
173
|
+
const {
|
|
174
|
+
correctAnswer,
|
|
175
|
+
data: initialData = [],
|
|
176
|
+
scoringType
|
|
177
|
+
} = model || {};
|
|
178
|
+
const {
|
|
179
|
+
data: correctAnswers = []
|
|
180
|
+
} = correctAnswer || {};
|
|
181
|
+
const studentAnswers = session && session.answer || [];
|
|
182
|
+
const isPartialScoring = _controllerUtils.partialScoring.enabled({
|
|
183
|
+
partialScoring: scoringType !== undefined ? scoringType === 'partial scoring' : scoringType
|
|
184
|
+
}, env);
|
|
185
|
+
const defaultAnswers = filterCategories(initialData);
|
|
186
|
+
const answers = studentAnswers.length > 0 ? filterCategories(studentAnswers) : defaultAnswers;
|
|
187
|
+
if (!studentAnswers.length) {
|
|
188
|
+
traceLog.push(`Student did not modify the chart. Initial chart is scored.`);
|
|
189
|
+
}
|
|
190
|
+
correctAnswers.forEach((correct, index) => {
|
|
191
|
+
const initial = defaultAnswers[index];
|
|
192
|
+
const student = answers[index];
|
|
193
|
+
if (!student) {
|
|
194
|
+
traceLog.push(`Category ${index + 1}: missing (expected value '${correct.value}', label '${correct.label}').`);
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
const valueCorrect = student.value === correct.value;
|
|
198
|
+
const labelCorrect = checkLabelsEquality(student.label, correct.label);
|
|
199
|
+
if (!student.interactive) {
|
|
200
|
+
traceLog.push(`Category ${index + 1}: non-interactive category treated as correct.`);
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
if (studentAnswers.length > 0) {
|
|
204
|
+
const valueChanged = initial ? student.value !== initial.value : true;
|
|
205
|
+
const labelChanged = initial ? !checkLabelsEquality(student.label, initial.label) : true;
|
|
206
|
+
if (!valueChanged && !labelChanged) {
|
|
207
|
+
if (valueCorrect && labelCorrect) {
|
|
208
|
+
traceLog.push(`Category ${index + 1}: unchanged from initial value and correct.`);
|
|
209
|
+
} else {
|
|
210
|
+
traceLog.push(`Category ${index + 1}: unchanged from initial value but incorrect.`);
|
|
211
|
+
}
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
const parts = [];
|
|
215
|
+
if (valueChanged) {
|
|
216
|
+
parts.push(`value ${valueCorrect ? 'correct' : 'incorrect'}`);
|
|
217
|
+
}
|
|
218
|
+
if (labelChanged) {
|
|
219
|
+
parts.push(`label ${labelCorrect ? 'correct' : 'incorrect'}`);
|
|
220
|
+
}
|
|
221
|
+
traceLog.push(`Category ${index + 1}: modified - ${parts.join(', ')}.`);
|
|
222
|
+
} else {
|
|
223
|
+
if (valueCorrect && labelCorrect) {
|
|
224
|
+
traceLog.push(`Category ${index + 1}: initial values are correct.`);
|
|
225
|
+
} else if (valueCorrect) {
|
|
226
|
+
traceLog.push(`Category ${index + 1}: initial value correct, label incorrect.`);
|
|
227
|
+
} else if (labelCorrect) {
|
|
228
|
+
traceLog.push(`Category ${index + 1}: initial value incorrect, label correct.`);
|
|
229
|
+
} else {
|
|
230
|
+
traceLog.push(`Category ${index + 1}: initial value and label incorrect.`);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
if (answers.length > correctAnswers.length) {
|
|
235
|
+
const extra = answers.length - correctAnswers.length;
|
|
236
|
+
traceLog.push(`${extra} extra category(ies) provided beyond expected number.`);
|
|
237
|
+
}
|
|
238
|
+
if (isPartialScoring) {
|
|
239
|
+
traceLog.push('Score calculated using partial scoring.');
|
|
240
|
+
traceLog.push('Student receives credit for each correct value and label independently.');
|
|
241
|
+
} else {
|
|
242
|
+
traceLog.push('Score calculated using all-or-nothing scoring.');
|
|
243
|
+
traceLog.push('Student must match all category values and labels exactly for full credit.');
|
|
244
|
+
}
|
|
245
|
+
const scoreObject = getScore(model, session, env);
|
|
246
|
+
traceLog.push(`Score: ${scoreObject.score}.`);
|
|
247
|
+
return traceLog;
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
// eslint-disable-next-line no-unused-vars
|
|
251
|
+
exports.getLogTrace = getLogTrace;
|
|
252
|
+
const filterCategories = categories => categories ? categories.map(({
|
|
253
|
+
deletable,
|
|
254
|
+
...rest
|
|
255
|
+
}) => rest) : [];
|
|
256
|
+
exports.filterCategories = filterCategories;
|
|
257
|
+
function model(question, session, env) {
|
|
258
|
+
return new Promise(resolve => {
|
|
259
|
+
const normalizedQuestion = normalize(question);
|
|
260
|
+
const {
|
|
261
|
+
addCategoryEnabled,
|
|
262
|
+
chartType,
|
|
263
|
+
data,
|
|
264
|
+
domain,
|
|
265
|
+
graph,
|
|
266
|
+
prompt,
|
|
267
|
+
promptEnabled,
|
|
268
|
+
range,
|
|
269
|
+
rationale,
|
|
270
|
+
title,
|
|
271
|
+
rationaleEnabled,
|
|
272
|
+
teacherInstructions,
|
|
273
|
+
teacherInstructionsEnabled,
|
|
274
|
+
correctAnswer,
|
|
275
|
+
scoringType,
|
|
276
|
+
studentNewCategoryDefaultLabel,
|
|
277
|
+
language,
|
|
278
|
+
extraCSSRules
|
|
279
|
+
} = normalizedQuestion;
|
|
280
|
+
const correctInfo = {
|
|
281
|
+
correctness: 'incorrect',
|
|
282
|
+
score: '0%'
|
|
283
|
+
};
|
|
284
|
+
const base = {
|
|
285
|
+
addCategoryEnabled,
|
|
286
|
+
chartType,
|
|
287
|
+
data: filterCategories(data),
|
|
288
|
+
domain,
|
|
289
|
+
graph,
|
|
290
|
+
prompt: promptEnabled ? prompt : null,
|
|
291
|
+
range,
|
|
292
|
+
rationale,
|
|
293
|
+
title,
|
|
294
|
+
size: graph,
|
|
295
|
+
showToggle: false,
|
|
296
|
+
correctness: correctInfo,
|
|
297
|
+
disabled: env.mode !== 'gather',
|
|
298
|
+
scoringType,
|
|
299
|
+
studentNewCategoryDefaultLabel,
|
|
300
|
+
language,
|
|
301
|
+
env,
|
|
302
|
+
extraCSSRules
|
|
303
|
+
};
|
|
304
|
+
const scoreObject = getScore(normalizedQuestion, session, env);
|
|
305
|
+
const answers = filterCategories(scoreObject.answers);
|
|
306
|
+
if (env.mode === 'view') {
|
|
307
|
+
// eslint-disable-next-line no-unused-vars
|
|
308
|
+
base.correctedAnswer = answers.map(({
|
|
309
|
+
correctness,
|
|
310
|
+
...rest
|
|
311
|
+
}) => {
|
|
312
|
+
return {
|
|
313
|
+
...rest,
|
|
314
|
+
interactive: false
|
|
315
|
+
};
|
|
316
|
+
});
|
|
317
|
+
base.addCategoryEnabled = false;
|
|
318
|
+
}
|
|
319
|
+
if (env.mode === 'evaluate') {
|
|
320
|
+
base.correctedAnswer = answers;
|
|
321
|
+
base.correctAnswer = correctAnswer;
|
|
322
|
+
base.showToggle = !!correctAnswer?.data?.length && scoreObject.score !== 1;
|
|
323
|
+
base.addCategoryEnabled = false;
|
|
324
|
+
base.showKeyLegend = true;
|
|
325
|
+
}
|
|
326
|
+
if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {
|
|
327
|
+
base.rationale = rationaleEnabled ? rationale : null;
|
|
328
|
+
base.teacherInstructions = teacherInstructionsEnabled ? teacherInstructions : null;
|
|
329
|
+
} else {
|
|
330
|
+
base.rationale = null;
|
|
331
|
+
base.teacherInstructions = null;
|
|
332
|
+
}
|
|
333
|
+
log('base: ', base);
|
|
334
|
+
resolve(base);
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
function outcome(model, session, env) {
|
|
338
|
+
return new Promise(resolve => {
|
|
339
|
+
const traceLog = getLogTrace(model, session, env);
|
|
340
|
+
const scoreObject = getScore(model, session, env);
|
|
341
|
+
const result = {
|
|
342
|
+
score: scoreObject.score,
|
|
343
|
+
empty: !session || (0, _lodashEs.isEmpty)(session),
|
|
344
|
+
traceLog
|
|
345
|
+
};
|
|
346
|
+
if (env.extraProps && env.extraProps.correctResponseEnabled) {
|
|
347
|
+
result.extraProps = {
|
|
348
|
+
correctResponse: scoreObject.correctResponses
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
resolve(result);
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
const createCorrectResponseSession = (question, env) => {
|
|
355
|
+
return new Promise(resolve => {
|
|
356
|
+
if (env.mode !== 'evaluate' && env.role === 'instructor') {
|
|
357
|
+
const {
|
|
358
|
+
correctAnswer
|
|
359
|
+
} = question;
|
|
360
|
+
let answers = correctAnswer && correctAnswer.data;
|
|
361
|
+
|
|
362
|
+
// for IBX preview mode
|
|
363
|
+
if (env.mode === 'gather') {
|
|
364
|
+
const {
|
|
365
|
+
data
|
|
366
|
+
} = question;
|
|
367
|
+
answers = (correctAnswer && correctAnswer.data || []).map((answer, index) => {
|
|
368
|
+
return {
|
|
369
|
+
...data[index],
|
|
370
|
+
...answer
|
|
371
|
+
};
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
resolve({
|
|
375
|
+
answer: answers,
|
|
376
|
+
id: '1'
|
|
377
|
+
});
|
|
378
|
+
} else {
|
|
379
|
+
return resolve(null);
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
// remove all html tags
|
|
385
|
+
exports.createCorrectResponseSession = createCorrectResponseSession;
|
|
386
|
+
const getInnerText = html => (html || '').replaceAll(/<[^>]*>/g, '');
|
|
387
|
+
|
|
388
|
+
// remove all html tags except img, iframe and source tag for audio
|
|
389
|
+
const getContent = html => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');
|
|
390
|
+
const validate = (model = {}, config = {}) => {
|
|
391
|
+
const {
|
|
392
|
+
correctAnswer,
|
|
393
|
+
data
|
|
394
|
+
} = model || {};
|
|
395
|
+
const {
|
|
396
|
+
data: correctData
|
|
397
|
+
} = correctAnswer || {};
|
|
398
|
+
const categories = correctData || [];
|
|
399
|
+
const errors = {};
|
|
400
|
+
const correctAnswerErrors = {};
|
|
401
|
+
const categoryErrors = {};
|
|
402
|
+
['teacherInstructions', 'prompt', 'rationale'].forEach(field => {
|
|
403
|
+
if (config[field]?.required && !getContent(model[field])) {
|
|
404
|
+
errors[field] = 'This field is required.';
|
|
405
|
+
}
|
|
406
|
+
});
|
|
407
|
+
categories.forEach((category, index) => {
|
|
408
|
+
const {
|
|
409
|
+
label
|
|
410
|
+
} = category;
|
|
411
|
+
if (!getInnerText(label)) {
|
|
412
|
+
categoryErrors[index] = 'Content should not be empty. ';
|
|
413
|
+
} else {
|
|
414
|
+
const identicalAnswer = categories.some((c, i) => c.label === label && index !== i);
|
|
415
|
+
if (identicalAnswer) {
|
|
416
|
+
categoryErrors[index] = 'Category names should be unique. ';
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
});
|
|
420
|
+
if (categories.length < 1 || categories.length > 20) {
|
|
421
|
+
correctAnswerErrors.categoriesError = 'The correct answer should include between 1 and 20 categories.';
|
|
422
|
+
} else if ((0, _lodashEs.isEqual)(data.map(category => (0, _lodashEs.pick)(category, 'value', 'label')), correctData.map(category => (0, _lodashEs.pick)(category, 'value', 'label')))) {
|
|
423
|
+
correctAnswerErrors.identicalError = 'Correct answer should not be identical to the chart’s initial state';
|
|
424
|
+
}
|
|
425
|
+
if (!(0, _lodashEs.isEmpty)(categoryErrors)) {
|
|
426
|
+
errors.categoryErrors = categoryErrors;
|
|
427
|
+
}
|
|
428
|
+
if (!(0, _lodashEs.isEmpty)(correctAnswerErrors)) {
|
|
429
|
+
errors.correctAnswerErrors = correctAnswerErrors;
|
|
430
|
+
}
|
|
431
|
+
return errors;
|
|
432
|
+
};
|
|
433
|
+
exports.validate = validate;
|
|
434
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_debug","_interopRequireDefault","require","_lodashEs","_defaults","_controllerUtils","log","debug","lowerCase","string","toLowerCase","checkLabelsEquality","givenAnswerLabel","correctAnswerLabel","exports","setCorrectness","answers","partialScoring","map","answer","correctness","value","label","normalize","question","defaults","getScore","session","env","correctAnswer","data","initialData","scoringType","correctResponses","isPartialScoring","enabled","undefined","correctAnswers","defaultAnswers","filterCategories","result","maxScore","score","scoreForLabelAndValueEditable","corrAnswer","index","valueIsCorrect","labelIsCorrect","push","forEach","defaultAnswer","editable","interactive","length","parseFloat","toFixed","extraProps","correctResponseEnabled","getLogTrace","model","traceLog","studentAnswers","correct","initial","student","valueCorrect","labelCorrect","valueChanged","labelChanged","parts","join","extra","scoreObject","categories","deletable","rest","Promise","resolve","normalizedQuestion","addCategoryEnabled","chartType","domain","graph","prompt","promptEnabled","range","rationale","title","rationaleEnabled","teacherInstructions","teacherInstructionsEnabled","studentNewCategoryDefaultLabel","language","extraCSSRules","correctInfo","base","size","showToggle","disabled","mode","correctedAnswer","showKeyLegend","role","outcome","empty","isEmpty","correctResponse","createCorrectResponseSession","id","getInnerText","html","replaceAll","getContent","replace","validate","config","correctData","errors","correctAnswerErrors","categoryErrors","field","required","category","identicalAnswer","some","c","i","categoriesError","isEqual","pick","identicalError"],"sources":["../src/index.js"],"sourcesContent":["import debug from 'debug';\nimport { isEmpty, isEqual, pick } from 'lodash-es';\nimport defaults from './defaults';\n\nimport { partialScoring } from '@pie-lib/controller-utils';\n\nconst log = debug('@pie-element:graphing:controller');\n\nconst lowerCase = (string) => (string || '').toLowerCase();\n\nexport const checkLabelsEquality = (givenAnswerLabel, correctAnswerLabel) =>\n lowerCase(givenAnswerLabel) === lowerCase(correctAnswerLabel);\n\nexport const setCorrectness = (answers, partialScoring) =>\n answers\n ? answers.map((answer) => ({\n ...answer,\n correctness: {\n value: partialScoring ? 'incorrect' : 'correct',\n label: partialScoring ? 'incorrect' : 'correct',\n },\n }))\n : [];\n\nexport const normalize = (question) => ({ ...defaults, ...question });\n\nexport const getScore = (question, session, env = {}) => {\n const { correctAnswer, data: initialData = [], scoringType } = question;\n let correctResponses = [];\n\n const isPartialScoring = partialScoring.enabled(\n { partialScoring: scoringType !== undefined ? scoringType === 'partial scoring' : scoringType },\n env,\n );\n\n const { data: correctAnswers = [] } = correctAnswer || {};\n const defaultAnswers = filterCategories(initialData);\n\n let answers = setCorrectness((session && session.answer) || defaultAnswers, isPartialScoring);\n\n let result = 0;\n\n if (isPartialScoring) {\n // if score type is \"partial scoring\"\n // maxScore is calculated based on the correct response\n // score is calculated based on the given response\n let maxScore = 0;\n let score = 0;\n\n const scoreForLabelAndValueEditable = (answer, corrAnswer) => {\n const { value, label, index } = answer;\n const valueIsCorrect = value === corrAnswer.value;\n const labelIsCorrect = checkLabelsEquality(label, corrAnswer.label);\n maxScore += 2;\n\n if (valueIsCorrect) {\n score += 1;\n answer.correctness.value = 'correct';\n }\n\n if (labelIsCorrect) {\n score += 1;\n answer.correctness.label = 'correct';\n }\n\n if (valueIsCorrect && labelIsCorrect) {\n correctResponses.push({ label: label, index: index });\n }\n };\n\n // if given answer has more categories than the correct answers, the \"extra\" will be ignored\n correctAnswers.forEach((corrAnswer, index) => {\n const defaultAnswer = defaultAnswers[index];\n const answer = answers[index];\n\n // if there is a corresponding category at the same position in the given answer\n if (answer) {\n // if there is a corresponding category at the same position in the default answer\n if (defaultAnswer) {\n // if category's label (in default answer) was not editable\n // it means that this category values only one point (only the value can be changed)\n if (!defaultAnswer.editable && answer.interactive) {\n maxScore += 1;\n\n if (answer.value === corrAnswer.value) {\n score += 1;\n answer.correctness.value = 'correct';\n correctResponses.push({ label: answer.label, index: index });\n }\n answer.correctness.label = 'correct';\n\n // if category's label (in default answer) was editable\n // it means that this category values 2 points (both label and value can be changed)\n } else if (defaultAnswer.editable && answer.interactive) {\n scoreForLabelAndValueEditable(answer, corrAnswer);\n } else if (!answer.interactive) {\n answer.correctness.value = 'correct';\n answer.correctness.label = 'correct';\n correctResponses.push({ label: answer.label, index: index });\n }\n } else {\n // if there is not a corresponding category at the same position in the default answer\n scoreForLabelAndValueEditable(answer, corrAnswer);\n }\n } else {\n // if there is not a corresponding category at the same position in the given answer\n // it means that the given answer has less categories than the correct answer\n maxScore += 2;\n }\n });\n\n result = maxScore ? score / maxScore : 0;\n } else {\n // all-or-nothing scoring: overall score is 1 only if lengths and all values/labels match\n result = correctAnswers.length === answers.length ? 1 : 0;\n\n // regardless of overall result, mark each answer individually for user feedback\n answers = answers.map((answer, index) => {\n const correctAnswer = correctAnswers[index];\n const valueIsCorrect = correctAnswer ? answer.value === correctAnswer.value : false;\n const labelIsCorrect = correctAnswer ? lowerCase(answer.label) === lowerCase(correctAnswer.label) : false;\n\n if (!valueIsCorrect || !labelIsCorrect) {\n result = 0;\n }\n\n if (valueIsCorrect && labelIsCorrect) {\n correctResponses.push({ label: answer.label, index });\n }\n\n return {\n ...answer,\n correctness: {\n value: valueIsCorrect ? 'correct' : 'incorrect',\n label: labelIsCorrect ? 'correct' : 'incorrect',\n },\n };\n });\n }\n\n const score = {\n score: parseFloat(result.toFixed(2)),\n answers,\n };\n\n if (env.extraProps && env.extraProps.correctResponseEnabled) {\n score.correctResponses = correctResponses;\n }\n\n return score;\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\n const { correctAnswer, data: initialData = [], scoringType } = model || {};\n const { data: correctAnswers = [] } = correctAnswer || {};\n const studentAnswers = (session && session.answer) || [];\n\n const isPartialScoring = partialScoring.enabled(\n { partialScoring: scoringType !== undefined ? scoringType === 'partial scoring' : scoringType },\n env\n );\n\n const defaultAnswers = filterCategories(initialData);\n const answers = studentAnswers.length > 0 ? filterCategories(studentAnswers) : defaultAnswers;\n\n if (!studentAnswers.length) {\n traceLog.push(`Student did not modify the chart. Initial chart is scored.`);\n }\n\n correctAnswers.forEach((correct, index) => {\n const initial = defaultAnswers[index];\n const student = answers[index];\n\n if (!student) {\n traceLog.push(`Category ${index + 1}: missing (expected value '${correct.value}', label '${correct.label}').`);\n return;\n }\n\n const valueCorrect = student.value === correct.value;\n const labelCorrect = checkLabelsEquality(student.label, correct.label);\n\n if (!student.interactive) {\n traceLog.push(`Category ${index + 1}: non-interactive category treated as correct.`);\n return;\n }\n\n if (studentAnswers.length > 0) {\n const valueChanged = initial ? student.value !== initial.value : true;\n const labelChanged = initial ? !checkLabelsEquality(student.label, initial.label) : true;\n\n if (!valueChanged && !labelChanged) {\n if (valueCorrect && labelCorrect) {\n traceLog.push(`Category ${index + 1}: unchanged from initial value and correct.`);\n } else {\n traceLog.push(`Category ${index + 1}: unchanged from initial value but incorrect.`);\n }\n return;\n }\n\n const parts = [];\n if (valueChanged) {\n parts.push(`value ${valueCorrect ? 'correct' : 'incorrect'}`);\n }\n if (labelChanged) {\n parts.push(`label ${labelCorrect ? 'correct' : 'incorrect'}`);\n }\n traceLog.push(`Category ${index + 1}: modified - ${parts.join(', ')}.`);\n } else {\n if (valueCorrect && labelCorrect) {\n traceLog.push(`Category ${index + 1}: initial values are correct.`);\n } else if (valueCorrect) {\n traceLog.push(`Category ${index + 1}: initial value correct, label incorrect.`);\n } else if (labelCorrect) {\n traceLog.push(`Category ${index + 1}: initial value incorrect, label correct.`);\n } else {\n traceLog.push(`Category ${index + 1}: initial value and label incorrect.`);\n }\n }\n });\n\n if (answers.length > correctAnswers.length) {\n const extra = answers.length - correctAnswers.length;\n traceLog.push(`${extra} extra category(ies) provided beyond expected number.`);\n }\n\n if (isPartialScoring) {\n traceLog.push('Score calculated using partial scoring.');\n traceLog.push('Student receives credit for each correct value and label independently.');\n } else {\n traceLog.push('Score calculated using all-or-nothing scoring.');\n traceLog.push('Student must match all category values and labels exactly for full credit.');\n }\n\n const scoreObject = getScore(model, session, env);\n traceLog.push(`Score: ${scoreObject.score}.`);\n\n return traceLog;\n};\n\n\n// eslint-disable-next-line no-unused-vars\nexport const filterCategories = (categories) => (categories ? categories.map(({ deletable, ...rest }) => rest) : []);\n\nexport function model(question, session, env) {\n return new Promise((resolve) => {\n const normalizedQuestion = normalize(question);\n const {\n addCategoryEnabled,\n chartType,\n data,\n domain,\n graph,\n prompt,\n promptEnabled,\n range,\n rationale,\n title,\n rationaleEnabled,\n teacherInstructions,\n teacherInstructionsEnabled,\n correctAnswer,\n scoringType,\n studentNewCategoryDefaultLabel,\n language,\n extraCSSRules,\n } = normalizedQuestion;\n\n const correctInfo = { correctness: 'incorrect', score: '0%' };\n\n const base = {\n addCategoryEnabled,\n chartType,\n data: filterCategories(data),\n domain,\n graph,\n prompt: promptEnabled ? prompt : null,\n range,\n rationale,\n title,\n size: graph,\n showToggle: false,\n correctness: correctInfo,\n disabled: env.mode !== 'gather',\n scoringType,\n studentNewCategoryDefaultLabel,\n language,\n env,\n extraCSSRules,\n };\n\n const scoreObject = getScore(normalizedQuestion, session, env);\n const answers = filterCategories(scoreObject.answers);\n\n if (env.mode === 'view') {\n // eslint-disable-next-line no-unused-vars\n base.correctedAnswer = answers.map(({ correctness, ...rest }) => {\n return { ...rest, interactive: false };\n });\n\n base.addCategoryEnabled = false;\n }\n\n if (env.mode === 'evaluate') {\n base.correctedAnswer = answers;\n base.correctAnswer = correctAnswer;\n base.showToggle = !!correctAnswer?.data?.length && scoreObject.score !== 1;\n base.addCategoryEnabled = false;\n base.showKeyLegend = true;\n }\n\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n base.rationale = rationaleEnabled ? rationale : null;\n base.teacherInstructions = teacherInstructionsEnabled ? teacherInstructions : null;\n } else {\n base.rationale = null;\n base.teacherInstructions = null;\n }\n\n log('base: ', base);\n resolve(base);\n });\n}\n\nexport function outcome(model, session, env) {\n return new Promise((resolve) => {\n const traceLog = getLogTrace(model, session, env);\n const scoreObject = getScore(model, session, env);\n \n const result = {\n score: scoreObject.score,\n empty: !session || isEmpty(session),\n traceLog\n };\n \n if (env.extraProps && env.extraProps.correctResponseEnabled) {\n result.extraProps = { correctResponse: scoreObject.correctResponses };\n }\n \n resolve(result);\n });\n}\n\nexport const createCorrectResponseSession = (question, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n const { correctAnswer } = question;\n\n let answers = correctAnswer && correctAnswer.data;\n\n // for IBX preview mode\n if (env.mode === 'gather') {\n const { data } = question;\n\n answers = ((correctAnswer && correctAnswer.data) || []).map((answer, index) => {\n return {\n ...data[index],\n ...answer,\n };\n });\n }\n\n resolve({\n answer: answers,\n id: '1',\n });\n } else {\n return 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 { correctAnswer, data } = model || {};\n const { data: correctData } = correctAnswer || {};\n const categories = correctData || [];\n\n const errors = {};\n const correctAnswerErrors = {};\n const categoryErrors = {};\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 categories.forEach((category, index) => {\n const { label } = category;\n\n if (!getInnerText(label)) {\n categoryErrors[index] = 'Content should not be empty. ';\n } else {\n const identicalAnswer = categories.some((c, i) => c.label === label && index !== i);\n\n if (identicalAnswer) {\n categoryErrors[index] = 'Category names should be unique. ';\n }\n }\n });\n\n if (categories.length < 1 || categories.length > 20) {\n correctAnswerErrors.categoriesError = 'The correct answer should include between 1 and 20 categories.';\n } else if (\n isEqual(\n data.map((category) => pick(category, 'value', 'label')),\n correctData.map((category) => pick(category, 'value', 'label')),\n )\n ) {\n correctAnswerErrors.identicalError = 'Correct answer should not be identical to the chart’s initial state';\n }\n\n if (!isEmpty(categoryErrors)) {\n errors.categoryErrors = categoryErrors;\n }\n\n if (!isEmpty(correctAnswerErrors)) {\n errors.correctAnswerErrors = correctAnswerErrors;\n }\n\n return errors;\n};\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,IAAAG,gBAAA,GAAAH,OAAA;AAEA,MAAMI,GAAG,GAAG,IAAAC,cAAK,EAAC,kCAAkC,CAAC;AAErD,MAAMC,SAAS,GAAIC,MAAM,IAAK,CAACA,MAAM,IAAI,EAAE,EAAEC,WAAW,CAAC,CAAC;AAEnD,MAAMC,mBAAmB,GAAGA,CAACC,gBAAgB,EAAEC,kBAAkB,KACtEL,SAAS,CAACI,gBAAgB,CAAC,KAAKJ,SAAS,CA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AG,EAAE,EAAE;IACnDiE,mBAAmB,CAACS,eAAe,GAAG,gEAAgE;EACxG,CAAC,MAAM,IACL,IAAAC,iBAAO,EACLlG,IAAI,CAACZ,GAAG,CAAEwG,QAAQ,IAAK,IAAAO,cAAI,EAACP,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,EACxDN,WAAW,CAAClG,GAAG,CAAEwG,QAAQ,IAAK,IAAAO,cAAI,EAACP,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,CAChE,CAAC,EACD;IACAJ,mBAAmB,CAACY,cAAc,GAAG,qEAAqE;EAC5G;EAEA,IAAI,CAAC,IAAAzB,iBAAO,EAACc,cAAc,CAAC,EAAE;IAC5BF,MAAM,CAACE,cAAc,GAAGA,cAAc;EACxC;EAEA,IAAI,CAAC,IAAAd,iBAAO,EAACa,mBAAmB,CAAC,EAAE;IACjCD,MAAM,CAACC,mBAAmB,GAAGA,mBAAmB;EAClD;EAEA,OAAOD,MAAM;AACf,CAAC;AAACvG,OAAA,CAAAoG,QAAA,GAAAA,QAAA","ignoreList":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pie-element/charting-controller",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "8.1.0",
|
|
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
|
+
"debug": "^4.1.1",
|
|
14
|
+
"lodash-es": "^4.17.23"
|
|
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
|
+
}
|