@pie-element/multiple-choice 9.16.2-next.12 → 9.16.2-next.16
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/lib/session-updater.js +5 -7
- package/lib/session-updater.js.map +1 -1
- package/module/configure.js +1 -1
- package/module/element.js +3 -6
- package/module/manifest.json +1 -1
- package/module/print.js +1 -1
- package/package.json +2 -2
package/lib/session-updater.js
CHANGED
|
@@ -8,20 +8,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.updateSessionMetadata = updateSessionMetadata;
|
|
9
9
|
exports.updateSessionValue = updateSessionValue;
|
|
10
10
|
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
var _uniq = _interopRequireDefault(require("lodash/uniq"));
|
|
14
|
-
|
|
15
|
-
var _without = _interopRequireDefault(require("lodash/without"));
|
|
11
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
16
12
|
|
|
17
13
|
function updateSessionValue(session, choiceMode, data) {
|
|
18
14
|
session.value = session.value || [];
|
|
19
15
|
|
|
20
16
|
if (choiceMode === 'checkbox') {
|
|
21
17
|
if (data.selected) {
|
|
22
|
-
session.value = (
|
|
18
|
+
session.value = Array.from(new Set([].concat((0, _toConsumableArray2["default"])(session.value), [data.value])));
|
|
23
19
|
} else {
|
|
24
|
-
session.value =
|
|
20
|
+
session.value = session.value.filter(function (v) {
|
|
21
|
+
return v !== data.value;
|
|
22
|
+
});
|
|
25
23
|
}
|
|
26
24
|
}
|
|
27
25
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/session-updater.js"],"names":["updateSessionValue","session","choiceMode","data","value","selected","selector","updateSessionMetadata","metadata","audioStartTime","audioEndTime","waitTime"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/session-updater.js"],"names":["updateSessionValue","session","choiceMode","data","value","selected","Array","from","Set","filter","v","selector","updateSessionMetadata","metadata","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AAqBf,OAAO,CAACa,cAA7B,IAA+Cb,OAAO,CAACc,YAA1D,EAAwE;AACtE;AACAd,IAAAA,OAAO,CAACe,QAAR,GAAoBf,OAAO,CAACc,YAAR,GAAuBd,OAAO,CAACa,cAAnD;AACD;AACF","sourcesContent":["export function updateSessionValue(session, choiceMode, data) {\n session.value = session.value || [];\n if (choiceMode === 'checkbox') {\n if (data.selected) {\n session.value = Array.from(new Set([...session.value, data.value]));\n } else {\n session.value = session.value.filter(v => v !== data.value);\n }\n }\n\n if (choiceMode === 'radio') {\n if (data.selected) {\n session.value = [data.value];\n } else {\n session.value = [];\n }\n }\n \n //update session value metadata\n session.selector = data.selector; //the input method used to select the choice (e.g. mouse, keyboard)\n}\n\nexport function updateSessionMetadata(session, metadata) {\n session.audioStartTime = session.audioStartTime || metadata.audioStartTime; //timestamp when auto-played audio started playing\n session.audioEndTime = session.audioEndTime || metadata.audioEndTime; //timestamp when auto-played audio completed playing\n \n if(!session.waitTime && session.audioStartTime && session.audioEndTime) {\n // waitTime is elapsed time the user waited for auto-played audio to finish\n session.waitTime = (session.audioEndTime - session.audioStartTime);\n }\n}\n"],"file":"session-updater.js"}
|
package/module/configure.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {_dll_react, _dll_prop_types, _dll_react_dom, _dll_classnames, _dll_lodash, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@4.1.
|
|
1
|
+
import {_dll_react, _dll_prop_types, _dll_react_dom, _dll_classnames, _dll_lodash, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@4.1.7/module/index.js";
|
|
2
2
|
import {_dll_pie_lib__pie_toolbox_editable_html, _dll_pie_lib__pie_toolbox_config_ui, _dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@7.0.4/module/index.js";
|
|
3
3
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
4
4
|
function getDefaultExportFromCjs(x) {
|
package/module/element.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_debug, _dll_pie_lib__pie_toolbox_math_rendering} from "../../../@pie-lib/pie-toolbox-math-rendering-module@4.1.
|
|
1
|
+
import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_debug, _dll_pie_lib__pie_toolbox_math_rendering} from "../../../@pie-lib/pie-toolbox-math-rendering-module@4.1.7/module/index.js";
|
|
2
2
|
import {_dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_correct_answer_toggle} from "../../../@pie-lib/pie-toolbox-module@7.0.4/module/index.js";
|
|
3
3
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
4
4
|
function getDefaultExportFromCjs(x) {
|
|
@@ -13085,16 +13085,13 @@ class SessionChangedEvent extends CustomEvent {
|
|
|
13085
13085
|
}
|
|
13086
13086
|
SessionChangedEvent.TYPE = 'session-changed';
|
|
13087
13087
|
var SessionChangedEvent_1 = lib.SessionChangedEvent = SessionChangedEvent;
|
|
13088
|
-
const {concat: concat} = _dll_lodash;
|
|
13089
|
-
const {uniq: uniq} = _dll_lodash;
|
|
13090
|
-
const {without: without} = _dll_lodash;
|
|
13091
13088
|
function updateSessionValue(session, choiceMode, data) {
|
|
13092
13089
|
session.value = session.value || [];
|
|
13093
13090
|
if (choiceMode === 'checkbox') {
|
|
13094
13091
|
if (data.selected) {
|
|
13095
|
-
session.value =
|
|
13092
|
+
session.value = Array.from(new Set([...session.value, data.value]));
|
|
13096
13093
|
} else {
|
|
13097
|
-
session.value =
|
|
13094
|
+
session.value = session.value.filter(v => v !== data.value);
|
|
13098
13095
|
}
|
|
13099
13096
|
}
|
|
13100
13097
|
if (choiceMode === 'radio') {
|
package/module/manifest.json
CHANGED
package/module/print.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_pie_lib__pie_toolbox_math_rendering, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@4.1.
|
|
1
|
+
import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_pie_lib__pie_toolbox_math_rendering, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@4.1.7/module/index.js";
|
|
2
2
|
import {_dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_correct_answer_toggle} from "../../../@pie-lib/pie-toolbox-module@7.0.4/module/index.js";
|
|
3
3
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
4
4
|
function getDefaultExportFromCjs(x) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/multiple-choice",
|
|
3
3
|
"repository": "pie-framework/pie-elements",
|
|
4
|
-
"version": "9.16.2-next.
|
|
4
|
+
"version": "9.16.2-next.16+1be136c5c",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"react-test-renderer": "^16.3.2",
|
|
20
20
|
"react-transition-group": "^2.3.1"
|
|
21
21
|
},
|
|
22
|
-
"gitHead": "
|
|
22
|
+
"gitHead": "1be136c5c419b152b075091675790a8ab677e180",
|
|
23
23
|
"scripts": {
|
|
24
24
|
"postpublish": "../../scripts/postpublish"
|
|
25
25
|
},
|