@pie-element/graphing-solution-set 6.1.2-next.0 → 6.1.2-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/author/correct-response.js +67 -67
- package/dist/author/graphing-config.js +67 -68
- package/dist/author/utils.js +1 -1
- package/dist/browser/author/index.js +71 -71
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/browser-pUycHh7Y.js +348 -0
- package/dist/browser/browser-pUycHh7Y.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 +17 -17
- package/dist/browser/{dist-SjeWPldT.js → dist-B9B3lIkf.js} +13602 -17635
- package/dist/browser/dist-B9B3lIkf.js.map +1 -0
- 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 +1 -4
- package/dist/index.iife.js +109 -107
- package/dist/runtime-support.d.ts +12 -0
- package/dist/runtime-support.js +12 -0
- package/package.json +13 -10
- 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
|
@@ -14,7 +14,7 @@ export declare const getAnswerCorrected: ({ sessionAnswers, marks: correctAnswer
|
|
|
14
14
|
export declare const getBestAnswer: (question: any, session: any, env?: {}) => {
|
|
15
15
|
bestScore: number;
|
|
16
16
|
bestScoreAnswerKey: null;
|
|
17
|
-
answersCorrected: any;
|
|
17
|
+
answersCorrected: any[];
|
|
18
18
|
foundOneSolution: boolean;
|
|
19
19
|
};
|
|
20
20
|
export declare const normalize: (question: any) => any;
|
package/dist/controller/index.js
CHANGED
|
@@ -1,28 +1,26 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import t from "
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { equalMarks as i, removeInvalidAnswers as a, sortedAnswers as o } from "./utils.js";
|
|
6
|
-
import s from "debug";
|
|
1
|
+
import e from "./defaults.js";
|
|
2
|
+
import { equalMarks as t, removeInvalidAnswers as n, sortedAnswers as r } from "./utils.js";
|
|
3
|
+
import i from "debug";
|
|
4
|
+
import { cloneDeep as a, isEmpty as o, uniqWith as s } from "@pie-element/shared-lodash";
|
|
7
5
|
//#region src/controller/index.ts
|
|
8
|
-
var c =
|
|
9
|
-
|
|
10
|
-
let
|
|
6
|
+
var c = i("@pie-element:graphing-solution-set:controller"), l = () => ({ line: [] }), u = (e, n) => !!(e && n && e.type === n.type && t[e.type] && t[e.type](e, n)), d = ({ sessionAnswers: e, marks: t }) => {
|
|
7
|
+
e ||= [], t ||= [];
|
|
8
|
+
let n = a(e).reduce((e, n) => (n.correctness = t.find((e) => u(n, e)) ? "correct" : "incorrect", [...e, n]), []), r = a(t).reduce((t, n) => e.find((e) => u(n, e)) ? t : [...t, {
|
|
11
9
|
...n,
|
|
12
10
|
correctness: "missing"
|
|
13
11
|
}], []);
|
|
14
|
-
return [...
|
|
15
|
-
}, f = (
|
|
16
|
-
let { answers:
|
|
17
|
-
Object.entries(
|
|
12
|
+
return [...n, ...r];
|
|
13
|
+
}, f = (e, t, n = {}) => {
|
|
14
|
+
let { answers: i = {}, scoringType: c } = e || {}, { answer: f } = t || {};
|
|
15
|
+
Object.entries(i || {}).forEach(([e, t]) => i[e] = {
|
|
18
16
|
...t,
|
|
19
17
|
marks: t?.marks.filter((e) => !e.building)
|
|
20
|
-
}), f ||= [],
|
|
21
|
-
correctAnswer:
|
|
22
|
-
...
|
|
18
|
+
}), f ||= [], i = o(i) ? { correctAnswer: l() } : {
|
|
19
|
+
correctAnswer: i.correctAnswer,
|
|
20
|
+
...r(i)
|
|
23
21
|
};
|
|
24
|
-
let p =
|
|
25
|
-
return Object.entries(
|
|
22
|
+
let p = s(f, u);
|
|
23
|
+
return Object.entries(i).reduce((e, t) => {
|
|
26
24
|
let n = t[0], { marks: r } = t[1] || {};
|
|
27
25
|
if (!r || !r.length) return e;
|
|
28
26
|
let i = d({
|
|
@@ -33,21 +31,21 @@ var c = s("@pie-element:graphing-solution-set:controller"), l = () => ({ line: [
|
|
|
33
31
|
}, {
|
|
34
32
|
bestScore: 0,
|
|
35
33
|
bestScoreAnswerKey: null,
|
|
36
|
-
answersCorrected:
|
|
34
|
+
answersCorrected: a(p).map((e) => ({
|
|
37
35
|
...e,
|
|
38
36
|
correctness: "incorrect"
|
|
39
37
|
})),
|
|
40
38
|
foundOneSolution: !1
|
|
41
39
|
});
|
|
42
|
-
}, p = (
|
|
43
|
-
...
|
|
44
|
-
...
|
|
40
|
+
}, p = (t) => ({
|
|
41
|
+
...e,
|
|
42
|
+
...t
|
|
45
43
|
});
|
|
46
|
-
function m(e,
|
|
44
|
+
function m(e, t, r) {
|
|
47
45
|
return new Promise((i) => {
|
|
48
|
-
let
|
|
49
|
-
|
|
50
|
-
let { defaultTool: s, extraCSSRules: l, prompt: u, promptEnabled: d, graph: m, answers: h, toolbarTools: g, ..._ } =
|
|
46
|
+
let a = p(e);
|
|
47
|
+
t.answer = n(t.answer);
|
|
48
|
+
let { defaultTool: s, extraCSSRules: l, prompt: u, promptEnabled: d, graph: m, answers: h, toolbarTools: g, ..._ } = a || {}, { arrows: v } = a, { mode: y, role: b } = r || {};
|
|
51
49
|
typeof v == "boolean" && (v = v ? {
|
|
52
50
|
left: !0,
|
|
53
51
|
right: !0,
|
|
@@ -68,30 +66,30 @@ function m(e, n, r) {
|
|
|
68
66
|
prompt: d ? u : null,
|
|
69
67
|
rationale: null,
|
|
70
68
|
size: m,
|
|
71
|
-
showToggle: r.mode === "evaluate" && !
|
|
69
|
+
showToggle: r.mode === "evaluate" && !o(h) && h.correctAnswer && h.correctAnswer.marks && !o(h.correctAnswer.marks),
|
|
72
70
|
teacherInstructions: null,
|
|
73
71
|
toolbarTools: g,
|
|
74
72
|
extraCSSRules: l
|
|
75
73
|
};
|
|
76
74
|
if (b === "instructor" && (y === "view" || y === "evaluate")) {
|
|
77
|
-
let { rationale: e, rationaleEnabled: t, teacherInstructions: n, teacherInstructionsEnabled: r } =
|
|
75
|
+
let { rationale: e, rationaleEnabled: t, teacherInstructions: n, teacherInstructionsEnabled: r } = a || {};
|
|
78
76
|
x.rationale = t ? e : null, x.teacherInstructions = r ? n : null;
|
|
79
77
|
}
|
|
80
|
-
if (y === "evaluate") if (!
|
|
81
|
-
let { answersCorrected: e, bestScoreAnswerKey:
|
|
82
|
-
x.answersCorrected = e, x.correctResponse =
|
|
83
|
-
} else x.answersCorrected =
|
|
78
|
+
if (y === "evaluate") if (!o(h) && h.correctAnswer && h.correctAnswer.marks && !o(h.correctAnswer.marks)) {
|
|
79
|
+
let { answersCorrected: e, bestScoreAnswerKey: n, bestScore: i } = f(a, t, r);
|
|
80
|
+
x.answersCorrected = e, x.correctResponse = n ? (h[n] || {}).marks : [], x.showToggle = x.showToggle && i !== 1;
|
|
81
|
+
} else x.answersCorrected = t && t.answer || [], x.correctResponse = [];
|
|
84
82
|
c("base: ", x), i(x);
|
|
85
83
|
});
|
|
86
84
|
}
|
|
87
|
-
function h(e,
|
|
88
|
-
return new Promise((
|
|
89
|
-
(!
|
|
85
|
+
function h(e, t, n = {}) {
|
|
86
|
+
return new Promise((r) => {
|
|
87
|
+
(!t || o(t)) && r({
|
|
90
88
|
score: 0,
|
|
91
89
|
empty: !0
|
|
92
|
-
}), (
|
|
93
|
-
let { bestScore:
|
|
94
|
-
|
|
90
|
+
}), (n.mode !== "evaluate" || o(e.answers) || e.answers && e.answers.correctAnswer && o(e.answers.correctAnswer.marks)) && r({ score: 0 });
|
|
91
|
+
let { bestScore: i } = f(e, t, n);
|
|
92
|
+
r({ score: i });
|
|
95
93
|
});
|
|
96
94
|
}
|
|
97
95
|
var g = (e, t) => new Promise((n) => {
|
|
@@ -103,10 +101,10 @@ var g = (e, t) => new Promise((n) => {
|
|
|
103
101
|
});
|
|
104
102
|
} else n(null);
|
|
105
103
|
}), _ = (e = {}) => {
|
|
106
|
-
let { answers:
|
|
107
|
-
|
|
108
|
-
let s =
|
|
109
|
-
return !
|
|
104
|
+
let { answers: t, gssLineData: n } = e, r = {}, i = {}, a = !1;
|
|
105
|
+
n.numberOfLines === 1 ? t.correctAnswer.marks.length < 1 ? (a = !0, i.correctAnswer = "At least 1 line object should be defined.") : t.correctAnswer.marks.length === 1 && t.correctAnswer.marks[0].building && (a = !0, i.correctAnswer = "1 or more graph object should be correctly defined.") : t.correctAnswer.marks.length < 2 ? (a = !0, i.correctAnswer = "At least 2 line object should be defined.") : t.correctAnswer.marks.length === 2 && (t.correctAnswer.marks[0].building || t.correctAnswer.marks[1].building) && (a = !0, i.correctAnswer = "1 or more graph object should be correctly defined.");
|
|
106
|
+
let s = t.correctAnswer.marks.find((e) => e.type === "polygon");
|
|
107
|
+
return !a && (!n.selectedTool === "solutionSet" || !s) && (i.correctAnswer = "Please select a solution set for the graphing solution set item."), o(i) || (r.correctAnswerErrors = i), r;
|
|
110
108
|
};
|
|
111
109
|
//#endregion
|
|
112
110
|
export { u as compareMarks, g as createCorrectResponseSession, d as getAnswerCorrected, f as getBestAnswer, m as model, p as normalize, h as outcome, _ as validate };
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
* Manual edits will be overwritten on next sync.
|
|
7
7
|
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
8
|
*/
|
|
9
|
-
export declare const equalSegment: (segment1: any, segment2: any) =>
|
|
9
|
+
export declare const equalSegment: (segment1: any, segment2: any) => boolean;
|
|
10
10
|
export declare const sortedAnswers: (answers: any) => {};
|
|
11
11
|
export declare const equalLine: (line1: any, line2: any) => boolean;
|
|
12
12
|
export declare const constructSegmentsFromPoints: (points: any) => any;
|
|
13
|
-
export declare const removeDuplicateSegments: (segments: any) =>
|
|
13
|
+
export declare const removeDuplicateSegments: (segments: any) => unknown[];
|
|
14
14
|
export declare const removeInvalidSegments: (segments: any) => any;
|
|
15
15
|
export declare const equalPolygon: (poly1: any, poly2: any) => boolean;
|
|
16
16
|
export declare const equalMarks: {
|
package/dist/controller/utils.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import t from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEqual.js";
|
|
3
|
-
import n from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/uniq.js";
|
|
4
|
-
import r from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/uniqWith.js";
|
|
1
|
+
import { differenceWith as e, isEqual as t, uniq as n, uniqWith as r } from "@pie-element/shared-lodash";
|
|
5
2
|
//#region src/controller/utils.ts
|
|
6
3
|
var i = (e, n) => t(e.from, n.from) && t(e.to, n.to) || t(e.to, n.from) && t(e.from, n.to), a = (e) => Object.keys(e || {}).sort().reduce((t, n) => (n !== "correctAnswer" && (t[n] = e[n]), t), {}), o = (e) => {
|
|
7
4
|
e = {
|