@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/delivery/main.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/match/src/main.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 Main extends React.Component {
|
|
12
|
-
static propTypes: {
|
|
13
|
-
session: PropTypes.Validator<object>;
|
|
14
|
-
onSessionChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
15
|
-
model: PropTypes.Validator<object>;
|
|
16
|
-
};
|
|
17
|
-
constructor(props: any);
|
|
18
|
-
generateAnswers: any;
|
|
19
|
-
isAnswerRegenerationRequired: any;
|
|
20
|
-
UNSAFE_componentWillReceiveProps(nextProps: any): void;
|
|
21
|
-
callOnSessionChange: any;
|
|
22
|
-
toggleShowCorrect: any;
|
|
23
|
-
onAnswerChange: any;
|
|
24
|
-
render(): React.JSX.Element;
|
|
25
|
-
}
|
|
26
|
-
export default Main;
|
package/dist/delivery/main.js
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import e from "./answer-grid.js";
|
|
2
|
-
import t from "react";
|
|
3
|
-
import n from "prop-types";
|
|
4
|
-
import r from "@pie-lib/correct-answer-toggle";
|
|
5
|
-
import * as i from "@pie-lib/render-ui";
|
|
6
|
-
import { Collapsible as a, Feedback as o, PreviewPrompt as s, UiLayout as c, hasMedia as l, hasText as u } from "@pie-lib/render-ui";
|
|
7
|
-
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
8
|
-
import { styled as p } from "@mui/material/styles";
|
|
9
|
-
//#region src/delivery/main.tsx
|
|
10
|
-
function m(e) {
|
|
11
|
-
return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
|
|
12
|
-
}
|
|
13
|
-
function h(e, t) {
|
|
14
|
-
return !e || m(e) ? e : m(e.default) ? e.default : t && m(e[t]) ? e[t] : t && m(e[t]?.default) ? e[t].default : e;
|
|
15
|
-
}
|
|
16
|
-
var g = h(c, "UiLayout") || h(S.UiLayout, "UiLayout"), _ = h(s, "PreviewPrompt") || h(S.PreviewPrompt, "PreviewPrompt"), v = h(o, "Feedback") || h(S.Feedback, "Feedback"), y = h(a, "Collapsible") || h(S.Collapsible, "Collapsible"), b = i, x = b.default, S = x && typeof x == "object" ? x : b, C = p("div")({ verticalAlign: "middle" }), w = p(y)(({ theme: e }) => ({ marginBottom: e.spacing(2) })), T = class extends t.Component {
|
|
17
|
-
static propTypes = {
|
|
18
|
-
session: n.object.isRequired,
|
|
19
|
-
onSessionChange: n.func,
|
|
20
|
-
model: n.object.isRequired
|
|
21
|
-
};
|
|
22
|
-
constructor(e) {
|
|
23
|
-
super(e), this.state = {
|
|
24
|
-
session: {
|
|
25
|
-
...e.session,
|
|
26
|
-
answers: e.session && e.session.answers || this.generateAnswers(e.model)
|
|
27
|
-
},
|
|
28
|
-
showCorrect: !1
|
|
29
|
-
}, this.callOnSessionChange();
|
|
30
|
-
}
|
|
31
|
-
generateAnswers = (e) => {
|
|
32
|
-
let t = {};
|
|
33
|
-
return e.rows?.forEach((n) => {
|
|
34
|
-
t[n.id] = Array(e.layout - 1).fill(!1);
|
|
35
|
-
}), t;
|
|
36
|
-
};
|
|
37
|
-
isAnswerRegenerationRequired = (e) => {
|
|
38
|
-
let { model: { choiceMode: t, layout: n, rows: r } = {} } = this.props, { session: { answers: i } = {} } = e, a = !1;
|
|
39
|
-
return t !== e.model.choiceMode && (a = !0), n !== e.model.layout && (a = !0), (r.length !== e.model.rows.length || i && e.model.rows.length !== Object.keys(i).length) && (a = !0), a || !i;
|
|
40
|
-
};
|
|
41
|
-
UNSAFE_componentWillReceiveProps(e) {
|
|
42
|
-
let t = this.isAnswerRegenerationRequired(e);
|
|
43
|
-
this.setState((n) => ({
|
|
44
|
-
session: {
|
|
45
|
-
...e.session,
|
|
46
|
-
answers: t ? this.generateAnswers(e.model) : e.session.answers
|
|
47
|
-
},
|
|
48
|
-
showCorrect: this.props.model.disabled && !e.model.disabled && n.showCorrect ? !1 : n.showCorrect
|
|
49
|
-
}), () => {
|
|
50
|
-
t && this.callOnSessionChange();
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
callOnSessionChange = () => {
|
|
54
|
-
let { onSessionChange: e } = this.props;
|
|
55
|
-
e && e(this.state.session);
|
|
56
|
-
};
|
|
57
|
-
toggleShowCorrect = (e) => {
|
|
58
|
-
this.setState({ showCorrect: e });
|
|
59
|
-
};
|
|
60
|
-
onAnswerChange = (e) => {
|
|
61
|
-
this.setState((t) => ({ session: {
|
|
62
|
-
...t.session,
|
|
63
|
-
answers: e
|
|
64
|
-
} }), this.callOnSessionChange);
|
|
65
|
-
};
|
|
66
|
-
render() {
|
|
67
|
-
let { model: t } = this.props, { showCorrect: n, session: i } = this.state, { correctness: a = {}, extraCSSRules: o, language: s } = t, c = a.correctness && a.correctness !== "correct", p = t.rationale && (u(t.rationale) || l(t.rationale));
|
|
68
|
-
return /* @__PURE__ */ f(g, {
|
|
69
|
-
extraCSSRules: o,
|
|
70
|
-
children: [
|
|
71
|
-
t.teacherInstructions && (u(t.teacherInstructions) || l(t.teacherInstructions)) && /* @__PURE__ */ d(w, {
|
|
72
|
-
labels: {
|
|
73
|
-
hidden: "Show Teacher Instructions",
|
|
74
|
-
visible: "Hide Teacher Instructions"
|
|
75
|
-
},
|
|
76
|
-
children: /* @__PURE__ */ d(_, { prompt: t.teacherInstructions })
|
|
77
|
-
}),
|
|
78
|
-
t.prompt && /* @__PURE__ */ d(C, { children: /* @__PURE__ */ d(_, { prompt: t.prompt }) }),
|
|
79
|
-
/* @__PURE__ */ d(r, {
|
|
80
|
-
language: s,
|
|
81
|
-
show: c,
|
|
82
|
-
toggled: n,
|
|
83
|
-
onToggle: this.toggleShowCorrect
|
|
84
|
-
}),
|
|
85
|
-
/* @__PURE__ */ d(e, {
|
|
86
|
-
showCorrect: n,
|
|
87
|
-
correctAnswers: t.correctResponse,
|
|
88
|
-
disabled: t.disabled,
|
|
89
|
-
view: t.view,
|
|
90
|
-
onAnswerChange: this.onAnswerChange,
|
|
91
|
-
choiceMode: t.choiceMode,
|
|
92
|
-
answers: n ? t.correctResponse || {} : i.answers,
|
|
93
|
-
headers: t.headers,
|
|
94
|
-
rows: t.rows
|
|
95
|
-
}),
|
|
96
|
-
p && /* @__PURE__ */ d(y, {
|
|
97
|
-
labels: {
|
|
98
|
-
hidden: "Show Rationale",
|
|
99
|
-
visible: "Hide Rationale"
|
|
100
|
-
},
|
|
101
|
-
children: /* @__PURE__ */ d(_, { prompt: t.rationale })
|
|
102
|
-
}),
|
|
103
|
-
t.feedback && /* @__PURE__ */ d(v, {
|
|
104
|
-
correctness: a.correctness,
|
|
105
|
-
feedback: t.feedback
|
|
106
|
-
})
|
|
107
|
-
]
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
//#endregion
|
|
112
|
-
export { T as default };
|
package/dist/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './delivery/index.js';
|
package/dist/index.iife.d.ts
DELETED