@pie-element/match-list 7.1.1-next.0 → 7.1.1-next.109
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +572 -0
- package/CHANGELOG.md +1485 -0
- package/LICENSE.md +5 -0
- package/README.md +1 -0
- package/controller/CHANGELOG.json +242 -0
- package/controller/CHANGELOG.md +1043 -0
- package/controller/lib/defaults.js +15 -0
- package/controller/lib/defaults.js.map +1 -0
- package/controller/lib/index.js +246 -0
- package/controller/lib/index.js.map +1 -0
- package/controller/package.json +25 -0
- package/docs/config-schema.json +70 -0
- package/docs/config-schema.json.md +55 -0
- package/docs/demo/config.js +34 -0
- package/docs/demo/generate.js +54 -0
- package/docs/demo/index.html +1 -0
- package/docs/demo/session.js +6 -0
- package/docs/pie-schema.json +170 -0
- package/docs/pie-schema.json.md +104 -0
- package/lib/answer-area.js +168 -0
- package/lib/answer-area.js.map +1 -0
- package/lib/answer.js +274 -0
- package/lib/answer.js.map +1 -0
- package/lib/arrow.js +57 -0
- package/lib/arrow.js.map +1 -0
- package/lib/choices-list.js +60 -0
- package/lib/choices-list.js.map +1 -0
- package/lib/droppable-placeholder.js +60 -0
- package/lib/droppable-placeholder.js.map +1 -0
- package/lib/index.js +87 -0
- package/lib/index.js.map +1 -0
- package/lib/keyboard-coordinates.js +147 -0
- package/lib/keyboard-coordinates.js.map +1 -0
- package/lib/main.js +304 -0
- package/lib/main.js.map +1 -0
- package/package.json +21 -50
- package/dist/controller/defaults.d.ts +0 -17
- package/dist/controller/defaults.js +0 -9
- package/dist/controller/index.d.ts +0 -38
- package/dist/controller/index.js +0 -105
- package/dist/delivery/answer-area.d.ts +0 -27
- package/dist/delivery/answer-area.js +0 -94
- package/dist/delivery/answer.d.ts +0 -40
- package/dist/delivery/answer.js +0 -176
- package/dist/delivery/arrow.d.ts +0 -17
- package/dist/delivery/arrow.js +0 -35
- package/dist/delivery/choices-list.d.ts +0 -21
- package/dist/delivery/choices-list.js +0 -37
- package/dist/delivery/droppable-placeholder.d.ts +0 -24
- package/dist/delivery/droppable-placeholder.js +0 -42
- package/dist/delivery/index.d.ts +0 -21
- package/dist/delivery/index.js +0 -49
- package/dist/delivery/main.d.ts +0 -26
- package/dist/delivery/main.js +0 -149
- package/dist/index.d.ts +0 -1
- package/dist/index.iife.d.ts +0 -8
- package/dist/index.iife.js +0 -152
- package/dist/index.js +0 -2
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_DataView.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Promise.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Set.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_SetCache.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Stack.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js +0 -15
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayMap.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayReduce.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arraySome.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseEach.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFindIndex.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFindKey.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFor.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseForOwn.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGet.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseHasIn.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_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/_baseIsMatch.js +0 -26
- 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/_baseIsTypedArray.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIteratee.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMatches.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMatchesProperty.js +0 -17
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseProperty.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_basePropertyDeep.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseReduce.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseToString.js +0 -15
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTrim.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cacheHas.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_castPath.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createBaseEach.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createBaseFor.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createFind.js +0 -19
- 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/_getMapData.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMatchData.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_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/_getTag.js +0 -23
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hasPath.js +0 -18
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_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/_isStrictComparable.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapToArray.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_matchesStrictComparable.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_memoizeCapped.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_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/_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/_stackClear.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stringToPath.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toKey.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js +0 -15
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_trimmedEndIndex.js +0 -8
- 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/find.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/findIndex.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/findKey.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/get.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/hasIn.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/identity.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js +0 -4
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/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/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/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/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/isUndefined.js +0 -6
- 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/memoize.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/property.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/reduce.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/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/toFinite.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toInteger.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toNumber.js +0 -19
- 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/uniqueId.js +0 -9
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/match-list/controller/src/index.js
|
|
3
|
-
* @auto-generated
|
|
4
|
-
*
|
|
5
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
-
* Manual edits will be overwritten on next sync.
|
|
7
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* Generates detailed trace log for match-list scoring evaluation
|
|
11
|
-
* @param {Object} question
|
|
12
|
-
* @param {Object} session
|
|
13
|
-
* @param {Object} env
|
|
14
|
-
* @returns {Array<string>} traceLog
|
|
15
|
-
*/
|
|
16
|
-
export declare const getLogTrace: (question: any, session: any, env: any) => string[];
|
|
17
|
-
export declare const outcome: (question: any, session: any, env: any) => Promise<unknown>;
|
|
18
|
-
export declare function createDefaultModel(model?: {}): Promise<unknown>;
|
|
19
|
-
export declare const normalize: (model: any) => any;
|
|
20
|
-
/**
|
|
21
|
-
*
|
|
22
|
-
* @param {*} question
|
|
23
|
-
* @param {*} session
|
|
24
|
-
* @param {*} env
|
|
25
|
-
* @param {*} updateSession - optional - a function that will set the properties passed into it on the session.
|
|
26
|
-
*/
|
|
27
|
-
export declare function model(question: any, session: any, env: any, updateSession: any): Promise<{
|
|
28
|
-
config: any;
|
|
29
|
-
correctness: {
|
|
30
|
-
score: string;
|
|
31
|
-
correctness: string | undefined;
|
|
32
|
-
};
|
|
33
|
-
feedback: string | undefined;
|
|
34
|
-
mode: any;
|
|
35
|
-
} & {
|
|
36
|
-
correctResponse: {};
|
|
37
|
-
}>;
|
|
38
|
-
export declare const createCorrectResponseSession: (question: any, env: any) => Promise<unknown>;
|
package/dist/controller/index.js
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import e from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js";
|
|
2
|
-
import t from "./defaults.js";
|
|
3
|
-
import n from "debug";
|
|
4
|
-
import { getFeedbackForCorrectness as r } from "@pie-element/shared-feedback";
|
|
5
|
-
import { getShuffledChoices as i, lockChoices as a, partialScoring as o } from "@pie-element/shared-controller-utils";
|
|
6
|
-
//#region src/controller/index.ts
|
|
7
|
-
var s = n("@pie-element:match-list:controller"), c = (e, t, n) => {
|
|
8
|
-
let r = o.enabled(e, n), i = e.prompts;
|
|
9
|
-
if (!t || Object.keys(t).length === 0) return "unanswered";
|
|
10
|
-
let a = d(e), s = u(i, t);
|
|
11
|
-
return a === s ? "correct" : s === 0 ? "incorrect" : r ? "partial" : "incorrect";
|
|
12
|
-
}, l = (e, t, n) => {
|
|
13
|
-
if (t.mode === "evaluate") return c(e, n, t);
|
|
14
|
-
}, u = (e = [], t) => {
|
|
15
|
-
let n = 0;
|
|
16
|
-
return e.forEach((e) => {
|
|
17
|
-
e.relatedAnswer === t[e.id] && (n += 1);
|
|
18
|
-
}), n;
|
|
19
|
-
}, d = (e) => e && e.prompts ? e.prompts.length : 0, f = (e, t) => {
|
|
20
|
-
let n = u(e && e.prompts, t), r = d(e);
|
|
21
|
-
return parseFloat((n / r).toFixed(2));
|
|
22
|
-
}, p = (e, t, n) => {
|
|
23
|
-
let r = l(e, t, n);
|
|
24
|
-
return r === "correct" ? 1 : r === "partial" ? f(e, n) : 0;
|
|
25
|
-
}, m = (e, t, n) => {
|
|
26
|
-
let r = [], i = e?.prompts || [], a = t?.value || {};
|
|
27
|
-
if (!a || Object.keys(a).length === 0) return r.push("Student did not provide any answer."), r;
|
|
28
|
-
let s = i.length;
|
|
29
|
-
r.push(`Match-list item contains ${s} question(s).`);
|
|
30
|
-
let c = 0, l = 0;
|
|
31
|
-
i.forEach((e) => {
|
|
32
|
-
let t = e.relatedAnswer, n = a[e.id];
|
|
33
|
-
n === void 0 ? r.push(`Question ${e.id}: no answer provided.`) : (l += 1, n === t ? (c += 1, r.push(`Question ${e.id}: correctly matched.`)) : r.push(`Question ${e.id}: incorrectly matched (selected '${n}', expected '${t}').`));
|
|
34
|
-
}), r.push(`Student correctly matched ${c} out of ${s} question(s).`);
|
|
35
|
-
let u = o.enabled(e, n);
|
|
36
|
-
u ? (r.push("Score calculated using partial scoring."), r.push("Score is the number of correct matches divided by the total number of questions.")) : (r.push("Score calculated using all-or-nothing scoring."), r.push("Student must match all questions correctly to receive full credit."));
|
|
37
|
-
let d = p(e, n, a), f = u ? d : +(d === 1);
|
|
38
|
-
return r.push(`Final score: ${f}.`), r;
|
|
39
|
-
}, h = (t, n, r) => new Promise((i) => {
|
|
40
|
-
r.mode === "evaluate" ? !n || e(n) ? i({
|
|
41
|
-
score: 0,
|
|
42
|
-
empty: !0,
|
|
43
|
-
logTrace: ["Student did not provide any answer."]
|
|
44
|
-
}) : i({
|
|
45
|
-
score: p(t, r, n.value),
|
|
46
|
-
empty: !1,
|
|
47
|
-
logTrace: m(t, n, r)
|
|
48
|
-
}) : i({
|
|
49
|
-
score: void 0,
|
|
50
|
-
completed: void 0,
|
|
51
|
-
logTrace: []
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
function g(e = {}) {
|
|
55
|
-
return new Promise((n) => {
|
|
56
|
-
n({
|
|
57
|
-
...t,
|
|
58
|
-
...e
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
var _ = (e) => ({
|
|
63
|
-
...t,
|
|
64
|
-
...e
|
|
65
|
-
});
|
|
66
|
-
async function v(t, n, o, c) {
|
|
67
|
-
t = _(t);
|
|
68
|
-
let u = l(t, o, n && n.value), d = {}, f = {
|
|
69
|
-
score: `${p(t, o, n && n.value) * 100}%`,
|
|
70
|
-
correctness: u
|
|
71
|
-
}, m = {}, h = t.prompts, g = t.answers, v = (e) => (t, n, r) => new Promise((t) => {
|
|
72
|
-
m[e] = r.shuffledValues, t();
|
|
73
|
-
});
|
|
74
|
-
a(t, n, o) || (h = await i(h, { shuffledValues: (n && n.shuffledValues || {}).prompts }, v("prompts"), "id"), g = await i(g, { shuffledValues: (n && n.shuffledValues || {}).answers }, v("answers"), "id")), e(m) || c && typeof c == "function" && c(n.id, n.element, { shuffledValues: m }).catch((e) => {
|
|
75
|
-
console.error("update session failed", e);
|
|
76
|
-
}), t && h && h.forEach((e) => {
|
|
77
|
-
d[e.id] = e.relatedAnswer;
|
|
78
|
-
});
|
|
79
|
-
let y = o.mode === "evaluate" ? await r(f.correctness, t.feedback) : void 0, b = {
|
|
80
|
-
config: {
|
|
81
|
-
...t,
|
|
82
|
-
prompts: h,
|
|
83
|
-
answers: g
|
|
84
|
-
},
|
|
85
|
-
correctness: f,
|
|
86
|
-
feedback: y,
|
|
87
|
-
mode: o.mode
|
|
88
|
-
};
|
|
89
|
-
o.role === "instructor" && (o.mode === "view" || o.mode === "evaluate") ? b.rationale = t.rationale : b.rationale = null;
|
|
90
|
-
let x = Object.assign(b, { correctResponse: d });
|
|
91
|
-
return s("out: ", x), x;
|
|
92
|
-
}
|
|
93
|
-
var y = (e, t) => new Promise((n) => {
|
|
94
|
-
if (t.mode !== "evaluate" && t.role === "instructor") {
|
|
95
|
-
let { prompts: t, answers: r } = e, i = {};
|
|
96
|
-
t.forEach((e) => {
|
|
97
|
-
r.filter((t) => t.id === e.relatedAnswer).length && (i[e.id] = e.relatedAnswer);
|
|
98
|
-
}), n({
|
|
99
|
-
value: i,
|
|
100
|
-
id: "1"
|
|
101
|
-
});
|
|
102
|
-
} else n(null);
|
|
103
|
-
});
|
|
104
|
-
//#endregion
|
|
105
|
-
export { y as createCorrectResponseSession, g as createDefaultModel, m as getLogTrace, v as model, _ as normalize, h as outcome };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/match-list/src/answer-area.jsx
|
|
3
|
-
* @auto-generated
|
|
4
|
-
*
|
|
5
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
-
* Manual edits will be overwritten on next sync.
|
|
7
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
-
*/
|
|
9
|
-
import React from 'react';
|
|
10
|
-
import PropTypes from 'prop-types';
|
|
11
|
-
export declare class AnswerArea extends React.Component {
|
|
12
|
-
static propTypes: {
|
|
13
|
-
session: PropTypes.Validator<object>;
|
|
14
|
-
showCorrect: PropTypes.Validator<boolean>;
|
|
15
|
-
disabled: PropTypes.Validator<boolean>;
|
|
16
|
-
onSessionChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
17
|
-
onRemoveAnswer: PropTypes.Requireable<(...args: any[]) => any>;
|
|
18
|
-
instanceId: PropTypes.Validator<string>;
|
|
19
|
-
model: PropTypes.Validator<object>;
|
|
20
|
-
prompt: PropTypes.Requireable<string>;
|
|
21
|
-
};
|
|
22
|
-
getAnswerFromSession: any;
|
|
23
|
-
getCorrectOrIncorrectMap: any;
|
|
24
|
-
buildRows: any;
|
|
25
|
-
render(): React.JSX.Element;
|
|
26
|
-
}
|
|
27
|
-
export default AnswerArea;
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import e from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js";
|
|
2
|
-
import t from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isUndefined.js";
|
|
3
|
-
import n from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/reduce.js";
|
|
4
|
-
import r from "./arrow.js";
|
|
5
|
-
import i from "./answer.js";
|
|
6
|
-
import a from "react";
|
|
7
|
-
import o from "prop-types";
|
|
8
|
-
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
9
|
-
import { styled as l } from "@mui/material/styles";
|
|
10
|
-
//#region src/delivery/answer-area.tsx
|
|
11
|
-
var u = l("div")({
|
|
12
|
-
alignItems: "normal",
|
|
13
|
-
display: "flex",
|
|
14
|
-
height: 40,
|
|
15
|
-
margin: "10px 20px"
|
|
16
|
-
}), d = l("div")(({ theme: e }) => ({
|
|
17
|
-
alignItems: "flex-start",
|
|
18
|
-
display: "flex",
|
|
19
|
-
flex: 1,
|
|
20
|
-
flexDirection: "column",
|
|
21
|
-
justifyContent: "space-between",
|
|
22
|
-
marginTop: e.spacing(2),
|
|
23
|
-
marginBottom: e.spacing(2)
|
|
24
|
-
})), f = l("div")(({ theme: e }) => ({
|
|
25
|
-
border: `1px solid ${e.palette.grey[400]}`,
|
|
26
|
-
boxSizing: "border-box",
|
|
27
|
-
flex: 1,
|
|
28
|
-
margin: "10px 0",
|
|
29
|
-
minHeight: 40,
|
|
30
|
-
overflow: "hidden",
|
|
31
|
-
padding: 10,
|
|
32
|
-
textAlign: "center",
|
|
33
|
-
width: "100%",
|
|
34
|
-
wordBreak: "break-word"
|
|
35
|
-
})), p = l("div")({
|
|
36
|
-
alignItems: "center",
|
|
37
|
-
display: "flex",
|
|
38
|
-
justifyContent: "space-between",
|
|
39
|
-
width: "100%"
|
|
40
|
-
}), m = class extends a.Component {
|
|
41
|
-
static propTypes = {
|
|
42
|
-
session: o.object.isRequired,
|
|
43
|
-
showCorrect: o.bool.isRequired,
|
|
44
|
-
disabled: o.bool.isRequired,
|
|
45
|
-
onSessionChange: o.func,
|
|
46
|
-
onRemoveAnswer: o.func,
|
|
47
|
-
instanceId: o.string.isRequired,
|
|
48
|
-
model: o.object.isRequired,
|
|
49
|
-
prompt: o.string
|
|
50
|
-
};
|
|
51
|
-
getAnswerFromSession = (e) => {
|
|
52
|
-
let { model: t, session: n, showCorrect: r } = this.props, { config: i } = t, a = r ? i.prompts.find((t) => t.id === e).relatedAnswer : n.value && n.value[e];
|
|
53
|
-
return i.answers.find((e) => e.id === a) || {};
|
|
54
|
-
};
|
|
55
|
-
getCorrectOrIncorrectMap = () => {
|
|
56
|
-
let { model: e, session: r, showCorrect: i } = this.props, { config: a } = e, o = r.value || a.prompts.reduce((e, t) => (e[t.id] = void 0, e), {});
|
|
57
|
-
if (e.mode !== "evaluate") return {};
|
|
58
|
-
if (i) return a.prompts.reduce((e, t) => (e[t.id] = !0, e), {});
|
|
59
|
-
let s = a.prompts.reduce((e, n) => (t(n.relatedAnswer) || (e[n.id] = n.relatedAnswer), e), {});
|
|
60
|
-
return n(o, (e, t, n) => (e[n] = s[n] === o[n], e), {});
|
|
61
|
-
};
|
|
62
|
-
buildRows = () => {
|
|
63
|
-
let { model: e } = this.props, { config: t } = e;
|
|
64
|
-
return (t.prompts || []).map((e) => {
|
|
65
|
-
let t = this.getAnswerFromSession(e.id);
|
|
66
|
-
return {
|
|
67
|
-
...e,
|
|
68
|
-
sessionAnswer: t
|
|
69
|
-
};
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
|
-
render() {
|
|
73
|
-
let { disabled: t, instanceId: n, onRemoveAnswer: a } = this.props, o = this.buildRows(), l = this.getCorrectOrIncorrectMap();
|
|
74
|
-
return /* @__PURE__ */ s(d, { children: o.map(({ sessionAnswer: o, title: d, id: m }, h) => /* @__PURE__ */ c(p, { children: [
|
|
75
|
-
/* @__PURE__ */ s(f, { dangerouslySetInnerHTML: { __html: d } }),
|
|
76
|
-
/* @__PURE__ */ c(u, { children: [/* @__PURE__ */ s(r, { direction: "left" }), /* @__PURE__ */ s(r, {})] }),
|
|
77
|
-
/* @__PURE__ */ s(i, {
|
|
78
|
-
className: "answer",
|
|
79
|
-
index: h,
|
|
80
|
-
promptId: m,
|
|
81
|
-
correct: l[m],
|
|
82
|
-
draggable: !e(o),
|
|
83
|
-
disabled: t,
|
|
84
|
-
instanceId: n,
|
|
85
|
-
id: o.id,
|
|
86
|
-
title: o.title,
|
|
87
|
-
type: "target",
|
|
88
|
-
onRemoveChoice: () => a(m)
|
|
89
|
-
}, h)
|
|
90
|
-
] }, h)) });
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
//#endregion
|
|
94
|
-
export { m as default };
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/match-list/src/answer.jsx
|
|
3
|
-
* @auto-generated
|
|
4
|
-
*
|
|
5
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
-
* Manual edits will be overwritten on next sync.
|
|
7
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
-
*/
|
|
9
|
-
import PropTypes from 'prop-types';
|
|
10
|
-
import React from 'react';
|
|
11
|
-
export declare class Answer extends React.Component {
|
|
12
|
-
static propTypes: {
|
|
13
|
-
className: PropTypes.Requireable<string>;
|
|
14
|
-
isDragging: PropTypes.Requireable<boolean>;
|
|
15
|
-
id: PropTypes.Requireable<any>;
|
|
16
|
-
title: PropTypes.Requireable<string>;
|
|
17
|
-
isOver: PropTypes.Requireable<boolean>;
|
|
18
|
-
empty: PropTypes.Requireable<boolean>;
|
|
19
|
-
type: PropTypes.Requireable<string>;
|
|
20
|
-
disabled: PropTypes.Requireable<boolean>;
|
|
21
|
-
correct: PropTypes.Requireable<boolean>;
|
|
22
|
-
};
|
|
23
|
-
componentDidMount(): void;
|
|
24
|
-
componentWillUnmount(): void;
|
|
25
|
-
handleTouchStart: any;
|
|
26
|
-
render(): React.JSX.Element;
|
|
27
|
-
}
|
|
28
|
-
declare function DragAndDropAnswer(props: any): React.JSX.Element;
|
|
29
|
-
declare namespace DragAndDropAnswer {
|
|
30
|
-
var propTypes: {
|
|
31
|
-
id: PropTypes.Requireable<any>;
|
|
32
|
-
instanceId: PropTypes.Requireable<string>;
|
|
33
|
-
promptId: PropTypes.Requireable<any>;
|
|
34
|
-
title: PropTypes.Requireable<string>;
|
|
35
|
-
draggable: PropTypes.Requireable<boolean>;
|
|
36
|
-
disabled: PropTypes.Requireable<boolean>;
|
|
37
|
-
type: PropTypes.Requireable<string>;
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
export default DragAndDropAnswer;
|
package/dist/delivery/answer.js
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import e from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js";
|
|
2
|
-
import t from "react";
|
|
3
|
-
import n from "debug";
|
|
4
|
-
import r from "prop-types";
|
|
5
|
-
import { PlaceHolder as i } from "@pie-lib/drag";
|
|
6
|
-
import { useDraggable as a, useDroppable as o } from "@dnd-kit/core";
|
|
7
|
-
import { color as s } from "@pie-lib/render-ui";
|
|
8
|
-
import { jsx as c } from "react/jsx-runtime";
|
|
9
|
-
import { styled as l } from "@mui/material/styles";
|
|
10
|
-
//#region src/delivery/answer.tsx
|
|
11
|
-
var u = n("pie-elements:match-title:answer"), d = l("div")(({ theme: e }) => ({
|
|
12
|
-
width: "100%",
|
|
13
|
-
fontSize: "18px",
|
|
14
|
-
textAlign: "center",
|
|
15
|
-
color: `rgba(${e.palette.common.black}, 0.6)`
|
|
16
|
-
})), f = ({ index: e, isOver: t, disabled: n, type: r }) => /* @__PURE__ */ c(i, {
|
|
17
|
-
extraStyles: {
|
|
18
|
-
display: "flex",
|
|
19
|
-
padding: "0",
|
|
20
|
-
alignItems: "center",
|
|
21
|
-
justifyContent: "center",
|
|
22
|
-
height: "40px"
|
|
23
|
-
},
|
|
24
|
-
disabled: n,
|
|
25
|
-
isOver: t,
|
|
26
|
-
type: r,
|
|
27
|
-
children: e !== void 0 && /* @__PURE__ */ c(d, { children: e })
|
|
28
|
-
});
|
|
29
|
-
f.propTypes = {
|
|
30
|
-
index: r.number,
|
|
31
|
-
isOver: r.bool,
|
|
32
|
-
disabled: r.bool,
|
|
33
|
-
type: r.string
|
|
34
|
-
};
|
|
35
|
-
var p = l("div")(({ theme: e, isDragging: t, isOver: n, disabled: r, outcome: i }) => ({
|
|
36
|
-
color: s.text(),
|
|
37
|
-
backgroundColor: s.white(),
|
|
38
|
-
border: `1px solid ${i === "correct" ? s.correct() : i === "incorrect" ? s.incorrect() : e.palette.grey[400]}`,
|
|
39
|
-
cursor: r ? "not-allowed" : "pointer",
|
|
40
|
-
width: "100%",
|
|
41
|
-
padding: "10px",
|
|
42
|
-
boxSizing: "border-box",
|
|
43
|
-
overflow: "hidden",
|
|
44
|
-
transition: "opacity 200ms linear",
|
|
45
|
-
wordBreak: "break-word",
|
|
46
|
-
opacity: t && !r ? .5 : n && !r ? .2 : 1,
|
|
47
|
-
touchAction: "none"
|
|
48
|
-
})), m = (e) => {
|
|
49
|
-
let { isDragging: t, isOver: n, title: r, disabled: i, empty: a, outcome: o, guideIndex: s, type: l } = e;
|
|
50
|
-
return a ? /* @__PURE__ */ c(f, {
|
|
51
|
-
index: s,
|
|
52
|
-
isOver: n,
|
|
53
|
-
disabled: i,
|
|
54
|
-
type: l
|
|
55
|
-
}) : /* @__PURE__ */ c(p, {
|
|
56
|
-
isDragging: t,
|
|
57
|
-
isOver: n,
|
|
58
|
-
disabled: i,
|
|
59
|
-
outcome: o,
|
|
60
|
-
dangerouslySetInnerHTML: { __html: r }
|
|
61
|
-
});
|
|
62
|
-
}, h = l("div")(({ correct: e, theme: t }) => ({
|
|
63
|
-
boxSizing: "border-box",
|
|
64
|
-
minHeight: 40,
|
|
65
|
-
minWidth: "200px",
|
|
66
|
-
overflow: "hidden",
|
|
67
|
-
margin: t.spacing(.5),
|
|
68
|
-
padding: "0px",
|
|
69
|
-
textAlign: "center",
|
|
70
|
-
height: "initial",
|
|
71
|
-
border: e === !0 ? `1px solid var(--feedback-correct-bg-color, ${s.correct()})` : e === !1 ? `1px solid var(--feedback-incorrect-bg-color, ${s.incorrect()})` : "none"
|
|
72
|
-
})), g = class extends t.Component {
|
|
73
|
-
static propTypes = {
|
|
74
|
-
className: r.string,
|
|
75
|
-
isDragging: r.bool,
|
|
76
|
-
id: r.any,
|
|
77
|
-
title: r.string,
|
|
78
|
-
isOver: r.bool,
|
|
79
|
-
empty: r.bool,
|
|
80
|
-
type: r.string,
|
|
81
|
-
disabled: r.bool,
|
|
82
|
-
correct: r.bool
|
|
83
|
-
};
|
|
84
|
-
componentDidMount() {
|
|
85
|
-
this.ref && this.ref.addEventListener("touchstart", this.handleTouchStart, { passive: !0 });
|
|
86
|
-
}
|
|
87
|
-
componentWillUnmount() {
|
|
88
|
-
this.ref && this.ref.removeEventListener("touchstart", this.handleTouchStart);
|
|
89
|
-
}
|
|
90
|
-
handleTouchStart = (e) => {};
|
|
91
|
-
render() {
|
|
92
|
-
let { id: t, title: n, isDragging: r = !1, className: i, disabled: a, isOver: o = !1, type: s, correct: l } = this.props;
|
|
93
|
-
return u("[render], props: ", this.props), /* @__PURE__ */ c(h, {
|
|
94
|
-
correct: l,
|
|
95
|
-
className: i,
|
|
96
|
-
ref: (e) => this.ref = e,
|
|
97
|
-
children: /* @__PURE__ */ c(m, {
|
|
98
|
-
title: n,
|
|
99
|
-
id: t,
|
|
100
|
-
isOver: o,
|
|
101
|
-
empty: e(n),
|
|
102
|
-
isDragging: r,
|
|
103
|
-
disabled: a,
|
|
104
|
-
type: s
|
|
105
|
-
})
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
function _(e) {
|
|
110
|
-
let { id: t, instanceId: n, promptId: r, draggable: i = !0, disabled: s = !1, type: l } = e, u = `${l || "answer"}-${t}`, d = r == null ? void 0 : `drop-${r}`, { attributes: f, listeners: p, setNodeRef: m, transform: h, transition: _, isDragging: v } = a({
|
|
111
|
-
id: u,
|
|
112
|
-
data: {
|
|
113
|
-
type: l || "answer",
|
|
114
|
-
id: t,
|
|
115
|
-
instanceId: n,
|
|
116
|
-
value: e.title,
|
|
117
|
-
promptId: r
|
|
118
|
-
},
|
|
119
|
-
disabled: !i || s
|
|
120
|
-
}), y = o({
|
|
121
|
-
id: d,
|
|
122
|
-
data: d ? {
|
|
123
|
-
type: "drop-zone",
|
|
124
|
-
promptId: r,
|
|
125
|
-
instanceId: n
|
|
126
|
-
} : void 0,
|
|
127
|
-
disabled: s || !d
|
|
128
|
-
}), b = y.setNodeRef, x = y.isOver, S = h ? `translate3d(${h.x}px, ${h.y}px, 0)` : void 0;
|
|
129
|
-
return d ? /* @__PURE__ */ c("div", {
|
|
130
|
-
ref: b,
|
|
131
|
-
style: {
|
|
132
|
-
flex: 1,
|
|
133
|
-
transform: S,
|
|
134
|
-
transition: _,
|
|
135
|
-
opacity: v ? .5 : 1,
|
|
136
|
-
backgroundColor: x ? "rgba(0,0,0,0.05)" : "transparent"
|
|
137
|
-
},
|
|
138
|
-
children: /* @__PURE__ */ c("div", {
|
|
139
|
-
ref: m,
|
|
140
|
-
...p,
|
|
141
|
-
...f,
|
|
142
|
-
children: /* @__PURE__ */ c(g, {
|
|
143
|
-
...e,
|
|
144
|
-
isDragging: v,
|
|
145
|
-
isOver: x
|
|
146
|
-
})
|
|
147
|
-
})
|
|
148
|
-
}) : /* @__PURE__ */ c("div", {
|
|
149
|
-
ref: m,
|
|
150
|
-
...p,
|
|
151
|
-
...f,
|
|
152
|
-
style: {
|
|
153
|
-
transform: S,
|
|
154
|
-
transition: _,
|
|
155
|
-
cursor: s ? "not-allowed" : "grab",
|
|
156
|
-
opacity: v ? .5 : 1,
|
|
157
|
-
touchAction: i && !s ? "none" : "auto"
|
|
158
|
-
},
|
|
159
|
-
children: /* @__PURE__ */ c(g, {
|
|
160
|
-
...e,
|
|
161
|
-
isDragging: v,
|
|
162
|
-
isOver: !1
|
|
163
|
-
})
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
_.propTypes = {
|
|
167
|
-
id: r.any,
|
|
168
|
-
instanceId: r.string,
|
|
169
|
-
promptId: r.any,
|
|
170
|
-
title: r.string,
|
|
171
|
-
draggable: r.bool,
|
|
172
|
-
disabled: r.bool,
|
|
173
|
-
type: r.string
|
|
174
|
-
};
|
|
175
|
-
//#endregion
|
|
176
|
-
export { g as Answer, _ as default };
|
package/dist/delivery/arrow.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/match-list/src/arrow.jsx
|
|
3
|
-
* @auto-generated
|
|
4
|
-
*
|
|
5
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
-
* Manual edits will be overwritten on next sync.
|
|
7
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
-
*/
|
|
9
|
-
import React from 'react';
|
|
10
|
-
import PropTypes from 'prop-types';
|
|
11
|
-
export declare class Arrow extends React.Component {
|
|
12
|
-
static propTypes: {
|
|
13
|
-
direction: PropTypes.Requireable<string>;
|
|
14
|
-
};
|
|
15
|
-
render(): React.JSX.Element;
|
|
16
|
-
}
|
|
17
|
-
export default Arrow;
|
package/dist/delivery/arrow.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import e from "react";
|
|
2
|
-
import t from "prop-types";
|
|
3
|
-
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
-
import { styled as i } from "@mui/material/styles";
|
|
5
|
-
import a from "@mui/icons-material/ArrowDropDown";
|
|
6
|
-
//#region src/delivery/arrow.tsx
|
|
7
|
-
var o = i("div")({
|
|
8
|
-
display: "inline-block",
|
|
9
|
-
position: "relative",
|
|
10
|
-
width: "100%"
|
|
11
|
-
}), s = i("span")(({ theme: e, isRight: t }) => ({
|
|
12
|
-
backgroundColor: e.palette.grey[500],
|
|
13
|
-
bottom: t ? 20 : 19,
|
|
14
|
-
content: "\"\"",
|
|
15
|
-
display: "block",
|
|
16
|
-
height: 1,
|
|
17
|
-
left: 20,
|
|
18
|
-
position: "absolute",
|
|
19
|
-
width: "100%"
|
|
20
|
-
})), c = class extends e.Component {
|
|
21
|
-
static propTypes = { direction: t.string };
|
|
22
|
-
render() {
|
|
23
|
-
let { direction: e } = this.props;
|
|
24
|
-
return /* @__PURE__ */ r(o, {
|
|
25
|
-
style: e === "left" ? {} : { transform: "rotate(180deg)" },
|
|
26
|
-
children: [/* @__PURE__ */ n(a, { style: {
|
|
27
|
-
transform: "rotate(90deg)",
|
|
28
|
-
color: "#979797",
|
|
29
|
-
fontSize: 40
|
|
30
|
-
} }), /* @__PURE__ */ n(s, { isRight: e !== "left" })]
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
//#endregion
|
|
35
|
-
export { c as default };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/match-list/src/choices-list.jsx
|
|
3
|
-
* @auto-generated
|
|
4
|
-
*
|
|
5
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
-
* Manual edits will be overwritten on next sync.
|
|
7
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
-
*/
|
|
9
|
-
import React from 'react';
|
|
10
|
-
import PropTypes from 'prop-types';
|
|
11
|
-
export declare class ChoicesList extends React.Component {
|
|
12
|
-
static propTypes: {
|
|
13
|
-
session: PropTypes.Validator<object>;
|
|
14
|
-
instanceId: PropTypes.Validator<string>;
|
|
15
|
-
model: PropTypes.Validator<object>;
|
|
16
|
-
disabled: PropTypes.Validator<boolean>;
|
|
17
|
-
onRemoveAnswer: PropTypes.Requireable<(...args: any[]) => any>;
|
|
18
|
-
};
|
|
19
|
-
render(): React.JSX.Element;
|
|
20
|
-
}
|
|
21
|
-
export default ChoicesList;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import e from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/find.js";
|
|
2
|
-
import t from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js";
|
|
3
|
-
import n from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isUndefined.js";
|
|
4
|
-
import r from "./answer.js";
|
|
5
|
-
import i from "./droppable-placeholder.js";
|
|
6
|
-
import a from "react";
|
|
7
|
-
import o from "prop-types";
|
|
8
|
-
import { jsx as s } from "react/jsx-runtime";
|
|
9
|
-
import { styled as c } from "@mui/material/styles";
|
|
10
|
-
//#region src/delivery/choices-list.tsx
|
|
11
|
-
var l = c("div")(({ theme: e }) => ({ marginBottom: e.spacing(2) })), u = class extends a.Component {
|
|
12
|
-
static propTypes = {
|
|
13
|
-
session: o.object.isRequired,
|
|
14
|
-
instanceId: o.string.isRequired,
|
|
15
|
-
model: o.object.isRequired,
|
|
16
|
-
disabled: o.bool.isRequired,
|
|
17
|
-
onRemoveAnswer: o.func
|
|
18
|
-
};
|
|
19
|
-
render() {
|
|
20
|
-
let { model: a, disabled: o, session: c, instanceId: u, onRemoveAnswer: d } = this.props, { config: f } = a, { duplicates: p } = f;
|
|
21
|
-
return /* @__PURE__ */ s(l, { children: /* @__PURE__ */ s(i, {
|
|
22
|
-
id: "choices-pool",
|
|
23
|
-
disabled: o,
|
|
24
|
-
onRemoveAnswer: d,
|
|
25
|
-
children: f.answers.filter((r) => p || t(c) || !c.value || n(e(c.value, (e) => e === r.id))).map((e) => /* @__PURE__ */ s(r, {
|
|
26
|
-
instanceId: u,
|
|
27
|
-
draggable: !0,
|
|
28
|
-
disabled: o,
|
|
29
|
-
session: c,
|
|
30
|
-
type: "choice",
|
|
31
|
-
...e
|
|
32
|
-
}, e.id))
|
|
33
|
-
}) });
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
//#endregion
|
|
37
|
-
export { u as default };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/match-list/src/droppable-placeholder.jsx
|
|
3
|
-
* @auto-generated
|
|
4
|
-
*
|
|
5
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
-
* Manual edits will be overwritten on next sync.
|
|
7
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
-
*/
|
|
9
|
-
import React from 'react';
|
|
10
|
-
import PropTypes from 'prop-types';
|
|
11
|
-
export declare function DroppablePlaceholder({ id, disabled, children, ...rest }: {
|
|
12
|
-
[x: string]: any;
|
|
13
|
-
id: any;
|
|
14
|
-
disabled: any;
|
|
15
|
-
children: any;
|
|
16
|
-
}): React.JSX.Element;
|
|
17
|
-
export declare namespace DroppablePlaceholder {
|
|
18
|
-
var propTypes: {
|
|
19
|
-
id: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
20
|
-
disabled: PropTypes.Requireable<boolean>;
|
|
21
|
-
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
export default DroppablePlaceholder;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import "react";
|
|
2
|
-
import e from "prop-types";
|
|
3
|
-
import { MatchDroppablePlaceholder as t } from "@pie-lib/drag";
|
|
4
|
-
import { useDroppable as n } from "@dnd-kit/core";
|
|
5
|
-
import { jsx as r } from "react/jsx-runtime";
|
|
6
|
-
import { styled as i } from "@mui/material/styles";
|
|
7
|
-
//#region src/delivery/droppable-placeholder.tsx
|
|
8
|
-
var a = i("div")(({ theme: e }) => ({
|
|
9
|
-
alignItems: "center",
|
|
10
|
-
display: "flex",
|
|
11
|
-
flexDirection: "row",
|
|
12
|
-
flexWrap: "wrap",
|
|
13
|
-
justifyContent: "space-between",
|
|
14
|
-
marginTop: e.spacing(1),
|
|
15
|
-
marginBottom: e.spacing(1),
|
|
16
|
-
minHeight: 50,
|
|
17
|
-
transition: "background-color 200ms ease"
|
|
18
|
-
}));
|
|
19
|
-
function o({ id: e, disabled: i, children: o, ...s }) {
|
|
20
|
-
let { setNodeRef: c, isOver: l } = n({
|
|
21
|
-
id: e || "choices-pool",
|
|
22
|
-
data: { type: "choices-pool" },
|
|
23
|
-
disabled: i
|
|
24
|
-
});
|
|
25
|
-
return /* @__PURE__ */ r(a, {
|
|
26
|
-
ref: c,
|
|
27
|
-
style: { backgroundColor: l ? "rgba(0,0,0,0.05)" : "transparent" },
|
|
28
|
-
...s,
|
|
29
|
-
children: /* @__PURE__ */ r(t, {
|
|
30
|
-
id: e,
|
|
31
|
-
disabled: i,
|
|
32
|
-
children: o
|
|
33
|
-
})
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
o.propTypes = {
|
|
37
|
-
id: e.oneOfType([e.string, e.number]),
|
|
38
|
-
disabled: e.bool,
|
|
39
|
-
children: e.node
|
|
40
|
-
};
|
|
41
|
-
//#endregion
|
|
42
|
-
export { o as default };
|
package/dist/delivery/index.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/match-list/src/index.js
|
|
3
|
-
* @auto-generated
|
|
4
|
-
*
|
|
5
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
-
* Manual edits will be overwritten on next sync.
|
|
7
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
-
*/
|
|
9
|
-
import Main from './main.js';
|
|
10
|
-
export { Main as Component };
|
|
11
|
-
export declare const isComplete: (session: any, model: any) => boolean;
|
|
12
|
-
export default class MatchList extends HTMLElement {
|
|
13
|
-
constructor();
|
|
14
|
-
set model(m: any);
|
|
15
|
-
set session(s: any);
|
|
16
|
-
get session(): any;
|
|
17
|
-
sessionChanged(s: any): void;
|
|
18
|
-
connectedCallback(): void;
|
|
19
|
-
_render(): void;
|
|
20
|
-
disconnectedCallback(): void;
|
|
21
|
-
}
|