@pie-element/ebsr 14.0.1 → 14.1.1-next.2
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/dist/author/defaults.d.ts +67 -0
- package/dist/author/defaults.d.ts.map +1 -0
- package/dist/author/defaults.js +161 -0
- package/dist/author/index.d.ts +35 -0
- package/dist/author/index.d.ts.map +1 -0
- package/dist/author/index.js +78 -0
- package/dist/author/main.d.ts +23 -0
- package/dist/author/main.d.ts.map +1 -0
- package/dist/author/main.js +121 -0
- package/dist/controller/defaults.d.ts +16 -0
- package/dist/controller/defaults.d.ts.map +1 -0
- package/dist/controller/defaults.js +26 -0
- package/dist/controller/index.d.ts +43 -0
- package/dist/controller/index.d.ts.map +1 -0
- package/dist/controller/index.js +186 -0
- package/dist/controller/utils.d.ts +11 -0
- package/dist/controller/utils.d.ts.map +1 -0
- package/dist/controller/utils.js +8 -0
- package/dist/delivery/index.d.ts +27 -0
- package/dist/delivery/index.d.ts.map +1 -0
- package/dist/delivery/index.js +132 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.iife.d.ts +9 -0
- package/dist/index.iife.d.ts.map +1 -0
- package/dist/index.iife.js +165 -0
- package/dist/index.js +2 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_DataView.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Hash.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_ListCache.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Map.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_MapCache.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Promise.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Set.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_SetCache.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Stack.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Symbol.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Uint8Array.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_WeakMap.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_apply.js +12 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayEach.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayFilter.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayLikeKeys.js +15 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayMap.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayPush.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arraySome.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_assignValue.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_assocIndexOf.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseAssign.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseAssignIn.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseAssignValue.js +12 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseClone.js +57 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseCreate.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseGet.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseGetAllKeys.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseGetTag.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsArguments.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsEqual.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsEqualDeep.js +30 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsMap.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsNative.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsSet.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsTypedArray.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseKeys.js +12 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseKeysIn.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseRest.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseSetToString.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseTimes.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseToString.js +15 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseUnary.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cacheHas.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_castPath.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneArrayBuffer.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneBuffer.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneDataView.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneRegExp.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneSymbol.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneTypedArray.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copyArray.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copyObject.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copySymbols.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copySymbolsIn.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_coreJsData.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_defineProperty.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_equalArrays.js +35 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_equalByTag.js +35 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_equalObjects.js +32 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_freeGlobal.js +4 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getAllKeys.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getAllKeysIn.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getMapData.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getNative.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getPrototype.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getRawTag.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getSymbols.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getSymbolsIn.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getTag.js +23 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getValue.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashClear.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashDelete.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashGet.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashHas.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashSet.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_initCloneArray.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_initCloneByTag.js +33 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_initCloneObject.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isIndex.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isIterateeCall.js +12 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isKey.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isKeyable.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isMasked.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isPrototype.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheClear.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheDelete.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheGet.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheHas.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheSet.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheClear.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheDelete.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheGet.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheHas.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheSet.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapToArray.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_memoizeCapped.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeCreate.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeKeys.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeKeysIn.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nodeUtil.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_objectToString.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_overArg.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_overRest.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_root.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setCacheAdd.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setCacheHas.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setToArray.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setToString.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_shortOut.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackClear.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackDelete.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackGet.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackHas.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackSet.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stringToPath.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_toKey.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_toSource.js +15 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/cloneDeep.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/constant.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/defaults.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/eq.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/get.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/identity.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArguments.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArray.js +4 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArrayLike.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isBuffer.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isEmpty.js +21 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isEqual.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isFunction.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isLength.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isMap.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isObject.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isObjectLike.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isSet.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isSymbol.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isTypedArray.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/keys.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/keysIn.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/memoize.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/stubArray.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/stubFalse.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/toString.js +7 -0
- package/dist/print/index.d.ts +26 -0
- package/dist/print/index.d.ts.map +1 -0
- package/dist/print/index.js +107 -0
- package/package.json +59 -18
- package/{configure/src/defaults.js → src/author/defaults.ts} +10 -0
- package/{configure/src/index.js → src/author/index.ts} +16 -6
- package/{configure/src/main.jsx → src/author/main.tsx} +14 -4
- package/{controller/src/defaults.js → src/controller/defaults.ts} +10 -0
- package/{controller/src/index.js → src/controller/index.ts} +13 -3
- package/{controller/src/utils.js → src/controller/utils.ts} +10 -0
- package/src/{index.js → delivery/index.tsx} +78 -3
- package/src/index.iife.ts +16 -0
- package/src/index.ts +1 -0
- package/src/{print.js → print/index.tsx} +12 -2
- package/CHANGELOG.json +0 -1547
- package/CHANGELOG.md +0 -2259
- package/LICENSE.md +0 -5
- package/README.md +0 -62
- package/configure/CHANGELOG.json +0 -992
- package/configure/CHANGELOG.md +0 -2126
- package/configure/lib/defaults.js +0 -229
- package/configure/lib/defaults.js.map +0 -1
- package/configure/lib/index.js +0 -154
- package/configure/lib/index.js.map +0 -1
- package/configure/lib/main.js +0 -222
- package/configure/lib/main.js.map +0 -1
- package/configure/package.json +0 -23
- package/configure/src/__tests__/index.test.js +0 -492
- package/controller/CHANGELOG.json +0 -552
- package/controller/CHANGELOG.md +0 -1269
- package/controller/lib/defaults.js +0 -31
- package/controller/lib/defaults.js.map +0 -1
- package/controller/lib/index.js +0 -448
- package/controller/lib/index.js.map +0 -1
- package/controller/lib/utils.js +0 -18
- package/controller/lib/utils.js.map +0 -1
- package/controller/package.json +0 -18
- package/controller/src/__tests__/index.test.js +0 -591
- package/controller/src/__tests__/utils.test.js +0 -48
- package/docs/config-schema.json +0 -5787
- package/docs/config-schema.json.md +0 -4278
- package/docs/demo/config.js +0 -8
- package/docs/demo/generate.js +0 -52
- package/docs/demo/index.html +0 -2
- package/docs/demo/session.js +0 -14
- package/docs/pie-schema.json +0 -2911
- package/docs/pie-schema.json.md +0 -2142
- package/ebsr.png +0 -0
- package/lib/index.js +0 -146
- package/lib/index.js.map +0 -1
- package/lib/print.js +0 -186
- package/lib/print.js.map +0 -1
- package/module/configure.js +0 -1
- package/module/controller.js +0 -5664
- package/module/demo.js +0 -77
- package/module/element.js +0 -1
- package/module/index.html +0 -21
- package/module/manifest.json +0 -14
- package/module/print-demo.js +0 -115
- package/module/print.html +0 -18
- package/module/print.js +0 -1
- package/src/__tests__/index.test.js +0 -129
package/ebsr.png
DELETED
|
Binary file
|
package/lib/index.js
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.isSessionComplete = exports.default = void 0;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var _piePlayerEvents = require("@pie-framework/pie-player-events");
|
|
10
|
-
var _multipleChoice = _interopRequireDefault(require("@pie-element/multiple-choice"));
|
|
11
|
-
var _lodashEs = require("lodash-es");
|
|
12
|
-
var _debug = _interopRequireDefault(require("debug"));
|
|
13
|
-
const SESSION_CHANGED = _piePlayerEvents.SessionChangedEvent.TYPE;
|
|
14
|
-
const MC_TAG_NAME = 'ebsr-multiple-choice';
|
|
15
|
-
const log = (0, _debug.default)('pie-elements:ebsr');
|
|
16
|
-
class EbsrMC extends _multipleChoice.default {}
|
|
17
|
-
const defineMultipleChoice = () => {
|
|
18
|
-
if (!customElements.get(MC_TAG_NAME)) {
|
|
19
|
-
customElements.define(MC_TAG_NAME, EbsrMC);
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
defineMultipleChoice();
|
|
23
|
-
const isNonEmptyArray = a => Array.isArray(a) && a.length > 0;
|
|
24
|
-
const isSessionComplete = session => {
|
|
25
|
-
const a = (0, _lodashEs.get)(session, 'value.partA.value');
|
|
26
|
-
const b = (0, _lodashEs.get)(session, 'value.partB.value');
|
|
27
|
-
return isNonEmptyArray(a) && isNonEmptyArray(b);
|
|
28
|
-
};
|
|
29
|
-
exports.isSessionComplete = isSessionComplete;
|
|
30
|
-
class Ebsr extends HTMLElement {
|
|
31
|
-
constructor() {
|
|
32
|
-
super();
|
|
33
|
-
(0, _defineProperty2.default)(this, "onSessionUpdated", e => {
|
|
34
|
-
if (e.target === this) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
e.preventDefault();
|
|
38
|
-
e.stopImmediatePropagation();
|
|
39
|
-
const id = e.target.getAttribute('id');
|
|
40
|
-
if (id) {
|
|
41
|
-
const key = `part${id.toUpperCase()}`;
|
|
42
|
-
if (e.update) {
|
|
43
|
-
this._model[key] = e.update;
|
|
44
|
-
}
|
|
45
|
-
//TODO: accessing a private property here. The session event should contain the update in future to prevent this.
|
|
46
|
-
this.dispatchSessionChanged(e.srcElement._session, key);
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
this._model = {};
|
|
50
|
-
this._session = {};
|
|
51
|
-
}
|
|
52
|
-
set model(m) {
|
|
53
|
-
this._model = m;
|
|
54
|
-
customElements.whenDefined(MC_TAG_NAME).then(() => {
|
|
55
|
-
this.setPartModel(this.partA, 'partA');
|
|
56
|
-
this.setPartModel(this.partB, 'partB');
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
set session(s) {
|
|
60
|
-
this._session = s;
|
|
61
|
-
customElements.whenDefined(MC_TAG_NAME).then(() => {
|
|
62
|
-
this.setPartSession(this.partA, 'partA');
|
|
63
|
-
this.setPartSession(this.partB, 'partB');
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
get session() {
|
|
67
|
-
return this._session;
|
|
68
|
-
}
|
|
69
|
-
setPartModel(part, key) {
|
|
70
|
-
if (this._model && this._model[key] && part) {
|
|
71
|
-
const {
|
|
72
|
-
mode
|
|
73
|
-
} = this._model;
|
|
74
|
-
part.model = {
|
|
75
|
-
...this._model[key],
|
|
76
|
-
mode,
|
|
77
|
-
keyMode: this._model[key].choicePrefix
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
setPartSession(part, key) {
|
|
82
|
-
if (this._session && this._model && part) {
|
|
83
|
-
const {
|
|
84
|
-
value
|
|
85
|
-
} = this._session;
|
|
86
|
-
part.session = value && value[key] ? value[key] : {
|
|
87
|
-
id: key
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
dispatchSessionChanged(partSession, key) {
|
|
92
|
-
this._session.value = {
|
|
93
|
-
...this._session.value,
|
|
94
|
-
[key]: partSession
|
|
95
|
-
};
|
|
96
|
-
log('[onSessionChanged] session: ', this._session);
|
|
97
|
-
const complete = isSessionComplete(this._session);
|
|
98
|
-
this.dispatchEvent(new _piePlayerEvents.SessionChangedEvent(this.tagName.toLowerCase(), complete));
|
|
99
|
-
}
|
|
100
|
-
get partA() {
|
|
101
|
-
return this.querySelector(`${MC_TAG_NAME}#a`);
|
|
102
|
-
}
|
|
103
|
-
get partB() {
|
|
104
|
-
return this.querySelector(`${MC_TAG_NAME}#b`);
|
|
105
|
-
}
|
|
106
|
-
connectedCallback() {
|
|
107
|
-
this._render();
|
|
108
|
-
this.addEventListener(SESSION_CHANGED, this.onSessionUpdated);
|
|
109
|
-
}
|
|
110
|
-
disconnectedCallback() {
|
|
111
|
-
this.removeEventListener(SESSION_CHANGED, this.onSessionUpdated);
|
|
112
|
-
}
|
|
113
|
-
_render() {
|
|
114
|
-
this.ariaLabel = 'Two-Part Question';
|
|
115
|
-
this.role = 'region';
|
|
116
|
-
this.innerHTML = `
|
|
117
|
-
<style>
|
|
118
|
-
.srOnly {
|
|
119
|
-
position: absolute;
|
|
120
|
-
width: 1px;
|
|
121
|
-
height: 1px;
|
|
122
|
-
padding: 0;
|
|
123
|
-
margin: -1px;
|
|
124
|
-
overflow: hidden;
|
|
125
|
-
left: -10000px;
|
|
126
|
-
top: auto;
|
|
127
|
-
}
|
|
128
|
-
${this._model?.extraCSSRules?.rules}
|
|
129
|
-
</style>
|
|
130
|
-
<h2 class="srOnly">Two-Part Question</h2>
|
|
131
|
-
<${MC_TAG_NAME} id="a"></${MC_TAG_NAME}>
|
|
132
|
-
<${MC_TAG_NAME} id="b"></${MC_TAG_NAME}>
|
|
133
|
-
`;
|
|
134
|
-
|
|
135
|
-
// when item is re-rendered (due to connectedCallback), if the custom element is already defined,
|
|
136
|
-
// we need to set the model and session, otherwise the setters are not reached again
|
|
137
|
-
if (customElements.get(MC_TAG_NAME)) {
|
|
138
|
-
this.setPartModel(this.partA, 'partA');
|
|
139
|
-
this.setPartModel(this.partB, 'partB');
|
|
140
|
-
this.setPartSession(this.partA, 'partA');
|
|
141
|
-
this.setPartSession(this.partB, 'partB');
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
exports.default = Ebsr;
|
|
146
|
-
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_piePlayerEvents","require","_multipleChoice","_interopRequireDefault","_lodashEs","_debug","SESSION_CHANGED","SessionChangedEvent","TYPE","MC_TAG_NAME","log","debug","EbsrMC","MultipleChoice","defineMultipleChoice","customElements","get","define","isNonEmptyArray","a","Array","isArray","length","isSessionComplete","session","b","exports","Ebsr","HTMLElement","constructor","_defineProperty2","default","e","target","preventDefault","stopImmediatePropagation","id","getAttribute","key","toUpperCase","update","_model","dispatchSessionChanged","srcElement","_session","model","m","whenDefined","then","setPartModel","partA","partB","s","setPartSession","part","mode","keyMode","choicePrefix","value","partSession","complete","dispatchEvent","tagName","toLowerCase","querySelector","connectedCallback","_render","addEventListener","onSessionUpdated","disconnectedCallback","removeEventListener","ariaLabel","role","innerHTML","extraCSSRules","rules"],"sources":["../src/index.js"],"sourcesContent":["import { SessionChangedEvent } from '@pie-framework/pie-player-events';\nimport MultipleChoice from '@pie-element/multiple-choice';\nimport { get } from 'lodash-es';\nimport debug from 'debug';\n\nconst SESSION_CHANGED = SessionChangedEvent.TYPE;\nconst MC_TAG_NAME = 'ebsr-multiple-choice';\nconst log = debug('pie-elements:ebsr');\n\nclass EbsrMC extends MultipleChoice {}\n\nconst defineMultipleChoice = () => {\n if (!customElements.get(MC_TAG_NAME)) {\n customElements.define(MC_TAG_NAME, EbsrMC);\n }\n};\n\ndefineMultipleChoice();\n\nconst isNonEmptyArray = (a) => Array.isArray(a) && a.length > 0;\n\nexport const isSessionComplete = (session) => {\n const a = get(session, 'value.partA.value');\n const b = get(session, 'value.partB.value');\n\n return isNonEmptyArray(a) && isNonEmptyArray(b);\n};\n\nexport default class Ebsr extends HTMLElement {\n constructor() {\n super();\n this._model = {};\n this._session = {};\n }\n\n onSessionUpdated = (e) => {\n if (e.target === this) {\n return;\n }\n\n e.preventDefault();\n e.stopImmediatePropagation();\n\n const id = e.target.getAttribute('id');\n\n if (id) {\n const key = `part${id.toUpperCase()}`;\n\n if (e.update) {\n this._model[key] = e.update;\n }\n //TODO: accessing a private property here. The session event should contain the update in future to prevent this.\n this.dispatchSessionChanged(e.srcElement._session, key);\n }\n };\n\n set model(m) {\n this._model = m;\n\n customElements.whenDefined(MC_TAG_NAME).then(() => {\n this.setPartModel(this.partA, 'partA');\n this.setPartModel(this.partB, 'partB');\n });\n }\n\n set session(s) {\n this._session = s;\n\n customElements.whenDefined(MC_TAG_NAME).then(() => {\n this.setPartSession(this.partA, 'partA');\n this.setPartSession(this.partB, 'partB');\n });\n }\n\n get session() {\n return this._session;\n }\n\n setPartModel(part, key) {\n if (this._model && this._model[key] && part) {\n const { mode } = this._model;\n\n part.model = {\n ...this._model[key],\n mode,\n keyMode: this._model[key].choicePrefix,\n };\n }\n }\n\n setPartSession(part, key) {\n if (this._session && this._model && part) {\n const { value } = this._session;\n part.session = value && value[key] ? value[key] : { id: key };\n }\n }\n\n dispatchSessionChanged(partSession, key) {\n this._session.value = {\n ...this._session.value,\n [key]: partSession,\n };\n\n log('[onSessionChanged] session: ', this._session);\n const complete = isSessionComplete(this._session);\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), complete));\n }\n\n get partA() {\n return this.querySelector(`${MC_TAG_NAME}#a`);\n }\n\n get partB() {\n return this.querySelector(`${MC_TAG_NAME}#b`);\n }\n\n connectedCallback() {\n this._render();\n this.addEventListener(SESSION_CHANGED, this.onSessionUpdated);\n }\n\n disconnectedCallback() {\n this.removeEventListener(SESSION_CHANGED, this.onSessionUpdated);\n }\n\n _render() {\n this.ariaLabel = 'Two-Part Question';\n this.role = 'region';\n this.innerHTML = `\n <style>\n .srOnly {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n left: -10000px;\n top: auto;\n }\n ${this._model?.extraCSSRules?.rules}\n </style>\n <h2 class=\"srOnly\">Two-Part Question</h2>\n <${MC_TAG_NAME} id=\"a\"></${MC_TAG_NAME}>\n <${MC_TAG_NAME} id=\"b\"></${MC_TAG_NAME}>\n `;\n\n // when item is re-rendered (due to connectedCallback), if the custom element is already defined,\n // we need to set the model and session, otherwise the setters are not reached again\n if (customElements.get(MC_TAG_NAME)) {\n this.setPartModel(this.partA, 'partA');\n this.setPartModel(this.partB, 'partB');\n this.setPartSession(this.partA, 'partA');\n this.setPartSession(this.partB, 'partB');\n }\n }\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAF,sBAAA,CAAAF,OAAA;AAEA,MAAMK,eAAe,GAAGC,oCAAmB,CAACC,IAAI;AAChD,MAAMC,WAAW,GAAG,sBAAsB;AAC1C,MAAMC,GAAG,GAAG,IAAAC,cAAK,EAAC,mBAAmB,CAAC;AAEtC,MAAMC,MAAM,SAASC,uBAAc,CAAC;AAEpC,MAAMC,oBAAoB,GAAGA,CAAA,KAAM;EACjC,IAAI,CAACC,cAAc,CAACC,GAAG,CAACP,WAAW,CAAC,EAAE;IACpCM,cAAc,CAACE,MAAM,CAACR,WAAW,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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,IAAI,CAAChC,MAAM,EAAEiC,aAAa,EAAEC,KAAK;AACzC;AACA;AACA,WAAWlE,WAAW,aAAaA,WAAW;AAC9C,WAAWA,WAAW,aAAaA,WAAW;AAC9C,KAAK;;IAED;IACA;IACA,IAAIM,cAAc,CAACC,GAAG,CAACP,WAAW,CAAC,EAAE;MACnC,IAAI,CAACwC,YAAY,CAAC,IAAI,CAACC,KAAK,EAAE,OAAO,CAAC;MACtC,IAAI,CAACD,YAAY,CAAC,IAAI,CAACE,KAAK,EAAE,OAAO,CAAC;MACtC,IAAI,CAACE,cAAc,CAAC,IAAI,CAACH,KAAK,EAAE,OAAO,CAAC;MACxC,IAAI,CAACG,cAAc,CAAC,IAAI,CAACF,KAAK,EAAE,OAAO,CAAC;IAC1C;EACF;AACF;AAACzB,OAAA,CAAAK,OAAA,GAAAJ,IAAA","ignoreList":[]}
|
package/lib/print.js
DELETED
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.isSessionComplete = exports.default = void 0;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var _lodashEs = require("lodash-es");
|
|
10
|
-
var _multipleChoice = _interopRequireDefault(require("@pie-element/multiple-choice"));
|
|
11
|
-
var _debug = _interopRequireDefault(require("debug"));
|
|
12
|
-
var _piePlayerEvents = require("@pie-framework/pie-player-events");
|
|
13
|
-
var _translator = _interopRequireDefault(require("@pie-lib/translator"));
|
|
14
|
-
const MC_TAG_NAME = 'ebsr-multiple-choice';
|
|
15
|
-
const SESSION_CHANGED = _piePlayerEvents.SessionChangedEvent.TYPE;
|
|
16
|
-
const {
|
|
17
|
-
translator
|
|
18
|
-
} = _translator.default;
|
|
19
|
-
const log = (0, _debug.default)('pie-element:ebsr:print');
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Live in same package as main element - so we can access some of the shared comps!
|
|
23
|
-
*
|
|
24
|
-
* - update pslb to build print if src/print.js is there
|
|
25
|
-
* - update demo el
|
|
26
|
-
* - get configure/controller building
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
const preparePrintModel = (model, opts) => {
|
|
30
|
-
const instr = opts.role === 'instructor';
|
|
31
|
-
const printModel = (0, _lodashEs.cloneDeep)(model);
|
|
32
|
-
printModel.prompt = printModel.promptEnabled !== false ? printModel.prompt : undefined;
|
|
33
|
-
printModel.teacherInstructions = instr && printModel.teacherInstructionsEnabled !== false ? printModel.teacherInstructions : undefined;
|
|
34
|
-
printModel.showTeacherInstructions = instr;
|
|
35
|
-
printModel.alwaysShowCorrect = instr;
|
|
36
|
-
printModel.mode = instr ? 'evaluate' : 'gather';
|
|
37
|
-
printModel.disabled = true;
|
|
38
|
-
printModel.animationsDisabled = true;
|
|
39
|
-
printModel.lockChoiceOrder = true;
|
|
40
|
-
printModel.choicesLayout = printModel.choicesLayout || 'vertical';
|
|
41
|
-
printModel.choices = (printModel.choices || []).map(c => {
|
|
42
|
-
c.rationale = instr && printModel.rationaleEnabled !== false ? c.rationale : undefined;
|
|
43
|
-
c.hideTick = instr;
|
|
44
|
-
c.feedback = undefined;
|
|
45
|
-
return c;
|
|
46
|
-
});
|
|
47
|
-
printModel.keyMode = printModel.choicePrefix || 'letters';
|
|
48
|
-
return printModel;
|
|
49
|
-
};
|
|
50
|
-
class EbsrMC extends _multipleChoice.default {}
|
|
51
|
-
const defineMultipleChoice = () => {
|
|
52
|
-
if (!customElements.get(MC_TAG_NAME)) {
|
|
53
|
-
customElements.define(MC_TAG_NAME, EbsrMC);
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
defineMultipleChoice();
|
|
57
|
-
const isNonEmptyArray = a => Array.isArray(a) && a.length > 0;
|
|
58
|
-
const isSessionComplete = session => {
|
|
59
|
-
const a = (0, _lodashEs.get)(session, 'value.partA.value');
|
|
60
|
-
const b = (0, _lodashEs.get)(session, 'value.partB.value');
|
|
61
|
-
return isNonEmptyArray(a) && isNonEmptyArray(b);
|
|
62
|
-
};
|
|
63
|
-
exports.isSessionComplete = isSessionComplete;
|
|
64
|
-
class Ebsr extends HTMLElement {
|
|
65
|
-
constructor() {
|
|
66
|
-
super();
|
|
67
|
-
(0, _defineProperty2.default)(this, "onSessionUpdated", e => {
|
|
68
|
-
if (e.target === this) {
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
e.preventDefault();
|
|
72
|
-
e.stopImmediatePropagation();
|
|
73
|
-
const id = e.target.getAttribute('id');
|
|
74
|
-
if (id) {
|
|
75
|
-
const key = `part${id.toUpperCase()}`;
|
|
76
|
-
if (e.update) {
|
|
77
|
-
this._model[key] = e.update;
|
|
78
|
-
}
|
|
79
|
-
//TODO: accessing a private property here. The session event should contain the update in future to prevent this.
|
|
80
|
-
this.dispatchSessionChanged(e.srcElement._session, key);
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
this._model = {};
|
|
84
|
-
this._session = {};
|
|
85
|
-
this._options = null;
|
|
86
|
-
}
|
|
87
|
-
set model(m) {
|
|
88
|
-
this._model = m;
|
|
89
|
-
this._updateParts();
|
|
90
|
-
}
|
|
91
|
-
set session(s) {
|
|
92
|
-
this._session = s;
|
|
93
|
-
customElements.whenDefined(MC_TAG_NAME).then(() => {
|
|
94
|
-
this.setPartSession(this.partA, 'partA');
|
|
95
|
-
this.setPartSession(this.partB, 'partB');
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
_updateParts() {
|
|
99
|
-
customElements.whenDefined(MC_TAG_NAME).then(() => {
|
|
100
|
-
this.setPartModel(this.partA, 'partA');
|
|
101
|
-
this.setPartModel(this.partB, 'partB');
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
setPartModel(part, key) {
|
|
105
|
-
if (this._model && this._model[key] && part && this._options) {
|
|
106
|
-
let labels = {
|
|
107
|
-
partA: undefined,
|
|
108
|
-
partB: undefined
|
|
109
|
-
};
|
|
110
|
-
if (this._model.partLabels) {
|
|
111
|
-
const language = this._model.language;
|
|
112
|
-
labels = {
|
|
113
|
-
partA: translator.t('ebsr.part', {
|
|
114
|
-
lng: language,
|
|
115
|
-
index: this._model.partLabelType === 'Letters' ? 'A' : '1'
|
|
116
|
-
}),
|
|
117
|
-
partB: translator.t('ebsr.part', {
|
|
118
|
-
lng: language,
|
|
119
|
-
index: this._model.partLabelType === 'Letters' ? 'B' : '2'
|
|
120
|
-
})
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
part.model = {
|
|
124
|
-
...preparePrintModel(this._model[key], this._options),
|
|
125
|
-
keyMode: this._model[key].choicePrefix,
|
|
126
|
-
partLabel: labels[key]
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
// pass options to enable print mode detection in multiple-choice component
|
|
130
|
-
part.options = this._options;
|
|
131
|
-
if (!part._session) {
|
|
132
|
-
// for print, "set session" is not called,
|
|
133
|
-
// but ebsr needs sessions in order to render the elements,
|
|
134
|
-
// so we set it here it was not set already
|
|
135
|
-
part.session = {};
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
set options(o) {
|
|
140
|
-
this._options = o;
|
|
141
|
-
// re-render parts so role changes (student/instructor) propagate to each part
|
|
142
|
-
this._updateParts();
|
|
143
|
-
}
|
|
144
|
-
setPartSession(part, key) {
|
|
145
|
-
if (this._session && this._model && part) {
|
|
146
|
-
const {
|
|
147
|
-
value
|
|
148
|
-
} = this._session;
|
|
149
|
-
part.session = value && value[key] ? value[key] : {
|
|
150
|
-
id: key
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
dispatchSessionChanged(partSession, key) {
|
|
155
|
-
this._session.value = {
|
|
156
|
-
...this._session.value,
|
|
157
|
-
[key]: partSession
|
|
158
|
-
};
|
|
159
|
-
log('[onSessionChanged] session: ', this._session);
|
|
160
|
-
const complete = isSessionComplete(this._session);
|
|
161
|
-
this.dispatchEvent(new _piePlayerEvents.SessionChangedEvent(this.tagName.toLowerCase(), complete));
|
|
162
|
-
}
|
|
163
|
-
get partA() {
|
|
164
|
-
return this.querySelector(`${MC_TAG_NAME}#a`);
|
|
165
|
-
}
|
|
166
|
-
get partB() {
|
|
167
|
-
return this.querySelector(`${MC_TAG_NAME}#b`);
|
|
168
|
-
}
|
|
169
|
-
connectedCallback() {
|
|
170
|
-
this._render();
|
|
171
|
-
this.addEventListener(SESSION_CHANGED, this.onSessionUpdated);
|
|
172
|
-
}
|
|
173
|
-
disconnectedCallback() {
|
|
174
|
-
this.removeEventListener(SESSION_CHANGED, this.onSessionUpdated);
|
|
175
|
-
}
|
|
176
|
-
_render() {
|
|
177
|
-
this.innerHTML = `
|
|
178
|
-
<div>
|
|
179
|
-
<${MC_TAG_NAME} id="a"></${MC_TAG_NAME}>
|
|
180
|
-
<${MC_TAG_NAME} id="b"></${MC_TAG_NAME}>
|
|
181
|
-
</div>
|
|
182
|
-
`;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
exports.default = Ebsr;
|
|
186
|
-
//# sourceMappingURL=print.js.map
|
package/lib/print.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"print.js","names":["_lodashEs","require","_multipleChoice","_interopRequireDefault","_debug","_piePlayerEvents","_translator","MC_TAG_NAME","SESSION_CHANGED","SessionChangedEvent","TYPE","translator","Translator","log","debug","preparePrintModel","model","opts","instr","role","printModel","cloneDeep","prompt","promptEnabled","undefined","teacherInstructions","teacherInstructionsEnabled","showTeacherInstructions","alwaysShowCorrect","mode","disabled","animationsDisabled","lockChoiceOrder","choicesLayout","choices","map","c","rationale","rationaleEnabled","hideTick","feedback","keyMode","choicePrefix","EbsrMC","MultipleChoice","defineMultipleChoice","customElements","get","define","isNonEmptyArray","a","Array","isArray","length","isSessionComplete","session","b","exports","Ebsr","HTMLElement","constructor","_defineProperty2","default","e","target","preventDefault","stopImmediatePropagation","id","getAttribute","key","toUpperCase","update","_model","dispatchSessionChanged","srcElement","_session","_options","m","_updateParts","s","whenDefined","then","setPartSession","partA","partB","setPartModel","part","labels","partLabels","language","t","lng","index","partLabelType","partLabel","options","o","value","partSession","complete","dispatchEvent","tagName","toLowerCase","querySelector","connectedCallback","_render","addEventListener","onSessionUpdated","disconnectedCallback","removeEventListener","innerHTML"],"sources":["../src/print.js"],"sourcesContent":["import { cloneDeep, get } from 'lodash-es';\nimport MultipleChoice from '@pie-element/multiple-choice';\nimport debug from 'debug';\nimport { SessionChangedEvent } from '@pie-framework/pie-player-events';\nconst MC_TAG_NAME = 'ebsr-multiple-choice';\nconst SESSION_CHANGED = SessionChangedEvent.TYPE;\nimport Translator from '@pie-lib/translator';\n\nconst { translator } = Translator;\n\nconst log = debug('pie-element:ebsr:print');\n\n/**\n * Live in same package as main element - so we can access some of the shared comps!\n *\n * - update pslb to build print if src/print.js is there\n * - update demo el\n * - get configure/controller building\n */\n\nconst preparePrintModel = (model, opts) => {\n const instr = opts.role === 'instructor';\n const printModel = cloneDeep(model);\n\n printModel.prompt = printModel.promptEnabled !== false ? printModel.prompt : undefined;\n printModel.teacherInstructions =\n instr && printModel.teacherInstructionsEnabled !== false ? printModel.teacherInstructions : undefined;\n printModel.showTeacherInstructions = instr;\n printModel.alwaysShowCorrect = instr;\n printModel.mode = instr ? 'evaluate' : 'gather';\n\n printModel.disabled = true;\n printModel.animationsDisabled = true;\n printModel.lockChoiceOrder = true;\n printModel.choicesLayout = printModel.choicesLayout || 'vertical';\n\n printModel.choices = (printModel.choices || []).map((c) => {\n c.rationale = instr && printModel.rationaleEnabled !== false ? c.rationale : undefined;\n c.hideTick = instr;\n c.feedback = undefined;\n return c;\n });\n\n printModel.keyMode = printModel.choicePrefix || 'letters';\n\n return printModel;\n};\n\nclass EbsrMC extends MultipleChoice {}\n\nconst defineMultipleChoice = () => {\n if (!customElements.get(MC_TAG_NAME)) {\n customElements.define(MC_TAG_NAME, EbsrMC);\n }\n};\n\ndefineMultipleChoice();\n\nconst isNonEmptyArray = (a) => Array.isArray(a) && a.length > 0;\n\nexport const isSessionComplete = (session) => {\n const a = get(session, 'value.partA.value');\n const b = get(session, 'value.partB.value');\n\n return isNonEmptyArray(a) && isNonEmptyArray(b);\n};\n\nexport default class Ebsr extends HTMLElement {\n constructor() {\n super();\n this._model = {};\n this._session = {};\n this._options = null;\n }\n\n onSessionUpdated = (e) => {\n if (e.target === this) {\n return;\n }\n\n e.preventDefault();\n e.stopImmediatePropagation();\n\n const id = e.target.getAttribute('id');\n\n if (id) {\n const key = `part${id.toUpperCase()}`;\n\n if (e.update) {\n this._model[key] = e.update;\n }\n //TODO: accessing a private property here. The session event should contain the update in future to prevent this.\n this.dispatchSessionChanged(e.srcElement._session, key);\n }\n };\n\n set model(m) {\n this._model = m;\n this._updateParts();\n }\n\n set session(s) {\n this._session = s;\n\n customElements.whenDefined(MC_TAG_NAME).then(() => {\n this.setPartSession(this.partA, 'partA');\n this.setPartSession(this.partB, 'partB');\n });\n }\n\n _updateParts() {\n customElements.whenDefined(MC_TAG_NAME).then(() => {\n this.setPartModel(this.partA, 'partA');\n this.setPartModel(this.partB, 'partB');\n });\n }\n\n setPartModel(part, key) {\n if (this._model && this._model[key] && part && this._options) {\n let labels = {\n partA: undefined,\n partB: undefined,\n };\n\n if (this._model.partLabels) {\n const language = this._model.language;\n\n labels = {\n partA: translator.t('ebsr.part', {\n lng: language,\n index: this._model.partLabelType === 'Letters' ? 'A' : '1',\n }),\n partB: translator.t('ebsr.part', {\n lng: language,\n index: this._model.partLabelType === 'Letters' ? 'B' : '2',\n }),\n };\n }\n\n part.model = {\n ...preparePrintModel(this._model[key], this._options),\n keyMode: this._model[key].choicePrefix,\n partLabel: labels[key],\n };\n\n // pass options to enable print mode detection in multiple-choice component\n part.options = this._options;\n\n if (!part._session) {\n // for print, \"set session\" is not called,\n // but ebsr needs sessions in order to render the elements,\n // so we set it here it was not set already\n part.session = {};\n }\n }\n }\n\n set options(o) {\n this._options = o;\n // re-render parts so role changes (student/instructor) propagate to each part\n this._updateParts();\n }\n\n setPartSession(part, key) {\n if (this._session && this._model && part) {\n const { value } = this._session;\n part.session = value && value[key] ? value[key] : { id: key };\n }\n }\n\n dispatchSessionChanged(partSession, key) {\n this._session.value = {\n ...this._session.value,\n [key]: partSession,\n };\n\n log('[onSessionChanged] session: ', this._session);\n const complete = isSessionComplete(this._session);\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), complete));\n }\n\n get partA() {\n return this.querySelector(`${MC_TAG_NAME}#a`);\n }\n\n get partB() {\n return this.querySelector(`${MC_TAG_NAME}#b`);\n }\n\n connectedCallback() {\n this._render();\n this.addEventListener(SESSION_CHANGED, this.onSessionUpdated);\n }\n\n disconnectedCallback() {\n this.removeEventListener(SESSION_CHANGED, this.onSessionUpdated);\n }\n\n _render() {\n this.innerHTML = `\n <div>\n <${MC_TAG_NAME} id=\"a\"></${MC_TAG_NAME}>\n <${MC_TAG_NAME} id=\"b\"></${MC_TAG_NAME}>\n </div>\n `;\n }\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AAGA,IAAAK,WAAA,GAAAH,sBAAA,CAAAF,OAAA;AAFA,MAAMM,WAAW,GAAG,sBAAsB;AAC1C,MAAMC,eAAe,GAAGC,oCAAmB,CAACC,IAAI;AAGhD,MAAM;EAAEC;AAAW,CAAC,GAAGC,mBAAU;AAEjC,MAAMC,GAAG,GAAG,IAAAC,cAAK,EAAC,wBAAwB,CAAC;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,iBA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