@pie-element/match 12.1.1-next.1 → 12.1.1-next.29
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 +1462 -0
- package/CHANGELOG.md +2327 -0
- package/LICENSE.md +5 -0
- package/README.md +1 -0
- package/configure/CHANGELOG.json +892 -0
- package/configure/CHANGELOG.md +2030 -0
- package/configure/lib/add-row.js +40 -0
- package/configure/lib/add-row.js.map +1 -0
- package/configure/lib/answer-config-block.js +288 -0
- package/configure/lib/answer-config-block.js.map +1 -0
- package/configure/lib/common.js +31 -0
- package/configure/lib/common.js.map +1 -0
- package/configure/lib/configure.js +410 -0
- package/configure/lib/configure.js.map +1 -0
- package/configure/lib/defaults.js +201 -0
- package/configure/lib/defaults.js.map +1 -0
- package/configure/lib/general-config-block.js +144 -0
- package/configure/lib/general-config-block.js.map +1 -0
- package/configure/lib/index.js +152 -0
- package/configure/lib/index.js.map +1 -0
- package/configure/lib/row.js +321 -0
- package/configure/lib/row.js.map +1 -0
- package/configure/lib/utils.js +12 -0
- package/configure/lib/utils.js.map +1 -0
- package/configure/package.json +29 -0
- package/configure/utils.js +19 -0
- package/controller/CHANGELOG.json +502 -0
- package/controller/CHANGELOG.md +1359 -0
- package/controller/lib/defaults.js +25 -0
- package/controller/lib/defaults.js.map +1 -0
- package/controller/lib/index.js +424 -0
- package/controller/lib/index.js.map +1 -0
- package/controller/package.json +24 -0
- package/docs/config-schema.json +2929 -0
- package/docs/config-schema.json.md +2162 -0
- package/docs/demo/config.js +8 -0
- package/docs/demo/generate.js +49 -0
- package/docs/demo/index.html +1 -0
- package/docs/demo/session.js +11 -0
- package/docs/pie-schema.json +1530 -0
- package/docs/pie-schema.json.md +907 -0
- package/lib/answer-grid.js +166 -0
- package/lib/answer-grid.js.map +1 -0
- package/lib/index.js +85 -0
- package/lib/index.js.map +1 -0
- package/lib/main.js +163 -0
- package/lib/main.js.map +1 -0
- package/package.json +21 -60
- package/dist/author/add-row.d.ts +0 -17
- package/dist/author/add-row.js +0 -24
- package/dist/author/answer-config-block.d.ts +0 -36
- package/dist/author/answer-config-block.js +0 -176
- package/dist/author/common.d.ts +0 -22
- package/dist/author/configure.d.ts +0 -48
- package/dist/author/configure.js +0 -259
- package/dist/author/defaults.d.ts +0 -203
- package/dist/author/defaults.js +0 -151
- package/dist/author/general-config-block.d.ts +0 -22
- package/dist/author/general-config-block.js +0 -93
- package/dist/author/index.d.ts +0 -44
- package/dist/author/index.js +0 -78
- package/dist/author/row.d.ts +0 -51
- package/dist/author/row.js +0 -204
- package/dist/author/utils.d.ts +0 -10
- package/dist/author/utils.js +0 -10
- package/dist/controller/defaults.d.ts +0 -27
- package/dist/controller/defaults.js +0 -25
- package/dist/controller/index.d.ts +0 -29
- package/dist/controller/index.js +0 -156
- package/dist/delivery/answer-grid.d.ts +0 -28
- package/dist/delivery/answer-grid.js +0 -99
- package/dist/delivery/index.d.ts +0 -21
- package/dist/delivery/index.js +0 -51
- package/dist/delivery/main.d.ts +0 -26
- package/dist/delivery/main.js +0 -112
- package/dist/index.d.ts +0 -1
- package/dist/index.iife.d.ts +0 -8
- package/dist/index.iife.js +0 -148
- 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/_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/_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/_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/_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/_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/_baseSet.js +0 -22
- 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/_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/_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/_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/_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/cloneDeep.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/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/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/memoize.js +0 -16
- 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/author/row.js
DELETED
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
import e from "react";
|
|
2
|
-
import t from "prop-types";
|
|
3
|
-
import { color as n } from "@pie-lib/render-ui";
|
|
4
|
-
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
-
import a from "@mui/material/Radio";
|
|
6
|
-
import { styled as o } from "@mui/material/styles";
|
|
7
|
-
import s from "debug";
|
|
8
|
-
import { AlertDialog as c, Checkbox as l } from "@pie-lib/config-ui";
|
|
9
|
-
import u, { DEFAULT_PLUGINS as d } from "@pie-lib/editable-html-tip-tap";
|
|
10
|
-
import f from "@mui/icons-material/DragHandle";
|
|
11
|
-
import p from "@mui/material/IconButton";
|
|
12
|
-
import m from "@mui/icons-material/Delete";
|
|
13
|
-
import { useDraggable as h, useDroppable as g } from "@dnd-kit/core";
|
|
14
|
-
//#region src/author/row.tsx
|
|
15
|
-
s("@pie-element:categorize:configure:choice");
|
|
16
|
-
var _ = o("span")({ cursor: "move" }), v = o("div")(({ theme: e }) => ({
|
|
17
|
-
marginTop: e.spacing(2),
|
|
18
|
-
display: "flex",
|
|
19
|
-
alignItems: "center",
|
|
20
|
-
flex: 1
|
|
21
|
-
})), y = o("div")(({ theme: e }) => ({
|
|
22
|
-
flex: 1,
|
|
23
|
-
display: "flex",
|
|
24
|
-
justifyContent: "center",
|
|
25
|
-
alignItems: "center",
|
|
26
|
-
minWidth: "120px",
|
|
27
|
-
padding: `0 ${e.spacing(1)}`
|
|
28
|
-
})), b = o(a)(({ theme: e, error: t }) => ({
|
|
29
|
-
"& input": { width: "100% !important" },
|
|
30
|
-
"&.MuiRadio-root": { color: `${t ? e.palette.error.main : n.tertiary()} !important` }
|
|
31
|
-
})), x = o("div")(({ theme: e }) => ({
|
|
32
|
-
flex: .5,
|
|
33
|
-
display: "flex",
|
|
34
|
-
justifyContent: "center",
|
|
35
|
-
minWidth: "45px",
|
|
36
|
-
padding: `0 ${e.spacing(1)}`
|
|
37
|
-
})), S = o(y)(({ theme: e }) => ({
|
|
38
|
-
flex: 2,
|
|
39
|
-
display: "flex",
|
|
40
|
-
justifyContent: "flex-start",
|
|
41
|
-
padding: 0,
|
|
42
|
-
maxWidth: "unset",
|
|
43
|
-
textAlign: "left",
|
|
44
|
-
minWidth: "200px",
|
|
45
|
-
marginRight: e.spacing(1),
|
|
46
|
-
"&> div": { width: "100%" }
|
|
47
|
-
})), C = o("hr")(({ theme: e }) => ({
|
|
48
|
-
marginTop: e.spacing(2),
|
|
49
|
-
border: 0,
|
|
50
|
-
borderTop: `2px solid ${e.palette.grey.A100}`,
|
|
51
|
-
width: "100%"
|
|
52
|
-
})), w = o("div")(({ theme: e }) => ({
|
|
53
|
-
fontSize: e.typography.fontSize - 2,
|
|
54
|
-
color: e.palette.error.main,
|
|
55
|
-
paddingTop: e.spacing(1)
|
|
56
|
-
})), T = class extends e.Component {
|
|
57
|
-
static propTypes = {
|
|
58
|
-
model: t.object.isRequired,
|
|
59
|
-
row: t.object.isRequired,
|
|
60
|
-
idx: t.number.isRequired,
|
|
61
|
-
maxImageWidth: t.object,
|
|
62
|
-
maxImageHeight: t.object,
|
|
63
|
-
onDeleteRow: t.func.isRequired,
|
|
64
|
-
onChange: t.func.isRequired,
|
|
65
|
-
imageSupport: t.shape({
|
|
66
|
-
add: t.func.isRequired,
|
|
67
|
-
delete: t.func.isRequired
|
|
68
|
-
}),
|
|
69
|
-
uploadSoundSupport: t.shape({
|
|
70
|
-
add: t.func.isRequired,
|
|
71
|
-
delete: t.func.isRequired
|
|
72
|
-
}),
|
|
73
|
-
inputConfiguration: t.object,
|
|
74
|
-
toolbarOpts: t.object,
|
|
75
|
-
error: t.string,
|
|
76
|
-
spellCheck: t.bool,
|
|
77
|
-
minQuestions: t.number
|
|
78
|
-
};
|
|
79
|
-
static defaultProps = {};
|
|
80
|
-
state = { dialog: {
|
|
81
|
-
open: !1,
|
|
82
|
-
text: ""
|
|
83
|
-
} };
|
|
84
|
-
componentDidMount() {
|
|
85
|
-
document.addEventListener("mouseup", this.onMouseUpOnHandle);
|
|
86
|
-
}
|
|
87
|
-
onRowTitleChange = (e) => (t) => {
|
|
88
|
-
let { model: n, onChange: r } = this.props, i = { ...n };
|
|
89
|
-
i.rows[e].title = t, r(i);
|
|
90
|
-
};
|
|
91
|
-
onRowValueChange = (e, t) => (n) => {
|
|
92
|
-
let { model: r, onChange: i } = this.props, a = { ...r };
|
|
93
|
-
if (r.choiceMode === "radio") for (let t = 0; t < a.rows[e].values.length; t++) a.rows[e].values[t] = !1;
|
|
94
|
-
a.rows[e].values[t] = n.target.checked, i(a);
|
|
95
|
-
};
|
|
96
|
-
onDeleteRow = (e) => () => {
|
|
97
|
-
let { model: t, onDeleteRow: n, minQuestions: r } = this.props;
|
|
98
|
-
t.rows && t.rows.length === r ? this.setState({ dialog: {
|
|
99
|
-
open: !0,
|
|
100
|
-
text: `There should be at least ${r} question row` + (r > 1 ? "s" : "") + "."
|
|
101
|
-
} }) : n(e);
|
|
102
|
-
};
|
|
103
|
-
onMouseDownOnHandle = () => {};
|
|
104
|
-
onMouseUpOnHandle = () => {};
|
|
105
|
-
render() {
|
|
106
|
-
let { imageSupport: e, model: t, row: n, idx: a, inputConfiguration: o = {}, toolbarOpts: s, spellCheck: h, error: g, maxImageWidth: T, maxImageHeight: E, uploadSoundSupport: D, mathMlOptions: O = {} } = this.props, { dialog: k } = this.state, A = (d || []).filter((e) => e !== "bulleted-list" && e !== "numbered-list");
|
|
107
|
-
return /* @__PURE__ */ i("div", {
|
|
108
|
-
style: { width: "100%" },
|
|
109
|
-
children: [
|
|
110
|
-
/* @__PURE__ */ r(_, {
|
|
111
|
-
itemID: "handle",
|
|
112
|
-
onMouseDown: this.onMouseDownOnHandle,
|
|
113
|
-
children: /* @__PURE__ */ r(f, { color: "primary" })
|
|
114
|
-
}),
|
|
115
|
-
/* @__PURE__ */ i(v, { children: [
|
|
116
|
-
/* @__PURE__ */ r(S, { children: /* @__PURE__ */ r(u, {
|
|
117
|
-
imageSupport: e,
|
|
118
|
-
autoWidthToolbar: !0,
|
|
119
|
-
disableUnderline: !0,
|
|
120
|
-
label: "label",
|
|
121
|
-
markup: n.title,
|
|
122
|
-
onChange: this.onRowTitleChange(a),
|
|
123
|
-
pluginProps: o,
|
|
124
|
-
toolbarOpts: s,
|
|
125
|
-
activePlugins: A,
|
|
126
|
-
spellCheck: h,
|
|
127
|
-
maxImageWidth: T,
|
|
128
|
-
maxImageHeight: E,
|
|
129
|
-
uploadSoundSupport: D,
|
|
130
|
-
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
131
|
-
error: g && g !== "No correct response defined.",
|
|
132
|
-
mathMlOptions: O
|
|
133
|
-
}) }),
|
|
134
|
-
n.values.map((e, n) => /* @__PURE__ */ r(y, { children: t.choiceMode === "radio" ? /* @__PURE__ */ r(b, {
|
|
135
|
-
error: g?.includes("No correct response defined."),
|
|
136
|
-
onChange: this.onRowValueChange(a, n),
|
|
137
|
-
checked: e === !0
|
|
138
|
-
}) : /* @__PURE__ */ r(l, {
|
|
139
|
-
onChange: this.onRowValueChange(a, n),
|
|
140
|
-
checked: e === !0,
|
|
141
|
-
label: "",
|
|
142
|
-
error: g?.includes("No correct response defined.")
|
|
143
|
-
}) }, n)),
|
|
144
|
-
/* @__PURE__ */ r(x, { children: /* @__PURE__ */ r(p, {
|
|
145
|
-
onClick: this.onDeleteRow(a),
|
|
146
|
-
"aria-label": "Delete",
|
|
147
|
-
size: "large",
|
|
148
|
-
children: /* @__PURE__ */ r(m, {})
|
|
149
|
-
}) })
|
|
150
|
-
] }),
|
|
151
|
-
g && /* @__PURE__ */ r(w, { children: g }),
|
|
152
|
-
/* @__PURE__ */ r(C, {}),
|
|
153
|
-
/* @__PURE__ */ r(c, {
|
|
154
|
-
open: k.open,
|
|
155
|
-
title: "Warning",
|
|
156
|
-
text: k.text,
|
|
157
|
-
onConfirm: () => this.setState({ dialog: { open: !1 } })
|
|
158
|
-
})
|
|
159
|
-
]
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
};
|
|
163
|
-
function E(e) {
|
|
164
|
-
let { attributes: t, listeners: n, setNodeRef: i, transform: a, transition: o, isDragging: s } = h({
|
|
165
|
-
id: `row-${e.row.id}`,
|
|
166
|
-
data: {
|
|
167
|
-
type: "row",
|
|
168
|
-
index: e.idx,
|
|
169
|
-
id: e.row.id
|
|
170
|
-
}
|
|
171
|
-
}), { setNodeRef: c, isOver: l } = g({
|
|
172
|
-
id: `row-drop-${e.row.id}`,
|
|
173
|
-
data: {
|
|
174
|
-
type: "row",
|
|
175
|
-
index: e.idx,
|
|
176
|
-
id: e.row.id
|
|
177
|
-
}
|
|
178
|
-
});
|
|
179
|
-
return /* @__PURE__ */ r("div", {
|
|
180
|
-
ref: c,
|
|
181
|
-
style: {
|
|
182
|
-
transform: a ? `translate3d(${a.x}px, ${a.y}px, 0)` : void 0,
|
|
183
|
-
transition: o,
|
|
184
|
-
opacity: s ? .5 : 1,
|
|
185
|
-
backgroundColor: l ? "rgba(0, 0, 0, 0.1)" : "transparent"
|
|
186
|
-
},
|
|
187
|
-
children: /* @__PURE__ */ r("div", {
|
|
188
|
-
ref: i,
|
|
189
|
-
...n,
|
|
190
|
-
onKeyDown: (e) => {
|
|
191
|
-
let t = e.target;
|
|
192
|
-
t.closest("[contenteditable]") || t.closest("input") || t.closest("textarea") || t.isContentEditable || n?.onKeyDown?.(e);
|
|
193
|
-
},
|
|
194
|
-
onPointerDown: (e) => {
|
|
195
|
-
let t = e.target;
|
|
196
|
-
t.closest("[contenteditable]") || t.closest("input") || t.closest("textarea") || t.isContentEditable || n?.onPointerDown?.(e);
|
|
197
|
-
},
|
|
198
|
-
...t,
|
|
199
|
-
children: /* @__PURE__ */ r(T, { ...e })
|
|
200
|
-
})
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
|
-
//#endregion
|
|
204
|
-
export { E as default };
|
package/dist/author/utils.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/match/configure/src/utils.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
|
-
export declare const getPluginProps: (props?: {}, baseInputConfiguration?: {}) => {};
|
|
10
|
-
export declare const generateValidationMessage: (model: any, configuration: any) => string;
|
package/dist/author/utils.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
//#region src/author/utils.ts
|
|
2
|
-
var e = (e = {}, t = {}) => ({
|
|
3
|
-
...t,
|
|
4
|
-
...e
|
|
5
|
-
}), t = (e, t) => {
|
|
6
|
-
let { choiceMode: n } = e, { minQuestions: r, maxQuestions: i, maxAnswers: a } = t, o = `\nThere should be at least ${r}` + (i ? ` and at most ${i}` : "") + " question row" + (r > 1 || i ? "s." : ".") + "\nRow and column headings should be non-blank and unique. \nFirst column heading is excluded from validation." + (a ? `\nThere should be at most ${a} answer choices.` : ""), s = n === "radio" ? "\nThere should be a correct response defined for every row." : "\nThere should be at least one correct response defined for every row.";
|
|
7
|
-
return "Validation requirements:" + o + s;
|
|
8
|
-
};
|
|
9
|
-
//#endregion
|
|
10
|
-
export { t as generateValidationMessage, e as getPluginProps };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/match/controller/src/defaults.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
|
-
declare const _default: {
|
|
10
|
-
choiceMode: string;
|
|
11
|
-
feedbackEnabled: boolean;
|
|
12
|
-
headers: string[];
|
|
13
|
-
layout: number;
|
|
14
|
-
lockChoiceOrder: boolean;
|
|
15
|
-
partialScoring: boolean;
|
|
16
|
-
prompt: string;
|
|
17
|
-
promptEnabled: boolean;
|
|
18
|
-
rationale: string;
|
|
19
|
-
rationaleEnabled: boolean;
|
|
20
|
-
rows: never[];
|
|
21
|
-
scoringType: string;
|
|
22
|
-
studentInstructionsEnabled: boolean;
|
|
23
|
-
teacherInstructions: string;
|
|
24
|
-
teacherInstructionsEnabled: boolean;
|
|
25
|
-
toolbarEditorPosition: string;
|
|
26
|
-
};
|
|
27
|
-
export default _default;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
//#region src/controller/defaults.ts
|
|
2
|
-
var e = {
|
|
3
|
-
choiceMode: "radio",
|
|
4
|
-
feedbackEnabled: !1,
|
|
5
|
-
headers: [
|
|
6
|
-
"Column 1",
|
|
7
|
-
"Column 2",
|
|
8
|
-
"Column 3"
|
|
9
|
-
],
|
|
10
|
-
layout: 3,
|
|
11
|
-
lockChoiceOrder: !0,
|
|
12
|
-
partialScoring: !1,
|
|
13
|
-
prompt: "",
|
|
14
|
-
promptEnabled: !0,
|
|
15
|
-
rationale: "",
|
|
16
|
-
rationaleEnabled: !0,
|
|
17
|
-
rows: [],
|
|
18
|
-
scoringType: "auto",
|
|
19
|
-
studentInstructionsEnabled: !0,
|
|
20
|
-
teacherInstructions: "",
|
|
21
|
-
teacherInstructionsEnabled: !0,
|
|
22
|
-
toolbarEditorPosition: "bottom"
|
|
23
|
-
};
|
|
24
|
-
//#endregion
|
|
25
|
-
export { e as default };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/match/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 item 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: (question: 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<any>;
|
|
28
|
-
export declare const createCorrectResponseSession: (question: any, env: any) => Promise<unknown>;
|
|
29
|
-
export declare const validate: (model?: {}, config?: {}) => {};
|
package/dist/controller/index.js
DELETED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import e from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.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/isEqual.js";
|
|
4
|
-
import r from "./defaults.js";
|
|
5
|
-
import { getFeedbackForCorrectness as i } from "@pie-element/shared-feedback";
|
|
6
|
-
import { getShuffledChoices as a, lockChoices as o, partialScoring as s } from "@pie-element/shared-controller-utils";
|
|
7
|
-
import c from "debug";
|
|
8
|
-
//#region src/controller/index.ts
|
|
9
|
-
var l = c("@pie-element:match:controller"), u = (e, t, n = {}) => {
|
|
10
|
-
let r = s.enabled(e, n), i = e.rows, a = e.choiceMode === "checkbox";
|
|
11
|
-
if (!t || Object.keys(t).length === 0) return "unanswered";
|
|
12
|
-
let o = a ? h(e) : m(e), c, l = 0;
|
|
13
|
-
if (a) {
|
|
14
|
-
let e = f(i, t);
|
|
15
|
-
c = e.correctAnswers, l = e.incorrectAnswers;
|
|
16
|
-
} else c = p(i, t);
|
|
17
|
-
return o === c && !l ? "correct" : c === 0 ? "incorrect" : r ? "partial" : "incorrect";
|
|
18
|
-
}, d = (e, t, n = {}) => {
|
|
19
|
-
if (t.mode === "evaluate") return u(e, n, t);
|
|
20
|
-
}, f = (e, t) => {
|
|
21
|
-
let n = 0, r = 0;
|
|
22
|
-
return e.forEach((e) => {
|
|
23
|
-
let i = t[e.id];
|
|
24
|
-
i && e.values.forEach((e, t) => {
|
|
25
|
-
i[t] && i[t] === e ? n += 1 : i[t] && i[t] !== e && (r += 1);
|
|
26
|
-
});
|
|
27
|
-
}), {
|
|
28
|
-
correctAnswers: n,
|
|
29
|
-
incorrectAnswers: r
|
|
30
|
-
};
|
|
31
|
-
}, p = (e, t) => {
|
|
32
|
-
let r = 0;
|
|
33
|
-
return e.forEach((e) => {
|
|
34
|
-
n(e.values, t[e.id]) && (r += 1);
|
|
35
|
-
}), r;
|
|
36
|
-
}, m = (e) => {
|
|
37
|
-
let t = e.choiceMode === "checkbox" ? e.layout - 1 : 1;
|
|
38
|
-
return (e.rows.length || 0) * t;
|
|
39
|
-
}, h = (e) => {
|
|
40
|
-
let t = 0;
|
|
41
|
-
return e.rows.forEach((e) => {
|
|
42
|
-
e.values.forEach((e) => {
|
|
43
|
-
e && (t += 1);
|
|
44
|
-
});
|
|
45
|
-
}), t;
|
|
46
|
-
}, g = (e, t) => {
|
|
47
|
-
if (e.choiceMode === "checkbox") {
|
|
48
|
-
let { correctAnswers: n, incorrectAnswers: r } = f(e.rows, t), i = h(e), a = i === 0 ? 1 : i;
|
|
49
|
-
if (n + r > i) {
|
|
50
|
-
let e = n + r - i, t = parseFloat(((n - e) / a).toFixed(2));
|
|
51
|
-
return t < 0 ? 0 : t;
|
|
52
|
-
} else return parseFloat((n / a).toFixed(2));
|
|
53
|
-
} else {
|
|
54
|
-
let n = p(e.rows, t), r = m(e) === 0 ? 1 : m(e);
|
|
55
|
-
return parseFloat((n / r).toFixed(2));
|
|
56
|
-
}
|
|
57
|
-
}, _ = (e, t, n = {}) => {
|
|
58
|
-
let r = d(e, t, n), i = s.enabled(e, t);
|
|
59
|
-
return r === "correct" ? 1 : r === "partial" && i ? g(e, n) : 0;
|
|
60
|
-
}, v = (e, t, r) => {
|
|
61
|
-
let i = [], a = t?.answers || {}, o = e?.rows || [], c = e.choiceMode === "checkbox";
|
|
62
|
-
if (!a || Object.keys(a).length === 0) return i.push("Student did not provide any answer."), i;
|
|
63
|
-
i.push(`Match item contains ${o.length} row(s).`), i.push(`Matching mode: ${c ? "checkbox (multiple matches allowed)" : "radio (single match per row)"}.`);
|
|
64
|
-
let l = 0, u = 0, d = 0;
|
|
65
|
-
o.forEach((e) => {
|
|
66
|
-
let t = a[e.id], r = e.values || [];
|
|
67
|
-
c ? r.forEach((e, n) => {
|
|
68
|
-
e && d++, t && t[n] && (t[n] === e ? l++ : u++);
|
|
69
|
-
}) : (d++, t && (n(r, t) ? l++ : u++));
|
|
70
|
-
}), l > 0 && i.push(`${l} correct match(es) selected.`), u > 0 && i.push(`${u} incorrect match(es) selected.`), l === 0 && u === 0 && i.push("Student provided answers, but none matched the correct responses.");
|
|
71
|
-
let f = s.enabled(e, r);
|
|
72
|
-
f ? (i.push("Score calculated using partial scoring."), c ? (i.push("Score is based on the number of correct minus extra incorrect matches, divided by the total number of correct matches."), l + u > d && i.push("Extra selected matches beyond the correct set reduce the score.")) : i.push("Score is based on the number of correctly matched rows divided by the total number of rows.")) : (i.push("Score calculated using all-or-nothing scoring."), i.push("Student must match all rows correctly to receive full credit."));
|
|
73
|
-
let p = _(e, r, a), m = f ? p : +(p === 1);
|
|
74
|
-
return i.push(`Final score: ${m}.`), i;
|
|
75
|
-
}, y = (e, n, r) => new Promise((i) => {
|
|
76
|
-
r.mode === "evaluate" ? ((!n || t(n)) && i({
|
|
77
|
-
score: 0,
|
|
78
|
-
empty: !0,
|
|
79
|
-
logTrace: ["Student did not provide any answer."]
|
|
80
|
-
}), i({
|
|
81
|
-
score: _(e, r, n.answers),
|
|
82
|
-
empty: !1,
|
|
83
|
-
logTrace: v(e, n, r)
|
|
84
|
-
})) : i({
|
|
85
|
-
score: void 0,
|
|
86
|
-
completed: void 0,
|
|
87
|
-
logTrace: []
|
|
88
|
-
});
|
|
89
|
-
});
|
|
90
|
-
function b(e = {}) {
|
|
91
|
-
return new Promise((t) => {
|
|
92
|
-
t({
|
|
93
|
-
...r,
|
|
94
|
-
...e
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
var x = (e) => ({
|
|
99
|
-
...r,
|
|
100
|
-
...e
|
|
101
|
-
});
|
|
102
|
-
async function S(n, r, s, c) {
|
|
103
|
-
let u = e(x(n)), f, p;
|
|
104
|
-
(!r || t(r)) && s.mode === "evaluate" ? (f = "unanswered", p = "0%") : (f = d(u, s, r && r.answers), p = `${_(u, s, r && r.answers) * 100}%`);
|
|
105
|
-
let m = {}, h = {
|
|
106
|
-
score: p,
|
|
107
|
-
correctness: f
|
|
108
|
-
}, g = o(u, r, s);
|
|
109
|
-
g || (u.rows = await a(u.rows, r, c, "id")), u.rows.forEach((e) => {
|
|
110
|
-
m[e.id] = e.values, s.mode !== "evaluate" && delete e.values;
|
|
111
|
-
});
|
|
112
|
-
let v = s.mode === "evaluate" && u.feedbackEnabled ? await i(h.correctness, u.feedback) : void 0, { extraCSSRules: y, feedbackEnabled: b, promptEnabled: S, prompt: C, lockChoiceOrder: w, ...T } = u, E = {
|
|
113
|
-
...T,
|
|
114
|
-
extraCSSRules: y,
|
|
115
|
-
allowFeedback: b,
|
|
116
|
-
prompt: S ? C : null,
|
|
117
|
-
shuffled: !g,
|
|
118
|
-
feedback: v,
|
|
119
|
-
disabled: s.mode !== "gather",
|
|
120
|
-
view: s.mode === "view"
|
|
121
|
-
};
|
|
122
|
-
return s.role === "instructor" && (s.mode === "view" || s.mode === "evaluate") ? (E.teacherInstructions = u.teacherInstructionsEnabled ? u.teacherInstructions : null, E.rationale = u.rationaleEnabled ? u.rationale : null) : (E.rationale = null, E.teacherInstructions = null), s.mode === "evaluate" && Object.assign(E, {
|
|
123
|
-
correctResponse: m,
|
|
124
|
-
correctness: h
|
|
125
|
-
}), l("out: ", E), E;
|
|
126
|
-
}
|
|
127
|
-
var C = (e, t) => new Promise((n) => {
|
|
128
|
-
if (t.mode !== "evaluate" && t.role === "instructor") {
|
|
129
|
-
let { rows: t } = e, r = {};
|
|
130
|
-
t.forEach((e) => {
|
|
131
|
-
r[e.id] = e.values;
|
|
132
|
-
}), n({
|
|
133
|
-
answers: r,
|
|
134
|
-
id: "1"
|
|
135
|
-
});
|
|
136
|
-
} else n(null);
|
|
137
|
-
}), w = (e) => (e || "").replaceAll(/<[^>]*>/g, ""), T = (e) => (e || "").replace(/(<(?!img|iframe|source)([^>]+)>)/gi, ""), E = (e = {}, t = {}) => {
|
|
138
|
-
let { rows: n, choiceMode: r, headers: i } = e, { minQuestions: a, maxQuestions: o, maxLengthQuestionsHeading: s, maxAnswers: c, maxLengthAnswers: l, maxLengthFirstColumnHeading: u } = t, d = {}, f = {}, p = {};
|
|
139
|
-
[
|
|
140
|
-
"teacherInstructions",
|
|
141
|
-
"prompt",
|
|
142
|
-
"rationale"
|
|
143
|
-
].forEach((n) => {
|
|
144
|
-
t[n]?.required && !T(e[n]) && (p[n] = "This field is required.");
|
|
145
|
-
}), n.length < a ? p.noOfRowsError = `There should be at least ${a} question rows.` : n.length > o && (p.noOfRowsError = `No more than ${o} question rows should be defined.`), (n || []).forEach((e, t) => {
|
|
146
|
-
let { id: r, values: i = [], title: a } = e;
|
|
147
|
-
d[r] = "", s && w(a).length > s && (d[r] += `Content length should be maximum ${s} characters. `), T(a) ? n.slice(0, t).some((e) => T(e.title) === T(a)) && (d[r] += "Content should be unique. ") : d[r] += "Content should not be empty. ", i.some((e) => !!e) || (d[r] += "No correct response defined.");
|
|
148
|
-
}), c && i.length - 1 > c && (p.columnsLengthError = `There should be maximum ${c} answers.`), u && i[0].length > u && (f[0] = `Content length should be maximum ${u} characters.`);
|
|
149
|
-
let m = (i || []).map((e) => T(e));
|
|
150
|
-
return m.shift(), m.forEach((e, t) => {
|
|
151
|
-
let n = t + 1;
|
|
152
|
-
f[n] = "", l && w(e).length > l && (f[n] += `Content length should be maximum ${l} characters. `), e ? m.slice(0, t).some((t) => t === e) && (f[t + 1] += "Content should be unique.") : f[n] += "Content should not be empty.";
|
|
153
|
-
}), Object.values(d).some((e) => (e || "").length) && (p.rowsErrors = d, Object.values(d).some((e) => (e || "").includes("No correct response defined.")) && (p.correctResponseError = r === "radio" ? "There should be a correct response defined for every row." : "There should be at least one correct response defined for every row.")), Object.values(f).some((e) => (e || "").length) && (p.columnsErrors = f), p;
|
|
154
|
-
};
|
|
155
|
-
//#endregion
|
|
156
|
-
export { C as createCorrectResponseSession, b as createDefaultModel, v as getLogTrace, S as model, x as normalize, y as outcome, E as validate };
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/match/src/answer-grid.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 AnswerGrid extends React.Component {
|
|
12
|
-
static propTypes: {
|
|
13
|
-
correctAnswers: PropTypes.Requireable<object>;
|
|
14
|
-
view: PropTypes.Validator<boolean>;
|
|
15
|
-
showCorrect: PropTypes.Validator<boolean>;
|
|
16
|
-
disabled: PropTypes.Validator<boolean>;
|
|
17
|
-
onAnswerChange: PropTypes.Validator<(...args: any[]) => any>;
|
|
18
|
-
choiceMode: PropTypes.Validator<string>;
|
|
19
|
-
rows: PropTypes.Validator<any[]>;
|
|
20
|
-
headers: PropTypes.Validator<any[]>;
|
|
21
|
-
answers: PropTypes.Validator<object>;
|
|
22
|
-
};
|
|
23
|
-
onRowValueChange: (rowId: any, answerIndex: any) => (event: any) => void;
|
|
24
|
-
answerIsCorrect: any;
|
|
25
|
-
answerIsIncorrect: any;
|
|
26
|
-
render(): React.JSX.Element;
|
|
27
|
-
}
|
|
28
|
-
export default AnswerGrid;
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import e from "react";
|
|
2
|
-
import t from "prop-types";
|
|
3
|
-
import { color as n } from "@pie-lib/render-ui";
|
|
4
|
-
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
-
import a from "@mui/material/Radio";
|
|
6
|
-
import o from "@mui/material/Checkbox";
|
|
7
|
-
import s from "@mui/material/Typography";
|
|
8
|
-
import { styled as c } from "@mui/material/styles";
|
|
9
|
-
//#region src/delivery/answer-grid.tsx
|
|
10
|
-
var l = c("div")(({ theme: e }) => ({
|
|
11
|
-
marginLeft: "auto",
|
|
12
|
-
marginRight: "auto",
|
|
13
|
-
marginTop: e.spacing(1),
|
|
14
|
-
marginBottom: e.spacing(1)
|
|
15
|
-
})), u = c("td")({ padding: "5px 0" }), d = c(s)(({ theme: e }) => ({ margin: e.spacing(2) })), f = c("th")({ padding: 0 }), p = c("div")(({ theme: e, isQuestionText: t }) => ({
|
|
16
|
-
padding: e.spacing(1.5),
|
|
17
|
-
textAlign: t ? "left" : "center"
|
|
18
|
-
})), m = c("tr")({
|
|
19
|
-
border: 0,
|
|
20
|
-
borderTop: `2.5px solid ${n.primaryLight()}`,
|
|
21
|
-
width: "100%"
|
|
22
|
-
}), h = c("table")({
|
|
23
|
-
color: n.text(),
|
|
24
|
-
backgroundColor: n.background(),
|
|
25
|
-
borderCollapse: "collapse",
|
|
26
|
-
borderSpacing: 0,
|
|
27
|
-
marginBottom: 0
|
|
28
|
-
}), g = class extends e.Component {
|
|
29
|
-
static propTypes = {
|
|
30
|
-
correctAnswers: t.object,
|
|
31
|
-
view: t.bool.isRequired,
|
|
32
|
-
showCorrect: t.bool.isRequired,
|
|
33
|
-
disabled: t.bool.isRequired,
|
|
34
|
-
onAnswerChange: t.func.isRequired,
|
|
35
|
-
choiceMode: t.string.isRequired,
|
|
36
|
-
rows: t.array.isRequired,
|
|
37
|
-
headers: t.array.isRequired,
|
|
38
|
-
answers: t.object.isRequired
|
|
39
|
-
};
|
|
40
|
-
onRowValueChange = (e, t) => (n) => {
|
|
41
|
-
let { onAnswerChange: r, choiceMode: i, answers: a } = this.props, o = { ...a };
|
|
42
|
-
if (i === "radio") for (let t = 0; t < o[e].length; t++) o[e][t] = !1;
|
|
43
|
-
o[e][t] = n.target.checked, r(o);
|
|
44
|
-
};
|
|
45
|
-
answerIsCorrect = (e, t, n) => {
|
|
46
|
-
let { correctAnswers: r } = this.props;
|
|
47
|
-
return r[e][n] === t && t === !0;
|
|
48
|
-
};
|
|
49
|
-
answerIsIncorrect = (e, t, n) => {
|
|
50
|
-
let { correctAnswers: r } = this.props;
|
|
51
|
-
return r[e][n] === !0 && t === !1 || r[e][n] === !1 && t === !0;
|
|
52
|
-
};
|
|
53
|
-
render() {
|
|
54
|
-
let { showCorrect: e, headers: t, rows: s, choiceMode: c, answers: g, disabled: _, view: v } = this.props, y = c === "radio" ? a : o, b = _ && !v;
|
|
55
|
-
return !s || s.length === 0 ? /* @__PURE__ */ r(l, { children: /* @__PURE__ */ r(d, {
|
|
56
|
-
component: "div",
|
|
57
|
-
children: "There are currently no questions to show."
|
|
58
|
-
}) }) : /* @__PURE__ */ r(l, { children: /* @__PURE__ */ i(h, { children: [
|
|
59
|
-
/* @__PURE__ */ r("colgroup", { children: (t || []).map((e, t) => /* @__PURE__ */ r("col", {}, `col-${t}`)) }),
|
|
60
|
-
/* @__PURE__ */ r("thead", { children: /* @__PURE__ */ r("tr", { children: (t || []).map((e, t) => /* @__PURE__ */ r(f, {
|
|
61
|
-
"data-colno": `${t}`,
|
|
62
|
-
scope: "row",
|
|
63
|
-
children: /* @__PURE__ */ r(p, {
|
|
64
|
-
isQuestionText: t === 0,
|
|
65
|
-
dangerouslySetInnerHTML: { __html: e }
|
|
66
|
-
})
|
|
67
|
-
}, `th-${t}`)) }) }),
|
|
68
|
-
(s || []).map((t, a) => /* @__PURE__ */ r("tbody", {
|
|
69
|
-
role: "group",
|
|
70
|
-
children: /* @__PURE__ */ i(m, { children: [/* @__PURE__ */ r("td", {
|
|
71
|
-
"data-colno": "0",
|
|
72
|
-
children: /* @__PURE__ */ r(p, {
|
|
73
|
-
isQuestionText: !0,
|
|
74
|
-
dangerouslySetInnerHTML: { __html: t.title }
|
|
75
|
-
})
|
|
76
|
-
}, `td-title-${a}`), (g[t.id] || []).map((i, o) => /* @__PURE__ */ r(u, {
|
|
77
|
-
"data-colno": `${o + 1}`,
|
|
78
|
-
children: /* @__PURE__ */ r(p, { children: /* @__PURE__ */ r(y, {
|
|
79
|
-
sx: {
|
|
80
|
-
padding: "6px",
|
|
81
|
-
color: e && i === !0 || b && this.answerIsCorrect(t.id, i, o) ? n.correct() : b && this.answerIsIncorrect(t.id, i, o) ? n.incorrect() : i === !0 && !b ? n.primary() : _ ? n.disabled() : n.text(),
|
|
82
|
-
cursor: _ ? "not-allowed" : "pointer",
|
|
83
|
-
pointerEvents: _ ? "initial" : "auto",
|
|
84
|
-
opacity: _ ? .7 : 1,
|
|
85
|
-
"& input": { width: "100% !important" },
|
|
86
|
-
"&:hover": { color: _ ? n.disabled() : n.primaryLight() },
|
|
87
|
-
"&.Mui-disabled": { color: `${e && i === !0 || b && this.answerIsCorrect(t.id, i, o) ? n.correct() : b && this.answerIsIncorrect(t.id, i, o) ? n.incorrect() : i === !0 && !b ? n.primary() : n.disabled()}` }
|
|
88
|
-
},
|
|
89
|
-
disabled: _,
|
|
90
|
-
onChange: this.onRowValueChange(t.id, o),
|
|
91
|
-
checked: i === !0
|
|
92
|
-
}) })
|
|
93
|
-
}, `td-${a}-${o}`))] })
|
|
94
|
-
}, `row-${a}`))
|
|
95
|
-
] }) });
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
//#endregion
|
|
99
|
-
export { g as default };
|
package/dist/delivery/index.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/match/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) => any;
|
|
12
|
-
export default class Match 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
|
-
}
|
package/dist/delivery/index.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import e from "./main.js";
|
|
2
|
-
import t from "react";
|
|
3
|
-
import { createRoot as n } from "react-dom/client";
|
|
4
|
-
import { SessionChangedEvent as r } from "@pie-element/shared-player-events";
|
|
5
|
-
import { renderMath as i } from "@pie-element/shared-math-rendering-mathjax";
|
|
6
|
-
//#region src/delivery/index.ts
|
|
7
|
-
var a = (e, t) => (t?.rows?.map((e) => e.id) || []).reduce((t, n) => {
|
|
8
|
-
if (!t) return !1;
|
|
9
|
-
let r = e.answers && e.answers[n];
|
|
10
|
-
return Array.isArray(r) && r.includes(!0) && t;
|
|
11
|
-
}, !0), o = class extends HTMLElement {
|
|
12
|
-
constructor() {
|
|
13
|
-
super(), this._root = null;
|
|
14
|
-
}
|
|
15
|
-
set model(e) {
|
|
16
|
-
this._model = {
|
|
17
|
-
...e,
|
|
18
|
-
...e?.config || {}
|
|
19
|
-
}, this._render();
|
|
20
|
-
}
|
|
21
|
-
set session(e) {
|
|
22
|
-
this._session = e, this._render();
|
|
23
|
-
}
|
|
24
|
-
get session() {
|
|
25
|
-
return this._session;
|
|
26
|
-
}
|
|
27
|
-
sessionChanged(e) {
|
|
28
|
-
this._session.answers = e.answers;
|
|
29
|
-
let t = a(this._session, this._model);
|
|
30
|
-
this.dispatchEvent(new r(this.tagName.toLowerCase(), t)), this._render();
|
|
31
|
-
}
|
|
32
|
-
connectedCallback() {
|
|
33
|
-
this._render();
|
|
34
|
-
}
|
|
35
|
-
_render() {
|
|
36
|
-
if (!this._model || !this._session) return;
|
|
37
|
-
let r = t.createElement(e, {
|
|
38
|
-
model: this._model,
|
|
39
|
-
session: this._session,
|
|
40
|
-
onSessionChange: this.sessionChanged.bind(this)
|
|
41
|
-
});
|
|
42
|
-
this._root ||= n(this), this._root.render(r), queueMicrotask(() => {
|
|
43
|
-
i(this);
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
disconnectedCallback() {
|
|
47
|
-
this._root && this._root.unmount();
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
//#endregion
|
|
51
|
-
export { e as Component, o as default, a as isComplete };
|