@pie-element/graphing-solution-set 6.1.2-next.0 → 6.1.2-next.10
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/configure.js +3 -3
- package/dist/author/correct-response.js +68 -68
- package/dist/author/graphing-config.js +68 -69
- package/dist/author/index.d.ts +1 -0
- package/dist/author/index.js +5 -2
- package/dist/author/utils.js +2 -2
- package/dist/browser/{dist-SjeWPldT.js → alert-dialog-BXwLDAJc.js} +45612 -49471
- package/dist/browser/alert-dialog-BXwLDAJc.js.map +1 -0
- package/dist/browser/author/index.js +2233 -347
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/browser-BQg8KPEc.js +352 -0
- package/dist/browser/browser-BQg8KPEc.js.map +1 -0
- package/dist/browser/controller/index.js +52 -79
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/delivery/index.js +39 -40
- package/dist/browser/delivery/index.js.map +1 -1
- package/dist/controller/index.d.ts +1 -1
- package/dist/controller/index.js +40 -42
- package/dist/controller/utils.d.ts +2 -2
- package/dist/controller/utils.js +2 -5
- package/dist/delivery/index.js +2 -2
- package/dist/delivery/main.js +1 -1
- package/dist/index.iife.js +119 -113
- package/dist/runtime-support.d.ts +12 -0
- package/dist/runtime-support.js +12 -0
- package/package.json +20 -17
- package/dist/browser/browser-DpedO01u.js +0 -1218
- package/dist/browser/browser-DpedO01u.js.map +0 -1
- package/dist/browser/dist-SjeWPldT.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/_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/_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/_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/_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/_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/_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/_baseKeys.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseRest.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseSet.js +0 -22
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseSetToString.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseToString.js +0 -15
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUniq.js +0 -27
- 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/_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/_getNative.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbolsIn.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getTag.js +0 -23
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneArray.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneByTag.js +0 -33
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isFlattenable.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKey.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapToArray.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_memoizeCapped.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overArg.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overRest.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheAdd.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheHas.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToArray.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToString.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_shortOut.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_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/cloneDeep.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/constant.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/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/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/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/set.js +0 -7
- 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/uniqWith.js +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseDifference.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/uniqWith.js","../../../src/controller/defaults.ts","../../../src/controller/utils.ts","../../../src/controller/index.ts"],"sourcesContent":["import SetCache from './_SetCache.js';\nimport arrayIncludes from './_arrayIncludes.js';\nimport arrayIncludesWith from './_arrayIncludesWith.js';\nimport arrayMap from './_arrayMap.js';\nimport baseUnary from './_baseUnary.js';\nimport cacheHas from './_cacheHas.js';\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * The base implementation of methods like `_.difference` without support\n * for excluding multiple arrays or iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Array} values The values to exclude.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n */\nfunction baseDifference(array, values, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n isCommon = true,\n length = array.length,\n result = [],\n valuesLength = values.length;\n\n if (!length) {\n return result;\n }\n if (iteratee) {\n values = arrayMap(values, baseUnary(iteratee));\n }\n if (comparator) {\n includes = arrayIncludesWith;\n isCommon = false;\n }\n else if (values.length >= LARGE_ARRAY_SIZE) {\n includes = cacheHas;\n isCommon = false;\n values = new SetCache(values);\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee == null ? value : iteratee(value);\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var valuesIndex = valuesLength;\n while (valuesIndex--) {\n if (values[valuesIndex] === computed) {\n continue outer;\n }\n }\n result.push(value);\n }\n else if (!includes(values, computed, comparator)) {\n result.push(value);\n }\n }\n return result;\n}\n\nexport default baseDifference;\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","import baseUniq from './_baseUniq.js';\n\n/**\n * This method is like `_.uniq` except that it accepts `comparator` which\n * is invoked to compare elements of `array`. The order of result values is\n * determined by the order they occur in the array.The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.uniqWith(objects, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]\n */\nfunction uniqWith(array, comparator) {\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return (array && array.length) ? baseUniq(array, undefined, comparator) : [];\n}\n\nexport default uniqWith;\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/graphing-solution-set/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\n/*\n * This file contains the default configuration for the Graphing Solution Set Item Type.\n * Model is similar to the one used in graphing item type except for the gssLineData object which handles\n * the configuration for the lines and the solution set.\n *\n * Same model is used in configure/src default.js\n * */\nexport default {\n answers: {\n correctAnswer: {\n name: 'Correct Answer',\n marks: [],\n },\n },\n arrows: {\n left: true,\n right: true,\n up: true,\n down: true,\n },\n marks: [],\n defaultGridConfiguration: 0,\n domain: {\n min: -5,\n max: 5,\n step: 1,\n labelStep: 1,\n axisLabel: 'x',\n },\n graph: {\n width: 500,\n height: 500,\n },\n gssLineData: {\n numberOfLines: 1,\n selectedTool: 'lineA',\n sections: [],\n lineA: {\n lineType: 'Solid',\n },\n },\n includeAxes: true,\n labels: {},\n labelsEnabled: true,\n padding: true,\n prompt: '',\n range: {\n min: -5,\n max: 5,\n step: 1,\n labelStep: 1,\n axisLabel: 'y',\n },\n rationale: '',\n standardGrid: false,\n title: '',\n coordinatesOnHover: false,\n promptEnabled: true,\n rationaleEnabled: true,\n teacherInstructionsEnabled: true,\n studentInstructionsEnabled: true,\n};\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/graphing-solution-set/controller/src/utils.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 { isEqual, differenceWith, uniq, uniqWith } from 'lodash-es';\n\n/*\n * Constant to check equal segments\n * @param {Object} segment1 - segment 1\n * @param {Object} segment2 - segment 2\n * */\nexport const equalSegment = (segment1, segment2) => {\n // A.from = B.from, A.to = B.to OR A.from = B.to, A.to = B.from\n // x1 = x3 & y1 = y3 & x2 = x4 & y2 = y4\n return (\n (isEqual(segment1.from, segment2.from) && isEqual(segment1.to, segment2.to)) ||\n (isEqual(segment1.to, segment2.from) && isEqual(segment1.from, segment2.to))\n );\n};\n\n// this function is implemented in configure as well\n/*\n * Constant to get sorted answers\n * @param {Object} answers - answers\n * */\nexport const sortedAnswers = (answers) =>\n Object.keys(answers || {})\n .sort()\n .reduce((result, key) => {\n if (key !== 'correctAnswer') {\n result[key] = answers[key];\n }\n return result;\n }, {});\n\n/*\n * Constant to return line equation coefficients\n * @param {Object} line - line\n * */\nconst returnLineEquationCoefficients = (line) => {\n line = { ...line, to: { ...line.to }, from: { ...line.from } };\n const xA = line.from.x;\n const yA = line.from.y;\n const xB = line.to.x;\n const yB = line.to.y;\n return {\n a: yB - yA,\n b: xA - xB,\n c: xB * yA - xA * yB,\n };\n};\n\n/*\n * Constant to get significant decimals\n * @param {Number} number - number\n * */\nconst getSignificantDecimals = (number) => Math.round(number * 10000) / 10000;\n\n/*\n * Constant to check equal lines\n * @param {Object} line1 - line 1\n * @param {Object} line2 - line 2\n * */\nexport const equalLine = (line1, line2) => {\n // line equation: ax + by + c = 0\n // 2 lines are equal if a1/a2 = b1/b2 = c1/c2, where a, b, c are the coefficients in line equation\n // line equation knowing 2 points: (y - yA) / (yB - yA) = (x - xA) / (xB - xA)\n // extending this equation, we get: x * (yB - yA) + y * (xA - xB) + (xB * yA - xA * yB) = 0\n // where a = yB - yA; b = xA - xB; c = xB * yA - xA * yB\n const { a: a1, b: b1, c: c1 } = returnLineEquationCoefficients(line1);\n const { a: a2, b: b2, c: c2 } = returnLineEquationCoefficients(line2);\n const proportions = [];\n if (a2 !== 0) {\n proportions.push(getSignificantDecimals(a1 / a2));\n } else if (a1 !== a2) {\n return false;\n }\n if (b2 !== 0) {\n proportions.push(getSignificantDecimals(b1 / b2));\n } else if (b1 !== b2) {\n return false;\n }\n if (c2 !== 0) {\n proportions.push(getSignificantDecimals(c1 / c2));\n } else if (c1 !== c2) {\n return false;\n }\n return uniq(proportions).length === 1 && line1.fill === line2.fill;\n // (y2 - y1)/(x2 - x1) = (y4 - y3)/(x4 - x3);\n // return ((Math.abs((line1.to.y - line1.from.y) / (line1.to.x - line1.from.x))) === (Math.abs((line2.to.y - line2.from.y) / (line2.to.x - line2.from.x))));\n};\n\n/*\n * Constant to construct segments from points\n * @param {Array} points - points\n * */\nexport const constructSegmentsFromPoints = (points) => {\n // takes the list of points that represent a polygon and transforms it into a list of segments; eg.:\n // points: A, B, C, D => segments: AB, BC, CD, DA\n return (points || []).map((point, index) => ({ from: point, to: points[(index + 1) % points.length] }));\n};\n\n/*\n * Constant to remove duplicate segments\n * @param {Array} segments - segments\n * */\nexport const removeDuplicateSegments = (segments) => {\n segments = segments || [];\n // removes segments that are duplicates; eg. These segments are the same, so one will be removed:\n // segment1: from: { x: 1, y: 1 }, to: { x: 2, y: 1 }\n // segment2: from: { x: 2, y: 1 }, to: { x: 1, y: 1 }\n return uniqWith(segments, (s1, s2) => equalSegment(s1, s2));\n};\n\n/*\n * Constant to remove invalid segments\n * @param {Array} segments - segments\n * */\nexport const removeInvalidSegments = (segments) => {\n segments = segments || [];\n // removes segments that start in a point and end in the same point (eg.: from: { x: 1, y: 1 }, to: { x: 1, y: 1 })\n return segments.filter((segment) => !isEqual(segment.from, segment.to));\n};\n\n/*\n * Constant to check equal polygons\n * @param {Object} poly1 - polygon 1 points\n * @param {Object} poly2 - polygon 2 points\n * */\nexport const equalPolygon = (poly1, poly2) => {\n const { points: points1 } = poly1;\n const { points: points2 } = poly2;\n // generate segments\n const segments1 = constructSegmentsFromPoints(points1);\n const segments2 = constructSegmentsFromPoints(points2);\n const segments1NoDuplicates = removeDuplicateSegments(removeInvalidSegments(segments1));\n const segments2NoDuplicates = removeDuplicateSegments(removeInvalidSegments(segments2));\n const differentSegments1 = differenceWith(segments1NoDuplicates, segments2NoDuplicates, equalSegment);\n const differentSegments2 = differenceWith(segments2NoDuplicates, segments1NoDuplicates, equalSegment);\n return (!differentSegments1 || !differentSegments1.length) && (!differentSegments2 || !differentSegments2.length);\n};\n\n/*\n * Constant to compare equal marks\n * */\nexport const equalMarks = {\n line: (sessAnswer, mark) => equalLine(sessAnswer, mark),\n polygon: (sessAnswer, poly) => equalPolygon(sessAnswer, poly),\n};\n\n/*\n * Check if a point is correct and complete\n * @param {Object} point - point object\n * */\nconst completePoint = (point) => point && Number.isFinite(point.x) && Number.isFinite(point.y);\n\n/*\n * Check if a line is complete\n * @param {Object} item - mark object\n * */\nconst completeFromTo = (item) => item && completeMark.point(item.from) && completeMark.point(item.to);\n\n/*\n * Check if a point is correct and complete\n * @param {Object} item - mark object\n * */\nconst completePoints = (item) =>\n item &&\n item.points &&\n item.points.length &&\n (item.points.filter((point) => completePoint(point)) || []).length === item.points.length;\n\n/*\n * Complete mark object for line and point\n * */\nconst completeMark = {\n point: completePoint,\n line: completeFromTo,\n polygon: completePoints,\n};\n\n/*\n * Function to remove invalid answers\n * @param {Array} answers - answers array\n * */\nexport const removeInvalidAnswers = (answers) =>\n answers\n ? (answers || []).filter(({ type, ...answer }) => (completeMark[type] ? completeMark[type](answer) : false))\n : [];\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/graphing-solution-set/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 debug from 'debug';\nimport { cloneDeep, isEmpty, uniqWith } from 'lodash-es';\nimport defaults from './defaults.js';\nimport { equalMarks, sortedAnswers, removeInvalidAnswers } from './utils.js';\n\nconst log = debug('@pie-element:graphing-solution-set:controller');\n\nconst initializeGraphMap = () => ({\n line: [],\n});\n\n/*\n * Function to compare two marks\n * @param {Object} mark1 - first mark\n * @param {Object} mark2 - second mark\n * */\nexport const compareMarks = (mark1, mark2) => {\n // marks can be compared with equalMarks[type] function only if they have the same type;\n // if type is different, they are clearly not equal\n return !!(\n mark1 &&\n mark2 &&\n mark1.type === mark2.type &&\n equalMarks[mark1.type] &&\n equalMarks[mark1.type](mark1, mark2)\n );\n};\n\n/*\n * Function to get the corrected answer\n * @param {Object} sessionAnswers - array of marks from session\n * @param {Object} marks - array of marks from correct answer\n * */\nexport const getAnswerCorrected = ({ sessionAnswers, marks: correctAnswers }) => {\n sessionAnswers = sessionAnswers || [];\n correctAnswers = correctAnswers || [];\n const rez = cloneDeep(sessionAnswers).reduce((correctedAnswer, answer) => {\n const answerIsCorrect = correctAnswers.find((mark) => compareMarks(answer, mark));\n answer.correctness = answerIsCorrect ? 'correct' : 'incorrect';\n return [...correctedAnswer, answer];\n }, []);\n // add missing objects from correct answer\n const missingAnswers = cloneDeep(correctAnswers).reduce((correctedAnswer, answer) => {\n const answerIndex = sessionAnswers.find((mark) => compareMarks(answer, mark));\n if (!answerIndex) {\n // means that corrected answer is missing from session, so we mark it as missing object\n return [...correctedAnswer, { ...answer, correctness: 'missing' }];\n }\n return correctedAnswer;\n }, []);\n return [...rez, ...missingAnswers];\n};\n\n/*\n * Function to get the best answer\n * @param {Object} question - question object\n * @param {Object} session - session object\n * @param {Object} env - env object\n * */\nexport const getBestAnswer = (question, session, env = {}) => {\n // questionPossibleAnswers contains all possible answers (correct response and alternates);\n let { answers: questionPossibleAnswers = {}, scoringType } = question || {};\n let { answer } = session || {};\n // filter the incomplete objects\n Object.entries(questionPossibleAnswers || {}).forEach(\n ([key, value]) =>\n (questionPossibleAnswers[key] = { ...value, marks: value?.marks.filter((mark) => !mark.building) }),\n );\n // initialize answer if no values\n answer = answer || [];\n // initialize one possible answer if no values\n if (isEmpty(questionPossibleAnswers)) {\n questionPossibleAnswers = { correctAnswer: initializeGraphMap() };\n } else {\n questionPossibleAnswers = {\n correctAnswer: questionPossibleAnswers.correctAnswer,\n ...sortedAnswers(questionPossibleAnswers),\n };\n }\n // student's answers without DUPLICATES\n const sessionAnswers = uniqWith(answer, compareMarks);\n // array of possible answers entries\n const possibleAnswers = Object.entries(questionPossibleAnswers);\n return possibleAnswers.reduce(\n (acc, entry) => {\n // iterating each possible answer (main + alternates)\n const possibleAnswerKey = entry[0];\n const possibleAnswer = entry[1] || {};\n let { marks } = possibleAnswer;\n if (!marks || !marks.length) {\n return acc;\n }\n // returns array of marks, each having 'correctness' property\n const correctedAnswer = getAnswerCorrected({ sessionAnswers, marks });\n const correctMarks = correctedAnswer.filter((answer) => answer.correctness === 'correct');\n // filter out missing objects because they do not affect the calculation of the score\n // only correct and incorrect are needed\n const scoredCorrectedAnswer = correctedAnswer.filter((answer) => answer.correctness !== 'missing');\n const maxScore = marks.length;\n let score = correctMarks.length;\n // if extra placements\n if (scoredCorrectedAnswer.length > maxScore) {\n score -= scoredCorrectedAnswer.length - maxScore;\n }\n if (score < 0) {\n score = 0;\n }\n if (score / maxScore > acc.bestScore || !acc.foundOneSolution) {\n acc.bestScore = Math.floor(score / maxScore);\n acc.bestScoreAnswerKey = possibleAnswerKey;\n acc.answersCorrected = correctedAnswer;\n acc.foundOneSolution = true;\n }\n return acc;\n },\n {\n bestScore: 0,\n bestScoreAnswerKey: null,\n // initially we just suppose all the answers are incorrect\n answersCorrected: cloneDeep(sessionAnswers).map((answer) => ({ ...answer, correctness: 'incorrect' })),\n foundOneSolution: false,\n },\n );\n};\n\n/*\n * Constant normalize\n * @param {Object} question - question object\n * */\nexport const normalize = (question) => ({ ...defaults, ...question });\n\n/*\n * Function to set model\n * @param {Object} question - question object\n * @param {Object} session - session object\n * @param {Object} env - env object\n * */\nexport function model(question, session, env) {\n return new Promise((resolve) => {\n const normalizedQuestion = normalize(question);\n // ensure removing of invalid answers\n // need this if undo redo was last operation\n session.answer = removeInvalidAnswers(session.answer);\n // console.log('normalizedQuestion', normalizedQuestion);\n const { defaultTool, extraCSSRules, prompt, promptEnabled, graph, answers, toolbarTools, ...questionProps } =\n normalizedQuestion || {};\n let { arrows } = normalizedQuestion;\n const { mode, role } = env || {};\n\n // This is used for offering support for old models which have the property arrows: boolean\n // Same thing is set in authoring : packages/graphing/configure/src/configure.jsx - componentDidMount\n if (typeof arrows === 'boolean') {\n if (arrows) {\n arrows = {\n left: true,\n right: true,\n up: true,\n down: true,\n };\n } else {\n arrows = {\n left: false,\n right: false,\n up: false,\n down: false,\n };\n }\n }\n\n const base = {\n ...questionProps,\n answers,\n arrows,\n defaultTool: 'line',\n disabled: env.mode !== 'gather',\n prompt: promptEnabled ? prompt : null,\n rationale: null,\n size: graph,\n showToggle:\n env.mode === 'evaluate' &&\n !isEmpty(answers) &&\n answers.correctAnswer &&\n answers.correctAnswer.marks &&\n !isEmpty(answers.correctAnswer.marks),\n teacherInstructions: null,\n toolbarTools,\n extraCSSRules,\n };\n\n if (role === 'instructor' && (mode === 'view' || mode === 'evaluate')) {\n const { rationale, rationaleEnabled, teacherInstructions, teacherInstructionsEnabled } = normalizedQuestion || {};\n\n base.rationale = rationaleEnabled ? rationale : null;\n base.teacherInstructions = teacherInstructionsEnabled ? teacherInstructions : null;\n }\n\n if (mode === 'evaluate') {\n if (\n !isEmpty(answers) &&\n answers.correctAnswer &&\n answers.correctAnswer.marks &&\n !isEmpty(answers.correctAnswer.marks)\n ) {\n const { answersCorrected, bestScoreAnswerKey, bestScore } = getBestAnswer(normalizedQuestion, session, env);\n // array of marks from session with 'correctness' property set\n base.answersCorrected = answersCorrected;\n base.correctResponse = bestScoreAnswerKey ? (answers[bestScoreAnswerKey] || {}).marks : [];\n base.showToggle = base.showToggle && bestScore !== 1;\n } else {\n base.answersCorrected = (session && session.answer) || [];\n base.correctResponse = [];\n }\n }\n\n log('base: ', base);\n resolve(base);\n });\n}\n\n/*\n * Function to check the outcome\n * @param {Object} question - question object\n * @param {Object} session - session object\n * @param {Object} env - env object\n * */\nexport function outcome(question, session, env = {}) {\n return new Promise((resolve) => {\n if (!session || isEmpty(session)) {\n resolve({ score: 0, empty: true });\n }\n if (\n env.mode !== 'evaluate' ||\n isEmpty(question.answers) ||\n (question.answers && question.answers.correctAnswer && isEmpty(question.answers.correctAnswer.marks))\n ) {\n resolve({ score: 0 });\n }\n const { bestScore } = getBestAnswer(question, session, env);\n resolve({ score: bestScore });\n });\n}\n\n/*\n * Constant to create correct response session\n * @param {Object} question - question object\n * @param {Object} env - env object\n * */\nexport const createCorrectResponseSession = (question, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n const { answers } = question || {};\n let marks = [];\n if (answers && Object.values(answers)) {\n const correctAnswer = answers.correctAnswer || Object.values(answers)[0] || {};\n marks = correctAnswer.marks || [];\n }\n resolve({\n answer: marks,\n id: '1',\n });\n } else {\n resolve(null);\n }\n });\n};\n\n/*\n * Constant to validate model before saving item\n * @param {Object} model - model object\n * */\nexport const validate = (model = {}) => {\n const { answers, gssLineData } = model;\n const errors = {};\n const correctAnswerErrors = {};\n let found = false;\n if (gssLineData.numberOfLines === 1) {\n if (answers.correctAnswer.marks.length < 1) {\n found = true;\n correctAnswerErrors.correctAnswer = 'At least 1 line object should be defined.';\n } else if (answers.correctAnswer.marks.length === 1 && answers.correctAnswer.marks[0].building) {\n found = true;\n correctAnswerErrors.correctAnswer = '1 or more graph object should be correctly defined.';\n }\n } else {\n if (answers.correctAnswer.marks.length < 2) {\n found = true;\n correctAnswerErrors.correctAnswer = 'At least 2 line object should be defined.';\n } else if (answers.correctAnswer.marks.length === 2) {\n if (answers.correctAnswer.marks[0].building || answers.correctAnswer.marks[1].building) {\n found = true;\n correctAnswerErrors.correctAnswer = '1 or more graph object should be correctly defined.';\n }\n }\n }\n let polygon = answers.correctAnswer.marks.find((mark) => mark.type === 'polygon');\n if (!found && (!gssLineData.selectedTool === 'solutionSet' || !polygon)) {\n correctAnswerErrors.correctAnswer = 'Please select a solution set for the graphing solution set item.';\n }\n if (!isEmpty(correctAnswerErrors)) {\n errors.correctAnswerErrors = correctAnswerErrors;\n }\n return errors;\n};\n"],"x_google_ignoreList":[0,1,2],"mappings":";;AAQA,IAAI,IAAmB;AAavB,SAAS,EAAe,GAAO,GAAQ,GAAU,GAAY;CAC3D,IAAI,IAAQ,IACR,IAAW,GACX,IAAW,IACX,IAAS,EAAM,QACf,IAAS,CAAC,GACV,IAAe,EAAO;CAE1B,IAAI,CAAC,GACH,OAAO;CAKT,AAHI,MACF,IAAS,EAAS,GAAQ,EAAU,CAAQ,CAAC,IAE3C,KACF,IAAW,GACX,IAAW,MAEJ,EAAO,UAAU,MACxB,IAAW,GACX,IAAW,IACX,IAA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ACE,EAAQ,IAAI;AAEhB,CAAC,GAOU,KAAY,IAAQ,CAAC,MAAM;CACtC,IAAM,EAAE,YAAS,mBAAgB,GAC3B,IAAS,CAAC,GACV,IAAsB,CAAC,GACzB,IAAQ;CACZ,AAAI,EAAY,kBAAkB,IAC5B,EAAQ,cAAc,MAAM,SAAS,KACvC,IAAQ,IACR,EAAoB,gBAAgB,+CAC3B,EAAQ,cAAc,MAAM,WAAW,KAAK,EAAQ,cAAc,MAAM,GAAG,aACpF,IAAQ,IACR,EAAoB,gBAAgB,yDAGlC,EAAQ,cAAc,MAAM,SAAS,KACvC,IAAQ,IACR,EAAoB,gBAAgB,+CAC3B,EAAQ,cAAc,MAAM,WAAW,MAC5C,EAAQ,cAAc,MAAM,GAAG,YAAY,EAAQ,cAAc,MAAM,GAAG,cAC5E,IAAQ,IACR,EAAoB,gBAAgB;CAI1C,IAAI,IAAU,EAAQ,cAAc,MAAM,MAAM,MAAS,EAAK,SAAS,SAAS;CAOhF,OANI,CAAC,MAAU,CAAC,EAAY,iBAAiB,iBAAiB,CAAC,OAC7D,EAAoB,gBAAgB,qEAEjC,EAAQ,CAAmB,MAC9B,EAAO,sBAAsB,IAExB;AACT"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/controller/defaults.ts","../../../src/controller/utils.ts","../../../src/controller/index.ts"],"sourcesContent":["// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/graphing-solution-set/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\n/*\n * This file contains the default configuration for the Graphing Solution Set Item Type.\n * Model is similar to the one used in graphing item type except for the gssLineData object which handles\n * the configuration for the lines and the solution set.\n *\n * Same model is used in configure/src default.js\n * */\nexport default {\n answers: {\n correctAnswer: {\n name: 'Correct Answer',\n marks: [],\n },\n },\n arrows: {\n left: true,\n right: true,\n up: true,\n down: true,\n },\n marks: [],\n defaultGridConfiguration: 0,\n domain: {\n min: -5,\n max: 5,\n step: 1,\n labelStep: 1,\n axisLabel: 'x',\n },\n graph: {\n width: 500,\n height: 500,\n },\n gssLineData: {\n numberOfLines: 1,\n selectedTool: 'lineA',\n sections: [],\n lineA: {\n lineType: 'Solid',\n },\n },\n includeAxes: true,\n labels: {},\n labelsEnabled: true,\n padding: true,\n prompt: '',\n range: {\n min: -5,\n max: 5,\n step: 1,\n labelStep: 1,\n axisLabel: 'y',\n },\n rationale: '',\n standardGrid: false,\n title: '',\n coordinatesOnHover: false,\n promptEnabled: true,\n rationaleEnabled: true,\n teacherInstructionsEnabled: true,\n studentInstructionsEnabled: true,\n};\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/graphing-solution-set/controller/src/utils.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 { isEqual, differenceWith, uniq, uniqWith } from '@pie-element/shared-lodash';\n\n/*\n * Constant to check equal segments\n * @param {Object} segment1 - segment 1\n * @param {Object} segment2 - segment 2\n * */\nexport const equalSegment = (segment1, segment2) => {\n // A.from = B.from, A.to = B.to OR A.from = B.to, A.to = B.from\n // x1 = x3 & y1 = y3 & x2 = x4 & y2 = y4\n return (\n (isEqual(segment1.from, segment2.from) && isEqual(segment1.to, segment2.to)) ||\n (isEqual(segment1.to, segment2.from) && isEqual(segment1.from, segment2.to))\n );\n};\n\n// this function is implemented in configure as well\n/*\n * Constant to get sorted answers\n * @param {Object} answers - answers\n * */\nexport const sortedAnswers = (answers) =>\n Object.keys(answers || {})\n .sort()\n .reduce((result, key) => {\n if (key !== 'correctAnswer') {\n result[key] = answers[key];\n }\n return result;\n }, {});\n\n/*\n * Constant to return line equation coefficients\n * @param {Object} line - line\n * */\nconst returnLineEquationCoefficients = (line) => {\n line = { ...line, to: { ...line.to }, from: { ...line.from } };\n const xA = line.from.x;\n const yA = line.from.y;\n const xB = line.to.x;\n const yB = line.to.y;\n return {\n a: yB - yA,\n b: xA - xB,\n c: xB * yA - xA * yB,\n };\n};\n\n/*\n * Constant to get significant decimals\n * @param {Number} number - number\n * */\nconst getSignificantDecimals = (number) => Math.round(number * 10000) / 10000;\n\n/*\n * Constant to check equal lines\n * @param {Object} line1 - line 1\n * @param {Object} line2 - line 2\n * */\nexport const equalLine = (line1, line2) => {\n // line equation: ax + by + c = 0\n // 2 lines are equal if a1/a2 = b1/b2 = c1/c2, where a, b, c are the coefficients in line equation\n // line equation knowing 2 points: (y - yA) / (yB - yA) = (x - xA) / (xB - xA)\n // extending this equation, we get: x * (yB - yA) + y * (xA - xB) + (xB * yA - xA * yB) = 0\n // where a = yB - yA; b = xA - xB; c = xB * yA - xA * yB\n const { a: a1, b: b1, c: c1 } = returnLineEquationCoefficients(line1);\n const { a: a2, b: b2, c: c2 } = returnLineEquationCoefficients(line2);\n const proportions = [];\n if (a2 !== 0) {\n proportions.push(getSignificantDecimals(a1 / a2));\n } else if (a1 !== a2) {\n return false;\n }\n if (b2 !== 0) {\n proportions.push(getSignificantDecimals(b1 / b2));\n } else if (b1 !== b2) {\n return false;\n }\n if (c2 !== 0) {\n proportions.push(getSignificantDecimals(c1 / c2));\n } else if (c1 !== c2) {\n return false;\n }\n return uniq(proportions).length === 1 && line1.fill === line2.fill;\n // (y2 - y1)/(x2 - x1) = (y4 - y3)/(x4 - x3);\n // return ((Math.abs((line1.to.y - line1.from.y) / (line1.to.x - line1.from.x))) === (Math.abs((line2.to.y - line2.from.y) / (line2.to.x - line2.from.x))));\n};\n\n/*\n * Constant to construct segments from points\n * @param {Array} points - points\n * */\nexport const constructSegmentsFromPoints = (points) => {\n // takes the list of points that represent a polygon and transforms it into a list of segments; eg.:\n // points: A, B, C, D => segments: AB, BC, CD, DA\n return (points || []).map((point, index) => ({ from: point, to: points[(index + 1) % points.length] }));\n};\n\n/*\n * Constant to remove duplicate segments\n * @param {Array} segments - segments\n * */\nexport const removeDuplicateSegments = (segments) => {\n segments = segments || [];\n // removes segments that are duplicates; eg. These segments are the same, so one will be removed:\n // segment1: from: { x: 1, y: 1 }, to: { x: 2, y: 1 }\n // segment2: from: { x: 2, y: 1 }, to: { x: 1, y: 1 }\n return uniqWith(segments, (s1, s2) => equalSegment(s1, s2));\n};\n\n/*\n * Constant to remove invalid segments\n * @param {Array} segments - segments\n * */\nexport const removeInvalidSegments = (segments) => {\n segments = segments || [];\n // removes segments that start in a point and end in the same point (eg.: from: { x: 1, y: 1 }, to: { x: 1, y: 1 })\n return segments.filter((segment) => !isEqual(segment.from, segment.to));\n};\n\n/*\n * Constant to check equal polygons\n * @param {Object} poly1 - polygon 1 points\n * @param {Object} poly2 - polygon 2 points\n * */\nexport const equalPolygon = (poly1, poly2) => {\n const { points: points1 } = poly1;\n const { points: points2 } = poly2;\n // generate segments\n const segments1 = constructSegmentsFromPoints(points1);\n const segments2 = constructSegmentsFromPoints(points2);\n const segments1NoDuplicates = removeDuplicateSegments(removeInvalidSegments(segments1));\n const segments2NoDuplicates = removeDuplicateSegments(removeInvalidSegments(segments2));\n const differentSegments1 = differenceWith(segments1NoDuplicates, segments2NoDuplicates, equalSegment);\n const differentSegments2 = differenceWith(segments2NoDuplicates, segments1NoDuplicates, equalSegment);\n return (!differentSegments1 || !differentSegments1.length) && (!differentSegments2 || !differentSegments2.length);\n};\n\n/*\n * Constant to compare equal marks\n * */\nexport const equalMarks = {\n line: (sessAnswer, mark) => equalLine(sessAnswer, mark),\n polygon: (sessAnswer, poly) => equalPolygon(sessAnswer, poly),\n};\n\n/*\n * Check if a point is correct and complete\n * @param {Object} point - point object\n * */\nconst completePoint = (point) => point && Number.isFinite(point.x) && Number.isFinite(point.y);\n\n/*\n * Check if a line is complete\n * @param {Object} item - mark object\n * */\nconst completeFromTo = (item) => item && completeMark.point(item.from) && completeMark.point(item.to);\n\n/*\n * Check if a point is correct and complete\n * @param {Object} item - mark object\n * */\nconst completePoints = (item) =>\n item &&\n item.points &&\n item.points.length &&\n (item.points.filter((point) => completePoint(point)) || []).length === item.points.length;\n\n/*\n * Complete mark object for line and point\n * */\nconst completeMark = {\n point: completePoint,\n line: completeFromTo,\n polygon: completePoints,\n};\n\n/*\n * Function to remove invalid answers\n * @param {Array} answers - answers array\n * */\nexport const removeInvalidAnswers = (answers) =>\n answers\n ? (answers || []).filter(({ type, ...answer }) => (completeMark[type] ? completeMark[type](answer) : false))\n : [];\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/graphing-solution-set/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 debug from 'debug';\nimport { cloneDeep, isEmpty, uniqWith } from '@pie-element/shared-lodash';\nimport defaults from './defaults.js';\nimport { equalMarks, sortedAnswers, removeInvalidAnswers } from './utils.js';\n\nconst log = debug('@pie-element:graphing-solution-set:controller');\n\nconst initializeGraphMap = () => ({\n line: [],\n});\n\n/*\n * Function to compare two marks\n * @param {Object} mark1 - first mark\n * @param {Object} mark2 - second mark\n * */\nexport const compareMarks = (mark1, mark2) => {\n // marks can be compared with equalMarks[type] function only if they have the same type;\n // if type is different, they are clearly not equal\n return !!(\n mark1 &&\n mark2 &&\n mark1.type === mark2.type &&\n equalMarks[mark1.type] &&\n equalMarks[mark1.type](mark1, mark2)\n );\n};\n\n/*\n * Function to get the corrected answer\n * @param {Object} sessionAnswers - array of marks from session\n * @param {Object} marks - array of marks from correct answer\n * */\nexport const getAnswerCorrected = ({ sessionAnswers, marks: correctAnswers }) => {\n sessionAnswers = sessionAnswers || [];\n correctAnswers = correctAnswers || [];\n const rez = cloneDeep(sessionAnswers).reduce((correctedAnswer, answer) => {\n const answerIsCorrect = correctAnswers.find((mark) => compareMarks(answer, mark));\n answer.correctness = answerIsCorrect ? 'correct' : 'incorrect';\n return [...correctedAnswer, answer];\n }, []);\n // add missing objects from correct answer\n const missingAnswers = cloneDeep(correctAnswers).reduce((correctedAnswer, answer) => {\n const answerIndex = sessionAnswers.find((mark) => compareMarks(answer, mark));\n if (!answerIndex) {\n // means that corrected answer is missing from session, so we mark it as missing object\n return [...correctedAnswer, { ...answer, correctness: 'missing' }];\n }\n return correctedAnswer;\n }, []);\n return [...rez, ...missingAnswers];\n};\n\n/*\n * Function to get the best answer\n * @param {Object} question - question object\n * @param {Object} session - session object\n * @param {Object} env - env object\n * */\nexport const getBestAnswer = (question, session, env = {}) => {\n // questionPossibleAnswers contains all possible answers (correct response and alternates);\n let { answers: questionPossibleAnswers = {}, scoringType } = question || {};\n let { answer } = session || {};\n // filter the incomplete objects\n Object.entries(questionPossibleAnswers || {}).forEach(\n ([key, value]) =>\n (questionPossibleAnswers[key] = { ...value, marks: value?.marks.filter((mark) => !mark.building) }),\n );\n // initialize answer if no values\n answer = answer || [];\n // initialize one possible answer if no values\n if (isEmpty(questionPossibleAnswers)) {\n questionPossibleAnswers = { correctAnswer: initializeGraphMap() };\n } else {\n questionPossibleAnswers = {\n correctAnswer: questionPossibleAnswers.correctAnswer,\n ...sortedAnswers(questionPossibleAnswers),\n };\n }\n // student's answers without DUPLICATES\n const sessionAnswers = uniqWith(answer, compareMarks);\n // array of possible answers entries\n const possibleAnswers = Object.entries(questionPossibleAnswers);\n return possibleAnswers.reduce(\n (acc, entry) => {\n // iterating each possible answer (main + alternates)\n const possibleAnswerKey = entry[0];\n const possibleAnswer = entry[1] || {};\n let { marks } = possibleAnswer;\n if (!marks || !marks.length) {\n return acc;\n }\n // returns array of marks, each having 'correctness' property\n const correctedAnswer = getAnswerCorrected({ sessionAnswers, marks });\n const correctMarks = correctedAnswer.filter((answer) => answer.correctness === 'correct');\n // filter out missing objects because they do not affect the calculation of the score\n // only correct and incorrect are needed\n const scoredCorrectedAnswer = correctedAnswer.filter((answer) => answer.correctness !== 'missing');\n const maxScore = marks.length;\n let score = correctMarks.length;\n // if extra placements\n if (scoredCorrectedAnswer.length > maxScore) {\n score -= scoredCorrectedAnswer.length - maxScore;\n }\n if (score < 0) {\n score = 0;\n }\n if (score / maxScore > acc.bestScore || !acc.foundOneSolution) {\n acc.bestScore = Math.floor(score / maxScore);\n acc.bestScoreAnswerKey = possibleAnswerKey;\n acc.answersCorrected = correctedAnswer;\n acc.foundOneSolution = true;\n }\n return acc;\n },\n {\n bestScore: 0,\n bestScoreAnswerKey: null,\n // initially we just suppose all the answers are incorrect\n answersCorrected: cloneDeep(sessionAnswers).map((answer) => ({ ...answer, correctness: 'incorrect' })),\n foundOneSolution: false,\n },\n );\n};\n\n/*\n * Constant normalize\n * @param {Object} question - question object\n * */\nexport const normalize = (question) => ({ ...defaults, ...question });\n\n/*\n * Function to set model\n * @param {Object} question - question object\n * @param {Object} session - session object\n * @param {Object} env - env object\n * */\nexport function model(question, session, env) {\n return new Promise((resolve) => {\n const normalizedQuestion = normalize(question);\n // ensure removing of invalid answers\n // need this if undo redo was last operation\n session.answer = removeInvalidAnswers(session.answer);\n // console.log('normalizedQuestion', normalizedQuestion);\n const { defaultTool, extraCSSRules, prompt, promptEnabled, graph, answers, toolbarTools, ...questionProps } =\n normalizedQuestion || {};\n let { arrows } = normalizedQuestion;\n const { mode, role } = env || {};\n\n // This is used for offering support for old models which have the property arrows: boolean\n // Same thing is set in authoring : packages/graphing/configure/src/configure.jsx - componentDidMount\n if (typeof arrows === 'boolean') {\n if (arrows) {\n arrows = {\n left: true,\n right: true,\n up: true,\n down: true,\n };\n } else {\n arrows = {\n left: false,\n right: false,\n up: false,\n down: false,\n };\n }\n }\n\n const base = {\n ...questionProps,\n answers,\n arrows,\n defaultTool: 'line',\n disabled: env.mode !== 'gather',\n prompt: promptEnabled ? prompt : null,\n rationale: null,\n size: graph,\n showToggle:\n env.mode === 'evaluate' &&\n !isEmpty(answers) &&\n answers.correctAnswer &&\n answers.correctAnswer.marks &&\n !isEmpty(answers.correctAnswer.marks),\n teacherInstructions: null,\n toolbarTools,\n extraCSSRules,\n };\n\n if (role === 'instructor' && (mode === 'view' || mode === 'evaluate')) {\n const { rationale, rationaleEnabled, teacherInstructions, teacherInstructionsEnabled } = normalizedQuestion || {};\n\n base.rationale = rationaleEnabled ? rationale : null;\n base.teacherInstructions = teacherInstructionsEnabled ? teacherInstructions : null;\n }\n\n if (mode === 'evaluate') {\n if (\n !isEmpty(answers) &&\n answers.correctAnswer &&\n answers.correctAnswer.marks &&\n !isEmpty(answers.correctAnswer.marks)\n ) {\n const { answersCorrected, bestScoreAnswerKey, bestScore } = getBestAnswer(normalizedQuestion, session, env);\n // array of marks from session with 'correctness' property set\n base.answersCorrected = answersCorrected;\n base.correctResponse = bestScoreAnswerKey ? (answers[bestScoreAnswerKey] || {}).marks : [];\n base.showToggle = base.showToggle && bestScore !== 1;\n } else {\n base.answersCorrected = (session && session.answer) || [];\n base.correctResponse = [];\n }\n }\n\n log('base: ', base);\n resolve(base);\n });\n}\n\n/*\n * Function to check the outcome\n * @param {Object} question - question object\n * @param {Object} session - session object\n * @param {Object} env - env object\n * */\nexport function outcome(question, session, env = {}) {\n return new Promise((resolve) => {\n if (!session || isEmpty(session)) {\n resolve({ score: 0, empty: true });\n }\n if (\n env.mode !== 'evaluate' ||\n isEmpty(question.answers) ||\n (question.answers && question.answers.correctAnswer && isEmpty(question.answers.correctAnswer.marks))\n ) {\n resolve({ score: 0 });\n }\n const { bestScore } = getBestAnswer(question, session, env);\n resolve({ score: bestScore });\n });\n}\n\n/*\n * Constant to create correct response session\n * @param {Object} question - question object\n * @param {Object} env - env object\n * */\nexport const createCorrectResponseSession = (question, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n const { answers } = question || {};\n let marks = [];\n if (answers && Object.values(answers)) {\n const correctAnswer = answers.correctAnswer || Object.values(answers)[0] || {};\n marks = correctAnswer.marks || [];\n }\n resolve({\n answer: marks,\n id: '1',\n });\n } else {\n resolve(null);\n }\n });\n};\n\n/*\n * Constant to validate model before saving item\n * @param {Object} model - model object\n * */\nexport const validate = (model = {}) => {\n const { answers, gssLineData } = model;\n const errors = {};\n const correctAnswerErrors = {};\n let found = false;\n if (gssLineData.numberOfLines === 1) {\n if (answers.correctAnswer.marks.length < 1) {\n found = true;\n correctAnswerErrors.correctAnswer = 'At least 1 line object should be defined.';\n } else if (answers.correctAnswer.marks.length === 1 && answers.correctAnswer.marks[0].building) {\n found = true;\n correctAnswerErrors.correctAnswer = '1 or more graph object should be correctly defined.';\n }\n } else {\n if (answers.correctAnswer.marks.length < 2) {\n found = true;\n correctAnswerErrors.correctAnswer = 'At least 2 line object should be defined.';\n } else if (answers.correctAnswer.marks.length === 2) {\n if (answers.correctAnswer.marks[0].building || answers.correctAnswer.marks[1].building) {\n found = true;\n correctAnswerErrors.correctAnswer = '1 or more graph object should be correctly defined.';\n }\n }\n }\n let polygon = answers.correctAnswer.marks.find((mark) => mark.type === 'polygon');\n if (!found && (!gssLineData.selectedTool === 'solutionSet' || !polygon)) {\n correctAnswerErrors.correctAnswer = 'Please select a solution set for the graphing solution set item.';\n }\n if (!isEmpty(correctAnswerErrors)) {\n errors.correctAnswerErrors = correctAnswerErrors;\n }\n return errors;\n};\n"],"mappings":";;mCAiBA,IAAe;CACb,SAAS,EACP,eAAe;EACb,MAAM;EACN,OAAO,CAAC;CACV,EACF;CACA,QAAQ;EACN,MAAM;EACN,OAAO;EACP,IAAI;EACJ,MAAM;CACR;CACA,OAAO,CAAC;CACR,0BAA0B;CAC1B,QAAQ;EACN,KAAK;EACL,KAAK;EACL,MAAM;EACN,WAAW;EACX,WAAW;CACb;CACA,OAAO;EACL,OAAO;EACP,QAAQ;CACV;CACA,aAAa;EACX,eAAe;EACf,cAAc;EACd,UAAU,CAAC;EACX,OAAO,EACL,UAAU,QACZ;CACF;CACA,aAAa;CACb,QAAQ,CAAC;CACT,eAAe;CACf,SAAS;CACT,QAAQ;CACR,OAAO;EACL,KAAK;EACL,KAAK;EACL,MAAM;EACN,WAAW;EACX,WAAW;CACb;CACA,WAAW;CACX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AY,iBAAiB,iBAAiB,CAAC,OAC7D,EAAoB,gBAAgB,qEAEjC,EAAQ,CAAmB,MAC9B,EAAO,sBAAsB,IAExB;AACT"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { E as e } from "../browser-BQg8KPEc.js";
|
|
2
|
+
import { C as t, K as n, N as r, S as i, T as a, U as o, W as s, i as c, j as l, n as u, nt as d, t as ee, tt as f, w as p, x as m } from "../alert-dialog-BXwLDAJc.js";
|
|
3
3
|
import h, { useRef as g } from "react";
|
|
4
4
|
import { createRoot as _ } from "react-dom/client";
|
|
5
5
|
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
@@ -19,7 +19,6 @@ import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
|
19
19
|
}), this.component = t, this.complete = n;
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
|
-
//#region ../../shared/player-events/dist/index.js
|
|
23
22
|
var b = class e extends CustomEvent {
|
|
24
23
|
static {
|
|
25
24
|
this.TYPE = "session-changed";
|
|
@@ -251,7 +250,7 @@ var b = class e extends CustomEvent {
|
|
|
251
250
|
if (t.length === 1) return !t[0].building;
|
|
252
251
|
} else if (t.length !== 2) return !1;
|
|
253
252
|
else return !t[1].building;
|
|
254
|
-
}, ae = (e) => e ? (e || []).filter(({ type: e, ...t }) => x[e] ? x[e](t) : !1) : [], I = /* @__PURE__ */ e(
|
|
253
|
+
}, ae = (e) => e ? (e || []).filter(({ type: e, ...t }) => x[e] ? x[e](t) : !1) : [], I = /* @__PURE__ */ e(f(), 1), L = ({ bgFill: e, fgFill: t }) => /* @__PURE__ */ y("svg", {
|
|
255
254
|
preserveAspectRatio: "xMinYMin meet",
|
|
256
255
|
version: "1.1",
|
|
257
256
|
viewBox: "-283 359 34 35",
|
|
@@ -322,7 +321,7 @@ R.propTypes = {
|
|
|
322
321
|
fgFill: I.default.string.isRequired,
|
|
323
322
|
borderFill: I.default.string.isRequired
|
|
324
323
|
};
|
|
325
|
-
var oe =
|
|
324
|
+
var oe = n("div")(({ size: e }) => ({
|
|
326
325
|
width: e || "25px",
|
|
327
326
|
height: e || "25px"
|
|
328
327
|
})), z = ({ open: e, size: t }) => /* @__PURE__ */ v(oe, {
|
|
@@ -342,7 +341,7 @@ z.propTypes = {
|
|
|
342
341
|
}, z.defaultProps = { open: !1 };
|
|
343
342
|
//#endregion
|
|
344
343
|
//#region ../../lib-react/correct-answer-toggle/dist/expander.js
|
|
345
|
-
var B = "height ease-in 300ms, opacity ease-in 300ms", se =
|
|
344
|
+
var B = "height ease-in 300ms, opacity ease-in 300ms", se = n("div")(() => ({
|
|
346
345
|
position: "relative",
|
|
347
346
|
height: 0,
|
|
348
347
|
overflow: "hidden",
|
|
@@ -377,9 +376,9 @@ var B = "height ease-in 300ms, opacity ease-in 300ms", se = a("div")(() => ({
|
|
|
377
376
|
width: 0
|
|
378
377
|
}
|
|
379
378
|
})), V = (e) => {
|
|
380
|
-
let { show: t, children: n, className:
|
|
381
|
-
return /* @__PURE__ */ v(
|
|
382
|
-
nodeRef:
|
|
379
|
+
let { show: t, children: n, className: r } = e, i = g(null);
|
|
380
|
+
return /* @__PURE__ */ v(o, {
|
|
381
|
+
nodeRef: i,
|
|
383
382
|
in: t,
|
|
384
383
|
appear: !0,
|
|
385
384
|
mountOnEnter: !1,
|
|
@@ -391,8 +390,8 @@ var B = "height ease-in 300ms, opacity ease-in 300ms", se = a("div")(() => ({
|
|
|
391
390
|
exitDone: "exit-done"
|
|
392
391
|
},
|
|
393
392
|
children: /* @__PURE__ */ v(se, {
|
|
394
|
-
ref:
|
|
395
|
-
className:
|
|
393
|
+
ref: i,
|
|
394
|
+
className: r,
|
|
396
395
|
children: n
|
|
397
396
|
})
|
|
398
397
|
});
|
|
@@ -410,29 +409,29 @@ function H(e) {
|
|
|
410
409
|
function U(e, t) {
|
|
411
410
|
return !e || H(e) ? e : H(e.default) ? e.default : t && H(e[t]) ? e[t] : t && H(e[t]?.default) ? e[t].default : e;
|
|
412
411
|
}
|
|
413
|
-
var ce = U(p, "Readable") || U(le.Readable, "Readable"), W = m, G = W.default, le = G && typeof G == "object" ? G : W, { translator: K } =
|
|
412
|
+
var ce = U(p, "Readable") || U(le.Readable, "Readable"), W = m, G = W.default, le = G && typeof G == "object" ? G : W, { translator: K } = c, ue = {
|
|
414
413
|
WebkitTouchCallout: "none",
|
|
415
414
|
WebkitUserSelect: "none",
|
|
416
415
|
KhtmlUserSelect: "none",
|
|
417
416
|
MozUserSelect: "none",
|
|
418
417
|
msUserSelect: "none",
|
|
419
418
|
userSelect: "none"
|
|
420
|
-
}, de =
|
|
419
|
+
}, de = n("div")(() => ({
|
|
421
420
|
width: "100%",
|
|
422
421
|
cursor: "pointer"
|
|
423
|
-
})), fe =
|
|
422
|
+
})), fe = n("div")(() => ({
|
|
424
423
|
margin: "0 auto",
|
|
425
424
|
textAlign: "center",
|
|
426
425
|
display: "flex"
|
|
427
|
-
})), pe =
|
|
426
|
+
})), pe = n("div")(() => ({
|
|
428
427
|
width: "fit-content",
|
|
429
428
|
minWidth: "140px",
|
|
430
429
|
alignSelf: "center",
|
|
431
430
|
verticalAlign: "middle",
|
|
432
|
-
color: `var(--correct-answer-toggle-label-color, ${
|
|
431
|
+
color: `var(--correct-answer-toggle-label-color, ${s.text()})`,
|
|
433
432
|
fontWeight: "normal",
|
|
434
433
|
...ue
|
|
435
|
-
})), q =
|
|
434
|
+
})), q = n("div")(() => ({
|
|
436
435
|
position: "absolute",
|
|
437
436
|
width: "25px",
|
|
438
437
|
"&.enter": { opacity: "0" },
|
|
@@ -445,7 +444,7 @@ var ce = U(p, "Readable") || U(le.Readable, "Readable"), W = m, G = W.default, l
|
|
|
445
444
|
opacity: "0",
|
|
446
445
|
transition: "opacity 0.3s ease-in"
|
|
447
446
|
}
|
|
448
|
-
})), me =
|
|
447
|
+
})), me = n("div")(() => ({
|
|
449
448
|
width: "25px",
|
|
450
449
|
marginRight: "5px",
|
|
451
450
|
display: "flex",
|
|
@@ -487,7 +486,7 @@ var ce = U(p, "Readable") || U(le.Readable, "Readable"), W = m, G = W.default, l
|
|
|
487
486
|
});
|
|
488
487
|
}
|
|
489
488
|
render() {
|
|
490
|
-
let { className: e, toggled: t, hideMessage: n, showMessage:
|
|
489
|
+
let { className: e, toggled: t, hideMessage: n, showMessage: r } = this.props;
|
|
491
490
|
return /* @__PURE__ */ v(de, {
|
|
492
491
|
className: e,
|
|
493
492
|
children: /* @__PURE__ */ v(V, {
|
|
@@ -495,7 +494,7 @@ var ce = U(p, "Readable") || U(le.Readable, "Readable"), W = m, G = W.default, l
|
|
|
495
494
|
children: /* @__PURE__ */ y(fe, {
|
|
496
495
|
onClick: this.onClick.bind(this),
|
|
497
496
|
onTouchEnd: this.onTouch.bind(this),
|
|
498
|
-
children: [/* @__PURE__ */ y(me, { children: [/* @__PURE__ */ v(
|
|
497
|
+
children: [/* @__PURE__ */ y(me, { children: [/* @__PURE__ */ v(o, {
|
|
499
498
|
nodeRef: this.openIconRef,
|
|
500
499
|
timeout: 400,
|
|
501
500
|
in: t,
|
|
@@ -510,7 +509,7 @@ var ce = U(p, "Readable") || U(le.Readable, "Readable"), W = m, G = W.default, l
|
|
|
510
509
|
ref: this.openIconRef,
|
|
511
510
|
children: /* @__PURE__ */ v(z, { open: t }, "correct-open")
|
|
512
511
|
})
|
|
513
|
-
}), /* @__PURE__ */ v(
|
|
512
|
+
}), /* @__PURE__ */ v(o, {
|
|
514
513
|
nodeRef: this.closedIconRef,
|
|
515
514
|
timeout: 5e3,
|
|
516
515
|
in: !t,
|
|
@@ -529,7 +528,7 @@ var ce = U(p, "Readable") || U(le.Readable, "Readable"), W = m, G = W.default, l
|
|
|
529
528
|
false: !0,
|
|
530
529
|
children: /* @__PURE__ */ v(pe, {
|
|
531
530
|
"aria-hidden": !this.state.show,
|
|
532
|
-
children: t ? n :
|
|
531
|
+
children: t ? n : r
|
|
533
532
|
})
|
|
534
533
|
})]
|
|
535
534
|
})
|
|
@@ -545,10 +544,10 @@ function J(e) {
|
|
|
545
544
|
function Y(e, t) {
|
|
546
545
|
return !e || J(e) ? e : J(e.default) ? e.default : t && J(e[t]) ? e[t] : t && J(e[t]?.default) ? e[t].default : e;
|
|
547
546
|
}
|
|
548
|
-
var ge = Y(
|
|
549
|
-
color:
|
|
550
|
-
backgroundColor:
|
|
551
|
-
}), be =
|
|
547
|
+
var ge = Y(l, "UiLayout") || Y(Q.UiLayout, "UiLayout"), X = Y(a, "PreviewPrompt") || Y(Q.PreviewPrompt, "PreviewPrompt"), _e = Y(r, "Collapsible") || Y(Q.Collapsible, "Collapsible"), ve = m, Z = ve.default, Q = Z && typeof Z == "object" ? Z : ve, ye = n(ge)({
|
|
548
|
+
color: s.text(),
|
|
549
|
+
backgroundColor: s.background()
|
|
550
|
+
}), be = n(_e)(({ theme: e }) => ({ marginBottom: e.spacing(2) })), xe = n(u)(({ theme: e }) => ({
|
|
552
551
|
marginTop: e.spacing(2),
|
|
553
552
|
marginBottom: e.spacing(2)
|
|
554
553
|
})), $ = class extends h.Component {
|
|
@@ -638,11 +637,11 @@ var ge = Y(u, "UiLayout") || Y(Q.UiLayout, "UiLayout"), X = Y(s, "PreviewPrompt"
|
|
|
638
637
|
} }), e.selectedTool = "lineB"), n(e, t);
|
|
639
638
|
};
|
|
640
639
|
render() {
|
|
641
|
-
let { model: e, onAnswersChange:
|
|
640
|
+
let { model: e, onAnswersChange: n, session: r } = this.props, { showingCorrect: a, dialog: o } = this.state, { answer: s } = r || {}, { answersCorrected: c, arrows: l, coordinatesOnHover: u, correctResponse: d, defaultTool: f, disabled: p, domain: m, extraCSSRules: h, labels: g, labelsEnabled: _, prompt: b, range: x, rationale: S, size: C, showToggle: w, title: T, titleEnabled: E, teacherInstructions: D, language: O, gssLineData: k, gssData: A } = e || {}, j = c || s || [], M = e.rationale && (t(e.rationale) || i(e.rationale));
|
|
642
641
|
return /* @__PURE__ */ y(ye, {
|
|
643
642
|
extraCSSRules: h,
|
|
644
643
|
children: [
|
|
645
|
-
e.teacherInstructions && (
|
|
644
|
+
e.teacherInstructions && (t(e.teacherInstructions) || i(e.teacherInstructions)) && /* @__PURE__ */ v(be, {
|
|
646
645
|
labels: {
|
|
647
646
|
hidden: "Show Teacher Instructions",
|
|
648
647
|
visible: "Hide Teacher Instructions"
|
|
@@ -655,11 +654,11 @@ var ge = Y(u, "UiLayout") || Y(Q.UiLayout, "UiLayout"), X = Y(s, "PreviewPrompt"
|
|
|
655
654
|
}),
|
|
656
655
|
/* @__PURE__ */ v(he, {
|
|
657
656
|
show: w,
|
|
658
|
-
toggled:
|
|
657
|
+
toggled: a,
|
|
659
658
|
onToggle: this.toggleCorrect,
|
|
660
659
|
language: O
|
|
661
660
|
}),
|
|
662
|
-
|
|
661
|
+
a && w ? /* @__PURE__ */ v(xe, {
|
|
663
662
|
axesSettings: { includeArrows: l },
|
|
664
663
|
coordinatesOnHover: u,
|
|
665
664
|
disabled: !0,
|
|
@@ -671,7 +670,7 @@ var ge = Y(u, "UiLayout") || Y(Q.UiLayout, "UiLayout"), X = Y(s, "PreviewPrompt"
|
|
|
671
670
|
...e,
|
|
672
671
|
correctness: "correct"
|
|
673
672
|
})),
|
|
674
|
-
onChangeMarks:
|
|
673
|
+
onChangeMarks: n,
|
|
675
674
|
range: x,
|
|
676
675
|
showLabels: _,
|
|
677
676
|
showTitle: E,
|
|
@@ -692,7 +691,7 @@ var ge = Y(u, "UiLayout") || Y(Q.UiLayout, "UiLayout"), X = Y(s, "PreviewPrompt"
|
|
|
692
691
|
domain: m,
|
|
693
692
|
labels: g,
|
|
694
693
|
marks: j,
|
|
695
|
-
onChangeMarks:
|
|
694
|
+
onChangeMarks: n,
|
|
696
695
|
onCustomReset: this.onResetClick,
|
|
697
696
|
range: x,
|
|
698
697
|
showLabels: _,
|
|
@@ -713,12 +712,12 @@ var ge = Y(u, "UiLayout") || Y(Q.UiLayout, "UiLayout"), X = Y(s, "PreviewPrompt"
|
|
|
713
712
|
children: /* @__PURE__ */ v(X, { prompt: S })
|
|
714
713
|
}),
|
|
715
714
|
/* @__PURE__ */ v(ee, {
|
|
716
|
-
open:
|
|
717
|
-
title:
|
|
718
|
-
text:
|
|
719
|
-
onClose:
|
|
720
|
-
onConfirm:
|
|
721
|
-
onConfirmText:
|
|
715
|
+
open: o.open,
|
|
716
|
+
title: o.title,
|
|
717
|
+
text: o.text,
|
|
718
|
+
onClose: o.onClose,
|
|
719
|
+
onConfirm: o.onConfirm,
|
|
720
|
+
onConfirmText: o.onConfirmText ? o.onConfirmText : "OK"
|
|
722
721
|
})
|
|
723
722
|
]
|
|
724
723
|
});
|
|
@@ -769,11 +768,11 @@ var ge = Y(u, "UiLayout") || Y(Q.UiLayout, "UiLayout"), X = Y(s, "PreviewPrompt"
|
|
|
769
768
|
setGssData: this.setGssData
|
|
770
769
|
});
|
|
771
770
|
this._root ||= _(this), this._root.render(e), queueMicrotask(() => {
|
|
772
|
-
|
|
771
|
+
d(this);
|
|
773
772
|
});
|
|
774
773
|
}
|
|
775
774
|
disconnectedCallback() {
|
|
776
|
-
this._root
|
|
775
|
+
this._root &&= (this._root.unmount(), null);
|
|
777
776
|
}
|
|
778
777
|
};
|
|
779
778
|
//#endregion
|