@pie-element/ebsr 14.2.1-next.2 → 14.2.1-next.31
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 +1547 -0
- package/CHANGELOG.md +2281 -0
- package/LICENSE.md +5 -0
- package/README.md +62 -0
- package/configure/CHANGELOG.json +992 -0
- package/configure/CHANGELOG.md +2144 -0
- package/configure/lib/defaults.js +229 -0
- package/configure/lib/defaults.js.map +1 -0
- package/configure/lib/index.js +155 -0
- package/configure/lib/index.js.map +1 -0
- package/configure/lib/main.js +222 -0
- package/configure/lib/main.js.map +1 -0
- package/configure/package.json +23 -0
- package/configure/src/__tests__/index.test.js +492 -0
- package/configure/src/defaults.js +173 -0
- package/configure/src/index.js +175 -0
- package/configure/src/main.jsx +235 -0
- package/controller/CHANGELOG.json +552 -0
- package/controller/CHANGELOG.md +1282 -0
- package/controller/lib/defaults.js +31 -0
- package/controller/lib/defaults.js.map +1 -0
- package/controller/lib/index.js +448 -0
- package/controller/lib/index.js.map +1 -0
- package/controller/lib/utils.js +18 -0
- package/controller/lib/utils.js.map +1 -0
- package/controller/package.json +18 -0
- package/controller/src/__tests__/index.test.js +591 -0
- package/controller/src/__tests__/utils.test.js +48 -0
- package/controller/src/defaults.js +25 -0
- package/controller/src/index.js +442 -0
- package/controller/src/utils.js +18 -0
- package/docs/config-schema.json +5787 -0
- package/docs/config-schema.json.md +4278 -0
- package/docs/demo/config.js +8 -0
- package/docs/demo/generate.js +52 -0
- package/docs/demo/index.html +2 -0
- package/docs/demo/session.js +14 -0
- package/docs/pie-schema.json +2911 -0
- package/docs/pie-schema.json.md +2142 -0
- package/ebsr.png +0 -0
- package/lib/index.js +207 -0
- package/lib/index.js.map +1 -0
- package/lib/print.js +186 -0
- package/lib/print.js.map +1 -0
- package/module/configure.js +1 -0
- package/module/controller.js +5664 -0
- package/module/demo.js +77 -0
- package/module/element.js +1 -0
- package/module/index.html +21 -0
- package/module/manifest.json +14 -0
- package/module/print-demo.js +115 -0
- package/module/print.html +18 -0
- package/module/print.js +1 -0
- package/package.json +17 -56
- package/src/__tests__/index.test.js +129 -0
- package/src/index.js +222 -0
- package/src/print.js +207 -0
- package/dist/author/defaults.d.ts +0 -66
- package/dist/author/defaults.js +0 -161
- package/dist/author/index.d.ts +0 -34
- package/dist/author/index.js +0 -78
- package/dist/author/main.d.ts +0 -22
- package/dist/author/main.js +0 -121
- package/dist/controller/defaults.d.ts +0 -15
- package/dist/controller/defaults.js +0 -26
- package/dist/controller/index.d.ts +0 -42
- package/dist/controller/index.js +0 -186
- package/dist/controller/utils.d.ts +0 -10
- package/dist/controller/utils.js +0 -8
- package/dist/delivery/index.d.ts +0 -26
- package/dist/delivery/index.js +0 -132
- package/dist/index.d.ts +0 -1
- package/dist/index.iife.d.ts +0 -8
- package/dist/index.iife.js +0 -165
- 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/_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/_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/_baseRest.js +0 -9
- 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/_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/_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/_isIndex.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIterateeCall.js +0 -12
- 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/defaults.js +0 -16
- 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/get.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/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
- package/dist/print/index.d.ts +0 -25
- package/dist/print/index.js +0 -107
package/dist/author/defaults.js
DELETED
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import e from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js";
|
|
2
|
-
//#region src/author/defaults.ts
|
|
3
|
-
var t = {
|
|
4
|
-
addChoiceButton: {
|
|
5
|
-
settings: !0,
|
|
6
|
-
label: "Add a Choice"
|
|
7
|
-
},
|
|
8
|
-
choiceMode: {
|
|
9
|
-
settings: !0,
|
|
10
|
-
label: "Response Type"
|
|
11
|
-
},
|
|
12
|
-
choicePrefix: {
|
|
13
|
-
settings: !0,
|
|
14
|
-
label: "Choice Labels"
|
|
15
|
-
},
|
|
16
|
-
deleteChoice: { settings: !0 },
|
|
17
|
-
feedback: {
|
|
18
|
-
settings: !0,
|
|
19
|
-
label: "Feedback"
|
|
20
|
-
},
|
|
21
|
-
lockChoiceOrder: {
|
|
22
|
-
settings: !0,
|
|
23
|
-
label: "Lock Choice Order"
|
|
24
|
-
},
|
|
25
|
-
prompt: {
|
|
26
|
-
settings: !0,
|
|
27
|
-
label: "Prompt",
|
|
28
|
-
inputConfiguration: {
|
|
29
|
-
audio: { disabled: !1 },
|
|
30
|
-
video: { disabled: !1 },
|
|
31
|
-
image: { disabled: !1 }
|
|
32
|
-
},
|
|
33
|
-
required: !1
|
|
34
|
-
},
|
|
35
|
-
rationale: {
|
|
36
|
-
settings: !0,
|
|
37
|
-
label: "Rationale",
|
|
38
|
-
inputConfiguration: {
|
|
39
|
-
audio: { disabled: !1 },
|
|
40
|
-
video: { disabled: !1 },
|
|
41
|
-
image: { disabled: !1 }
|
|
42
|
-
},
|
|
43
|
-
required: !1
|
|
44
|
-
},
|
|
45
|
-
settingsPanelDisabled: !0,
|
|
46
|
-
studentInstructions: {
|
|
47
|
-
settings: !1,
|
|
48
|
-
label: "Student Instructions"
|
|
49
|
-
},
|
|
50
|
-
teacherInstructions: {
|
|
51
|
-
settings: !0,
|
|
52
|
-
label: "Teacher Instructions",
|
|
53
|
-
inputConfiguration: {
|
|
54
|
-
audio: { disabled: !1 },
|
|
55
|
-
video: { disabled: !1 },
|
|
56
|
-
image: { disabled: !1 }
|
|
57
|
-
},
|
|
58
|
-
required: !1
|
|
59
|
-
},
|
|
60
|
-
choicesLayout: {
|
|
61
|
-
settings: !1,
|
|
62
|
-
label: "Choices Layout"
|
|
63
|
-
},
|
|
64
|
-
gridColumns: { label: "Grid columns" },
|
|
65
|
-
spellCheck: {
|
|
66
|
-
label: "Spellcheck",
|
|
67
|
-
settings: !1,
|
|
68
|
-
enabled: !0
|
|
69
|
-
},
|
|
70
|
-
maxImageWidth: {
|
|
71
|
-
teacherInstructions: 300,
|
|
72
|
-
prompt: 300,
|
|
73
|
-
rationale: 636,
|
|
74
|
-
choices: 636
|
|
75
|
-
},
|
|
76
|
-
maxImageHeight: {
|
|
77
|
-
teacherInstructions: 300,
|
|
78
|
-
prompt: 300,
|
|
79
|
-
rationale: 300,
|
|
80
|
-
choices: 300
|
|
81
|
-
},
|
|
82
|
-
mathMlOptions: {
|
|
83
|
-
mmlOutput: !1,
|
|
84
|
-
mmlEditing: !1
|
|
85
|
-
},
|
|
86
|
-
choices: { inputConfiguration: {
|
|
87
|
-
audio: { disabled: !1 },
|
|
88
|
-
video: { disabled: !1 },
|
|
89
|
-
image: { disabled: !1 }
|
|
90
|
-
} },
|
|
91
|
-
baseInputConfiguration: {
|
|
92
|
-
h3: { disabled: !0 },
|
|
93
|
-
audio: { disabled: !1 },
|
|
94
|
-
video: { disabled: !1 },
|
|
95
|
-
image: { disabled: !1 },
|
|
96
|
-
textAlign: { disabled: !0 },
|
|
97
|
-
showParagraphs: { disabled: !1 },
|
|
98
|
-
separateParagraphs: { disabled: !0 }
|
|
99
|
-
}
|
|
100
|
-
}, n = (e) => ({
|
|
101
|
-
choiceMode: "radio",
|
|
102
|
-
choicePrefix: "letters",
|
|
103
|
-
choices: [],
|
|
104
|
-
choicesLayout: "vertical",
|
|
105
|
-
feedbackEnabled: !1,
|
|
106
|
-
gridColumns: 2,
|
|
107
|
-
prompt: "",
|
|
108
|
-
promptEnabled: !0,
|
|
109
|
-
rationale: "",
|
|
110
|
-
rationaleEnabled: !0,
|
|
111
|
-
spellCheckEnabled: !0,
|
|
112
|
-
studentInstructionsEnabled: !0,
|
|
113
|
-
teacherInstructions: "",
|
|
114
|
-
teacherInstructionsEnabled: !0,
|
|
115
|
-
toolbarEditorPosition: "bottom",
|
|
116
|
-
...e
|
|
117
|
-
}), r = {
|
|
118
|
-
model: {
|
|
119
|
-
partLabels: !1,
|
|
120
|
-
partLabelType: "Letters",
|
|
121
|
-
partA: n(),
|
|
122
|
-
partB: n()
|
|
123
|
-
},
|
|
124
|
-
configuration: {
|
|
125
|
-
baseInputConfiguration: {
|
|
126
|
-
h3: { disabled: !0 },
|
|
127
|
-
audio: { disabled: !1 },
|
|
128
|
-
video: { disabled: !1 },
|
|
129
|
-
image: { disabled: !1 },
|
|
130
|
-
textAlign: { disabled: !0 },
|
|
131
|
-
showParagraphs: { disabled: !1 },
|
|
132
|
-
separateParagraphs: { disabled: !0 }
|
|
133
|
-
},
|
|
134
|
-
partialScoring: {
|
|
135
|
-
label: "Allow Partial Scoring",
|
|
136
|
-
settings: !1
|
|
137
|
-
},
|
|
138
|
-
scoringType: {
|
|
139
|
-
settings: !1,
|
|
140
|
-
label: "Scoring Type"
|
|
141
|
-
},
|
|
142
|
-
partA: e(t),
|
|
143
|
-
partB: e(t),
|
|
144
|
-
partLabels: {
|
|
145
|
-
settings: !0,
|
|
146
|
-
label: "Part Labels"
|
|
147
|
-
},
|
|
148
|
-
settingsPanelDisabled: !1,
|
|
149
|
-
language: {
|
|
150
|
-
settings: !1,
|
|
151
|
-
label: "Specify Language",
|
|
152
|
-
enabled: !1
|
|
153
|
-
},
|
|
154
|
-
languageChoices: {
|
|
155
|
-
label: "Language Choices",
|
|
156
|
-
options: []
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
//#endregion
|
|
161
|
-
export { r as default };
|
package/dist/author/index.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/ebsr/configure/src/index.js
|
|
3
|
-
* @auto-generated
|
|
4
|
-
*
|
|
5
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
-
* Manual edits will be overwritten on next sync.
|
|
7
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
-
*/
|
|
9
|
-
export default class EbsrConfigure extends HTMLElement {
|
|
10
|
-
static createDefaultModel: ({ partA, partB, ...model }?: {
|
|
11
|
-
partA?: {} | undefined;
|
|
12
|
-
partB?: {} | undefined;
|
|
13
|
-
}, defaults?: {
|
|
14
|
-
partLabels: boolean;
|
|
15
|
-
partLabelType: string;
|
|
16
|
-
partA: any;
|
|
17
|
-
partB: any;
|
|
18
|
-
}) => {
|
|
19
|
-
partA: any;
|
|
20
|
-
partB: any;
|
|
21
|
-
partLabels: boolean;
|
|
22
|
-
partLabelType: string;
|
|
23
|
-
};
|
|
24
|
-
constructor();
|
|
25
|
-
set model(m: any);
|
|
26
|
-
dispatchModelUpdated(reset: any): void;
|
|
27
|
-
onModelChanged: any;
|
|
28
|
-
set configuration(c: any);
|
|
29
|
-
onConfigurationChanged(c: any): void;
|
|
30
|
-
onModelUpdated: any;
|
|
31
|
-
connectedCallback(): void;
|
|
32
|
-
_render(): void;
|
|
33
|
-
disconnectedCallback(): void;
|
|
34
|
-
}
|
package/dist/author/index.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import e from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/defaults.js";
|
|
2
|
-
import t from "./main.js";
|
|
3
|
-
import n from "./defaults.js";
|
|
4
|
-
import r from "react";
|
|
5
|
-
import { createRoot as i } from "react-dom/client";
|
|
6
|
-
import { ModelUpdatedEvent as a } from "@pie-element/shared-configure-events";
|
|
7
|
-
import o from "@pie-element/multiple-choice/author";
|
|
8
|
-
//#region src/author/index.ts
|
|
9
|
-
var s = a.TYPE, c = "ebsr-multiple-choice-configure", l = class extends o {};
|
|
10
|
-
customElements.get(c) || customElements.define(c, l);
|
|
11
|
-
var u = (t, r) => ({
|
|
12
|
-
configuration: e(t, n.configuration),
|
|
13
|
-
model: r
|
|
14
|
-
}), { model: d } = n || {}, f = class e extends HTMLElement {
|
|
15
|
-
static createDefaultModel = ({ partA: e = {}, partB: t = {}, ...n } = {}, r = d) => ({
|
|
16
|
-
...r,
|
|
17
|
-
...n,
|
|
18
|
-
partA: {
|
|
19
|
-
...r.partA,
|
|
20
|
-
...e,
|
|
21
|
-
choicesLayout: e.choicesLayout || e.verticalMode === !1 && "horizontal" || r.partA.choicesLayout
|
|
22
|
-
},
|
|
23
|
-
partB: {
|
|
24
|
-
...r.partB,
|
|
25
|
-
...t,
|
|
26
|
-
choicesLayout: t.choicesLayout || t.verticalMode === !1 && "horizontal" || r.partB.choicesLayout
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
constructor() {
|
|
30
|
-
super(), this._root = null, this._model = e.createDefaultModel(), this._configuration = n.configuration, this.onConfigurationChanged = this.onConfigurationChanged.bind(this);
|
|
31
|
-
}
|
|
32
|
-
set model(t) {
|
|
33
|
-
this._model = e.createDefaultModel(t, this._model), this._render();
|
|
34
|
-
}
|
|
35
|
-
dispatchModelUpdated(e) {
|
|
36
|
-
let t = !!e;
|
|
37
|
-
this.dispatchEvent(new a(this._model, t));
|
|
38
|
-
}
|
|
39
|
-
onModelChanged = (t, n) => {
|
|
40
|
-
this._model = e.createDefaultModel(t, this._model), this.dispatchModelUpdated(n), this._render();
|
|
41
|
-
};
|
|
42
|
-
set configuration(e) {
|
|
43
|
-
let t = u(e, this._model), r = {
|
|
44
|
-
...n.configuration,
|
|
45
|
-
...t.configuration
|
|
46
|
-
};
|
|
47
|
-
this._configuration = r, r?.language?.enabled ? r?.languageChoices?.options?.length && (this._model.language = r?.languageChoices.options[0].value) : r.language.settings && this._model.language ? (this._configuration.language.enabled = !0, (!this._configuration.languageChoices.options || !this._configuration.languageChoices.options.length) && (this._configuration.languageChoices.options = []), this._configuration.languageChoices.options.find((e) => e.value === this._model.language) || this._configuration.languageChoices.options.push({
|
|
48
|
-
value: this._model.language,
|
|
49
|
-
label: this._model.language
|
|
50
|
-
})) : delete this._model.language, this._render();
|
|
51
|
-
}
|
|
52
|
-
onConfigurationChanged(e) {
|
|
53
|
-
this._configuration = u(e, this._model).configuration, this._model && this.onModelChanged(this._model), this._render();
|
|
54
|
-
}
|
|
55
|
-
onModelUpdated = (e) => {
|
|
56
|
-
if (e.target === this) return;
|
|
57
|
-
e.preventDefault(), e.stopImmediatePropagation();
|
|
58
|
-
let t = e.target && e.target.getAttribute("id");
|
|
59
|
-
t && (e.update && (this._model[`part${t}`] = e.update), this.dispatchEvent(new a(this._model)));
|
|
60
|
-
};
|
|
61
|
-
connectedCallback() {
|
|
62
|
-
this.addEventListener(s, this.onModelUpdated), this._render();
|
|
63
|
-
}
|
|
64
|
-
_render() {
|
|
65
|
-
let e = r.createElement(t, {
|
|
66
|
-
model: this._model,
|
|
67
|
-
configuration: this._configuration,
|
|
68
|
-
onModelChanged: this.onModelChanged,
|
|
69
|
-
onConfigurationChanged: this.onConfigurationChanged
|
|
70
|
-
});
|
|
71
|
-
this._root ||= i(this), this._root.render(e);
|
|
72
|
-
}
|
|
73
|
-
disconnectedCallback() {
|
|
74
|
-
this.removeEventListener(s, this.onModelUpdated), this._root && this._root.unmount();
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
//#endregion
|
|
78
|
-
export { f as default };
|
package/dist/author/main.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/ebsr/configure/src/main.jsx
|
|
3
|
-
* @auto-generated
|
|
4
|
-
*
|
|
5
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
-
* Manual edits will be overwritten on next sync.
|
|
7
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
-
*/
|
|
9
|
-
import React from 'react';
|
|
10
|
-
import PropTypes from 'prop-types';
|
|
11
|
-
export declare class Main extends React.Component {
|
|
12
|
-
static propTypes: {
|
|
13
|
-
configuration: PropTypes.Requireable<object>;
|
|
14
|
-
model: PropTypes.Requireable<object>;
|
|
15
|
-
onModelChanged: PropTypes.Requireable<(...args: any[]) => any>;
|
|
16
|
-
onConfigurationChanged: PropTypes.Requireable<(...args: any[]) => any>;
|
|
17
|
-
};
|
|
18
|
-
removeExtraChoices: any;
|
|
19
|
-
onModelChanged: any;
|
|
20
|
-
render(): React.JSX.Element;
|
|
21
|
-
}
|
|
22
|
-
export default Main;
|
package/dist/author/main.js
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import e from "react";
|
|
2
|
-
import t from "prop-types";
|
|
3
|
-
import { layout as n, settings as r } from "@pie-lib/config-ui";
|
|
4
|
-
import { styled as i } from "@mui/material/styles";
|
|
5
|
-
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
-
//#region src/author/main.tsx
|
|
7
|
-
var { Panel: s, toggle: c, radio: l, dropdown: u } = r, d = i("div")(({ theme: e }) => ({ paddingBottom: e.spacing(2) })), f = i("div")(({ theme: e }) => ({
|
|
8
|
-
flex: 1,
|
|
9
|
-
height: e.spacing(2.5)
|
|
10
|
-
})), p = class extends e.Component {
|
|
11
|
-
static propTypes = {
|
|
12
|
-
configuration: t.object,
|
|
13
|
-
model: t.object,
|
|
14
|
-
onModelChanged: t.func,
|
|
15
|
-
onConfigurationChanged: t.func
|
|
16
|
-
};
|
|
17
|
-
removeExtraChoices = (e) => {
|
|
18
|
-
let t = !1;
|
|
19
|
-
return (e || []).map((e) => t ? (e.correct = !1, e) : (e.correct && (t = !0), e));
|
|
20
|
-
};
|
|
21
|
-
onModelChanged = (e, t) => {
|
|
22
|
-
let { onModelChanged: n } = this.props;
|
|
23
|
-
return t === "partA.choiceMode" && e.partA.choiceMode === "radio" ? (e.partA.choices = this.removeExtraChoices(e.partA.choices), n(e, !0)) : t === "partB.choiceMode" && e.partB.choiceMode === "radio" ? (e.partB.choices = this.removeExtraChoices(e.partB.choices), n(e, !0)) : n(e);
|
|
24
|
-
};
|
|
25
|
-
render() {
|
|
26
|
-
let { model: e, configuration: t, onConfigurationChanged: r } = this.props, { partLabelType: i, partA: p, partB: m, extraCSSRules: h } = e, { contentDimensions: g = {}, partA: _ = {}, partB: v = {}, partialScoring: y = {}, settingsPanelDisabled: b, scoringType: x = {}, language: S = {}, languageChoices: C = {}, ...w } = t, { feedback: T = {}, choiceMode: E = {}, choicePrefix: D = {}, lockChoiceOrder: O = {}, prompt: k = {}, teacherInstructions: A = {}, studentInstructions: j = {}, choicesLayout: M = {}, gridColumns: N = {}, rationale: P = {}, spellCheck: F = {} } = _ || {}, { feedback: I = {}, choiceMode: L = {}, choicePrefix: R = {}, lockChoiceOrder: z = {}, prompt: B = {}, teacherInstructions: V = {}, studentInstructions: H = {}, choicesLayout: U = {}, gridColumns: W = {}, rationale: G = {}, spellCheck: K = {} } = v || {}, q = (i || "Numbers") === "Numbers", J = `Part ${q ? "1" : "A"}`, Y = `Part ${q ? "2" : "B"}`, X = {
|
|
27
|
-
partA: p.choices && p.choices.length ? Array.from({ length: p.choices.length }, (e, t) => `${t + 1}`) : [],
|
|
28
|
-
partB: m.choices && m.choices.length ? Array.from({ length: m.choices.length }, (e, t) => `${t + 1}`) : []
|
|
29
|
-
}, Z = {
|
|
30
|
-
partLabels: w.partLabels.settings && c(w.partLabels.label),
|
|
31
|
-
partLabelType: e.partLabels && u("", ["Numbers", "Letters"]),
|
|
32
|
-
partialScoring: y.settings && c(y.label),
|
|
33
|
-
scoringType: x.settings && l(x.label, ["auto", "rubric"]),
|
|
34
|
-
"language.enabled": S.settings && c(S.label, !0),
|
|
35
|
-
language: S.settings && S.enabled && u(C.label, C.options)
|
|
36
|
-
}, Q = {
|
|
37
|
-
"partA.choiceMode": E.settings && l(E.label, ["checkbox", "radio"]),
|
|
38
|
-
"partA.choicePrefix": D.settings && l(D.label, ["numbers", "letters"]),
|
|
39
|
-
"partA.lockChoiceOrder": O.settings && c(O.label),
|
|
40
|
-
"partA.choicesLayout": M.settings && u(M.label, [
|
|
41
|
-
"vertical",
|
|
42
|
-
"grid",
|
|
43
|
-
"horizontal"
|
|
44
|
-
]),
|
|
45
|
-
"partA.gridColumns": M.settings && p.choicesLayout === "grid" && X.partA.length > 0 && u(N.label, X.partA)
|
|
46
|
-
}, $ = {
|
|
47
|
-
"partA.feedbackEnabled": T.settings && c(T.label),
|
|
48
|
-
"partA.promptEnabled": k.settings && c(k.label),
|
|
49
|
-
"partA.teacherInstructionsEnabled": A.settings && c(A.label),
|
|
50
|
-
"partA.studentInstructionsEnabled": j.settings && c(j.label),
|
|
51
|
-
"partA.rationaleEnabled": P.settings && c(P.label),
|
|
52
|
-
"partA.spellCheckEnabled": F.settings && c(F.label)
|
|
53
|
-
}, ee = {
|
|
54
|
-
"partB.choiceMode": L.settings && l(L.label, ["checkbox", "radio"]),
|
|
55
|
-
"partB.choicePrefix": R.settings && l(R.label, ["numbers", "letters"]),
|
|
56
|
-
"partB.lockChoiceOrder": z.settings && c(z.label),
|
|
57
|
-
"partB.choicesLayout": U.settings && u(U.label, [
|
|
58
|
-
"vertical",
|
|
59
|
-
"grid",
|
|
60
|
-
"horizontal"
|
|
61
|
-
]),
|
|
62
|
-
"partB.gridColumns": U.settings && m.choicesLayout === "grid" && X.partB.length > 0 && u(W.label, X.partB)
|
|
63
|
-
}, te = {
|
|
64
|
-
"partB.feedbackEnabled": I.settings && c(I.label),
|
|
65
|
-
"partB.promptEnabled": B.settings && c(B.label),
|
|
66
|
-
"partB.teacherInstructionsEnabled": V.settings && c(V.label),
|
|
67
|
-
"partB.studentInstructionsEnabled": H.settings && c(H.label),
|
|
68
|
-
"partB.rationaleEnabled": G.settings && c(G.label),
|
|
69
|
-
"partB.spellCheckEnabled": K.settings && c(K.label)
|
|
70
|
-
};
|
|
71
|
-
return /* @__PURE__ */ o(n.ConfigLayout, {
|
|
72
|
-
extraCSSRules: h,
|
|
73
|
-
dimensions: g,
|
|
74
|
-
hideSettings: b,
|
|
75
|
-
settings: /* @__PURE__ */ a(s, {
|
|
76
|
-
model: e,
|
|
77
|
-
onChangeModel: this.onModelChanged,
|
|
78
|
-
configuration: t,
|
|
79
|
-
onChangeConfiguration: r,
|
|
80
|
-
groups: {
|
|
81
|
-
"Settings for both": Z,
|
|
82
|
-
[`Settings ${J}`]: Q,
|
|
83
|
-
[`Properties ${J}`]: $,
|
|
84
|
-
[`Settings ${Y}`]: ee,
|
|
85
|
-
[`Properties ${Y}`]: te
|
|
86
|
-
}
|
|
87
|
-
}),
|
|
88
|
-
children: [
|
|
89
|
-
e.partLabels && /* @__PURE__ */ a(d, { children: J }),
|
|
90
|
-
/* @__PURE__ */ a("ebsr-multiple-choice-configure", {
|
|
91
|
-
id: "A",
|
|
92
|
-
ref: (e) => {
|
|
93
|
-
e && (this.partA = e, this.partA._model = {
|
|
94
|
-
...this.props.model.partA,
|
|
95
|
-
errors: this.props.model.errors && this.props.model.errors.partA || {}
|
|
96
|
-
}, this.partA.configuration = {
|
|
97
|
-
..._,
|
|
98
|
-
...w
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
}, "partA"),
|
|
102
|
-
/* @__PURE__ */ a(f, {}),
|
|
103
|
-
e.partLabels && /* @__PURE__ */ a(d, { children: Y }),
|
|
104
|
-
/* @__PURE__ */ a("ebsr-multiple-choice-configure", {
|
|
105
|
-
id: "B",
|
|
106
|
-
ref: (e) => {
|
|
107
|
-
e && (this.partB = e, this.partB._model = {
|
|
108
|
-
...this.props.model.partB,
|
|
109
|
-
errors: this.props.model.errors && this.props.model.errors.partB || {}
|
|
110
|
-
}, this.partB.configuration = {
|
|
111
|
-
...v,
|
|
112
|
-
...w
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
}, "partB")
|
|
116
|
-
]
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
//#endregion
|
|
121
|
-
export { p as default };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/ebsr/controller/src/defaults.js
|
|
3
|
-
* @auto-generated
|
|
4
|
-
*
|
|
5
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
-
* Manual edits will be overwritten on next sync.
|
|
7
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
-
*/
|
|
9
|
-
declare const _default: {
|
|
10
|
-
partLabels: boolean;
|
|
11
|
-
partLabelType: string;
|
|
12
|
-
partA: any;
|
|
13
|
-
partB: any;
|
|
14
|
-
};
|
|
15
|
-
export default _default;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
//#region src/controller/defaults.ts
|
|
2
|
-
var e = (e) => ({
|
|
3
|
-
choiceMode: "radio",
|
|
4
|
-
choicePrefix: "letters",
|
|
5
|
-
choices: [],
|
|
6
|
-
choicesLayout: "vertical",
|
|
7
|
-
feedbackEnabled: !1,
|
|
8
|
-
gridColumns: 2,
|
|
9
|
-
prompt: "",
|
|
10
|
-
promptEnabled: !0,
|
|
11
|
-
rationale: "",
|
|
12
|
-
rationaleEnabled: !0,
|
|
13
|
-
spellCheckEnabled: !0,
|
|
14
|
-
studentInstructionsEnabled: !0,
|
|
15
|
-
teacherInstructions: "",
|
|
16
|
-
teacherInstructionsEnabled: !0,
|
|
17
|
-
toolbarEditorPosition: "bottom",
|
|
18
|
-
...e
|
|
19
|
-
}), t = {
|
|
20
|
-
partLabels: !0,
|
|
21
|
-
partLabelType: "Letters",
|
|
22
|
-
partA: e(),
|
|
23
|
-
partB: e()
|
|
24
|
-
};
|
|
25
|
-
//#endregion
|
|
26
|
-
export { t as default };
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/ebsr/controller/src/index.js
|
|
3
|
-
* @auto-generated
|
|
4
|
-
*
|
|
5
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
-
* Manual edits will be overwritten on next sync.
|
|
7
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
-
*/
|
|
9
|
-
export declare const normalize: ({ partA, partB, language, ...question }: {
|
|
10
|
-
[x: string]: any;
|
|
11
|
-
partA?: {} | undefined;
|
|
12
|
-
partB?: {} | undefined;
|
|
13
|
-
language: any;
|
|
14
|
-
}) => {
|
|
15
|
-
partA: any;
|
|
16
|
-
partB: any;
|
|
17
|
-
partLabels: boolean;
|
|
18
|
-
partLabelType: string;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
*
|
|
22
|
-
* @param {*} question
|
|
23
|
-
* @param {*} session
|
|
24
|
-
* @param {*} env
|
|
25
|
-
* @param {*} updateSession - optional - a function that will set the properties passed into it on the session.
|
|
26
|
-
*/
|
|
27
|
-
export declare function model(question: any, session: any, env: any, updateSession: any): Promise<unknown>;
|
|
28
|
-
export declare const createDefaultModel: (model?: {}) => Promise<unknown>;
|
|
29
|
-
/**
|
|
30
|
-
* Generates detailed trace log for math-templated scoring evaluation
|
|
31
|
-
* @param {Object} question
|
|
32
|
-
* @param {Object} session
|
|
33
|
-
* @param {Object} env
|
|
34
|
-
* @returns {Array<string>} traceLog
|
|
35
|
-
*/
|
|
36
|
-
export declare const getLogTrace: (question: any, session: any, env: any) => string[];
|
|
37
|
-
export declare function outcome(config: any, session: any, env: any): Promise<unknown>;
|
|
38
|
-
export declare const createCorrectResponseSession: (question: any, env: any) => Promise<unknown>;
|
|
39
|
-
export declare const validate: (model?: {}, config?: {}) => {
|
|
40
|
-
partA: {};
|
|
41
|
-
partB: {};
|
|
42
|
-
};
|
package/dist/controller/index.js
DELETED
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
import e from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/get.js";
|
|
2
|
-
import t from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js";
|
|
3
|
-
import n from "./defaults.js";
|
|
4
|
-
import { isResponseCorrect as r } from "./utils.js";
|
|
5
|
-
import { getShuffledChoices as i, lockChoices as a, partialScoring as o } from "@pie-element/shared-controller-utils";
|
|
6
|
-
import s from "@pie-lib/translator";
|
|
7
|
-
//#region src/controller/index.ts
|
|
8
|
-
var { translator: c } = s, l = (e, t, n) => (r) => {
|
|
9
|
-
let i = {
|
|
10
|
-
label: r.label,
|
|
11
|
-
value: r.value
|
|
12
|
-
};
|
|
13
|
-
if (t.role === "instructor" && (t.mode === "view" || t.mode === "evaluate") ? i.rationale = e.rationaleEnabled ? r.rationale : null : i.rationale = null, t.mode === "evaluate" && (i.correct = !!r.correct, e.feedbackEnabled)) {
|
|
14
|
-
let e = r.feedback && r.feedback.type || "none";
|
|
15
|
-
e === "default" ? i.feedback = n[r.correct ? "correct" : "incorrect"] : e === "custom" && (i.feedback = r.feedback.value);
|
|
16
|
-
}
|
|
17
|
-
return i;
|
|
18
|
-
}, u = (e, t, n, i) => {
|
|
19
|
-
let a = Object.assign({
|
|
20
|
-
correct: "Correct",
|
|
21
|
-
incorrect: "Incorrect"
|
|
22
|
-
}, e.defaultFeedback), o = e.choices ? e.choices.map(l(e, i, a)) : [];
|
|
23
|
-
return {
|
|
24
|
-
...e,
|
|
25
|
-
choices: o,
|
|
26
|
-
disabled: i.mode !== "gather",
|
|
27
|
-
complete: { min: e.choices.filter((e) => e.correct).length },
|
|
28
|
-
responseCorrect: i.mode === "evaluate" ? r(e, t, n) : void 0
|
|
29
|
-
};
|
|
30
|
-
}, d = (e, t) => ({
|
|
31
|
-
...t,
|
|
32
|
-
...e,
|
|
33
|
-
choicesLayout: e.choicesLayout || e.verticalMode === !1 && "horizontal" || "vertical"
|
|
34
|
-
}), f = ({ partA: e = {}, partB: t = {}, language: r, ...i }) => ({
|
|
35
|
-
...n,
|
|
36
|
-
...i,
|
|
37
|
-
partA: d(e, {
|
|
38
|
-
...n.partA,
|
|
39
|
-
language: r
|
|
40
|
-
}),
|
|
41
|
-
partB: d(t, {
|
|
42
|
-
...n.partB,
|
|
43
|
-
language: r
|
|
44
|
-
})
|
|
45
|
-
});
|
|
46
|
-
async function p(n, r, o, s) {
|
|
47
|
-
let l = f(n), d = u(l.partA, "partA", r, o), p = u(l.partB, "partB", r, o), m = {}, h = (e) => (t, n, r) => new Promise((t) => {
|
|
48
|
-
m[e] = r.shuffledValues, t();
|
|
49
|
-
}), g = e(r, "value.partA"), _ = a(l.partA, g, o), { choices: v } = d || {}, { choices: y } = p || {};
|
|
50
|
-
!_ && v && v.length && (d.choices = await i(v, { shuffledValues: (r.shuffledValues || {}).partA }, h("partA"), "value"));
|
|
51
|
-
let b = e(r, "value.partB");
|
|
52
|
-
if (!a(l.partB, b, o) && y && y.length && (p.choices = await i(y, { shuffledValues: (r.shuffledValues || {}).partB }, h("partB"), "value")), t(m) || s && typeof s == "function" && s(r.id, r.element, { shuffledValues: m }).catch((e) => {
|
|
53
|
-
console.error("update session failed", e);
|
|
54
|
-
}), l.partLabels) {
|
|
55
|
-
let e = l.language;
|
|
56
|
-
d.partLabel = c.t("ebsr.part", {
|
|
57
|
-
lng: e,
|
|
58
|
-
index: l.partLabelType === "Letters" ? "A" : "1"
|
|
59
|
-
}), p.partLabel = c.t("ebsr.part", {
|
|
60
|
-
lng: e,
|
|
61
|
-
index: l.partLabelType === "Letters" ? "B" : "2"
|
|
62
|
-
});
|
|
63
|
-
} else d.partLabel = void 0, p.partLabel = void 0;
|
|
64
|
-
return o.role === "instructor" && (o.mode === "view" || o.mode === "evaluate") ? (d.teacherInstructions = l.partA.teacherInstructionsEnabled ? l.partA.teacherInstructions : null, p.teacherInstructions = l.partB.teacherInstructionsEnabled ? l.partB.teacherInstructions : null) : (d.teacherInstructions = null, p.teacherInstructions = null), d.prompt = l.partA.promptEnabled ? l.partA.prompt : null, p.prompt = l.partB.promptEnabled ? l.partB.prompt : null, new Promise((e) => {
|
|
65
|
-
e({
|
|
66
|
-
disabled: o.mode !== "gather",
|
|
67
|
-
mode: o.mode,
|
|
68
|
-
extraCSSRules: l.extraCSSRules,
|
|
69
|
-
partA: d,
|
|
70
|
-
partB: p
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
var m = (e = {}) => new Promise((t) => {
|
|
75
|
-
t({
|
|
76
|
-
...n,
|
|
77
|
-
...e
|
|
78
|
-
});
|
|
79
|
-
}), h = (e) => e.correct === !0, g = (e, t, n, r) => {
|
|
80
|
-
let { choices: i = [] } = e && e[n] || {}, a = i.length, { value: o } = t || {}, s = (e) => !!(o || []).find((t) => t === e.value), c = (e) => h(e) && !s(e), l = (e) => !h(e) && s(e), u = i.reduce((e, t) => c(t) || l(t) ? e - 1 : e, i.length);
|
|
81
|
-
return !r && u < a ? 0 : parseFloat(a ? (u / a).toFixed(2) : 0);
|
|
82
|
-
}, _ = (e, t, n) => {
|
|
83
|
-
let r = [];
|
|
84
|
-
if (!t || !t.value) return r.push("Student did not answer the question."), r;
|
|
85
|
-
let { value: i } = t, { partA: a, partB: s } = i, c = o.enabled(e, n);
|
|
86
|
-
r.push(`Scoring method: ${c ? "partial scoring" : "all-or-nothing scoring"}.`);
|
|
87
|
-
let l = e.partA.choiceMode === "radio" ? "multiple-choice (radio)" : "multiple-select (checkbox)";
|
|
88
|
-
r.push(`Part A question type: ${l}.`);
|
|
89
|
-
let u = a?.value || [], d = (e.partA.choices || []).filter((e) => e.correct).map((e) => e.value), f = u.filter((e) => d.includes(e)), p = u.filter((e) => !d.includes(e));
|
|
90
|
-
u.length && r.push(`Part A: student selected ${u.length} choice(s) (${f.length} correct, ${p.length} incorrect).`);
|
|
91
|
-
let m = g(e, a, "partA", c);
|
|
92
|
-
r.push(`Part A score: ${m}.`);
|
|
93
|
-
let h = e.partB.choiceMode === "radio" ? "multiple-choice (radio)" : "multiple-select (checkbox)";
|
|
94
|
-
r.push(`Part B question type: ${h}.`);
|
|
95
|
-
let _ = s?.value || [], v = (e.partB.choices || []).filter((e) => e.correct).map((e) => e.value), y = _.filter((e) => v.includes(e)), b = _.filter((e) => !v.includes(e));
|
|
96
|
-
_.length && r.push(`Part B: student selected ${_.length} choice(s) (${y.length} correct, ${b.length} incorrect).`);
|
|
97
|
-
let x = g(e, s, "partB", c);
|
|
98
|
-
if (r.push(`Part B score: ${x}.`), !c) r.push("Final score is awarded only if both Part A and Part B are completely correct."), r.push(`Final score: ${+(m === 1 && x === 1)}.`);
|
|
99
|
-
else {
|
|
100
|
-
r.push("With partial scoring enabled, Part A must be correct to earn any credit.");
|
|
101
|
-
let e = 0;
|
|
102
|
-
m === 1 && x === 1 ? e = 2 : m === 1 && x < 1 && (e = 1), r.push(`Final score: ${e}.`);
|
|
103
|
-
}
|
|
104
|
-
return r;
|
|
105
|
-
};
|
|
106
|
-
function v(e, t, n) {
|
|
107
|
-
return new Promise((r) => {
|
|
108
|
-
let { value: i } = t || {};
|
|
109
|
-
if ((!t || !i) && r({
|
|
110
|
-
score: 0,
|
|
111
|
-
scoreA: 0,
|
|
112
|
-
scoreB: 0,
|
|
113
|
-
empty: !0,
|
|
114
|
-
logTrace: ["Student did not answer the question."]
|
|
115
|
-
}), i) {
|
|
116
|
-
let { partA: a, partB: s } = i || {}, c = o.enabled(e, n), l = g(e, a, "partA", c), u = g(e, s, "partB", c), d = _(e, t, n);
|
|
117
|
-
r(c ? l === 1 ? u === 1 ? {
|
|
118
|
-
score: 2,
|
|
119
|
-
scoreA: l,
|
|
120
|
-
scoreB: u,
|
|
121
|
-
max: 2,
|
|
122
|
-
logTrace: d
|
|
123
|
-
} : {
|
|
124
|
-
score: 1,
|
|
125
|
-
scoreA: l,
|
|
126
|
-
scoreB: u,
|
|
127
|
-
max: 2,
|
|
128
|
-
logTrace: d
|
|
129
|
-
} : {
|
|
130
|
-
score: 0,
|
|
131
|
-
scoreA: l,
|
|
132
|
-
scoreB: u,
|
|
133
|
-
max: 2,
|
|
134
|
-
logTrace: d
|
|
135
|
-
} : {
|
|
136
|
-
score: +(l === 1 && u === 1),
|
|
137
|
-
scoreA: l,
|
|
138
|
-
scoreB: u,
|
|
139
|
-
max: 1,
|
|
140
|
-
logTrace: d
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
var y = (e) => {
|
|
146
|
-
let t = [];
|
|
147
|
-
return e.forEach((e) => {
|
|
148
|
-
let { correct: n, value: r } = e;
|
|
149
|
-
n && t.push(r);
|
|
150
|
-
}), t;
|
|
151
|
-
}, b = (e, t) => new Promise((n) => {
|
|
152
|
-
if (t.mode !== "evaluate" && t.role === "instructor") {
|
|
153
|
-
let { partA: t, partB: r } = e, i = y(t.choices), a = y(r.choices);
|
|
154
|
-
n({
|
|
155
|
-
value: {
|
|
156
|
-
partA: {
|
|
157
|
-
id: "partA",
|
|
158
|
-
value: i
|
|
159
|
-
},
|
|
160
|
-
partB: {
|
|
161
|
-
id: "partB",
|
|
162
|
-
value: a
|
|
163
|
-
}
|
|
164
|
-
},
|
|
165
|
-
id: "1"
|
|
166
|
-
});
|
|
167
|
-
} else n(null);
|
|
168
|
-
}), x = (e) => (e || "").replace(/(<(?!img|iframe|source)([^>]+)>)/gi, ""), S = (e = {}, n = {}) => {
|
|
169
|
-
let { choices: r } = e, { minAnswerChoices: i = 2, maxAnswerChoices: a } = n, o = [...r || []].reverse(), s = {}, c = {}, l = {}, u = !1;
|
|
170
|
-
["teacherInstructions", "prompt"].forEach((t) => {
|
|
171
|
-
n[t]?.required && !x(e[t]) && (s[t] = "This field is required.");
|
|
172
|
-
}), o.forEach((e, t) => {
|
|
173
|
-
let { correct: r, value: i, label: a, rationale: s } = e;
|
|
174
|
-
r && (u = !0), x(a) ? o.slice(t + 1).some((e) => e.label === a) && (c[i] = "Content should be unique.") : c[i] = "Content should not be empty.", n.rationale?.required && !x(s) && (l[i] = "This field is required.");
|
|
175
|
-
});
|
|
176
|
-
let d = (r || []).length;
|
|
177
|
-
return d < i ? s.answerChoices = `There should be at least ${i} choices defined.` : d > a && (s.answerChoices = `No more than ${a} choices should be defined.`), u || (s.correctResponse = "No correct response defined."), t(c) || (s.choices = c), t(l) || (s.rationale = l), s;
|
|
178
|
-
}, C = (e = {}, t = {}) => {
|
|
179
|
-
let { partA: n, partB: r } = e || {}, { partA: i, partB: a } = t || {};
|
|
180
|
-
return {
|
|
181
|
-
partA: S(n, i),
|
|
182
|
-
partB: S(r, a)
|
|
183
|
-
};
|
|
184
|
-
};
|
|
185
|
-
//#endregion
|
|
186
|
-
export { b as createCorrectResponseSession, m as createDefaultModel, _ as getLogTrace, p as model, f as normalize, v as outcome, C as validate };
|