@pie-element/placement-ordering 14.1.2-next.0 → 14.1.2-next.1
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/choice-editor.js +16 -17
- package/dist/author/design.js +49 -50
- package/dist/author/index.js +21 -21
- package/dist/author/utils.js +1 -1
- package/dist/browser/author/index.js +8227 -8516
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/browser-Dbw2uHQ7.js +372 -0
- package/dist/browser/browser-Dbw2uHQ7.js.map +1 -0
- package/dist/browser/controller/index.js +86 -163
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/delivery/index.js +299 -296
- package/dist/browser/delivery/index.js.map +1 -1
- package/dist/browser/{dist-BTHiIs74.js → dist-D9ARZhQk.js} +354 -538
- package/dist/browser/dist-D9ARZhQk.js.map +1 -0
- package/dist/browser/{drag-provider-DaPxkh4j.js → drag-provider-DSf9QLEN.js} +3280 -3565
- package/dist/browser/drag-provider-DSf9QLEN.js.map +1 -0
- package/dist/controller/index.js +44 -49
- package/dist/controller/scoring.js +1 -3
- package/dist/delivery/index.js +10 -10
- package/dist/delivery/ordering.js +2 -5
- package/dist/delivery/placement-ordering.js +37 -39
- package/dist/index.iife.js +33 -33
- package/dist/runtime-support.d.ts +12 -0
- package/dist/runtime-support.js +12 -0
- package/package.json +12 -8
- package/dist/browser/browser-CvJkn_Ec.js +0 -1019
- package/dist/browser/browser-CvJkn_Ec.js.map +0 -1
- package/dist/browser/dist-BTHiIs74.js.map +0 -1
- package/dist/browser/drag-provider-DaPxkh4j.js.map +0 -1
- package/dist/browser/last-D7N4Qfx4.js +0 -9
- package/dist/browser/last-D7N4Qfx4.js.map +0 -1
- 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/_arrayEvery.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/_arrayIncludes.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayIncludesWith.js +0 -7
- 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/_arrayReduce.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayShuffle.js +0 -8
- 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/_baseDifference.js +0 -23
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseEach.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseEvery.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFindIndex.js +0 -7
- 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/_baseFor.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseForOwn.js +0 -8
- 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/_baseIndexOf.js +0 -9
- 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/_baseIsMatch.js +0 -26
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNaN.js +0 -6
- 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/_baseIteratee.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/_baseMap.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMatches.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMatchesProperty.js +0 -17
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseProperty.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_basePropertyDeep.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseRandom.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseReduce.js +0 -8
- 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/_baseShuffle.js +0 -8
- 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/_baseUniq.js +0 -27
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseValues.js +0 -9
- 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/_createAssigner.js +0 -15
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createBaseEach.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createBaseFor.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createSet.js +0 -9
- 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/_getMatchData.js +0 -16
- 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/_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/_isStrictComparable.js +0 -7
- 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/_matchesStrictComparable.js +0 -8
- 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/_shuffleSelf.js +0 -12
- 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/_strictIndexOf.js +0 -7
- 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/assign.js +0 -16
- 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/compact.js +0 -10
- 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/difference.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/differenceWith.js +0 -12
- 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/every.js +0 -12
- 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/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/isArrayLikeObject.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/last.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/map.js +0 -10
- 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/noop.js +0 -4
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/property.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/reduce.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/shuffle.js +0 -9
- 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/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/uniq.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/uniqueId.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/values.js +0 -8
|
@@ -1,84 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as v } from "../last-D7N4Qfx4.js";
|
|
4
|
-
//#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/noop.js
|
|
5
|
-
function y() {}
|
|
6
|
-
//#endregion
|
|
7
|
-
//#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayReduce.js
|
|
8
|
-
function b(e, t, n, r) {
|
|
9
|
-
var i = -1, a = e == null ? 0 : e.length;
|
|
10
|
-
for (r && a && (n = e[++i]); ++i < a;) n = t(n, e[i], i, e);
|
|
11
|
-
return n;
|
|
12
|
-
}
|
|
13
|
-
//#endregion
|
|
14
|
-
//#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/differenceWith.js
|
|
15
|
-
var x = t(function(e, t) {
|
|
16
|
-
var n = v(t);
|
|
17
|
-
return a(n) && (n = void 0), a(e) ? te(e, r(t, 1, a, !0), void 0, n) : [];
|
|
18
|
-
});
|
|
19
|
-
//#endregion
|
|
20
|
-
//#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEvery.js
|
|
21
|
-
function S(e, t) {
|
|
22
|
-
for (var n = -1, r = e == null ? 0 : e.length; ++n < r;) if (!t(e[n], n, e)) return !1;
|
|
23
|
-
return !0;
|
|
24
|
-
}
|
|
25
|
-
//#endregion
|
|
26
|
-
//#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseEvery.js
|
|
27
|
-
function C(e, t) {
|
|
28
|
-
var n = !0;
|
|
29
|
-
return p(e, function(e, r, i) {
|
|
30
|
-
return n = !!t(e, r, i), n;
|
|
31
|
-
}), n;
|
|
32
|
-
}
|
|
33
|
-
//#endregion
|
|
34
|
-
//#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/every.js
|
|
35
|
-
function w(t, r, i) {
|
|
36
|
-
var a = n(t) ? S : C;
|
|
37
|
-
return i && e(t, r, i) && (r = void 0), a(t, h(r, 3));
|
|
38
|
-
}
|
|
39
|
-
//#endregion
|
|
40
|
-
//#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseReduce.js
|
|
41
|
-
function T(e, t, n, r, i) {
|
|
42
|
-
return i(e, function(e, i, a) {
|
|
43
|
-
n = r ? (r = !1, e) : t(n, e, i, a);
|
|
44
|
-
}), n;
|
|
45
|
-
}
|
|
46
|
-
//#endregion
|
|
47
|
-
//#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/reduce.js
|
|
48
|
-
function E(e, t, r) {
|
|
49
|
-
var i = n(e) ? b : T, a = arguments.length < 3;
|
|
50
|
-
return i(e, h(t, 4), r, a, p);
|
|
51
|
-
}
|
|
52
|
-
//#endregion
|
|
53
|
-
//#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createSet.js
|
|
54
|
-
var D = l && 1 / i(new l([, -0]))[1] == Infinity ? function(e) {
|
|
55
|
-
return new l(e);
|
|
56
|
-
} : y, O = 200;
|
|
57
|
-
function ne(e, t, n) {
|
|
58
|
-
var r = -1, a = g, s = e.length, c = !0, l = [], u = l;
|
|
59
|
-
if (n) c = !1, a = ee;
|
|
60
|
-
else if (s >= O) {
|
|
61
|
-
var d = t ? null : D(e);
|
|
62
|
-
if (d) return i(d);
|
|
63
|
-
c = !1, a = o, u = new f();
|
|
64
|
-
} else u = t ? [] : l;
|
|
65
|
-
outer: for (; ++r < s;) {
|
|
66
|
-
var p = e[r], m = t ? t(p) : p;
|
|
67
|
-
if (p = n || p !== 0 ? p : 0, c && m === m) {
|
|
68
|
-
for (var h = u.length; h--;) if (u[h] === m) continue outer;
|
|
69
|
-
t && u.push(m), l.push(p);
|
|
70
|
-
} else a(u, m, n) || (u !== l && u.push(m), l.push(p));
|
|
71
|
-
}
|
|
72
|
-
return l;
|
|
73
|
-
}
|
|
74
|
-
//#endregion
|
|
75
|
-
//#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/uniq.js
|
|
76
|
-
function k(e) {
|
|
77
|
-
return e && e.length ? ne(e) : [];
|
|
78
|
-
}
|
|
79
|
-
//#endregion
|
|
1
|
+
import { a as e, h as t, k as n, l as r, m as i, n as a, r as o, s, t as c, u as l } from "../browser-Dbw2uHQ7.js";
|
|
2
|
+
import { t as u } from "../dist-D9ARZhQk.js";
|
|
80
3
|
//#region ../../../node_modules/.bun/js-combinatorics@2.1.2/node_modules/js-combinatorics/combinatorics.js
|
|
81
|
-
function
|
|
4
|
+
function d(e, t) {
|
|
82
5
|
if (e < 0) throw RangeError(`${e} is out of range`);
|
|
83
6
|
if (t < 0) throw RangeError(`${t} is out of range`);
|
|
84
7
|
if (t == 0) return 1n;
|
|
@@ -91,37 +14,37 @@ function A(e, t) {
|
|
|
91
14
|
for (; r--;) i *= n--;
|
|
92
15
|
return i;
|
|
93
16
|
}
|
|
94
|
-
function
|
|
95
|
-
return t == 0 || e == t ? 1n : e < t ? 0n :
|
|
17
|
+
function f(e, t) {
|
|
18
|
+
return t == 0 || e == t ? 1n : e < t ? 0n : d(e, t) / d(t, t);
|
|
96
19
|
}
|
|
97
|
-
var
|
|
98
|
-
typeof
|
|
20
|
+
var p = typeof crypto < "u" ? crypto : {};
|
|
21
|
+
typeof p.randomBytes == "function" || p.getRandomValues;
|
|
99
22
|
//#endregion
|
|
100
23
|
//#region src/controller/scoring.ts
|
|
101
|
-
var
|
|
102
|
-
if (
|
|
24
|
+
var m = /* @__PURE__ */ n(c(), 1), h = (0, m.default)("pie-elements:placement-ordering:controller"), g = (e) => /* @__PURE__ */ Error(`Cant score answer: ${e} it has duplicates and allowDuplicates is false`), _ = (e, n, r) => {
|
|
25
|
+
if (r = {
|
|
103
26
|
allowDuplicates: !1,
|
|
104
27
|
orderMustBeComplete: !1,
|
|
105
|
-
...
|
|
106
|
-
}, !
|
|
107
|
-
if (
|
|
108
|
-
if (
|
|
109
|
-
if (e.length === 1) return +!!
|
|
110
|
-
if (!Array.isArray(
|
|
111
|
-
let
|
|
112
|
-
return parseFloat(
|
|
113
|
-
},
|
|
28
|
+
...r
|
|
29
|
+
}, !r.allowDuplicates && !o(a(e), e)) throw g(n);
|
|
30
|
+
if (r.allowDuplicates === !1 && n.length !== a(n).length) return 0;
|
|
31
|
+
if (n = r.allowDuplicates === !1 ? a(n) : n, h("answer:", n), !Array.isArray(e) || e.length === 0) throw Error("correct must be non empty an array");
|
|
32
|
+
if (e.length === 1) return +!!o(e, n);
|
|
33
|
+
if (!Array.isArray(n) || n.length < 2 || n.length > e.length || e.length !== n.length && r.orderMustBeComplete) return 0;
|
|
34
|
+
let i = f(e, 2).toArray(), s = f(n, 2).toArray(), c = t(s, i, o), l = i.length - s.length, u = i.length, d = ((u - c.length - l) / u).toFixed(2);
|
|
35
|
+
return parseFloat(d);
|
|
36
|
+
}, v = (e) => e.correctResponse ? e.correctResponse.map((e) => e && e.id ? e.id : e) : [], y = (e) => {
|
|
114
37
|
let t = (e.alternateResponses || []).map((e) => Array.isArray(e) ? e : e.response).filter((e) => e !== void 0);
|
|
115
|
-
return [
|
|
116
|
-
},
|
|
38
|
+
return [v(e), ...t];
|
|
39
|
+
}, b = (e, t) => {
|
|
117
40
|
let { value: n } = t || {};
|
|
118
41
|
if (!n) return 0;
|
|
119
|
-
let r =
|
|
42
|
+
let r = y(e), i = (e.configure && e.configure.removeTilesAfterPlacing) !== !1, a = 0;
|
|
120
43
|
return r.forEach((e) => {
|
|
121
|
-
let t =
|
|
44
|
+
let t = _(e, n, { allowDuplicates: i });
|
|
122
45
|
t >= a && (a = t);
|
|
123
46
|
}), a;
|
|
124
|
-
},
|
|
47
|
+
}, x = {
|
|
125
48
|
correct: {
|
|
126
49
|
type: "default",
|
|
127
50
|
default: "Correct",
|
|
@@ -143,19 +66,19 @@ var N = /* @__PURE__ */ c(d(), 1), P = (0, N.default)("pie-elements:placement-or
|
|
|
143
66
|
custom: "You have not entered a response"
|
|
144
67
|
}
|
|
145
68
|
};
|
|
146
|
-
function
|
|
69
|
+
function S(e) {
|
|
147
70
|
return e === "partially-correct" ? "partial" : e;
|
|
148
71
|
}
|
|
149
|
-
function
|
|
72
|
+
function C(e, t = {}) {
|
|
150
73
|
return new Promise((n) => {
|
|
151
74
|
let r = {
|
|
152
|
-
...
|
|
75
|
+
...x,
|
|
153
76
|
...t
|
|
154
|
-
}, i =
|
|
155
|
-
|
|
77
|
+
}, i = S(e), a = r[i], o = x[i];
|
|
78
|
+
w(a, o[a.type]).then(n);
|
|
156
79
|
});
|
|
157
80
|
}
|
|
158
|
-
function
|
|
81
|
+
function w(e, t) {
|
|
159
82
|
return new Promise((n) => {
|
|
160
83
|
if (!e || e.type === "none") {
|
|
161
84
|
n(void 0);
|
|
@@ -166,20 +89,20 @@ function U(e, t) {
|
|
|
166
89
|
}
|
|
167
90
|
//#endregion
|
|
168
91
|
//#region ../../shared/controller-utils/dist/index.js
|
|
169
|
-
var
|
|
92
|
+
var T = Object.defineProperty, E = /* @__PURE__ */ ((e, t) => {
|
|
170
93
|
let n = {};
|
|
171
|
-
for (var r in e)
|
|
94
|
+
for (var r in e) T(n, r, {
|
|
172
95
|
get: e[r],
|
|
173
96
|
enumerable: !0
|
|
174
97
|
});
|
|
175
|
-
return t ||
|
|
176
|
-
})({ enabled: () =>
|
|
177
|
-
function
|
|
98
|
+
return t || T(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
99
|
+
})({ enabled: () => D });
|
|
100
|
+
function D(e, t, n) {
|
|
178
101
|
return e?.partialScoring === !1 || t?.partialScoring === !1 ? !1 : typeof n == "boolean" ? n : !0;
|
|
179
102
|
}
|
|
180
103
|
//#endregion
|
|
181
104
|
//#region src/controller/defaults.ts
|
|
182
|
-
var
|
|
105
|
+
var O = {
|
|
183
106
|
choiceLabel: "",
|
|
184
107
|
choiceLabelEnabled: !0,
|
|
185
108
|
choices: [],
|
|
@@ -200,16 +123,16 @@ var q = {
|
|
|
200
123
|
teacherInstructions: "",
|
|
201
124
|
teacherInstructionsEnabled: !0,
|
|
202
125
|
toolbarEditorPosition: "bottom"
|
|
203
|
-
},
|
|
126
|
+
}, k = (0, m.default)("@pie-element:placement-ordering:controller"), { translator: A } = u, j = () => /* @__PURE__ */ Error("Question is missing required array: correctResponse"), M = (e, t, n) => {
|
|
204
127
|
let r = [], i = t?.value || [];
|
|
205
128
|
e?.correctResponse;
|
|
206
129
|
let a = e?.placementArea === !0;
|
|
207
130
|
if (!i.length) return a ? r.push("Student did not place any tiles in the target area.") : r.push("Student did not reorder any tiles."), r.push("Final score: 0."), r;
|
|
208
|
-
let
|
|
131
|
+
let s = y(e), c = {
|
|
209
132
|
score: 0,
|
|
210
133
|
response: []
|
|
211
134
|
};
|
|
212
|
-
|
|
135
|
+
s.forEach((e) => {
|
|
213
136
|
let t = 0;
|
|
214
137
|
i.forEach((n, r) => {
|
|
215
138
|
e[r] === n && t++;
|
|
@@ -219,44 +142,44 @@ var q = {
|
|
|
219
142
|
});
|
|
220
143
|
});
|
|
221
144
|
let l = c.score, u = i.length - l;
|
|
222
|
-
l > 0 && r.push(`${l} tile(s) placed in the correct order.`), u > 0 && r.push(`${u} tile(s) placed in an incorrect order.`),
|
|
223
|
-
let d =
|
|
145
|
+
l > 0 && r.push(`${l} tile(s) placed in the correct order.`), u > 0 && r.push(`${u} tile(s) placed in an incorrect order.`), s.some((e) => o(e, i));
|
|
146
|
+
let d = E.enabled(e, n || {});
|
|
224
147
|
d ? (r.push("Score calculated using partial scoring."), r.push("Each tile placed in the correct position contributes to the score.")) : (r.push("Score calculated using all-or-nothing scoring."), a ? r.push("Student must place all tiles in the correct positions within the target area to receive full credit.") : r.push("Student must arrange all tiles in the correct order to receive full credit."));
|
|
225
|
-
let f =
|
|
148
|
+
let f = b(e, t), p = d ? f : +(f === 1);
|
|
226
149
|
return r.push(`Final score: ${p}.`), r;
|
|
227
150
|
};
|
|
228
|
-
function
|
|
229
|
-
return new Promise((
|
|
230
|
-
if (!t ||
|
|
231
|
-
|
|
151
|
+
function N(e, t, n) {
|
|
152
|
+
return new Promise((i, a) => {
|
|
153
|
+
if (!t || r(t)) {
|
|
154
|
+
i({
|
|
232
155
|
score: 0,
|
|
233
156
|
empty: !0,
|
|
234
157
|
logTrace: ["Student did not interact with the placement-ordering item."]
|
|
235
158
|
});
|
|
236
159
|
return;
|
|
237
160
|
}
|
|
238
|
-
if (!e || !e.correctResponse ||
|
|
161
|
+
if (!e || !e.correctResponse || r(e.correctResponse)) a(j());
|
|
239
162
|
else try {
|
|
240
|
-
let
|
|
241
|
-
|
|
242
|
-
score:
|
|
243
|
-
logTrace:
|
|
163
|
+
let r = b(e, t);
|
|
164
|
+
i({
|
|
165
|
+
score: E.enabled(e, n || {}) ? r : +(r === 1),
|
|
166
|
+
logTrace: M(e, t, n)
|
|
244
167
|
});
|
|
245
168
|
} catch (e) {
|
|
246
|
-
|
|
169
|
+
a(e);
|
|
247
170
|
}
|
|
248
171
|
});
|
|
249
172
|
}
|
|
250
|
-
function
|
|
173
|
+
function P(e = {}) {
|
|
251
174
|
return new Promise((t) => {
|
|
252
175
|
t({
|
|
253
|
-
...
|
|
176
|
+
...O,
|
|
254
177
|
...e
|
|
255
178
|
});
|
|
256
179
|
});
|
|
257
180
|
}
|
|
258
|
-
var
|
|
259
|
-
...
|
|
181
|
+
var F = (e) => ({
|
|
182
|
+
...O,
|
|
260
183
|
rationaleEnabled: !0,
|
|
261
184
|
feedbackEnabled: !1,
|
|
262
185
|
promptEnabled: !0,
|
|
@@ -264,56 +187,56 @@ var Q = (e) => ({
|
|
|
264
187
|
studentInstructionsEnabled: !0,
|
|
265
188
|
...e
|
|
266
189
|
});
|
|
267
|
-
async function
|
|
268
|
-
let
|
|
269
|
-
if (
|
|
270
|
-
orientation:
|
|
271
|
-
includeTargets:
|
|
272
|
-
choiceLabelEnabled:
|
|
273
|
-
targetLabel:
|
|
274
|
-
choiceLabel:
|
|
275
|
-
showOrdering:
|
|
276
|
-
allowSameChoiceInTargets: !
|
|
277
|
-
},
|
|
278
|
-
let
|
|
279
|
-
let r =
|
|
280
|
-
return r >
|
|
281
|
-
arr:
|
|
190
|
+
async function I(t, n, r) {
|
|
191
|
+
let a = F(t), c = {};
|
|
192
|
+
if (t.alternateResponses && i(t.alternateResponses, e) && (k("Deprecated structure of alternateResponses is in use"), console.error("Deprecated structure of alternateResponses is in use")), c.env = r, c.extraCSSRules = a.extraCSSRules, c.outcomes = [], c.completeLength = (a.correctResponse || []).length, c.choices = (a.choices || []).filter((e) => e.label), c.note = a.note, c.showNote = a.alternateResponses && a.alternateResponses.length > 0, c.language = a.language, k("[model] removing tileSize for the moment."), c.prompt = a.promptEnabled ? a.prompt : null, c.config = {
|
|
193
|
+
orientation: a.orientation || "vertical",
|
|
194
|
+
includeTargets: a.placementArea,
|
|
195
|
+
choiceLabelEnabled: a.choiceLabelEnabled,
|
|
196
|
+
targetLabel: a.targetLabel,
|
|
197
|
+
choiceLabel: a.choiceLabel,
|
|
198
|
+
showOrdering: a.numberedGuides,
|
|
199
|
+
allowSameChoiceInTargets: !a.removeTilesAfterPlacing
|
|
200
|
+
}, c.disabled = r.mode !== "gather", c.note ||= A.t("common:commonCorrectAnswerWithAlternates", { lng: a.language }), r.role === "instructor" && (r.mode === "view" || r.mode === "evaluate") ? (c.rationale = a.rationaleEnabled ? a.rationale : null, c.teacherInstructions = a.teacherInstructionsEnabled ? a.teacherInstructions : null) : (c.rationale = null, c.teacherInstructions = null), r.mode === "evaluate") {
|
|
201
|
+
let e = n && n.value || [], i = y(a), u = i.reduce((t, n) => {
|
|
202
|
+
let r = s(e, (e, t, r) => e + (Array.isArray(n) && n[r] === t ? 1 : 0), 0);
|
|
203
|
+
return r > t.score ? {
|
|
204
|
+
arr: n,
|
|
282
205
|
score: r
|
|
283
|
-
} :
|
|
206
|
+
} : t;
|
|
284
207
|
}, {
|
|
285
208
|
arr: [],
|
|
286
209
|
score: 0
|
|
287
210
|
});
|
|
288
|
-
|
|
211
|
+
c.outcomes = l(e, (e, t) => ({
|
|
289
212
|
id: e,
|
|
290
|
-
outcome:
|
|
213
|
+
outcome: u.arr[t] === e ? "correct" : "incorrect"
|
|
291
214
|
}));
|
|
292
|
-
let
|
|
293
|
-
return
|
|
294
|
-
} else return
|
|
215
|
+
let d = i.some((t) => o(t, e)), f = b(t, n), p = f === 1, m = !p && E.enabled(a, r || {}) && f !== 0;
|
|
216
|
+
return c.correctness = p ? "correct" : m ? "partial" : "incorrect", d || (c.correctResponse = v(a)), a.feedback || (a.feedbackEnabled = !1), c.feedback = a.feedbackEnabled ? await C(c.correctness, a.feedback) : void 0, c;
|
|
217
|
+
} else return c;
|
|
295
218
|
}
|
|
296
|
-
var
|
|
219
|
+
var L = (e, t) => new Promise((n) => {
|
|
297
220
|
t.mode !== "evaluate" && t.role === "instructor" ? n({
|
|
298
221
|
id: "1",
|
|
299
|
-
value:
|
|
222
|
+
value: v(e)
|
|
300
223
|
}) : n(null);
|
|
301
|
-
}),
|
|
302
|
-
let { choices: n, correctResponse:
|
|
224
|
+
}), R = (e) => (e || "").replace(/(<(?!img|iframe|source)([^>]+)>)/gi, ""), z = (e = {}, t = {}) => {
|
|
225
|
+
let { choices: n, correctResponse: i } = e, a = {};
|
|
303
226
|
[
|
|
304
227
|
"teacherInstructions",
|
|
305
228
|
"prompt",
|
|
306
229
|
"rationale"
|
|
307
230
|
].forEach((n) => {
|
|
308
|
-
t[n]?.required &&
|
|
231
|
+
t[n]?.required && !R(e[n]) && (a[n] = "This field is required.");
|
|
309
232
|
});
|
|
310
|
-
let
|
|
311
|
-
return
|
|
233
|
+
let s = [...n || []].reverse(), c = {};
|
|
234
|
+
return s.forEach((e, t) => {
|
|
312
235
|
let { id: n, label: r } = e;
|
|
313
|
-
|
|
314
|
-
}),
|
|
236
|
+
R(r) ? s.slice(t + 1).some((e) => e.label === r) && (c[n] = "Content should be unique.") : c[n] = "Content should not be empty.";
|
|
237
|
+
}), o((n || []).map((e) => e.id), (i || []).map((e) => e.id || e)) && (a.orderError = "The correct ordering should not be identical to the initial ordering."), r(c) || (a.choicesErrors = c), a;
|
|
315
238
|
};
|
|
316
239
|
//#endregion
|
|
317
|
-
export {
|
|
240
|
+
export { L as createCorrectResponseSession, P as createDefaultModel, M as getLogTrace, I as model, F as normalize, N as outcome, j as questionError, z as validate };
|
|
318
241
|
|
|
319
242
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/noop.js","../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayReduce.js","../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/differenceWith.js","../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEvery.js","../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseEvery.js","../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/every.js","../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseReduce.js","../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/reduce.js","../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createSet.js","../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUniq.js","../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/uniq.js","../../../../../../node_modules/.bun/js-combinatorics@2.1.2/node_modules/js-combinatorics/combinatorics.js","../../../src/controller/scoring.ts","../../../../../shared/feedback/dist/index.js","../../../../../shared/controller-utils/dist/index.js","../../../src/controller/defaults.ts","../../../src/controller/index.ts"],"sourcesContent":["/**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\nfunction noop() {\n // No operation performed.\n}\n\nexport default noop;\n","/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\nexport default arrayReduce;\n","import baseDifference from './_baseDifference.js';\nimport baseFlatten from './_baseFlatten.js';\nimport baseRest from './_baseRest.js';\nimport isArrayLikeObject from './isArrayLikeObject.js';\nimport last from './last.js';\n\n/**\n * This method is like `_.difference` except that it accepts `comparator`\n * which is invoked to compare elements of `array` to `values`. The order and\n * references of result values are determined by the first array. The comparator\n * is invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.pullAllWith`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n *\n * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }]\n */\nvar differenceWith = baseRest(function(array, values) {\n var comparator = last(values);\n if (isArrayLikeObject(comparator)) {\n comparator = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)\n : [];\n});\n\nexport default differenceWith;\n","/**\n * A specialized version of `_.every` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n */\nfunction arrayEvery(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (!predicate(array[index], index, array)) {\n return false;\n }\n }\n return true;\n}\n\nexport default arrayEvery;\n","import baseEach from './_baseEach.js';\n\n/**\n * The base implementation of `_.every` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`\n */\nfunction baseEvery(collection, predicate) {\n var result = true;\n baseEach(collection, function(value, index, collection) {\n result = !!predicate(value, index, collection);\n return result;\n });\n return result;\n}\n\nexport default baseEvery;\n","import arrayEvery from './_arrayEvery.js';\nimport baseEvery from './_baseEvery.js';\nimport baseIteratee from './_baseIteratee.js';\nimport isArray from './isArray.js';\nimport isIterateeCall from './_isIterateeCall.js';\n\n/**\n * Checks if `predicate` returns truthy for **all** elements of `collection`.\n * Iteration is stopped once `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * **Note:** This method returns `true` for\n * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because\n * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of\n * elements of empty collections.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n * @example\n *\n * _.every([true, 1, null, 'yes'], Boolean);\n * // => false\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.every(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.every(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.every(users, 'active');\n * // => false\n */\nfunction every(collection, predicate, guard) {\n var func = isArray(collection) ? arrayEvery : baseEvery;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, baseIteratee(predicate, 3));\n}\n\nexport default every;\n","/**\n * The base implementation of `_.reduce` and `_.reduceRight`, without support\n * for iteratee shorthands, which iterates over `collection` using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} accumulator The initial value.\n * @param {boolean} initAccum Specify using the first or last element of\n * `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\nfunction baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {\n eachFunc(collection, function(value, index, collection) {\n accumulator = initAccum\n ? (initAccum = false, value)\n : iteratee(accumulator, value, index, collection);\n });\n return accumulator;\n}\n\nexport default baseReduce;\n","import arrayReduce from './_arrayReduce.js';\nimport baseEach from './_baseEach.js';\nimport baseIteratee from './_baseIteratee.js';\nimport baseReduce from './_baseReduce.js';\nimport isArray from './isArray.js';\n\n/**\n * Reduces `collection` to a value which is the accumulated result of running\n * each element in `collection` thru `iteratee`, where each successive\n * invocation is supplied the return value of the previous. If `accumulator`\n * is not given, the first element of `collection` is used as the initial\n * value. The iteratee is invoked with four arguments:\n * (accumulator, value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.reduce`, `_.reduceRight`, and `_.transform`.\n *\n * The guarded methods are:\n * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,\n * and `sortBy`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduceRight\n * @example\n *\n * _.reduce([1, 2], function(sum, n) {\n * return sum + n;\n * }, 0);\n * // => 3\n *\n * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * return result;\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)\n */\nfunction reduce(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduce : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, baseIteratee(iteratee, 4), accumulator, initAccum, baseEach);\n}\n\nexport default reduce;\n","import Set from './_Set.js';\nimport noop from './noop.js';\nimport setToArray from './_setToArray.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\nvar createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n};\n\nexport default createSet;\n","import SetCache from './_SetCache.js';\nimport arrayIncludes from './_arrayIncludes.js';\nimport arrayIncludesWith from './_arrayIncludesWith.js';\nimport cacheHas from './_cacheHas.js';\nimport createSet from './_createSet.js';\nimport setToArray from './_setToArray.js';\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\nfunction baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n}\n\nexport default baseUniq;\n","import baseUniq from './_baseUniq.js';\n\n/**\n * Creates a duplicate-free version of an array, using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons, in which only the first occurrence of each element\n * is kept. The order of result values is determined by the order they occur\n * in the array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniq([2, 1, 2]);\n * // => [2, 1]\n */\nfunction uniq(array) {\n return (array && array.length) ? baseUniq(array) : [];\n}\n\nexport default uniq;\n","/**\n * combinatorics.js\n *\n * Licensed under the MIT license.\n * http://www.opensource.org/licenses/mit-license.php\n *\n * @author: Dan Kogai <dankogai+github@gmail.com>\n *\n * References:\n * @link: http://www.ruby-doc.org/core-2.0/Array.html#method-i-combination\n * @link: http://www.ruby-doc.org/core-2.0/Array.html#method-i-permutation\n * @link: http://en.wikipedia.org/wiki/Factorial_number_system\n * @link: https://en.wikipedia.org/wiki/Combinatorial_number_system\n */\nexport const version = '2.1.2';\n/**\n * calculates `P(n, k)`.\n *\n * @link https://en.wikipedia.org/wiki/Permutation\n */\nexport function permutation(n, k) {\n if (n < 0)\n throw new RangeError(`${n} is out of range`);\n if (k < 0)\n throw new RangeError(`${k} is out of range`);\n if (0 == k)\n return 1n;\n if (n < k)\n return 0n;\n let [bn, bk, bp] = [BigInt(n), BigInt(k), 1n];\n while (bk--)\n bp *= bn--;\n return bp;\n}\n/**\n * calculates `C(n, k)`.\n *\n * @link https://en.wikipedia.org/wiki/Combination\n */\nexport function combination(n, k) {\n if (0 == k)\n return 1n;\n if (n == k)\n return 1n;\n if (n < k)\n return 0n;\n return permutation(n, k) / permutation(k, k);\n}\n/**\n * calculates `n!` === `P(n, n)`.\n *\n * @link https://en.wikipedia.org/wiki/Factorial\n */\nexport function factorial(n) {\n return permutation(n, n);\n}\n/**\n * returns the factoradic representation of `n`, least significant order.\n *\n * @link https://en.wikipedia.org/wiki/Factorial_number_system\n * @param {number} l the number of digits\n */\nexport function factoradic(n, l = 0) {\n if (n < 0)\n throw new RangeError(`${n} is out of range`);\n let [bn, bf] = [BigInt(n), 1n];\n if (!l) {\n for (l = 1; bf < bn; bf *= BigInt(++l))\n ;\n if (bn < bf)\n bf /= BigInt(l--);\n }\n else {\n bf = BigInt(factorial(l));\n }\n let digits = [0];\n for (; l; bf /= BigInt(l--)) {\n digits[l] = Number(bn / bf);\n bn %= bf;\n }\n return digits;\n}\n/**\n * `combinadic(n, k)` returns a function\n * that takes `m` as an argument and\n * returns the combinadics representation of `m` for `n C k`.\n *\n * @link https://en.wikipedia.org/wiki/Combinatorial_number_system\n */\nexport function combinadic(n, k) {\n const count = combination(n, k);\n const [bn, bk] = [BigInt(n), BigInt(k)];\n return (m) => {\n if (m < 0 || count <= m)\n throw new RangeError(`${m} is out of range`);\n let digits = [];\n let [ba, bb] = [bn, bk];\n let x = BigInt(count) - 1n - BigInt(m);\n for (let i = 0; i < k; i++) {\n ba--;\n while (x < combination(ba, bb))\n ba--;\n digits.push(Number(bn - 1n - ba));\n x -= combination(ba, bb);\n bb--;\n }\n return digits;\n };\n}\n/**\n *\n */\nconst _crypto = typeof crypto !== 'undefined' ? crypto : {};\nconst _randomBytes = typeof _crypto['randomBytes'] === 'function'\n ? (len) => Uint8Array.from(_crypto['randomBytes'](len))\n : typeof _crypto['getRandomValues'] === 'function'\n ? (len) => _crypto['getRandomValues'](new Uint8Array(len))\n : (len) => Uint8Array.from(Array(len), () => Math.random() * 256);\n/**\n * returns random integer `n` where `min` <= `n` < `max`:\n *\n * if the argument is `BigInt` the result is also `BigInt`.\n *\n * @param {anyint} min\n * @param {anyint} max\n */\nexport function randomInteger(min = 0, max = Math.pow(2, 53)) {\n let ctor = min.constructor;\n if (arguments.length === 0) {\n return Math.floor(Math.random() * ctor(max));\n }\n if (arguments.length == 1) {\n [min, max] = [ctor(0), min];\n }\n if (typeof min == 'number') { // number\n [min, max] = [Math.ceil(Number(min)), Math.ceil(Number(max))];\n return Math.floor(Math.random() * (max - min)) + min;\n }\n const mag = ctor(max) - ctor(min);\n const len = mag.toString(16).length;\n const u8s = _randomBytes(len);\n const rnd = u8s.reduce((a, v) => ((a << ctor(8)) + ctor(v)), ctor(0));\n return ((ctor(rnd) * mag) >> ctor(len * 8)) + ctor(min);\n}\n;\n/**\n * Base Class of `js-combinatorics`\n */\nclass _CBase {\n /**\n * does `new`\n * @param args\n */\n static of(...args) {\n return new (Function.prototype.bind.apply(this, [null].concat(args)));\n }\n /**\n * Same as `of` but takes a single array `arg`\n *\n * cf. https://stackoverflow.com/questions/1606797/use-of-apply-with-new-operator-is-this-possible\n */\n static from(arg) {\n return new (Function.prototype.bind.apply(this, [null].concat(arg)));\n }\n /**\n * Common iterator\n */\n [Symbol.iterator]() {\n return function* (it, len) {\n for (let i = 0n; i < len; i++)\n yield it.at(i);\n }(this, this.length);\n }\n /**\n * returns `[...this]`.\n */\n toArray() {\n return [...this];\n }\n /**\n * @deprecated\n * tells wether you need `BigInt` to access all elements.\n */\n get isBig() {\n return Number.MAX_SAFE_INTEGER < this.length;\n }\n /**\n * @deprecated\n * tells wether it is safe to work on this instance.\n *\n * * always `true` unless your platform does not support `BigInt`.\n * * if not, `true` iff `.isBig` is `false`.\n */\n get isSafe() {\n return typeof BigInt !== 'undefined' || !this.isBig;\n }\n /**\n * check n for nth\n */\n _check(n) {\n if (n < 0) {\n if (this.length < -n)\n throw new RangeError(`${n} is out of range`);\n return BigInt(this.length) + BigInt(n);\n }\n if (this.length <= n)\n throw new RangeError(`${n} is out of range`);\n return n;\n }\n /**\n * get the `n`th element of the iterator.\n * negative `n` goes backwards\n * like `Array.prototype.at()`\n * @link: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at\n */\n at(n) { return undefined; }\n /**\n * an alias of `at`\n */\n nth(n) { return this.at(n); }\n /**\n * the seed iterable\n */\n seed;\n /**\n * the size (# of elements) of each element.\n */\n size;\n /**\n * the number of elements\n */\n length;\n /**\n * pick random element\n */\n sample() {\n return this.at(randomInteger(this.length));\n }\n /**\n * an infinite steam of random elements\n */\n samples() {\n return function* (it) {\n while (true)\n yield it.sample();\n }(this);\n }\n}\n/**\n * Permutation\n */\nexport class Permutation extends _CBase {\n constructor(seed, size = 0) {\n super();\n this.seed = [...seed];\n this.size = 0 < size ? size : this.seed.length;\n this.length = permutation(this.seed.length, this.size);\n Object.freeze(this);\n }\n at(n) {\n n = this._check(n);\n if (n === undefined)\n return undefined;\n const offset = this.seed.length - this.size;\n const skip = factorial(offset);\n let digits = factoradic(BigInt(n) * BigInt(skip), this.seed.length);\n let source = this.seed.slice();\n let result = [];\n for (let i = this.seed.length - 1; offset <= i; i--) {\n result.push(source.splice(digits[i], 1)[0]);\n }\n return result;\n }\n}\n/**\n * Combination\n */\nexport class Combination extends _CBase {\n comb;\n constructor(seed, size = 0) {\n super();\n this.seed = [...seed];\n this.size = 0 < size ? size : this.seed.length;\n this.size = size;\n this.length = combination(this.seed.length, this.size);\n this.comb = combinadic(this.seed.length, this.size);\n Object.freeze(this);\n }\n /**\n * returns an iterator which is more efficient\n * than the default iterator that uses .nth\n *\n * @link https://en.wikipedia.org/wiki/Combinatorial_number_system#Applications\n */\n bitwiseIterator() {\n // [Symbol.iterator]() {\n // console.log('overriding _CBase');\n const inc = (x) => {\n if (x <= 0n)\n return 0n;\n const u = x & -x;\n const v = u + x;\n return v + (((v ^ x) / u) >> 2n);\n };\n let x = (1n << BigInt(this.size)) - 1n; // 0b11...1\n return function* (it, len) {\n for (let i = 0n; i < BigInt(len); i++, x = inc(x)) {\n let result = [];\n for (let y = x, j = 0; 0n < y; y >>= 1n, j++) {\n if (y & 1n)\n result.push(it.seed[j]);\n }\n // console.log(`x = ${x}`);\n yield result;\n }\n }(this, this.length);\n }\n at(n) {\n n = this._check(n);\n if (n === undefined)\n return undefined;\n let result = [];\n for (let i of this.comb(n)) {\n result.push(this.seed[i]);\n }\n return result;\n }\n}\n/**\n * Base N\n */\nexport class BaseN extends _CBase {\n base;\n constructor(seed, size = 1) {\n if (size < 1)\n throw new RangeError(`${size} is out of range`);\n super();\n this.seed = [...seed];\n this.size = size;\n let base = this.seed.length;\n this.base = base;\n this.length = BigInt(base) ** BigInt(size);\n Object.freeze(this);\n }\n at(n) {\n n = this._check(n);\n if (n === undefined)\n return undefined;\n let bn = BigInt(n);\n const bb = BigInt(this.base);\n let result = [];\n for (let i = 0; i < this.size; i++) {\n let bd = bn % bb;\n result.push(this.seed[Number(bd)]);\n bn -= bd;\n bn /= bb;\n }\n return result;\n }\n}\n/**\n * Power Set\n */\nexport class PowerSet extends _CBase {\n constructor(seed) {\n super();\n this.seed = [...seed];\n const length = 1n << BigInt(this.seed.length);\n this.length = length;\n Object.freeze(this);\n }\n at(n) {\n n = this._check(n);\n if (n === undefined)\n return undefined;\n let bn = BigInt(n);\n let result = [];\n for (let bi = 0n; bn; bn >>= 1n, bi++)\n if (bn & 1n)\n result.push(this.seed[Number(bi)]);\n return result;\n }\n}\n/**\n * Cartesian Product\n */\nexport class CartesianProduct extends _CBase {\n constructor(...args) {\n super();\n this.seed = args.map(v => [...v]);\n this.size = this.seed.length;\n const length = this.seed.reduce((a, v) => a * BigInt(v.length), 1n);\n this.length = length;\n Object.freeze(this);\n }\n at(n) {\n n = this._check(n);\n if (n === undefined)\n return undefined;\n let bn = BigInt(n);\n let result = [];\n for (let i = 0; i < this.size; i++) {\n const base = this.seed[i].length;\n const bb = BigInt(base);\n const bd = bn % bb;\n result.push(this.seed[i][Number(bd)]);\n bn -= bd;\n bn /= bb;\n }\n return result;\n }\n}\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/placement-ordering/controller/src/scoring.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport { differenceWith, isEqual, uniq } from 'lodash-es';\nimport { combination } from 'js-combinatorics';\nimport debug from 'debug';\n\nconst log = debug('pie-elements:placement-ordering:controller');\n\nexport const illegalArgumentError = (answer) =>\n new Error(`Cant score answer: ${answer} it has duplicates and allowDuplicates is false`);\nexport const pairwiseCombinationScore = (correct, answer, opts) => {\n opts = { allowDuplicates: false, orderMustBeComplete: false, ...opts };\n\n if (!opts.allowDuplicates && !isEqual(uniq(correct), correct)) {\n throw illegalArgumentError(answer);\n }\n\n if (opts.allowDuplicates === false && answer.length !== uniq(answer).length) {\n return 0;\n }\n\n answer = opts.allowDuplicates !== false ? answer : uniq(answer);\n\n log('answer:', answer);\n if (!Array.isArray(correct) || correct.length === 0) {\n throw new Error('correct must be non empty an array');\n }\n\n if (correct.length === 1) {\n return isEqual(correct, answer) ? 1 : 0;\n }\n\n if (!Array.isArray(answer) || answer.length < 2) {\n return 0;\n }\n\n if (answer.length > correct.length) {\n return 0;\n }\n\n if (correct.length !== answer.length && opts.orderMustBeComplete) {\n return 0;\n }\n\n const correctCombo = combination(correct, 2).toArray();\n const answerCombo = combination(answer, 2).toArray();\n\n const diff = differenceWith(answerCombo, correctCombo, isEqual);\n\n const comboLengthDiff = correctCombo.length - answerCombo.length;\n\n const total = correctCombo.length;\n const actual = total - diff.length - comboLengthDiff;\n\n const n = (actual / total).toFixed(2);\n\n return parseFloat(n);\n};\n\n/**\n * Flattens the correctResponse into an array of ordered identifiers representing the\n * correct response.\n */\nexport const flattenCorrect = (question) =>\n question.correctResponse ? question.correctResponse.map((r) => (r && r.id ? r.id : r)) : [];\n\n/**\n * Returns all correct responses for this question\n * @param question - array\n */\nexport const getAllCorrectResponses = (question) => {\n const alternates = (question.alternateResponses || [])\n .map((alternate) => {\n if (Array.isArray(alternate)) {\n return alternate;\n }\n\n return alternate.response;\n })\n .filter((item) => item !== undefined);\n\n return [flattenCorrect(question), ...alternates];\n};\n\n/**\n * Returns the score for a session. If weighted scoring is present in the correctResponse\n * field for the question, this will be used. If partial scoring is present in the question\n * model, this will be used. Otherwise the default scoring mechanism (0 for any incorrect, 1\n * for all correct) will be used.\n */\n\nexport const score = (question, session) => {\n const { value } = session || {};\n\n if (!value) {\n return 0;\n }\n\n const allCorrectResponse = getAllCorrectResponses(question);\n const allowDuplicates = (question.configure && question.configure.removeTilesAfterPlacing) !== false;\n\n /**\n * We require this to be the case - locking\n */\n //const orderMustBeComplete = true;\n\n let bestScore = 0;\n\n allCorrectResponse.forEach((cr) => {\n const currentScore = pairwiseCombinationScore(cr, value, {\n allowDuplicates,\n });\n\n if (currentScore >= bestScore) {\n bestScore = currentScore;\n }\n });\n\n return bestScore;\n};\n","//#region src/defaults.ts\nvar e = {\n\tcorrect: {\n\t\ttype: \"default\",\n\t\tdefault: \"Correct\",\n\t\tcustom: \"Correct\"\n\t},\n\tincorrect: {\n\t\ttype: \"default\",\n\t\tdefault: \"Incorrect\",\n\t\tcustom: \"Incorrect\"\n\t},\n\tpartial: {\n\t\ttype: \"default\",\n\t\tdefault: \"Nearly\",\n\t\tcustom: \"Nearly\"\n\t},\n\tunanswered: {\n\t\ttype: \"default\",\n\t\tdefault: \"You have not entered a response\",\n\t\tcustom: \"You have not entered a response\"\n\t}\n};\n//#endregion\n//#region src/utils.ts\nfunction t(e) {\n\treturn e === \"partially-correct\" ? \"partial\" : e;\n}\n//#endregion\n//#region src/index.ts\nfunction n(n, i = {}) {\n\treturn new Promise((a) => {\n\t\tlet o = {\n\t\t\t...e,\n\t\t\t...i\n\t\t}, s = t(n), c = o[s], l = e[s];\n\t\tr(c, l[c.type]).then(a);\n\t});\n}\nfunction r(e, t) {\n\treturn new Promise((n) => {\n\t\tif (!e || e.type === \"none\") {\n\t\t\tn(void 0);\n\t\t\treturn;\n\t\t}\n\t\tn(e[e.type] || t);\n\t});\n}\nfunction i(n, r = {}) {\n\tlet i = {\n\t\t...e,\n\t\t...r\n\t}, o = t(n), s = i[o], c = e[o];\n\treturn a(s, c[s.type]);\n}\nfunction a(e, t) {\n\tif (!(!e || e.type === \"none\")) return e[e.type] || t;\n}\n//#endregion\nexport { e as defaultFeedback, a as getActualFeedback, i as getActualFeedbackForCorrectness, r as getFeedback, n as getFeedbackForCorrectness, t as normalizeCorrectness };\n","//#region \\0rolldown/runtime.js\nvar e = Object.defineProperty, t = (t, n) => {\n\tlet r = {};\n\tfor (var i in t) e(r, i, {\n\t\tget: t[i],\n\t\tenumerable: !0\n\t});\n\treturn n || e(r, Symbol.toStringTag, { value: \"Module\" }), r;\n};\n//#endregion\n//#region src/persistence.ts\nfunction n(e) {\n\treturn Array.isArray(e) ? e.filter((e) => e != null) : [];\n}\nfunction r(e) {\n\tlet t = [...e];\n\tfor (let e = t.length - 1; e > 0; e--) {\n\t\tlet n = Math.floor(Math.random() * (e + 1));\n\t\t[t[e], t[n]] = [t[n], t[e]];\n\t}\n\treturn t;\n}\nfunction i(e) {\n\treturn e == null ? !0 : Array.isArray(e) ? e.length === 0 : typeof e == \"object\" ? Object.keys(e).length === 0 : !1;\n}\nasync function a(e, t, a, o = \"value\") {\n\tlet s = n(t?.data?.shuffledValues ?? t?.shuffledValues ?? []);\n\tif (!t) {\n\t\tconsole.warn(\"Unable to save shuffled choices because there's no session.\");\n\t\treturn;\n\t}\n\tif (!i(s)) return n(s.map((t) => e.find((e) => e[o] === t)));\n\tlet c = r(e);\n\tif (a && typeof a == \"function\") try {\n\t\tlet e = n(c.map((e) => e[o]));\n\t\ti(e) ? console.error(`shuffledValues is an empty array - refusing to call updateSession. shuffledChoices: ${JSON.stringify(c)}, key: ${o}`) : t.id && t.element && await a(t.id, t.element, { shuffledValues: e });\n\t} catch (e) {\n\t\tconsole.warn(\"Unable to save shuffled order for choices\"), console.error(e);\n\t}\n\telse console.warn(\"Unable to save shuffled choices, shuffle will happen every time.\");\n\treturn c;\n}\nfunction o(e, t, n) {\n\treturn !!(e.lockChoiceOrder || n[\"@pie-element\"]?.lockChoiceOrder || (n.role ?? \"student\") === \"instructor\");\n}\n//#endregion\n//#region src/partial-scoring.ts\nvar s = /* @__PURE__ */ t({ enabled: () => c });\nfunction c(e, t, n) {\n\treturn e?.partialScoring === !1 || t?.partialScoring === !1 ? !1 : typeof n == \"boolean\" ? n : !0;\n}\n//#endregion\nexport { a as getShuffledChoices, o as lockChoices, s as partialScoring };\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/placement-ordering/controller/src/defaults.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nexport default {\n choiceLabel: '',\n choiceLabelEnabled: true,\n choices: [],\n correctResponse: [],\n feedbackEnabled: false,\n numberedGuides: false,\n orientation: 'vertical',\n partialScoring: true,\n placementArea: false,\n prompt: '',\n promptEnabled: true,\n rationale: '',\n rationaleEnabled: true,\n removeTilesAfterPlacing: true,\n scoringType: 'auto',\n studentInstructionsEnabled: true,\n targetLabel: '',\n teacherInstructions: '',\n teacherInstructionsEnabled: true,\n toolbarEditorPosition: 'bottom',\n};\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/placement-ordering/controller/src/index.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport { flattenCorrect, getAllCorrectResponses, score } from './scoring.js';\n\nimport { every, isArray, isEmpty, isEqual, map, reduce } from 'lodash-es';\nimport { getFeedbackForCorrectness } from '@pie-element/shared-feedback';\nimport { partialScoring } from '@pie-element/shared-controller-utils';\nimport debug from 'debug';\n\nimport defaults from './defaults.js';\n\nconst log = debug('@pie-element:placement-ordering:controller');\nimport Translator from '@pie-lib/translator';\n\nconst { translator } = Translator;\n\nexport const questionError = () => new Error('Question is missing required array: correctResponse');\n\n/**\n * Generates detailed trace log for placement-ordering scoring evaluation\n * @param {Object} question - the question model\n * @param {Object} session - the student session\n * @param {Object} env - the environment\n * @returns {Array<string>} traceLog\n */\nexport const getLogTrace = (question, session, env) => {\n const traceLog = [];\n\n const value = session?.value || [];\n const correctResponse = question?.correctResponse || [];\n const hasPlacementArea = question?.placementArea === true;\n\n if (!value.length) {\n if (hasPlacementArea) {\n traceLog.push('Student did not place any tiles in the target area.');\n } else {\n traceLog.push('Student did not reorder any tiles.');\n }\n traceLog.push('Final score: 0.');\n return traceLog;\n }\n\n const allCorrectResponses = getAllCorrectResponses(question);\n\n let bestMatch = { score: 0, response: [] };\n\n allCorrectResponses.forEach((cr) => {\n let matchCount = 0;\n value.forEach((v, idx) => {\n if (cr[idx] === v) {\n matchCount++;\n }\n });\n\n if (matchCount > bestMatch.score) {\n bestMatch = { score: matchCount, response: cr };\n }\n });\n\n const correctCount = bestMatch.score;\n const incorrectCount = value.length - correctCount;\n\n if (correctCount > 0) {\n traceLog.push(`${correctCount} tile(s) placed in the correct order.`);\n }\n\n if (incorrectCount > 0) {\n traceLog.push(`${incorrectCount} tile(s) placed in an incorrect order.`);\n }\n\n const isFullyCorrect = allCorrectResponses.some((cr) => isEqual(cr, value));\n\n const partialScoringEnabled = partialScoring.enabled(question, env || {});\n\n if (partialScoringEnabled) {\n traceLog.push('Score calculated using partial scoring.');\n traceLog.push(\n 'Each tile placed in the correct position contributes to the score.',\n );\n } else {\n traceLog.push('Score calculated using all-or-nothing scoring.');\n if (hasPlacementArea) {\n traceLog.push(\n 'Student must place all tiles in the correct positions within the target area to receive full credit.',\n );\n } else {\n traceLog.push(\n 'Student must arrange all tiles in the correct order to receive full credit.',\n );\n }\n }\n\n const rawScore = score(question, session);\n const finalScore = partialScoringEnabled ? rawScore : rawScore === 1 ? 1 : 0;\n\n traceLog.push(`Final score: ${finalScore}.`);\n\n return traceLog;\n};\n\nexport function outcome(question, session, env) {\n return new Promise((resolve, reject) => {\n if (!session || isEmpty(session)) {\n resolve({ \n score: 0, \n empty: true, \n logTrace: ['Student did not interact with the placement-ordering item.'] \n });\n return;\n }\n\n if (!question || !question.correctResponse || isEmpty(question.correctResponse)) {\n reject(questionError());\n } else {\n try {\n const s = score(question, session);\n const finalScore = partialScoring.enabled(question, env || {}) ? s : s === 1 ? 1 : 0;\n resolve({\n score: finalScore,\n logTrace: getLogTrace(question, session, env)\n });\n } catch (e) {\n reject(e);\n }\n }\n });\n}\n\nexport function createDefaultModel(model = {}) {\n return new Promise((resolve) => {\n resolve({\n ...defaults,\n ...model,\n });\n });\n}\n\nexport const normalize = (question) => ({\n ...defaults,\n rationaleEnabled: true,\n feedbackEnabled: false,\n promptEnabled: true,\n teacherInstructionsEnabled: true,\n studentInstructionsEnabled: true,\n ...question,\n});\n\n/**\n *\n * @param {*} question\n * @param {*} session\n * @param {*} env\n */\nexport async function model(question, session, env) {\n const normalizedQuestion = normalize(question);\n const base = {};\n\n if (question.alternateResponses && every(question.alternateResponses, isArray)) {\n log('Deprecated structure of alternateResponses is in use');\n // eslint-disable-next-line no-console\n console.error('Deprecated structure of alternateResponses is in use');\n }\n\n base.env = env;\n base.extraCSSRules = normalizedQuestion.extraCSSRules;\n base.outcomes = [];\n base.completeLength = (normalizedQuestion.correctResponse || []).length;\n base.choices = (normalizedQuestion.choices || []).filter((choice) => choice.label);\n base.note = normalizedQuestion.note;\n base.showNote = normalizedQuestion.alternateResponses && normalizedQuestion.alternateResponses.length > 0;\n base.language = normalizedQuestion.language;\n\n log('[model] removing tileSize for the moment.');\n\n base.prompt = normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null;\n base.config = {\n orientation: normalizedQuestion.orientation || 'vertical',\n includeTargets: normalizedQuestion.placementArea,\n choiceLabelEnabled: normalizedQuestion.choiceLabelEnabled,\n targetLabel: normalizedQuestion.targetLabel,\n choiceLabel: normalizedQuestion.choiceLabel,\n showOrdering: normalizedQuestion.numberedGuides,\n allowSameChoiceInTargets: !normalizedQuestion.removeTilesAfterPlacing,\n };\n\n base.disabled = env.mode !== 'gather';\n\n if (!base.note) {\n base.note = translator.t('common:commonCorrectAnswerWithAlternates', { lng: normalizedQuestion.language });\n }\n\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n base.rationale = normalizedQuestion.rationaleEnabled ? normalizedQuestion.rationale : null;\n base.teacherInstructions = normalizedQuestion.teacherInstructionsEnabled\n ? normalizedQuestion.teacherInstructions\n : null;\n } else {\n base.rationale = null;\n base.teacherInstructions = null;\n }\n\n if (env.mode === 'evaluate') {\n const value = (session && session.value) || [];\n const allCorrectResponses = getAllCorrectResponses(normalizedQuestion);\n\n const bestSetOfResponses = allCorrectResponses.reduce(\n (info, cr) => {\n const currentScore = reduce(value, (acc, c, idx) => acc + (Array.isArray(cr) && cr[idx] === c ? 1 : 0), 0);\n\n if (currentScore > info.score) {\n return {\n arr: cr,\n score: currentScore,\n };\n }\n\n return info;\n },\n { arr: [], score: 0 },\n );\n\n base.outcomes = map(value, (c, idx) => {\n return {\n id: c,\n outcome: bestSetOfResponses.arr[idx] === c ? 'correct' : 'incorrect',\n };\n });\n\n const isResponseCorrect = allCorrectResponses.some((response) => isEqual(response, value));\n const responseScore = score(question, session);\n const isCorrect = responseScore === 1;\n const isPartialCorrect = !isCorrect && partialScoring.enabled(normalizedQuestion, env || {}) && responseScore !== 0;\n\n base.correctness = isCorrect ? 'correct' : isPartialCorrect ? 'partial' : 'incorrect';\n\n if (!isResponseCorrect) {\n base.correctResponse = flattenCorrect(normalizedQuestion);\n }\n\n // requirement made in PD-2182\n if (!normalizedQuestion.feedback) {\n normalizedQuestion.feedbackEnabled = false;\n }\n\n const feedback = normalizedQuestion.feedbackEnabled\n ? await getFeedbackForCorrectness(base.correctness, normalizedQuestion.feedback)\n : undefined;\n\n base.feedback = feedback;\n return base;\n } else {\n return base;\n }\n}\n\nexport const createCorrectResponseSession = (question, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n resolve({\n id: '1',\n value: flattenCorrect(question),\n });\n } else {\n resolve(null);\n }\n });\n};\n\n// remove all html tags\nconst getInnerText = (html) => (html || '').replaceAll(/<[^>]*>/g, '');\n\n// remove all html tags except img, iframe and source tag for audio\nconst getContent = (html) => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');\n\nexport const validate = (model = {}, config = {}) => {\n const { choices, correctResponse } = model;\n const errors = {};\n\n ['teacherInstructions', 'prompt', 'rationale'].forEach((field) => {\n if (config[field]?.required && !getContent(model[field])) {\n errors[field] = 'This field is required.';\n }\n });\n\n const reversedChoices = [...(choices || [])].reverse();\n const choicesErrors = {};\n\n reversedChoices.forEach((choice, index) => {\n const { id, label } = choice;\n\n if (!getContent(label)) {\n choicesErrors[id] = 'Content should not be empty.';\n } else {\n const identicalAnswer = reversedChoices.slice(index + 1).some((c) => c.label === label);\n\n if (identicalAnswer) {\n choicesErrors[id] = 'Content should be unique.';\n }\n }\n });\n\n const choicesIds = (choices || []).map((choice) => choice.id);\n const correctResponseIds = (correctResponse || []).map((response) => response.id || response);\n\n if (isEqual(choicesIds, correctResponseIds)) {\n errors.orderError = 'The correct ordering should not be identical to the initial ordering.';\n }\n\n if (!isEmpty(choicesErrors)) {\n errors.choicesErrors = choicesErrors;\n }\n\n return errors;\n};\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11],"mappings":";;;;AAYA,SAAS,IAAO,CAEhB;;;ACFA,SAAS,EAAY,GAAO,GAAU,GAAa,GAAW;CAC5D,IAAI,IAAQ,IACR,IAAS,KAAS,OAAO,IAAI,EAAM;CAKvC,KAHI,KAAa,MACf,IAAc,EAAM,EAAE,KAEjB,EAAE,IAAQ,IACf,IAAc,EAAS,GAAa,EAAM,IAAQ,GAAO,CAAK;CAEhE,OAAO;AACT;;;ACMA,IAAI,IAAiB,EAAS,SAAS,GAAO,GAAQ;CACpD,IAAI,IAAa,EAAK,CAAM;CAI5B,OAHI,EAAkB,CAAU,MAC9B,IAAa,KAAA,IAER,E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sC,EAAE,GAE7E,MAAY,IAAQ,CAAC,GAAG,IAAS,CAAC,MAAM;CACnD,IAAM,EAAE,YAAS,uBAAoB,GAC/B,IAAS,CAAC;CAEhB;EAAC;EAAuB;EAAU;CAAW,EAAE,SAAS,MAAU;EAChE,AAAI,EAAO,IAAQ,YAAY,CAAC,EAAW,EAAM,EAAM,MACrD,EAAO,KAAS;CAEpB,CAAC;CAED,IAAM,IAAkB,CAAC,GAAI,KAAW,CAAC,CAAE,EAAE,QAAQ,GAC/C,IAAgB,CAAC;CA2BvB,OAzBA,EAAgB,SAAS,GAAQ,MAAU;EACzC,IAAM,EAAE,OAAI,aAAU;EAEtB,AAAK,EAAW,CAAK,IAGK,EAAgB,MAAM,IAAQ,CAAC,EAAE,MAAM,MAAM,EAAE,UAAU,CAE7E,MACF,EAAc,KAAM,+BALtB,EAAc,KAAM;CAQxB,CAAC,GAKG,GAHgB,KAAW,CAAC,GAAG,KAAK,MAAW,EAAO,EAG9C,IAFgB,KAAmB,CAAC,GAAG,KAAK,MAAa,EAAS,MAAM,CAE5D,CAAkB,MACxC,EAAO,aAAa,0EAGjB,EAAQ,CAAa,MACxB,EAAO,gBAAgB,IAGlB;AACT"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../../node_modules/.bun/js-combinatorics@2.1.2/node_modules/js-combinatorics/combinatorics.js","../../../src/controller/scoring.ts","../../../../../shared/feedback/dist/index.js","../../../../../shared/controller-utils/dist/index.js","../../../src/controller/defaults.ts","../../../src/controller/index.ts"],"sourcesContent":["/**\n * combinatorics.js\n *\n * Licensed under the MIT license.\n * http://www.opensource.org/licenses/mit-license.php\n *\n * @author: Dan Kogai <dankogai+github@gmail.com>\n *\n * References:\n * @link: http://www.ruby-doc.org/core-2.0/Array.html#method-i-combination\n * @link: http://www.ruby-doc.org/core-2.0/Array.html#method-i-permutation\n * @link: http://en.wikipedia.org/wiki/Factorial_number_system\n * @link: https://en.wikipedia.org/wiki/Combinatorial_number_system\n */\nexport const version = '2.1.2';\n/**\n * calculates `P(n, k)`.\n *\n * @link https://en.wikipedia.org/wiki/Permutation\n */\nexport function permutation(n, k) {\n if (n < 0)\n throw new RangeError(`${n} is out of range`);\n if (k < 0)\n throw new RangeError(`${k} is out of range`);\n if (0 == k)\n return 1n;\n if (n < k)\n return 0n;\n let [bn, bk, bp] = [BigInt(n), BigInt(k), 1n];\n while (bk--)\n bp *= bn--;\n return bp;\n}\n/**\n * calculates `C(n, k)`.\n *\n * @link https://en.wikipedia.org/wiki/Combination\n */\nexport function combination(n, k) {\n if (0 == k)\n return 1n;\n if (n == k)\n return 1n;\n if (n < k)\n return 0n;\n return permutation(n, k) / permutation(k, k);\n}\n/**\n * calculates `n!` === `P(n, n)`.\n *\n * @link https://en.wikipedia.org/wiki/Factorial\n */\nexport function factorial(n) {\n return permutation(n, n);\n}\n/**\n * returns the factoradic representation of `n`, least significant order.\n *\n * @link https://en.wikipedia.org/wiki/Factorial_number_system\n * @param {number} l the number of digits\n */\nexport function factoradic(n, l = 0) {\n if (n < 0)\n throw new RangeError(`${n} is out of range`);\n let [bn, bf] = [BigInt(n), 1n];\n if (!l) {\n for (l = 1; bf < bn; bf *= BigInt(++l))\n ;\n if (bn < bf)\n bf /= BigInt(l--);\n }\n else {\n bf = BigInt(factorial(l));\n }\n let digits = [0];\n for (; l; bf /= BigInt(l--)) {\n digits[l] = Number(bn / bf);\n bn %= bf;\n }\n return digits;\n}\n/**\n * `combinadic(n, k)` returns a function\n * that takes `m` as an argument and\n * returns the combinadics representation of `m` for `n C k`.\n *\n * @link https://en.wikipedia.org/wiki/Combinatorial_number_system\n */\nexport function combinadic(n, k) {\n const count = combination(n, k);\n const [bn, bk] = [BigInt(n), BigInt(k)];\n return (m) => {\n if (m < 0 || count <= m)\n throw new RangeError(`${m} is out of range`);\n let digits = [];\n let [ba, bb] = [bn, bk];\n let x = BigInt(count) - 1n - BigInt(m);\n for (let i = 0; i < k; i++) {\n ba--;\n while (x < combination(ba, bb))\n ba--;\n digits.push(Number(bn - 1n - ba));\n x -= combination(ba, bb);\n bb--;\n }\n return digits;\n };\n}\n/**\n *\n */\nconst _crypto = typeof crypto !== 'undefined' ? crypto : {};\nconst _randomBytes = typeof _crypto['randomBytes'] === 'function'\n ? (len) => Uint8Array.from(_crypto['randomBytes'](len))\n : typeof _crypto['getRandomValues'] === 'function'\n ? (len) => _crypto['getRandomValues'](new Uint8Array(len))\n : (len) => Uint8Array.from(Array(len), () => Math.random() * 256);\n/**\n * returns random integer `n` where `min` <= `n` < `max`:\n *\n * if the argument is `BigInt` the result is also `BigInt`.\n *\n * @param {anyint} min\n * @param {anyint} max\n */\nexport function randomInteger(min = 0, max = Math.pow(2, 53)) {\n let ctor = min.constructor;\n if (arguments.length === 0) {\n return Math.floor(Math.random() * ctor(max));\n }\n if (arguments.length == 1) {\n [min, max] = [ctor(0), min];\n }\n if (typeof min == 'number') { // number\n [min, max] = [Math.ceil(Number(min)), Math.ceil(Number(max))];\n return Math.floor(Math.random() * (max - min)) + min;\n }\n const mag = ctor(max) - ctor(min);\n const len = mag.toString(16).length;\n const u8s = _randomBytes(len);\n const rnd = u8s.reduce((a, v) => ((a << ctor(8)) + ctor(v)), ctor(0));\n return ((ctor(rnd) * mag) >> ctor(len * 8)) + ctor(min);\n}\n;\n/**\n * Base Class of `js-combinatorics`\n */\nclass _CBase {\n /**\n * does `new`\n * @param args\n */\n static of(...args) {\n return new (Function.prototype.bind.apply(this, [null].concat(args)));\n }\n /**\n * Same as `of` but takes a single array `arg`\n *\n * cf. https://stackoverflow.com/questions/1606797/use-of-apply-with-new-operator-is-this-possible\n */\n static from(arg) {\n return new (Function.prototype.bind.apply(this, [null].concat(arg)));\n }\n /**\n * Common iterator\n */\n [Symbol.iterator]() {\n return function* (it, len) {\n for (let i = 0n; i < len; i++)\n yield it.at(i);\n }(this, this.length);\n }\n /**\n * returns `[...this]`.\n */\n toArray() {\n return [...this];\n }\n /**\n * @deprecated\n * tells wether you need `BigInt` to access all elements.\n */\n get isBig() {\n return Number.MAX_SAFE_INTEGER < this.length;\n }\n /**\n * @deprecated\n * tells wether it is safe to work on this instance.\n *\n * * always `true` unless your platform does not support `BigInt`.\n * * if not, `true` iff `.isBig` is `false`.\n */\n get isSafe() {\n return typeof BigInt !== 'undefined' || !this.isBig;\n }\n /**\n * check n for nth\n */\n _check(n) {\n if (n < 0) {\n if (this.length < -n)\n throw new RangeError(`${n} is out of range`);\n return BigInt(this.length) + BigInt(n);\n }\n if (this.length <= n)\n throw new RangeError(`${n} is out of range`);\n return n;\n }\n /**\n * get the `n`th element of the iterator.\n * negative `n` goes backwards\n * like `Array.prototype.at()`\n * @link: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at\n */\n at(n) { return undefined; }\n /**\n * an alias of `at`\n */\n nth(n) { return this.at(n); }\n /**\n * the seed iterable\n */\n seed;\n /**\n * the size (# of elements) of each element.\n */\n size;\n /**\n * the number of elements\n */\n length;\n /**\n * pick random element\n */\n sample() {\n return this.at(randomInteger(this.length));\n }\n /**\n * an infinite steam of random elements\n */\n samples() {\n return function* (it) {\n while (true)\n yield it.sample();\n }(this);\n }\n}\n/**\n * Permutation\n */\nexport class Permutation extends _CBase {\n constructor(seed, size = 0) {\n super();\n this.seed = [...seed];\n this.size = 0 < size ? size : this.seed.length;\n this.length = permutation(this.seed.length, this.size);\n Object.freeze(this);\n }\n at(n) {\n n = this._check(n);\n if (n === undefined)\n return undefined;\n const offset = this.seed.length - this.size;\n const skip = factorial(offset);\n let digits = factoradic(BigInt(n) * BigInt(skip), this.seed.length);\n let source = this.seed.slice();\n let result = [];\n for (let i = this.seed.length - 1; offset <= i; i--) {\n result.push(source.splice(digits[i], 1)[0]);\n }\n return result;\n }\n}\n/**\n * Combination\n */\nexport class Combination extends _CBase {\n comb;\n constructor(seed, size = 0) {\n super();\n this.seed = [...seed];\n this.size = 0 < size ? size : this.seed.length;\n this.size = size;\n this.length = combination(this.seed.length, this.size);\n this.comb = combinadic(this.seed.length, this.size);\n Object.freeze(this);\n }\n /**\n * returns an iterator which is more efficient\n * than the default iterator that uses .nth\n *\n * @link https://en.wikipedia.org/wiki/Combinatorial_number_system#Applications\n */\n bitwiseIterator() {\n // [Symbol.iterator]() {\n // console.log('overriding _CBase');\n const inc = (x) => {\n if (x <= 0n)\n return 0n;\n const u = x & -x;\n const v = u + x;\n return v + (((v ^ x) / u) >> 2n);\n };\n let x = (1n << BigInt(this.size)) - 1n; // 0b11...1\n return function* (it, len) {\n for (let i = 0n; i < BigInt(len); i++, x = inc(x)) {\n let result = [];\n for (let y = x, j = 0; 0n < y; y >>= 1n, j++) {\n if (y & 1n)\n result.push(it.seed[j]);\n }\n // console.log(`x = ${x}`);\n yield result;\n }\n }(this, this.length);\n }\n at(n) {\n n = this._check(n);\n if (n === undefined)\n return undefined;\n let result = [];\n for (let i of this.comb(n)) {\n result.push(this.seed[i]);\n }\n return result;\n }\n}\n/**\n * Base N\n */\nexport class BaseN extends _CBase {\n base;\n constructor(seed, size = 1) {\n if (size < 1)\n throw new RangeError(`${size} is out of range`);\n super();\n this.seed = [...seed];\n this.size = size;\n let base = this.seed.length;\n this.base = base;\n this.length = BigInt(base) ** BigInt(size);\n Object.freeze(this);\n }\n at(n) {\n n = this._check(n);\n if (n === undefined)\n return undefined;\n let bn = BigInt(n);\n const bb = BigInt(this.base);\n let result = [];\n for (let i = 0; i < this.size; i++) {\n let bd = bn % bb;\n result.push(this.seed[Number(bd)]);\n bn -= bd;\n bn /= bb;\n }\n return result;\n }\n}\n/**\n * Power Set\n */\nexport class PowerSet extends _CBase {\n constructor(seed) {\n super();\n this.seed = [...seed];\n const length = 1n << BigInt(this.seed.length);\n this.length = length;\n Object.freeze(this);\n }\n at(n) {\n n = this._check(n);\n if (n === undefined)\n return undefined;\n let bn = BigInt(n);\n let result = [];\n for (let bi = 0n; bn; bn >>= 1n, bi++)\n if (bn & 1n)\n result.push(this.seed[Number(bi)]);\n return result;\n }\n}\n/**\n * Cartesian Product\n */\nexport class CartesianProduct extends _CBase {\n constructor(...args) {\n super();\n this.seed = args.map(v => [...v]);\n this.size = this.seed.length;\n const length = this.seed.reduce((a, v) => a * BigInt(v.length), 1n);\n this.length = length;\n Object.freeze(this);\n }\n at(n) {\n n = this._check(n);\n if (n === undefined)\n return undefined;\n let bn = BigInt(n);\n let result = [];\n for (let i = 0; i < this.size; i++) {\n const base = this.seed[i].length;\n const bb = BigInt(base);\n const bd = bn % bb;\n result.push(this.seed[i][Number(bd)]);\n bn -= bd;\n bn /= bb;\n }\n return result;\n }\n}\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/placement-ordering/controller/src/scoring.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport { differenceWith, isEqual, uniq } from '@pie-element/shared-lodash';\nimport { combination } from 'js-combinatorics';\nimport debug from 'debug';\n\nconst log = debug('pie-elements:placement-ordering:controller');\n\nexport const illegalArgumentError = (answer) =>\n new Error(`Cant score answer: ${answer} it has duplicates and allowDuplicates is false`);\nexport const pairwiseCombinationScore = (correct, answer, opts) => {\n opts = { allowDuplicates: false, orderMustBeComplete: false, ...opts };\n\n if (!opts.allowDuplicates && !isEqual(uniq(correct), correct)) {\n throw illegalArgumentError(answer);\n }\n\n if (opts.allowDuplicates === false && answer.length !== uniq(answer).length) {\n return 0;\n }\n\n answer = opts.allowDuplicates !== false ? answer : uniq(answer);\n\n log('answer:', answer);\n if (!Array.isArray(correct) || correct.length === 0) {\n throw new Error('correct must be non empty an array');\n }\n\n if (correct.length === 1) {\n return isEqual(correct, answer) ? 1 : 0;\n }\n\n if (!Array.isArray(answer) || answer.length < 2) {\n return 0;\n }\n\n if (answer.length > correct.length) {\n return 0;\n }\n\n if (correct.length !== answer.length && opts.orderMustBeComplete) {\n return 0;\n }\n\n const correctCombo = combination(correct, 2).toArray();\n const answerCombo = combination(answer, 2).toArray();\n\n const diff = differenceWith(answerCombo, correctCombo, isEqual);\n\n const comboLengthDiff = correctCombo.length - answerCombo.length;\n\n const total = correctCombo.length;\n const actual = total - diff.length - comboLengthDiff;\n\n const n = (actual / total).toFixed(2);\n\n return parseFloat(n);\n};\n\n/**\n * Flattens the correctResponse into an array of ordered identifiers representing the\n * correct response.\n */\nexport const flattenCorrect = (question) =>\n question.correctResponse ? question.correctResponse.map((r) => (r && r.id ? r.id : r)) : [];\n\n/**\n * Returns all correct responses for this question\n * @param question - array\n */\nexport const getAllCorrectResponses = (question) => {\n const alternates = (question.alternateResponses || [])\n .map((alternate) => {\n if (Array.isArray(alternate)) {\n return alternate;\n }\n\n return alternate.response;\n })\n .filter((item) => item !== undefined);\n\n return [flattenCorrect(question), ...alternates];\n};\n\n/**\n * Returns the score for a session. If weighted scoring is present in the correctResponse\n * field for the question, this will be used. If partial scoring is present in the question\n * model, this will be used. Otherwise the default scoring mechanism (0 for any incorrect, 1\n * for all correct) will be used.\n */\n\nexport const score = (question, session) => {\n const { value } = session || {};\n\n if (!value) {\n return 0;\n }\n\n const allCorrectResponse = getAllCorrectResponses(question);\n const allowDuplicates = (question.configure && question.configure.removeTilesAfterPlacing) !== false;\n\n /**\n * We require this to be the case - locking\n */\n //const orderMustBeComplete = true;\n\n let bestScore = 0;\n\n allCorrectResponse.forEach((cr) => {\n const currentScore = pairwiseCombinationScore(cr, value, {\n allowDuplicates,\n });\n\n if (currentScore >= bestScore) {\n bestScore = currentScore;\n }\n });\n\n return bestScore;\n};\n","//#region src/defaults.ts\nvar e = {\n\tcorrect: {\n\t\ttype: \"default\",\n\t\tdefault: \"Correct\",\n\t\tcustom: \"Correct\"\n\t},\n\tincorrect: {\n\t\ttype: \"default\",\n\t\tdefault: \"Incorrect\",\n\t\tcustom: \"Incorrect\"\n\t},\n\tpartial: {\n\t\ttype: \"default\",\n\t\tdefault: \"Nearly\",\n\t\tcustom: \"Nearly\"\n\t},\n\tunanswered: {\n\t\ttype: \"default\",\n\t\tdefault: \"You have not entered a response\",\n\t\tcustom: \"You have not entered a response\"\n\t}\n};\n//#endregion\n//#region src/utils.ts\nfunction t(e) {\n\treturn e === \"partially-correct\" ? \"partial\" : e;\n}\n//#endregion\n//#region src/index.ts\nfunction n(n, i = {}) {\n\treturn new Promise((a) => {\n\t\tlet o = {\n\t\t\t...e,\n\t\t\t...i\n\t\t}, s = t(n), c = o[s], l = e[s];\n\t\tr(c, l[c.type]).then(a);\n\t});\n}\nfunction r(e, t) {\n\treturn new Promise((n) => {\n\t\tif (!e || e.type === \"none\") {\n\t\t\tn(void 0);\n\t\t\treturn;\n\t\t}\n\t\tn(e[e.type] || t);\n\t});\n}\nfunction i(n, r = {}) {\n\tlet i = {\n\t\t...e,\n\t\t...r\n\t}, o = t(n), s = i[o], c = e[o];\n\treturn a(s, c[s.type]);\n}\nfunction a(e, t) {\n\tif (!(!e || e.type === \"none\")) return e[e.type] || t;\n}\n//#endregion\nexport { e as defaultFeedback, a as getActualFeedback, i as getActualFeedbackForCorrectness, r as getFeedback, n as getFeedbackForCorrectness, t as normalizeCorrectness };\n","//#region \\0rolldown/runtime.js\nvar e = Object.defineProperty, t = (t, n) => {\n\tlet r = {};\n\tfor (var i in t) e(r, i, {\n\t\tget: t[i],\n\t\tenumerable: !0\n\t});\n\treturn n || e(r, Symbol.toStringTag, { value: \"Module\" }), r;\n};\n//#endregion\n//#region src/persistence.ts\nfunction n(e) {\n\treturn Array.isArray(e) ? e.filter((e) => e != null) : [];\n}\nfunction r(e) {\n\tlet t = [...e];\n\tfor (let e = t.length - 1; e > 0; e--) {\n\t\tlet n = Math.floor(Math.random() * (e + 1));\n\t\t[t[e], t[n]] = [t[n], t[e]];\n\t}\n\treturn t;\n}\nfunction i(e) {\n\treturn e == null ? !0 : Array.isArray(e) ? e.length === 0 : typeof e == \"object\" ? Object.keys(e).length === 0 : !1;\n}\nasync function a(e, t, a, o = \"value\") {\n\tlet s = n(t?.data?.shuffledValues ?? t?.shuffledValues ?? []);\n\tif (!t) {\n\t\tconsole.warn(\"Unable to save shuffled choices because there's no session.\");\n\t\treturn;\n\t}\n\tif (!i(s)) return n(s.map((t) => e.find((e) => e[o] === t)));\n\tlet c = r(e);\n\tif (a && typeof a == \"function\") try {\n\t\tlet e = n(c.map((e) => e[o]));\n\t\ti(e) ? console.error(`shuffledValues is an empty array - refusing to call updateSession. shuffledChoices: ${JSON.stringify(c)}, key: ${o}`) : t.id && t.element && await a(t.id, t.element, { shuffledValues: e });\n\t} catch (e) {\n\t\tconsole.warn(\"Unable to save shuffled order for choices\"), console.error(e);\n\t}\n\telse console.warn(\"Unable to save shuffled choices, shuffle will happen every time.\");\n\treturn c;\n}\nfunction o(e, t, n) {\n\treturn !!(e.lockChoiceOrder || n[\"@pie-element\"]?.lockChoiceOrder || (n.role ?? \"student\") === \"instructor\");\n}\n//#endregion\n//#region src/partial-scoring.ts\nvar s = /* @__PURE__ */ t({ enabled: () => c });\nfunction c(e, t, n) {\n\treturn e?.partialScoring === !1 || t?.partialScoring === !1 ? !1 : typeof n == \"boolean\" ? n : !0;\n}\n//#endregion\nexport { a as getShuffledChoices, o as lockChoices, s as partialScoring };\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/placement-ordering/controller/src/defaults.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nexport default {\n choiceLabel: '',\n choiceLabelEnabled: true,\n choices: [],\n correctResponse: [],\n feedbackEnabled: false,\n numberedGuides: false,\n orientation: 'vertical',\n partialScoring: true,\n placementArea: false,\n prompt: '',\n promptEnabled: true,\n rationale: '',\n rationaleEnabled: true,\n removeTilesAfterPlacing: true,\n scoringType: 'auto',\n studentInstructionsEnabled: true,\n targetLabel: '',\n teacherInstructions: '',\n teacherInstructionsEnabled: true,\n toolbarEditorPosition: 'bottom',\n};\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/placement-ordering/controller/src/index.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport { flattenCorrect, getAllCorrectResponses, score } from './scoring.js';\n\nimport { every, isArray, isEmpty, isEqual, map, reduce } from '@pie-element/shared-lodash';\nimport { getFeedbackForCorrectness } from '@pie-element/shared-feedback';\nimport { partialScoring } from '@pie-element/shared-controller-utils';\nimport debug from 'debug';\n\nimport defaults from './defaults.js';\n\nconst log = debug('@pie-element:placement-ordering:controller');\nimport Translator from '@pie-lib/translator';\n\nconst { translator } = Translator;\n\nexport const questionError = () => new Error('Question is missing required array: correctResponse');\n\n/**\n * Generates detailed trace log for placement-ordering scoring evaluation\n * @param {Object} question - the question model\n * @param {Object} session - the student session\n * @param {Object} env - the environment\n * @returns {Array<string>} traceLog\n */\nexport const getLogTrace = (question, session, env) => {\n const traceLog = [];\n\n const value = session?.value || [];\n const correctResponse = question?.correctResponse || [];\n const hasPlacementArea = question?.placementArea === true;\n\n if (!value.length) {\n if (hasPlacementArea) {\n traceLog.push('Student did not place any tiles in the target area.');\n } else {\n traceLog.push('Student did not reorder any tiles.');\n }\n traceLog.push('Final score: 0.');\n return traceLog;\n }\n\n const allCorrectResponses = getAllCorrectResponses(question);\n\n let bestMatch = { score: 0, response: [] };\n\n allCorrectResponses.forEach((cr) => {\n let matchCount = 0;\n value.forEach((v, idx) => {\n if (cr[idx] === v) {\n matchCount++;\n }\n });\n\n if (matchCount > bestMatch.score) {\n bestMatch = { score: matchCount, response: cr };\n }\n });\n\n const correctCount = bestMatch.score;\n const incorrectCount = value.length - correctCount;\n\n if (correctCount > 0) {\n traceLog.push(`${correctCount} tile(s) placed in the correct order.`);\n }\n\n if (incorrectCount > 0) {\n traceLog.push(`${incorrectCount} tile(s) placed in an incorrect order.`);\n }\n\n const isFullyCorrect = allCorrectResponses.some((cr) => isEqual(cr, value));\n\n const partialScoringEnabled = partialScoring.enabled(question, env || {});\n\n if (partialScoringEnabled) {\n traceLog.push('Score calculated using partial scoring.');\n traceLog.push(\n 'Each tile placed in the correct position contributes to the score.',\n );\n } else {\n traceLog.push('Score calculated using all-or-nothing scoring.');\n if (hasPlacementArea) {\n traceLog.push(\n 'Student must place all tiles in the correct positions within the target area to receive full credit.',\n );\n } else {\n traceLog.push(\n 'Student must arrange all tiles in the correct order to receive full credit.',\n );\n }\n }\n\n const rawScore = score(question, session);\n const finalScore = partialScoringEnabled ? rawScore : rawScore === 1 ? 1 : 0;\n\n traceLog.push(`Final score: ${finalScore}.`);\n\n return traceLog;\n};\n\nexport function outcome(question, session, env) {\n return new Promise((resolve, reject) => {\n if (!session || isEmpty(session)) {\n resolve({ \n score: 0, \n empty: true, \n logTrace: ['Student did not interact with the placement-ordering item.'] \n });\n return;\n }\n\n if (!question || !question.correctResponse || isEmpty(question.correctResponse)) {\n reject(questionError());\n } else {\n try {\n const s = score(question, session);\n const finalScore = partialScoring.enabled(question, env || {}) ? s : s === 1 ? 1 : 0;\n resolve({\n score: finalScore,\n logTrace: getLogTrace(question, session, env)\n });\n } catch (e) {\n reject(e);\n }\n }\n });\n}\n\nexport function createDefaultModel(model = {}) {\n return new Promise((resolve) => {\n resolve({\n ...defaults,\n ...model,\n });\n });\n}\n\nexport const normalize = (question) => ({\n ...defaults,\n rationaleEnabled: true,\n feedbackEnabled: false,\n promptEnabled: true,\n teacherInstructionsEnabled: true,\n studentInstructionsEnabled: true,\n ...question,\n});\n\n/**\n *\n * @param {*} question\n * @param {*} session\n * @param {*} env\n */\nexport async function model(question, session, env) {\n const normalizedQuestion = normalize(question);\n const base = {};\n\n if (question.alternateResponses && every(question.alternateResponses, isArray)) {\n log('Deprecated structure of alternateResponses is in use');\n // eslint-disable-next-line no-console\n console.error('Deprecated structure of alternateResponses is in use');\n }\n\n base.env = env;\n base.extraCSSRules = normalizedQuestion.extraCSSRules;\n base.outcomes = [];\n base.completeLength = (normalizedQuestion.correctResponse || []).length;\n base.choices = (normalizedQuestion.choices || []).filter((choice) => choice.label);\n base.note = normalizedQuestion.note;\n base.showNote = normalizedQuestion.alternateResponses && normalizedQuestion.alternateResponses.length > 0;\n base.language = normalizedQuestion.language;\n\n log('[model] removing tileSize for the moment.');\n\n base.prompt = normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null;\n base.config = {\n orientation: normalizedQuestion.orientation || 'vertical',\n includeTargets: normalizedQuestion.placementArea,\n choiceLabelEnabled: normalizedQuestion.choiceLabelEnabled,\n targetLabel: normalizedQuestion.targetLabel,\n choiceLabel: normalizedQuestion.choiceLabel,\n showOrdering: normalizedQuestion.numberedGuides,\n allowSameChoiceInTargets: !normalizedQuestion.removeTilesAfterPlacing,\n };\n\n base.disabled = env.mode !== 'gather';\n\n if (!base.note) {\n base.note = translator.t('common:commonCorrectAnswerWithAlternates', { lng: normalizedQuestion.language });\n }\n\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n base.rationale = normalizedQuestion.rationaleEnabled ? normalizedQuestion.rationale : null;\n base.teacherInstructions = normalizedQuestion.teacherInstructionsEnabled\n ? normalizedQuestion.teacherInstructions\n : null;\n } else {\n base.rationale = null;\n base.teacherInstructions = null;\n }\n\n if (env.mode === 'evaluate') {\n const value = (session && session.value) || [];\n const allCorrectResponses = getAllCorrectResponses(normalizedQuestion);\n\n const bestSetOfResponses = allCorrectResponses.reduce(\n (info, cr) => {\n const currentScore = reduce(value, (acc, c, idx) => acc + (Array.isArray(cr) && cr[idx] === c ? 1 : 0), 0);\n\n if (currentScore > info.score) {\n return {\n arr: cr,\n score: currentScore,\n };\n }\n\n return info;\n },\n { arr: [], score: 0 },\n );\n\n base.outcomes = map(value, (c, idx) => {\n return {\n id: c,\n outcome: bestSetOfResponses.arr[idx] === c ? 'correct' : 'incorrect',\n };\n });\n\n const isResponseCorrect = allCorrectResponses.some((response) => isEqual(response, value));\n const responseScore = score(question, session);\n const isCorrect = responseScore === 1;\n const isPartialCorrect = !isCorrect && partialScoring.enabled(normalizedQuestion, env || {}) && responseScore !== 0;\n\n base.correctness = isCorrect ? 'correct' : isPartialCorrect ? 'partial' : 'incorrect';\n\n if (!isResponseCorrect) {\n base.correctResponse = flattenCorrect(normalizedQuestion);\n }\n\n // requirement made in PD-2182\n if (!normalizedQuestion.feedback) {\n normalizedQuestion.feedbackEnabled = false;\n }\n\n const feedback = normalizedQuestion.feedbackEnabled\n ? await getFeedbackForCorrectness(base.correctness, normalizedQuestion.feedback)\n : undefined;\n\n base.feedback = feedback;\n return base;\n } else {\n return base;\n }\n}\n\nexport const createCorrectResponseSession = (question, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n resolve({\n id: '1',\n value: flattenCorrect(question),\n });\n } else {\n resolve(null);\n }\n });\n};\n\n// remove all html tags\nconst getInnerText = (html) => (html || '').replaceAll(/<[^>]*>/g, '');\n\n// remove all html tags except img, iframe and source tag for audio\nconst getContent = (html) => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');\n\nexport const validate = (model = {}, config = {}) => {\n const { choices, correctResponse } = model;\n const errors = {};\n\n ['teacherInstructions', 'prompt', 'rationale'].forEach((field) => {\n if (config[field]?.required && !getContent(model[field])) {\n errors[field] = 'This field is required.';\n }\n });\n\n const reversedChoices = [...(choices || [])].reverse();\n const choicesErrors = {};\n\n reversedChoices.forEach((choice, index) => {\n const { id, label } = choice;\n\n if (!getContent(label)) {\n choicesErrors[id] = 'Content should not be empty.';\n } else {\n const identicalAnswer = reversedChoices.slice(index + 1).some((c) => c.label === label);\n\n if (identicalAnswer) {\n choicesErrors[id] = 'Content should be unique.';\n }\n }\n });\n\n const choicesIds = (choices || []).map((choice) => choice.id);\n const correctResponseIds = (correctResponse || []).map((response) => response.id || response);\n\n if (isEqual(choicesIds, correctResponseIds)) {\n errors.orderError = 'The correct ordering should not be identical to the initial ordering.';\n }\n\n if (!isEmpty(choicesErrors)) {\n errors.choicesErrors = choicesErrors;\n }\n\n return errors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