@pie-element/select-text 9.6.9 → 9.6.10-next.86
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/configure/lib/design.js +6 -6
- package/configure/lib/design.js.map +1 -1
- package/configure/package.json +3 -1
- package/controller/lib/index.js +2 -2
- package/controller/lib/index.js.map +1 -1
- package/controller/package.json +2 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/main.js +4 -4
- package/lib/main.js.map +1 -1
- package/lib/print.js +1 -1
- package/lib/print.js.map +1 -1
- package/module/configure.js +1 -108823
- package/module/controller.js +112 -1055
- package/module/element.js +1 -103664
- package/module/index.html +1 -1
- package/module/manifest.json +5 -5
- package/module/print.html +1 -1
- package/module/print.js +1 -103621
- package/package.json +6 -3
package/module/controller.js
CHANGED
|
@@ -2,7 +2,7 @@ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof win
|
|
|
2
2
|
|
|
3
3
|
/** Used for built-in method references. */
|
|
4
4
|
|
|
5
|
-
var objectProto$
|
|
5
|
+
var objectProto$8 = Object.prototype;
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Checks if `value` is likely a prototype object.
|
|
@@ -13,7 +13,7 @@ var objectProto$9 = Object.prototype;
|
|
|
13
13
|
*/
|
|
14
14
|
function isPrototype$2(value) {
|
|
15
15
|
var Ctor = value && value.constructor,
|
|
16
|
-
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$
|
|
16
|
+
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$8;
|
|
17
17
|
|
|
18
18
|
return value === proto;
|
|
19
19
|
}
|
|
@@ -48,10 +48,10 @@ var isPrototype$1 = _isPrototype,
|
|
|
48
48
|
nativeKeys = _nativeKeys;
|
|
49
49
|
|
|
50
50
|
/** Used for built-in method references. */
|
|
51
|
-
var objectProto$
|
|
51
|
+
var objectProto$7 = Object.prototype;
|
|
52
52
|
|
|
53
53
|
/** Used to check objects for own properties. */
|
|
54
|
-
var hasOwnProperty$
|
|
54
|
+
var hasOwnProperty$6 = objectProto$7.hasOwnProperty;
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
57
|
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
|
|
@@ -60,20 +60,20 @@ var hasOwnProperty$7 = objectProto$8.hasOwnProperty;
|
|
|
60
60
|
* @param {Object} object The object to query.
|
|
61
61
|
* @returns {Array} Returns the array of property names.
|
|
62
62
|
*/
|
|
63
|
-
function baseKeys$
|
|
63
|
+
function baseKeys$1(object) {
|
|
64
64
|
if (!isPrototype$1(object)) {
|
|
65
65
|
return nativeKeys(object);
|
|
66
66
|
}
|
|
67
67
|
var result = [];
|
|
68
68
|
for (var key in Object(object)) {
|
|
69
|
-
if (hasOwnProperty$
|
|
69
|
+
if (hasOwnProperty$6.call(object, key) && key != 'constructor') {
|
|
70
70
|
result.push(key);
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
return result;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
var _baseKeys = baseKeys$
|
|
76
|
+
var _baseKeys = baseKeys$1;
|
|
77
77
|
|
|
78
78
|
/** Detect free variable `global` from Node.js. */
|
|
79
79
|
|
|
@@ -94,27 +94,27 @@ var _root = root$7;
|
|
|
94
94
|
var root$6 = _root;
|
|
95
95
|
|
|
96
96
|
/** Built-in value references. */
|
|
97
|
-
var Symbol$
|
|
97
|
+
var Symbol$3 = root$6.Symbol;
|
|
98
98
|
|
|
99
|
-
var _Symbol = Symbol$
|
|
99
|
+
var _Symbol = Symbol$3;
|
|
100
100
|
|
|
101
|
-
var Symbol$
|
|
101
|
+
var Symbol$2 = _Symbol;
|
|
102
102
|
|
|
103
103
|
/** Used for built-in method references. */
|
|
104
|
-
var objectProto$
|
|
104
|
+
var objectProto$6 = Object.prototype;
|
|
105
105
|
|
|
106
106
|
/** Used to check objects for own properties. */
|
|
107
|
-
var hasOwnProperty$
|
|
107
|
+
var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
110
|
* Used to resolve the
|
|
111
111
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
112
112
|
* of values.
|
|
113
113
|
*/
|
|
114
|
-
var nativeObjectToString$1 = objectProto$
|
|
114
|
+
var nativeObjectToString$1 = objectProto$6.toString;
|
|
115
115
|
|
|
116
116
|
/** Built-in value references. */
|
|
117
|
-
var symToStringTag$1 = Symbol$
|
|
117
|
+
var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : undefined;
|
|
118
118
|
|
|
119
119
|
/**
|
|
120
120
|
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
|
@@ -124,7 +124,7 @@ var symToStringTag$1 = Symbol$3 ? Symbol$3.toStringTag : undefined;
|
|
|
124
124
|
* @returns {string} Returns the raw `toStringTag`.
|
|
125
125
|
*/
|
|
126
126
|
function getRawTag$1(value) {
|
|
127
|
-
var isOwn = hasOwnProperty$
|
|
127
|
+
var isOwn = hasOwnProperty$5.call(value, symToStringTag$1),
|
|
128
128
|
tag = value[symToStringTag$1];
|
|
129
129
|
|
|
130
130
|
try {
|
|
@@ -147,14 +147,14 @@ var _getRawTag = getRawTag$1;
|
|
|
147
147
|
|
|
148
148
|
/** Used for built-in method references. */
|
|
149
149
|
|
|
150
|
-
var objectProto$
|
|
150
|
+
var objectProto$5 = Object.prototype;
|
|
151
151
|
|
|
152
152
|
/**
|
|
153
153
|
* Used to resolve the
|
|
154
154
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
155
155
|
* of values.
|
|
156
156
|
*/
|
|
157
|
-
var nativeObjectToString = objectProto$
|
|
157
|
+
var nativeObjectToString = objectProto$5.toString;
|
|
158
158
|
|
|
159
159
|
/**
|
|
160
160
|
* Converts `value` to a string using `Object.prototype.toString`.
|
|
@@ -169,7 +169,7 @@ function objectToString$1(value) {
|
|
|
169
169
|
|
|
170
170
|
var _objectToString = objectToString$1;
|
|
171
171
|
|
|
172
|
-
var Symbol$
|
|
172
|
+
var Symbol$1 = _Symbol,
|
|
173
173
|
getRawTag = _getRawTag,
|
|
174
174
|
objectToString = _objectToString;
|
|
175
175
|
|
|
@@ -178,7 +178,7 @@ var nullTag = '[object Null]',
|
|
|
178
178
|
undefinedTag = '[object Undefined]';
|
|
179
179
|
|
|
180
180
|
/** Built-in value references. */
|
|
181
|
-
var symToStringTag = Symbol$
|
|
181
|
+
var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : undefined;
|
|
182
182
|
|
|
183
183
|
/**
|
|
184
184
|
* The base implementation of `getTag` without fallbacks for buggy environments.
|
|
@@ -187,7 +187,7 @@ var symToStringTag = Symbol$2 ? Symbol$2.toStringTag : undefined;
|
|
|
187
187
|
* @param {*} value The value to query.
|
|
188
188
|
* @returns {string} Returns the `toStringTag`.
|
|
189
189
|
*/
|
|
190
|
-
function baseGetTag$
|
|
190
|
+
function baseGetTag$4(value) {
|
|
191
191
|
if (value == null) {
|
|
192
192
|
return value === undefined ? undefinedTag : nullTag;
|
|
193
193
|
}
|
|
@@ -196,7 +196,7 @@ function baseGetTag$5(value) {
|
|
|
196
196
|
: objectToString(value);
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
-
var _baseGetTag = baseGetTag$
|
|
199
|
+
var _baseGetTag = baseGetTag$4;
|
|
200
200
|
|
|
201
201
|
/**
|
|
202
202
|
* Checks if `value` is the
|
|
@@ -231,7 +231,7 @@ function isObject$2(value) {
|
|
|
231
231
|
|
|
232
232
|
var isObject_1 = isObject$2;
|
|
233
233
|
|
|
234
|
-
var baseGetTag$
|
|
234
|
+
var baseGetTag$3 = _baseGetTag,
|
|
235
235
|
isObject$1 = isObject_1;
|
|
236
236
|
|
|
237
237
|
/** `Object#toString` result references. */
|
|
@@ -263,7 +263,7 @@ function isFunction$2(value) {
|
|
|
263
263
|
}
|
|
264
264
|
// The use of `Object#toString` avoids issues with the `typeof` operator
|
|
265
265
|
// in Safari 9 which returns 'object' for typed arrays and other constructors.
|
|
266
|
-
var tag = baseGetTag$
|
|
266
|
+
var tag = baseGetTag$3(value);
|
|
267
267
|
return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
268
268
|
}
|
|
269
269
|
|
|
@@ -341,17 +341,17 @@ var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
|
341
341
|
|
|
342
342
|
/** Used for built-in method references. */
|
|
343
343
|
var funcProto = Function.prototype,
|
|
344
|
-
objectProto$
|
|
344
|
+
objectProto$4 = Object.prototype;
|
|
345
345
|
|
|
346
346
|
/** Used to resolve the decompiled source of functions. */
|
|
347
347
|
var funcToString = funcProto.toString;
|
|
348
348
|
|
|
349
349
|
/** Used to check objects for own properties. */
|
|
350
|
-
var hasOwnProperty$
|
|
350
|
+
var hasOwnProperty$4 = objectProto$4.hasOwnProperty;
|
|
351
351
|
|
|
352
352
|
/** Used to detect if a method is native. */
|
|
353
353
|
var reIsNative = RegExp('^' +
|
|
354
|
-
funcToString.call(hasOwnProperty$
|
|
354
|
+
funcToString.call(hasOwnProperty$4).replace(reRegExpChar, '\\$&')
|
|
355
355
|
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
|
356
356
|
);
|
|
357
357
|
|
|
@@ -442,16 +442,16 @@ var getNative$1 = _getNative,
|
|
|
442
442
|
root = _root;
|
|
443
443
|
|
|
444
444
|
/* Built-in method references that are verified to be native. */
|
|
445
|
-
var WeakMap$
|
|
445
|
+
var WeakMap$1 = getNative$1(root, 'WeakMap');
|
|
446
446
|
|
|
447
|
-
var _WeakMap = WeakMap$
|
|
447
|
+
var _WeakMap = WeakMap$1;
|
|
448
448
|
|
|
449
449
|
var DataView = _DataView,
|
|
450
450
|
Map$1 = _Map,
|
|
451
451
|
Promise$1 = _Promise,
|
|
452
452
|
Set = _Set,
|
|
453
|
-
WeakMap
|
|
454
|
-
baseGetTag$
|
|
453
|
+
WeakMap = _WeakMap,
|
|
454
|
+
baseGetTag$2 = _baseGetTag,
|
|
455
455
|
toSource = _toSource;
|
|
456
456
|
|
|
457
457
|
/** `Object#toString` result references. */
|
|
@@ -468,7 +468,7 @@ var dataViewCtorString = toSource(DataView),
|
|
|
468
468
|
mapCtorString = toSource(Map$1),
|
|
469
469
|
promiseCtorString = toSource(Promise$1),
|
|
470
470
|
setCtorString = toSource(Set),
|
|
471
|
-
weakMapCtorString = toSource(WeakMap
|
|
471
|
+
weakMapCtorString = toSource(WeakMap);
|
|
472
472
|
|
|
473
473
|
/**
|
|
474
474
|
* Gets the `toStringTag` of `value`.
|
|
@@ -477,16 +477,16 @@ var dataViewCtorString = toSource(DataView),
|
|
|
477
477
|
* @param {*} value The value to query.
|
|
478
478
|
* @returns {string} Returns the `toStringTag`.
|
|
479
479
|
*/
|
|
480
|
-
var getTag$1 = baseGetTag$
|
|
480
|
+
var getTag$1 = baseGetTag$2;
|
|
481
481
|
|
|
482
482
|
// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
|
|
483
483
|
if ((DataView && getTag$1(new DataView(new ArrayBuffer(1))) != dataViewTag$1) ||
|
|
484
484
|
(Map$1 && getTag$1(new Map$1) != mapTag$2) ||
|
|
485
485
|
(Promise$1 && getTag$1(Promise$1.resolve()) != promiseTag) ||
|
|
486
486
|
(Set && getTag$1(new Set) != setTag$2) ||
|
|
487
|
-
(WeakMap
|
|
487
|
+
(WeakMap && getTag$1(new WeakMap) != weakMapTag$1)) {
|
|
488
488
|
getTag$1 = function(value) {
|
|
489
|
-
var result = baseGetTag$
|
|
489
|
+
var result = baseGetTag$2(value),
|
|
490
490
|
Ctor = result == objectTag$1 ? value.constructor : undefined,
|
|
491
491
|
ctorString = Ctor ? toSource(Ctor) : '';
|
|
492
492
|
|
|
@@ -530,14 +530,14 @@ var _getTag = getTag$1;
|
|
|
530
530
|
* // => false
|
|
531
531
|
*/
|
|
532
532
|
|
|
533
|
-
function isObjectLike$
|
|
533
|
+
function isObjectLike$3(value) {
|
|
534
534
|
return value != null && typeof value == 'object';
|
|
535
535
|
}
|
|
536
536
|
|
|
537
|
-
var isObjectLike_1 = isObjectLike$
|
|
537
|
+
var isObjectLike_1 = isObjectLike$3;
|
|
538
538
|
|
|
539
|
-
var baseGetTag$
|
|
540
|
-
isObjectLike$
|
|
539
|
+
var baseGetTag$1 = _baseGetTag,
|
|
540
|
+
isObjectLike$2 = isObjectLike_1;
|
|
541
541
|
|
|
542
542
|
/** `Object#toString` result references. */
|
|
543
543
|
var argsTag$1 = '[object Arguments]';
|
|
@@ -550,22 +550,22 @@ var argsTag$1 = '[object Arguments]';
|
|
|
550
550
|
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
|
551
551
|
*/
|
|
552
552
|
function baseIsArguments$1(value) {
|
|
553
|
-
return isObjectLike$
|
|
553
|
+
return isObjectLike$2(value) && baseGetTag$1(value) == argsTag$1;
|
|
554
554
|
}
|
|
555
555
|
|
|
556
556
|
var _baseIsArguments = baseIsArguments$1;
|
|
557
557
|
|
|
558
558
|
var baseIsArguments = _baseIsArguments,
|
|
559
|
-
isObjectLike$
|
|
559
|
+
isObjectLike$1 = isObjectLike_1;
|
|
560
560
|
|
|
561
561
|
/** Used for built-in method references. */
|
|
562
|
-
var objectProto$
|
|
562
|
+
var objectProto$3 = Object.prototype;
|
|
563
563
|
|
|
564
564
|
/** Used to check objects for own properties. */
|
|
565
|
-
var hasOwnProperty$
|
|
565
|
+
var hasOwnProperty$3 = objectProto$3.hasOwnProperty;
|
|
566
566
|
|
|
567
567
|
/** Built-in value references. */
|
|
568
|
-
var propertyIsEnumerable = objectProto$
|
|
568
|
+
var propertyIsEnumerable = objectProto$3.propertyIsEnumerable;
|
|
569
569
|
|
|
570
570
|
/**
|
|
571
571
|
* Checks if `value` is likely an `arguments` object.
|
|
@@ -585,12 +585,12 @@ var propertyIsEnumerable = objectProto$4.propertyIsEnumerable;
|
|
|
585
585
|
* _.isArguments([1, 2, 3]);
|
|
586
586
|
* // => false
|
|
587
587
|
*/
|
|
588
|
-
var isArguments$
|
|
589
|
-
return isObjectLike$
|
|
588
|
+
var isArguments$1 = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
|
|
589
|
+
return isObjectLike$1(value) && hasOwnProperty$3.call(value, 'callee') &&
|
|
590
590
|
!propertyIsEnumerable.call(value, 'callee');
|
|
591
591
|
};
|
|
592
592
|
|
|
593
|
-
var isArguments_1 = isArguments$
|
|
593
|
+
var isArguments_1 = isArguments$1;
|
|
594
594
|
|
|
595
595
|
/**
|
|
596
596
|
* Checks if `value` is classified as an `Array` object.
|
|
@@ -616,13 +616,13 @@ var isArguments_1 = isArguments$2;
|
|
|
616
616
|
* // => false
|
|
617
617
|
*/
|
|
618
618
|
|
|
619
|
-
var isArray$
|
|
619
|
+
var isArray$1 = Array.isArray;
|
|
620
620
|
|
|
621
|
-
var isArray_1 = isArray$
|
|
621
|
+
var isArray_1 = isArray$1;
|
|
622
622
|
|
|
623
623
|
/** Used as references for various `Number` constants. */
|
|
624
624
|
|
|
625
|
-
var MAX_SAFE_INTEGER
|
|
625
|
+
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
626
626
|
|
|
627
627
|
/**
|
|
628
628
|
* Checks if `value` is a valid array-like length.
|
|
@@ -652,7 +652,7 @@ var MAX_SAFE_INTEGER$1 = 9007199254740991;
|
|
|
652
652
|
*/
|
|
653
653
|
function isLength$2(value) {
|
|
654
654
|
return typeof value == 'number' &&
|
|
655
|
-
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER
|
|
655
|
+
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
656
656
|
}
|
|
657
657
|
|
|
658
658
|
var isLength_1 = isLength$2;
|
|
@@ -685,13 +685,13 @@ var isFunction = isFunction_1,
|
|
|
685
685
|
* _.isArrayLike(_.noop);
|
|
686
686
|
* // => false
|
|
687
687
|
*/
|
|
688
|
-
function isArrayLike$
|
|
688
|
+
function isArrayLike$1(value) {
|
|
689
689
|
return value != null && isLength$1(value.length) && !isFunction(value);
|
|
690
690
|
}
|
|
691
691
|
|
|
692
|
-
var isArrayLike_1 = isArrayLike$
|
|
692
|
+
var isArrayLike_1 = isArrayLike$1;
|
|
693
693
|
|
|
694
|
-
var isBuffer$
|
|
694
|
+
var isBuffer$1 = {exports: {}};
|
|
695
695
|
|
|
696
696
|
/**
|
|
697
697
|
* This method returns `false`.
|
|
@@ -752,11 +752,11 @@ var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
|
|
|
752
752
|
var isBuffer = nativeIsBuffer || stubFalse;
|
|
753
753
|
|
|
754
754
|
module.exports = isBuffer;
|
|
755
|
-
}(isBuffer$
|
|
755
|
+
}(isBuffer$1, isBuffer$1.exports));
|
|
756
756
|
|
|
757
|
-
var baseGetTag
|
|
757
|
+
var baseGetTag = _baseGetTag,
|
|
758
758
|
isLength = isLength_1,
|
|
759
|
-
isObjectLike
|
|
759
|
+
isObjectLike = isObjectLike_1;
|
|
760
760
|
|
|
761
761
|
/** `Object#toString` result references. */
|
|
762
762
|
var argsTag = '[object Arguments]',
|
|
@@ -809,8 +809,8 @@ typedArrayTags[weakMapTag] = false;
|
|
|
809
809
|
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
|
810
810
|
*/
|
|
811
811
|
function baseIsTypedArray$1(value) {
|
|
812
|
-
return isObjectLike
|
|
813
|
-
isLength(value.length) && !!typedArrayTags[baseGetTag
|
|
812
|
+
return isObjectLike(value) &&
|
|
813
|
+
isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
|
|
814
814
|
}
|
|
815
815
|
|
|
816
816
|
var _baseIsTypedArray = baseIsTypedArray$1;
|
|
@@ -890,28 +890,28 @@ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
|
|
890
890
|
* _.isTypedArray([]);
|
|
891
891
|
* // => false
|
|
892
892
|
*/
|
|
893
|
-
var isTypedArray$
|
|
893
|
+
var isTypedArray$1 = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
894
894
|
|
|
895
|
-
var isTypedArray_1 = isTypedArray$
|
|
895
|
+
var isTypedArray_1 = isTypedArray$1;
|
|
896
896
|
|
|
897
|
-
var baseKeys
|
|
897
|
+
var baseKeys = _baseKeys,
|
|
898
898
|
getTag = _getTag,
|
|
899
|
-
isArguments
|
|
900
|
-
isArray
|
|
901
|
-
isArrayLike
|
|
902
|
-
isBuffer
|
|
899
|
+
isArguments = isArguments_1,
|
|
900
|
+
isArray = isArray_1,
|
|
901
|
+
isArrayLike = isArrayLike_1,
|
|
902
|
+
isBuffer = isBuffer$1.exports,
|
|
903
903
|
isPrototype = _isPrototype,
|
|
904
|
-
isTypedArray
|
|
904
|
+
isTypedArray = isTypedArray_1;
|
|
905
905
|
|
|
906
906
|
/** `Object#toString` result references. */
|
|
907
907
|
var mapTag = '[object Map]',
|
|
908
908
|
setTag = '[object Set]';
|
|
909
909
|
|
|
910
910
|
/** Used for built-in method references. */
|
|
911
|
-
var objectProto$
|
|
911
|
+
var objectProto$2 = Object.prototype;
|
|
912
912
|
|
|
913
913
|
/** Used to check objects for own properties. */
|
|
914
|
-
var hasOwnProperty$
|
|
914
|
+
var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
|
|
915
915
|
|
|
916
916
|
/**
|
|
917
917
|
* Checks if `value` is an empty object, collection, map, or set.
|
|
@@ -950,9 +950,9 @@ function isEmpty(value) {
|
|
|
950
950
|
if (value == null) {
|
|
951
951
|
return true;
|
|
952
952
|
}
|
|
953
|
-
if (isArrayLike
|
|
954
|
-
(isArray
|
|
955
|
-
isBuffer
|
|
953
|
+
if (isArrayLike(value) &&
|
|
954
|
+
(isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
|
|
955
|
+
isBuffer(value) || isTypedArray(value) || isArguments(value))) {
|
|
956
956
|
return !value.length;
|
|
957
957
|
}
|
|
958
958
|
var tag = getTag(value);
|
|
@@ -960,10 +960,10 @@ function isEmpty(value) {
|
|
|
960
960
|
return !value.size;
|
|
961
961
|
}
|
|
962
962
|
if (isPrototype(value)) {
|
|
963
|
-
return !baseKeys
|
|
963
|
+
return !baseKeys(value).length;
|
|
964
964
|
}
|
|
965
965
|
for (var key in value) {
|
|
966
|
-
if (hasOwnProperty$
|
|
966
|
+
if (hasOwnProperty$2.call(value, key)) {
|
|
967
967
|
return false;
|
|
968
968
|
}
|
|
969
969
|
}
|
|
@@ -972,78 +972,17 @@ function isEmpty(value) {
|
|
|
972
972
|
|
|
973
973
|
var isEmpty_1 = isEmpty;
|
|
974
974
|
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
var interopRequireDefault = {exports: {}};
|
|
980
|
-
|
|
981
|
-
(function (module) {
|
|
982
|
-
function _interopRequireDefault(obj) {
|
|
983
|
-
return obj && obj.__esModule ? obj : {
|
|
984
|
-
"default": obj
|
|
985
|
-
};
|
|
986
|
-
}
|
|
987
|
-
|
|
988
|
-
module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
989
|
-
}(interopRequireDefault));
|
|
990
|
-
|
|
991
|
-
var defineProperty = {exports: {}};
|
|
992
|
-
|
|
993
|
-
(function (module) {
|
|
994
|
-
function _defineProperty(obj, key, value) {
|
|
995
|
-
if (key in obj) {
|
|
996
|
-
Object.defineProperty(obj, key, {
|
|
997
|
-
value: value,
|
|
998
|
-
enumerable: true,
|
|
999
|
-
configurable: true,
|
|
1000
|
-
writable: true
|
|
1001
|
-
});
|
|
1002
|
-
} else {
|
|
1003
|
-
obj[key] = value;
|
|
1004
|
-
}
|
|
1005
|
-
|
|
1006
|
-
return obj;
|
|
1007
|
-
}
|
|
1008
|
-
|
|
1009
|
-
module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
1010
|
-
}(defineProperty));
|
|
1011
|
-
|
|
1012
|
-
var _interopRequireDefault$1 = interopRequireDefault.exports;
|
|
1013
|
-
|
|
1014
|
-
Object.defineProperty(feedback, "__esModule", {
|
|
1015
|
-
value: true
|
|
1016
|
-
});
|
|
1017
|
-
feedback.getFeedbackForCorrectness = feedback.getFeedback = feedback.getActualFeedbackForCorrectness = feedback.getActualFeedback = feedback.defaults = void 0;
|
|
1018
|
-
|
|
1019
|
-
var _defineProperty2 = _interopRequireDefault$1(defineProperty.exports);
|
|
1020
|
-
|
|
1021
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1022
|
-
|
|
1023
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1024
|
-
|
|
1025
|
-
var defaults$1 = {
|
|
1026
|
-
correct: {
|
|
1027
|
-
type: 'default',
|
|
1028
|
-
"default": 'Correct',
|
|
1029
|
-
custom: 'Correct'
|
|
1030
|
-
},
|
|
1031
|
-
incorrect: {
|
|
1032
|
-
type: 'default',
|
|
1033
|
-
"default": 'Incorrect',
|
|
1034
|
-
custom: 'Incorrect'
|
|
1035
|
-
},
|
|
1036
|
-
partial: {
|
|
1037
|
-
type: 'default',
|
|
1038
|
-
"default": 'Nearly',
|
|
1039
|
-
custom: 'Nearly'
|
|
1040
|
-
},
|
|
975
|
+
const defaults$1 = {
|
|
976
|
+
correct: { type: 'default', default: 'Correct', custom: 'Correct' },
|
|
977
|
+
incorrect: { type: 'default', default: 'Incorrect', custom: 'Incorrect' },
|
|
978
|
+
partial: { type: 'default', default: 'Nearly', custom: 'Nearly' },
|
|
1041
979
|
unanswered: {
|
|
1042
980
|
type: 'default',
|
|
1043
|
-
|
|
1044
|
-
custom: 'You have not entered a response'
|
|
1045
|
-
}
|
|
981
|
+
default: 'You have not entered a response',
|
|
982
|
+
custom: 'You have not entered a response',
|
|
983
|
+
},
|
|
1046
984
|
};
|
|
985
|
+
|
|
1047
986
|
/**
|
|
1048
987
|
* @typedef {Object} FeedbackConfig
|
|
1049
988
|
* @property {'default'|'none'|'custom'} type
|
|
@@ -1056,162 +995,46 @@ var defaults$1 = {
|
|
|
1056
995
|
* @property {FeedbackConfig} partial
|
|
1057
996
|
*/
|
|
1058
997
|
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
var normalizeCorrectness = function normalizeCorrectness(c) {
|
|
998
|
+
const normalizeCorrectness = (c) => {
|
|
1062
999
|
if (c === 'partially-correct') {
|
|
1063
1000
|
return 'partial';
|
|
1064
1001
|
}
|
|
1065
|
-
|
|
1066
1002
|
return c;
|
|
1067
1003
|
};
|
|
1004
|
+
|
|
1068
1005
|
/**
|
|
1069
1006
|
* Get the feedback for the correctness
|
|
1070
1007
|
*
|
|
1071
1008
|
* @param {'correct'|'incorrect'|'partial'} correctness
|
|
1072
1009
|
* @param {Feedback} feedback
|
|
1073
1010
|
*/
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
return new Promise(function (resolve) {
|
|
1078
|
-
feedback = _objectSpread(_objectSpread({}, defaults$1), feedback);
|
|
1011
|
+
const getFeedbackForCorrectness = (correctness, feedback) =>
|
|
1012
|
+
new Promise((resolve) => {
|
|
1013
|
+
feedback = { ...defaults$1, ...feedback };
|
|
1079
1014
|
correctness = normalizeCorrectness(correctness);
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
getFeedback(fb, d[fb.type || 'default']).then(
|
|
1083
|
-
return resolve(result);
|
|
1084
|
-
});
|
|
1015
|
+
const fb = feedback[correctness] || defaults$1[correctness] || {};
|
|
1016
|
+
const d = defaults$1[correctness] || {};
|
|
1017
|
+
getFeedback(fb, d[fb.type || 'default']).then((result) => resolve(result));
|
|
1085
1018
|
});
|
|
1086
|
-
|
|
1019
|
+
|
|
1087
1020
|
/**
|
|
1088
1021
|
* Get the feedback from a {FeedbackConfig}
|
|
1089
1022
|
*
|
|
1090
1023
|
* @param {FeedbackConfig} feedback
|
|
1091
1024
|
* @param {string} fallback
|
|
1092
1025
|
*/
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
feedback.getFeedbackForCorrectness = getFeedbackForCorrectness;
|
|
1096
|
-
|
|
1097
|
-
var getFeedback = function getFeedback(feedback, fallback) {
|
|
1098
|
-
return new Promise(function (resolve) {
|
|
1026
|
+
const getFeedback = (feedback, fallback) =>
|
|
1027
|
+
new Promise((resolve) => {
|
|
1099
1028
|
if (!feedback || feedback.type === 'none') {
|
|
1100
1029
|
resolve(undefined);
|
|
1101
1030
|
return;
|
|
1102
1031
|
}
|
|
1103
|
-
|
|
1104
1032
|
feedback = feedback || {};
|
|
1105
|
-
|
|
1033
|
+
const out = feedback[feedback.type] || fallback;
|
|
1106
1034
|
resolve(out);
|
|
1107
1035
|
});
|
|
1108
|
-
}; // TODO: should replace getFeedbackForCorrectness
|
|
1109
|
-
|
|
1110
|
-
/**
|
|
1111
|
-
* Get feedback for correctness
|
|
1112
|
-
* @param {'correct'|'incorrect'|'partial'} correctness
|
|
1113
|
-
* @param {Feedback} feedback
|
|
1114
|
-
*/
|
|
1115
1036
|
|
|
1116
|
-
|
|
1117
|
-
feedback.getFeedback = getFeedback;
|
|
1118
|
-
|
|
1119
|
-
var getActualFeedbackForCorrectness = function getActualFeedbackForCorrectness(correctness, feedback) {
|
|
1120
|
-
feedback = _objectSpread(_objectSpread({}, defaults$1), feedback); // normalize correctness
|
|
1121
|
-
|
|
1122
|
-
correctness = correctness === 'partially-correct' ? 'partial' : correctness;
|
|
1123
|
-
var defaultFeedback = defaults$1[correctness] || {};
|
|
1124
|
-
var fb = feedback[correctness] || defaultFeedback;
|
|
1125
|
-
return getActualFeedback(fb, defaultFeedback[fb.type || 'default']);
|
|
1126
|
-
}; // TODO: should replace getFeedback
|
|
1127
|
-
|
|
1128
|
-
/**
|
|
1129
|
-
* Get the feedback from a {FeedbackConfig}
|
|
1130
|
-
* @param {FeedbackConfig} feedback
|
|
1131
|
-
* @param {string} fallback
|
|
1132
|
-
*/
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
feedback.getActualFeedbackForCorrectness = getActualFeedbackForCorrectness;
|
|
1136
|
-
|
|
1137
|
-
var getActualFeedback = function getActualFeedback(feedback, fallback) {
|
|
1138
|
-
if (!feedback || feedback.type === 'none') {
|
|
1139
|
-
return undefined;
|
|
1140
|
-
}
|
|
1141
|
-
|
|
1142
|
-
return feedback[feedback.type] || fallback;
|
|
1143
|
-
};
|
|
1144
|
-
|
|
1145
|
-
feedback.getActualFeedback = getActualFeedback;
|
|
1146
|
-
|
|
1147
|
-
(function (exports) {
|
|
1148
|
-
|
|
1149
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1150
|
-
value: true
|
|
1151
|
-
});
|
|
1152
|
-
Object.defineProperty(exports, "defaults", {
|
|
1153
|
-
enumerable: true,
|
|
1154
|
-
get: function get() {
|
|
1155
|
-
return _feedback.defaults;
|
|
1156
|
-
}
|
|
1157
|
-
});
|
|
1158
|
-
Object.defineProperty(exports, "getActualFeedback", {
|
|
1159
|
-
enumerable: true,
|
|
1160
|
-
get: function get() {
|
|
1161
|
-
return _feedback.getActualFeedback;
|
|
1162
|
-
}
|
|
1163
|
-
});
|
|
1164
|
-
Object.defineProperty(exports, "getActualFeedbackForCorrectness", {
|
|
1165
|
-
enumerable: true,
|
|
1166
|
-
get: function get() {
|
|
1167
|
-
return _feedback.getActualFeedbackForCorrectness;
|
|
1168
|
-
}
|
|
1169
|
-
});
|
|
1170
|
-
Object.defineProperty(exports, "getFeedback", {
|
|
1171
|
-
enumerable: true,
|
|
1172
|
-
get: function get() {
|
|
1173
|
-
return _feedback.getFeedback;
|
|
1174
|
-
}
|
|
1175
|
-
});
|
|
1176
|
-
Object.defineProperty(exports, "getFeedbackForCorrectness", {
|
|
1177
|
-
enumerable: true,
|
|
1178
|
-
get: function get() {
|
|
1179
|
-
return _feedback.getFeedbackForCorrectness;
|
|
1180
|
-
}
|
|
1181
|
-
});
|
|
1182
|
-
|
|
1183
|
-
var _feedback = feedback;
|
|
1184
|
-
|
|
1185
|
-
}(feedback$1));
|
|
1186
|
-
|
|
1187
|
-
var controllerUtils$1 = {};
|
|
1188
|
-
|
|
1189
|
-
var controllerUtils = {};
|
|
1190
|
-
|
|
1191
|
-
var _typeof = {exports: {}};
|
|
1192
|
-
|
|
1193
|
-
(function (module) {
|
|
1194
|
-
function _typeof(obj) {
|
|
1195
|
-
"@babel/helpers - typeof";
|
|
1196
|
-
|
|
1197
|
-
return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
1198
|
-
return typeof obj;
|
|
1199
|
-
} : function (obj) {
|
|
1200
|
-
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
1201
|
-
}, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
|
|
1202
|
-
}
|
|
1203
|
-
|
|
1204
|
-
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
1205
|
-
}(_typeof));
|
|
1206
|
-
|
|
1207
|
-
var partialScoring = {};
|
|
1208
|
-
|
|
1209
|
-
Object.defineProperty(partialScoring, "__esModule", {
|
|
1210
|
-
value: true
|
|
1211
|
-
});
|
|
1212
|
-
partialScoring.enabled = void 0;
|
|
1213
|
-
|
|
1214
|
-
var enabled = function enabled(config, env, defaultValue) {
|
|
1037
|
+
const enabled = (config, env, defaultValue) => {
|
|
1215
1038
|
// if model.partialScoring = false
|
|
1216
1039
|
// - if env.partialScoring = false || env.partialScoring = true => use dichotomous scoring
|
|
1217
1040
|
// else if model.partialScoring = true || undefined
|
|
@@ -1231,70 +1054,6 @@ var enabled = function enabled(config, env, defaultValue) {
|
|
|
1231
1054
|
return typeof defaultValue === 'boolean' ? defaultValue : true;
|
|
1232
1055
|
};
|
|
1233
1056
|
|
|
1234
|
-
partialScoring.enabled = enabled;
|
|
1235
|
-
|
|
1236
|
-
var persistence = {};
|
|
1237
|
-
|
|
1238
|
-
var baseGetTag = _baseGetTag,
|
|
1239
|
-
isObjectLike = isObjectLike_1;
|
|
1240
|
-
|
|
1241
|
-
/** `Object#toString` result references. */
|
|
1242
|
-
var symbolTag = '[object Symbol]';
|
|
1243
|
-
|
|
1244
|
-
/**
|
|
1245
|
-
* Checks if `value` is classified as a `Symbol` primitive or object.
|
|
1246
|
-
*
|
|
1247
|
-
* @static
|
|
1248
|
-
* @memberOf _
|
|
1249
|
-
* @since 4.0.0
|
|
1250
|
-
* @category Lang
|
|
1251
|
-
* @param {*} value The value to check.
|
|
1252
|
-
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
|
|
1253
|
-
* @example
|
|
1254
|
-
*
|
|
1255
|
-
* _.isSymbol(Symbol.iterator);
|
|
1256
|
-
* // => true
|
|
1257
|
-
*
|
|
1258
|
-
* _.isSymbol('abc');
|
|
1259
|
-
* // => false
|
|
1260
|
-
*/
|
|
1261
|
-
function isSymbol$3(value) {
|
|
1262
|
-
return typeof value == 'symbol' ||
|
|
1263
|
-
(isObjectLike(value) && baseGetTag(value) == symbolTag);
|
|
1264
|
-
}
|
|
1265
|
-
|
|
1266
|
-
var isSymbol_1 = isSymbol$3;
|
|
1267
|
-
|
|
1268
|
-
var isArray$4 = isArray_1,
|
|
1269
|
-
isSymbol$2 = isSymbol_1;
|
|
1270
|
-
|
|
1271
|
-
/** Used to match property names within property paths. */
|
|
1272
|
-
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
|
|
1273
|
-
reIsPlainProp = /^\w*$/;
|
|
1274
|
-
|
|
1275
|
-
/**
|
|
1276
|
-
* Checks if `value` is a property name and not a property path.
|
|
1277
|
-
*
|
|
1278
|
-
* @private
|
|
1279
|
-
* @param {*} value The value to check.
|
|
1280
|
-
* @param {Object} [object] The object to query keys on.
|
|
1281
|
-
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
|
|
1282
|
-
*/
|
|
1283
|
-
function isKey$1(value, object) {
|
|
1284
|
-
if (isArray$4(value)) {
|
|
1285
|
-
return false;
|
|
1286
|
-
}
|
|
1287
|
-
var type = typeof value;
|
|
1288
|
-
if (type == 'number' || type == 'symbol' || type == 'boolean' ||
|
|
1289
|
-
value == null || isSymbol$2(value)) {
|
|
1290
|
-
return true;
|
|
1291
|
-
}
|
|
1292
|
-
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
|
|
1293
|
-
(object != null && value in Object(object));
|
|
1294
|
-
}
|
|
1295
|
-
|
|
1296
|
-
var _isKey = isKey$1;
|
|
1297
|
-
|
|
1298
1057
|
var getNative = _getNative;
|
|
1299
1058
|
|
|
1300
1059
|
/* Built-in method references that are verified to be native. */
|
|
@@ -1343,10 +1102,10 @@ var nativeCreate$2 = _nativeCreate;
|
|
|
1343
1102
|
var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
|
|
1344
1103
|
|
|
1345
1104
|
/** Used for built-in method references. */
|
|
1346
|
-
var objectProto$
|
|
1105
|
+
var objectProto$1 = Object.prototype;
|
|
1347
1106
|
|
|
1348
1107
|
/** Used to check objects for own properties. */
|
|
1349
|
-
var hasOwnProperty$
|
|
1108
|
+
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
1350
1109
|
|
|
1351
1110
|
/**
|
|
1352
1111
|
* Gets the hash value for `key`.
|
|
@@ -1363,7 +1122,7 @@ function hashGet$1(key) {
|
|
|
1363
1122
|
var result = data[key];
|
|
1364
1123
|
return result === HASH_UNDEFINED$1 ? undefined : result;
|
|
1365
1124
|
}
|
|
1366
|
-
return hasOwnProperty$
|
|
1125
|
+
return hasOwnProperty$1.call(data, key) ? data[key] : undefined;
|
|
1367
1126
|
}
|
|
1368
1127
|
|
|
1369
1128
|
var _hashGet = hashGet$1;
|
|
@@ -1371,10 +1130,10 @@ var _hashGet = hashGet$1;
|
|
|
1371
1130
|
var nativeCreate$1 = _nativeCreate;
|
|
1372
1131
|
|
|
1373
1132
|
/** Used for built-in method references. */
|
|
1374
|
-
var objectProto
|
|
1133
|
+
var objectProto = Object.prototype;
|
|
1375
1134
|
|
|
1376
1135
|
/** Used to check objects for own properties. */
|
|
1377
|
-
var hasOwnProperty
|
|
1136
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
1378
1137
|
|
|
1379
1138
|
/**
|
|
1380
1139
|
* Checks if a hash value for `key` exists.
|
|
@@ -1387,7 +1146,7 @@ var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
|
1387
1146
|
*/
|
|
1388
1147
|
function hashHas$1(key) {
|
|
1389
1148
|
var data = this.__data__;
|
|
1390
|
-
return nativeCreate$1 ? (data[key] !== undefined) : hasOwnProperty
|
|
1149
|
+
return nativeCreate$1 ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
|
|
1391
1150
|
}
|
|
1392
1151
|
|
|
1393
1152
|
var _hashHas = hashHas$1;
|
|
@@ -1941,7 +1700,7 @@ var reEscapeChar = /\\(\\)?/g;
|
|
|
1941
1700
|
* @param {string} string The string to convert.
|
|
1942
1701
|
* @returns {Array} Returns the property path array.
|
|
1943
1702
|
*/
|
|
1944
|
-
|
|
1703
|
+
memoizeCapped(function(string) {
|
|
1945
1704
|
var result = [];
|
|
1946
1705
|
if (string.charCodeAt(0) === 46 /* . */) {
|
|
1947
1706
|
result.push('');
|
|
@@ -1952,720 +1711,18 @@ var stringToPath$1 = memoizeCapped(function(string) {
|
|
|
1952
1711
|
return result;
|
|
1953
1712
|
});
|
|
1954
1713
|
|
|
1955
|
-
var
|
|
1956
|
-
|
|
1957
|
-
/**
|
|
1958
|
-
* A specialized version of `_.map` for arrays without support for iteratee
|
|
1959
|
-
* shorthands.
|
|
1960
|
-
*
|
|
1961
|
-
* @private
|
|
1962
|
-
* @param {Array} [array] The array to iterate over.
|
|
1963
|
-
* @param {Function} iteratee The function invoked per iteration.
|
|
1964
|
-
* @returns {Array} Returns the new mapped array.
|
|
1965
|
-
*/
|
|
1966
|
-
|
|
1967
|
-
function arrayMap$2(array, iteratee) {
|
|
1968
|
-
var index = -1,
|
|
1969
|
-
length = array == null ? 0 : array.length,
|
|
1970
|
-
result = Array(length);
|
|
1971
|
-
|
|
1972
|
-
while (++index < length) {
|
|
1973
|
-
result[index] = iteratee(array[index], index, array);
|
|
1974
|
-
}
|
|
1975
|
-
return result;
|
|
1976
|
-
}
|
|
1977
|
-
|
|
1978
|
-
var _arrayMap = arrayMap$2;
|
|
1979
|
-
|
|
1980
|
-
var Symbol$1 = _Symbol,
|
|
1981
|
-
arrayMap$1 = _arrayMap,
|
|
1982
|
-
isArray$3 = isArray_1,
|
|
1983
|
-
isSymbol$1 = isSymbol_1;
|
|
1984
|
-
|
|
1985
|
-
/** Used as references for various `Number` constants. */
|
|
1986
|
-
var INFINITY$1 = 1 / 0;
|
|
1714
|
+
var Symbol = _Symbol;
|
|
1987
1715
|
|
|
1988
1716
|
/** Used to convert symbols to primitives and strings. */
|
|
1989
|
-
var symbolProto = Symbol
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
/**
|
|
1993
|
-
* The base implementation of `_.toString` which doesn't convert nullish
|
|
1994
|
-
* values to empty strings.
|
|
1995
|
-
*
|
|
1996
|
-
* @private
|
|
1997
|
-
* @param {*} value The value to process.
|
|
1998
|
-
* @returns {string} Returns the string.
|
|
1999
|
-
*/
|
|
2000
|
-
function baseToString$1(value) {
|
|
2001
|
-
// Exit early for strings to avoid a performance hit in some environments.
|
|
2002
|
-
if (typeof value == 'string') {
|
|
2003
|
-
return value;
|
|
2004
|
-
}
|
|
2005
|
-
if (isArray$3(value)) {
|
|
2006
|
-
// Recursively convert values (susceptible to call stack limits).
|
|
2007
|
-
return arrayMap$1(value, baseToString$1) + '';
|
|
2008
|
-
}
|
|
2009
|
-
if (isSymbol$1(value)) {
|
|
2010
|
-
return symbolToString ? symbolToString.call(value) : '';
|
|
2011
|
-
}
|
|
2012
|
-
var result = (value + '');
|
|
2013
|
-
return (result == '0' && (1 / value) == -INFINITY$1) ? '-0' : result;
|
|
2014
|
-
}
|
|
2015
|
-
|
|
2016
|
-
var _baseToString = baseToString$1;
|
|
2017
|
-
|
|
2018
|
-
var baseToString = _baseToString;
|
|
2019
|
-
|
|
2020
|
-
/**
|
|
2021
|
-
* Converts `value` to a string. An empty string is returned for `null`
|
|
2022
|
-
* and `undefined` values. The sign of `-0` is preserved.
|
|
2023
|
-
*
|
|
2024
|
-
* @static
|
|
2025
|
-
* @memberOf _
|
|
2026
|
-
* @since 4.0.0
|
|
2027
|
-
* @category Lang
|
|
2028
|
-
* @param {*} value The value to convert.
|
|
2029
|
-
* @returns {string} Returns the converted string.
|
|
2030
|
-
* @example
|
|
2031
|
-
*
|
|
2032
|
-
* _.toString(null);
|
|
2033
|
-
* // => ''
|
|
2034
|
-
*
|
|
2035
|
-
* _.toString(-0);
|
|
2036
|
-
* // => '-0'
|
|
2037
|
-
*
|
|
2038
|
-
* _.toString([1, 2, 3]);
|
|
2039
|
-
* // => '1,2,3'
|
|
2040
|
-
*/
|
|
2041
|
-
function toString$1(value) {
|
|
2042
|
-
return value == null ? '' : baseToString(value);
|
|
2043
|
-
}
|
|
2044
|
-
|
|
2045
|
-
var toString_1 = toString$1;
|
|
2046
|
-
|
|
2047
|
-
var isArray$2 = isArray_1,
|
|
2048
|
-
isKey = _isKey,
|
|
2049
|
-
stringToPath = _stringToPath,
|
|
2050
|
-
toString = toString_1;
|
|
2051
|
-
|
|
2052
|
-
/**
|
|
2053
|
-
* Casts `value` to a path array if it's not one.
|
|
2054
|
-
*
|
|
2055
|
-
* @private
|
|
2056
|
-
* @param {*} value The value to inspect.
|
|
2057
|
-
* @param {Object} [object] The object to query keys on.
|
|
2058
|
-
* @returns {Array} Returns the cast property path array.
|
|
2059
|
-
*/
|
|
2060
|
-
function castPath$1(value, object) {
|
|
2061
|
-
if (isArray$2(value)) {
|
|
2062
|
-
return value;
|
|
2063
|
-
}
|
|
2064
|
-
return isKey(value, object) ? [value] : stringToPath(toString(value));
|
|
2065
|
-
}
|
|
2066
|
-
|
|
2067
|
-
var _castPath = castPath$1;
|
|
2068
|
-
|
|
2069
|
-
var isSymbol = isSymbol_1;
|
|
2070
|
-
|
|
2071
|
-
/** Used as references for various `Number` constants. */
|
|
2072
|
-
var INFINITY = 1 / 0;
|
|
2073
|
-
|
|
2074
|
-
/**
|
|
2075
|
-
* Converts `value` to a string key if it's not a string or symbol.
|
|
2076
|
-
*
|
|
2077
|
-
* @private
|
|
2078
|
-
* @param {*} value The value to inspect.
|
|
2079
|
-
* @returns {string|symbol} Returns the key.
|
|
2080
|
-
*/
|
|
2081
|
-
function toKey$1(value) {
|
|
2082
|
-
if (typeof value == 'string' || isSymbol(value)) {
|
|
2083
|
-
return value;
|
|
2084
|
-
}
|
|
2085
|
-
var result = (value + '');
|
|
2086
|
-
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
|
|
2087
|
-
}
|
|
2088
|
-
|
|
2089
|
-
var _toKey = toKey$1;
|
|
2090
|
-
|
|
2091
|
-
var castPath = _castPath,
|
|
2092
|
-
toKey = _toKey;
|
|
2093
|
-
|
|
2094
|
-
/**
|
|
2095
|
-
* The base implementation of `_.get` without support for default values.
|
|
2096
|
-
*
|
|
2097
|
-
* @private
|
|
2098
|
-
* @param {Object} object The object to query.
|
|
2099
|
-
* @param {Array|string} path The path of the property to get.
|
|
2100
|
-
* @returns {*} Returns the resolved value.
|
|
2101
|
-
*/
|
|
2102
|
-
function baseGet$1(object, path) {
|
|
2103
|
-
path = castPath(path, object);
|
|
2104
|
-
|
|
2105
|
-
var index = 0,
|
|
2106
|
-
length = path.length;
|
|
2107
|
-
|
|
2108
|
-
while (object != null && index < length) {
|
|
2109
|
-
object = object[toKey(path[index++])];
|
|
2110
|
-
}
|
|
2111
|
-
return (index && index == length) ? object : undefined;
|
|
2112
|
-
}
|
|
2113
|
-
|
|
2114
|
-
var _baseGet = baseGet$1;
|
|
2115
|
-
|
|
2116
|
-
var baseGet = _baseGet;
|
|
2117
|
-
|
|
2118
|
-
/**
|
|
2119
|
-
* Gets the value at `path` of `object`. If the resolved value is
|
|
2120
|
-
* `undefined`, the `defaultValue` is returned in its place.
|
|
2121
|
-
*
|
|
2122
|
-
* @static
|
|
2123
|
-
* @memberOf _
|
|
2124
|
-
* @since 3.7.0
|
|
2125
|
-
* @category Object
|
|
2126
|
-
* @param {Object} object The object to query.
|
|
2127
|
-
* @param {Array|string} path The path of the property to get.
|
|
2128
|
-
* @param {*} [defaultValue] The value returned for `undefined` resolved values.
|
|
2129
|
-
* @returns {*} Returns the resolved value.
|
|
2130
|
-
* @example
|
|
2131
|
-
*
|
|
2132
|
-
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
|
|
2133
|
-
*
|
|
2134
|
-
* _.get(object, 'a[0].b.c');
|
|
2135
|
-
* // => 3
|
|
2136
|
-
*
|
|
2137
|
-
* _.get(object, ['a', '0', 'b', 'c']);
|
|
2138
|
-
* // => 3
|
|
2139
|
-
*
|
|
2140
|
-
* _.get(object, 'a.b.c', 'default');
|
|
2141
|
-
* // => 'default'
|
|
2142
|
-
*/
|
|
2143
|
-
function get(object, path, defaultValue) {
|
|
2144
|
-
var result = object == null ? undefined : baseGet(object, path);
|
|
2145
|
-
return result === undefined ? defaultValue : result;
|
|
2146
|
-
}
|
|
2147
|
-
|
|
2148
|
-
var get_1 = get;
|
|
2149
|
-
|
|
2150
|
-
/**
|
|
2151
|
-
* Copies the values of `source` to `array`.
|
|
2152
|
-
*
|
|
2153
|
-
* @private
|
|
2154
|
-
* @param {Array} source The array to copy values from.
|
|
2155
|
-
* @param {Array} [array=[]] The array to copy values to.
|
|
2156
|
-
* @returns {Array} Returns `array`.
|
|
2157
|
-
*/
|
|
2158
|
-
|
|
2159
|
-
function copyArray$1(source, array) {
|
|
2160
|
-
var index = -1,
|
|
2161
|
-
length = source.length;
|
|
2162
|
-
|
|
2163
|
-
array || (array = Array(length));
|
|
2164
|
-
while (++index < length) {
|
|
2165
|
-
array[index] = source[index];
|
|
2166
|
-
}
|
|
2167
|
-
return array;
|
|
2168
|
-
}
|
|
2169
|
-
|
|
2170
|
-
var _copyArray = copyArray$1;
|
|
2171
|
-
|
|
2172
|
-
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
2173
|
-
|
|
2174
|
-
var nativeFloor = Math.floor,
|
|
2175
|
-
nativeRandom = Math.random;
|
|
2176
|
-
|
|
2177
|
-
/**
|
|
2178
|
-
* The base implementation of `_.random` without support for returning
|
|
2179
|
-
* floating-point numbers.
|
|
2180
|
-
*
|
|
2181
|
-
* @private
|
|
2182
|
-
* @param {number} lower The lower bound.
|
|
2183
|
-
* @param {number} upper The upper bound.
|
|
2184
|
-
* @returns {number} Returns the random number.
|
|
2185
|
-
*/
|
|
2186
|
-
function baseRandom$1(lower, upper) {
|
|
2187
|
-
return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
|
|
2188
|
-
}
|
|
2189
|
-
|
|
2190
|
-
var _baseRandom = baseRandom$1;
|
|
2191
|
-
|
|
2192
|
-
var baseRandom = _baseRandom;
|
|
2193
|
-
|
|
2194
|
-
/**
|
|
2195
|
-
* A specialized version of `_.shuffle` which mutates and sets the size of `array`.
|
|
2196
|
-
*
|
|
2197
|
-
* @private
|
|
2198
|
-
* @param {Array} array The array to shuffle.
|
|
2199
|
-
* @param {number} [size=array.length] The size of `array`.
|
|
2200
|
-
* @returns {Array} Returns `array`.
|
|
2201
|
-
*/
|
|
2202
|
-
function shuffleSelf$2(array, size) {
|
|
2203
|
-
var index = -1,
|
|
2204
|
-
length = array.length,
|
|
2205
|
-
lastIndex = length - 1;
|
|
2206
|
-
|
|
2207
|
-
size = size === undefined ? length : size;
|
|
2208
|
-
while (++index < size) {
|
|
2209
|
-
var rand = baseRandom(index, lastIndex),
|
|
2210
|
-
value = array[rand];
|
|
2211
|
-
|
|
2212
|
-
array[rand] = array[index];
|
|
2213
|
-
array[index] = value;
|
|
2214
|
-
}
|
|
2215
|
-
array.length = size;
|
|
2216
|
-
return array;
|
|
2217
|
-
}
|
|
2218
|
-
|
|
2219
|
-
var _shuffleSelf = shuffleSelf$2;
|
|
2220
|
-
|
|
2221
|
-
var copyArray = _copyArray,
|
|
2222
|
-
shuffleSelf$1 = _shuffleSelf;
|
|
2223
|
-
|
|
2224
|
-
/**
|
|
2225
|
-
* A specialized version of `_.shuffle` for arrays.
|
|
2226
|
-
*
|
|
2227
|
-
* @private
|
|
2228
|
-
* @param {Array} array The array to shuffle.
|
|
2229
|
-
* @returns {Array} Returns the new shuffled array.
|
|
2230
|
-
*/
|
|
2231
|
-
function arrayShuffle$1(array) {
|
|
2232
|
-
return shuffleSelf$1(copyArray(array));
|
|
2233
|
-
}
|
|
2234
|
-
|
|
2235
|
-
var _arrayShuffle = arrayShuffle$1;
|
|
2236
|
-
|
|
2237
|
-
var arrayMap = _arrayMap;
|
|
2238
|
-
|
|
2239
|
-
/**
|
|
2240
|
-
* The base implementation of `_.values` and `_.valuesIn` which creates an
|
|
2241
|
-
* array of `object` property values corresponding to the property names
|
|
2242
|
-
* of `props`.
|
|
2243
|
-
*
|
|
2244
|
-
* @private
|
|
2245
|
-
* @param {Object} object The object to query.
|
|
2246
|
-
* @param {Array} props The property names to get values for.
|
|
2247
|
-
* @returns {Object} Returns the array of property values.
|
|
2248
|
-
*/
|
|
2249
|
-
function baseValues$1(object, props) {
|
|
2250
|
-
return arrayMap(props, function(key) {
|
|
2251
|
-
return object[key];
|
|
2252
|
-
});
|
|
2253
|
-
}
|
|
2254
|
-
|
|
2255
|
-
var _baseValues = baseValues$1;
|
|
2256
|
-
|
|
2257
|
-
/**
|
|
2258
|
-
* The base implementation of `_.times` without support for iteratee shorthands
|
|
2259
|
-
* or max array length checks.
|
|
2260
|
-
*
|
|
2261
|
-
* @private
|
|
2262
|
-
* @param {number} n The number of times to invoke `iteratee`.
|
|
2263
|
-
* @param {Function} iteratee The function invoked per iteration.
|
|
2264
|
-
* @returns {Array} Returns the array of results.
|
|
2265
|
-
*/
|
|
2266
|
-
|
|
2267
|
-
function baseTimes$1(n, iteratee) {
|
|
2268
|
-
var index = -1,
|
|
2269
|
-
result = Array(n);
|
|
2270
|
-
|
|
2271
|
-
while (++index < n) {
|
|
2272
|
-
result[index] = iteratee(index);
|
|
2273
|
-
}
|
|
2274
|
-
return result;
|
|
2275
|
-
}
|
|
2276
|
-
|
|
2277
|
-
var _baseTimes = baseTimes$1;
|
|
2278
|
-
|
|
2279
|
-
/** Used as references for various `Number` constants. */
|
|
2280
|
-
|
|
2281
|
-
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
2282
|
-
|
|
2283
|
-
/** Used to detect unsigned integer values. */
|
|
2284
|
-
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
2285
|
-
|
|
2286
|
-
/**
|
|
2287
|
-
* Checks if `value` is a valid array-like index.
|
|
2288
|
-
*
|
|
2289
|
-
* @private
|
|
2290
|
-
* @param {*} value The value to check.
|
|
2291
|
-
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
|
|
2292
|
-
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
|
|
2293
|
-
*/
|
|
2294
|
-
function isIndex$1(value, length) {
|
|
2295
|
-
var type = typeof value;
|
|
2296
|
-
length = length == null ? MAX_SAFE_INTEGER : length;
|
|
2297
|
-
|
|
2298
|
-
return !!length &&
|
|
2299
|
-
(type == 'number' ||
|
|
2300
|
-
(type != 'symbol' && reIsUint.test(value))) &&
|
|
2301
|
-
(value > -1 && value % 1 == 0 && value < length);
|
|
2302
|
-
}
|
|
2303
|
-
|
|
2304
|
-
var _isIndex = isIndex$1;
|
|
2305
|
-
|
|
2306
|
-
var baseTimes = _baseTimes,
|
|
2307
|
-
isArguments = isArguments_1,
|
|
2308
|
-
isArray$1 = isArray_1,
|
|
2309
|
-
isBuffer = isBuffer$2.exports,
|
|
2310
|
-
isIndex = _isIndex,
|
|
2311
|
-
isTypedArray = isTypedArray_1;
|
|
2312
|
-
|
|
2313
|
-
/** Used for built-in method references. */
|
|
2314
|
-
var objectProto = Object.prototype;
|
|
2315
|
-
|
|
2316
|
-
/** Used to check objects for own properties. */
|
|
2317
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
2318
|
-
|
|
2319
|
-
/**
|
|
2320
|
-
* Creates an array of the enumerable property names of the array-like `value`.
|
|
2321
|
-
*
|
|
2322
|
-
* @private
|
|
2323
|
-
* @param {*} value The value to query.
|
|
2324
|
-
* @param {boolean} inherited Specify returning inherited property names.
|
|
2325
|
-
* @returns {Array} Returns the array of property names.
|
|
2326
|
-
*/
|
|
2327
|
-
function arrayLikeKeys$1(value, inherited) {
|
|
2328
|
-
var isArr = isArray$1(value),
|
|
2329
|
-
isArg = !isArr && isArguments(value),
|
|
2330
|
-
isBuff = !isArr && !isArg && isBuffer(value),
|
|
2331
|
-
isType = !isArr && !isArg && !isBuff && isTypedArray(value),
|
|
2332
|
-
skipIndexes = isArr || isArg || isBuff || isType,
|
|
2333
|
-
result = skipIndexes ? baseTimes(value.length, String) : [],
|
|
2334
|
-
length = result.length;
|
|
2335
|
-
|
|
2336
|
-
for (var key in value) {
|
|
2337
|
-
if ((inherited || hasOwnProperty.call(value, key)) &&
|
|
2338
|
-
!(skipIndexes && (
|
|
2339
|
-
// Safari 9 has enumerable `arguments.length` in strict mode.
|
|
2340
|
-
key == 'length' ||
|
|
2341
|
-
// Node.js 0.10 has enumerable non-index properties on buffers.
|
|
2342
|
-
(isBuff && (key == 'offset' || key == 'parent')) ||
|
|
2343
|
-
// PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
2344
|
-
(isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
|
|
2345
|
-
// Skip index properties.
|
|
2346
|
-
isIndex(key, length)
|
|
2347
|
-
))) {
|
|
2348
|
-
result.push(key);
|
|
2349
|
-
}
|
|
2350
|
-
}
|
|
2351
|
-
return result;
|
|
2352
|
-
}
|
|
2353
|
-
|
|
2354
|
-
var _arrayLikeKeys = arrayLikeKeys$1;
|
|
2355
|
-
|
|
2356
|
-
var arrayLikeKeys = _arrayLikeKeys,
|
|
2357
|
-
baseKeys = _baseKeys,
|
|
2358
|
-
isArrayLike = isArrayLike_1;
|
|
2359
|
-
|
|
2360
|
-
/**
|
|
2361
|
-
* Creates an array of the own enumerable property names of `object`.
|
|
2362
|
-
*
|
|
2363
|
-
* **Note:** Non-object values are coerced to objects. See the
|
|
2364
|
-
* [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
|
|
2365
|
-
* for more details.
|
|
2366
|
-
*
|
|
2367
|
-
* @static
|
|
2368
|
-
* @since 0.1.0
|
|
2369
|
-
* @memberOf _
|
|
2370
|
-
* @category Object
|
|
2371
|
-
* @param {Object} object The object to query.
|
|
2372
|
-
* @returns {Array} Returns the array of property names.
|
|
2373
|
-
* @example
|
|
2374
|
-
*
|
|
2375
|
-
* function Foo() {
|
|
2376
|
-
* this.a = 1;
|
|
2377
|
-
* this.b = 2;
|
|
2378
|
-
* }
|
|
2379
|
-
*
|
|
2380
|
-
* Foo.prototype.c = 3;
|
|
2381
|
-
*
|
|
2382
|
-
* _.keys(new Foo);
|
|
2383
|
-
* // => ['a', 'b'] (iteration order is not guaranteed)
|
|
2384
|
-
*
|
|
2385
|
-
* _.keys('hi');
|
|
2386
|
-
* // => ['0', '1']
|
|
2387
|
-
*/
|
|
2388
|
-
function keys$1(object) {
|
|
2389
|
-
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
|
|
2390
|
-
}
|
|
2391
|
-
|
|
2392
|
-
var keys_1 = keys$1;
|
|
2393
|
-
|
|
2394
|
-
var baseValues = _baseValues,
|
|
2395
|
-
keys = keys_1;
|
|
2396
|
-
|
|
2397
|
-
/**
|
|
2398
|
-
* Creates an array of the own enumerable string keyed property values of `object`.
|
|
2399
|
-
*
|
|
2400
|
-
* **Note:** Non-object values are coerced to objects.
|
|
2401
|
-
*
|
|
2402
|
-
* @static
|
|
2403
|
-
* @since 0.1.0
|
|
2404
|
-
* @memberOf _
|
|
2405
|
-
* @category Object
|
|
2406
|
-
* @param {Object} object The object to query.
|
|
2407
|
-
* @returns {Array} Returns the array of property values.
|
|
2408
|
-
* @example
|
|
2409
|
-
*
|
|
2410
|
-
* function Foo() {
|
|
2411
|
-
* this.a = 1;
|
|
2412
|
-
* this.b = 2;
|
|
2413
|
-
* }
|
|
2414
|
-
*
|
|
2415
|
-
* Foo.prototype.c = 3;
|
|
2416
|
-
*
|
|
2417
|
-
* _.values(new Foo);
|
|
2418
|
-
* // => [1, 2] (iteration order is not guaranteed)
|
|
2419
|
-
*
|
|
2420
|
-
* _.values('hi');
|
|
2421
|
-
* // => ['h', 'i']
|
|
2422
|
-
*/
|
|
2423
|
-
function values$1(object) {
|
|
2424
|
-
return object == null ? [] : baseValues(object, keys(object));
|
|
2425
|
-
}
|
|
2426
|
-
|
|
2427
|
-
var values_1 = values$1;
|
|
2428
|
-
|
|
2429
|
-
var shuffleSelf = _shuffleSelf,
|
|
2430
|
-
values = values_1;
|
|
2431
|
-
|
|
2432
|
-
/**
|
|
2433
|
-
* The base implementation of `_.shuffle`.
|
|
2434
|
-
*
|
|
2435
|
-
* @private
|
|
2436
|
-
* @param {Array|Object} collection The collection to shuffle.
|
|
2437
|
-
* @returns {Array} Returns the new shuffled array.
|
|
2438
|
-
*/
|
|
2439
|
-
function baseShuffle$1(collection) {
|
|
2440
|
-
return shuffleSelf(values(collection));
|
|
2441
|
-
}
|
|
2442
|
-
|
|
2443
|
-
var _baseShuffle = baseShuffle$1;
|
|
2444
|
-
|
|
2445
|
-
var arrayShuffle = _arrayShuffle,
|
|
2446
|
-
baseShuffle = _baseShuffle,
|
|
2447
|
-
isArray = isArray_1;
|
|
2448
|
-
|
|
2449
|
-
/**
|
|
2450
|
-
* Creates an array of shuffled values, using a version of the
|
|
2451
|
-
* [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
|
|
2452
|
-
*
|
|
2453
|
-
* @static
|
|
2454
|
-
* @memberOf _
|
|
2455
|
-
* @since 0.1.0
|
|
2456
|
-
* @category Collection
|
|
2457
|
-
* @param {Array|Object} collection The collection to shuffle.
|
|
2458
|
-
* @returns {Array} Returns the new shuffled array.
|
|
2459
|
-
* @example
|
|
2460
|
-
*
|
|
2461
|
-
* _.shuffle([1, 2, 3, 4]);
|
|
2462
|
-
* // => [4, 1, 3, 2]
|
|
2463
|
-
*/
|
|
2464
|
-
function shuffle(collection) {
|
|
2465
|
-
var func = isArray(collection) ? arrayShuffle : baseShuffle;
|
|
2466
|
-
return func(collection);
|
|
2467
|
-
}
|
|
2468
|
-
|
|
2469
|
-
var shuffle_1 = shuffle;
|
|
2470
|
-
|
|
2471
|
-
var _interopRequireDefault = interopRequireDefault.exports;
|
|
2472
|
-
|
|
2473
|
-
Object.defineProperty(persistence, "__esModule", {
|
|
2474
|
-
value: true
|
|
2475
|
-
});
|
|
2476
|
-
persistence.lockChoices = persistence.getShuffledChoices = persistence.compact = void 0;
|
|
2477
|
-
|
|
2478
|
-
var _typeof2 = _interopRequireDefault(_typeof.exports);
|
|
2479
|
-
|
|
2480
|
-
var _get = _interopRequireDefault(get_1);
|
|
2481
|
-
|
|
2482
|
-
var _shuffle = _interopRequireDefault(shuffle_1);
|
|
2483
|
-
|
|
2484
|
-
var _isEmpty = _interopRequireDefault(isEmpty_1);
|
|
1717
|
+
var symbolProto = Symbol ? Symbol.prototype : undefined;
|
|
1718
|
+
symbolProto ? symbolProto.toString : undefined;
|
|
2485
1719
|
|
|
2486
1720
|
// eslint-disable-next-line no-console
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
var log = lg('log');
|
|
2493
|
-
var warn = lg('warn');
|
|
2494
|
-
var error = lg('error');
|
|
2495
|
-
|
|
2496
|
-
var compact = function compact(arr) {
|
|
2497
|
-
if (Array.isArray(arr)) {
|
|
2498
|
-
return arr.filter(function (v) {
|
|
2499
|
-
return v !== null && v !== undefined;
|
|
2500
|
-
});
|
|
2501
|
-
}
|
|
2502
|
-
|
|
2503
|
-
return arr;
|
|
2504
|
-
};
|
|
2505
|
-
|
|
2506
|
-
persistence.compact = compact;
|
|
2507
|
-
|
|
2508
|
-
var getShuffledChoices = function getShuffledChoices(choices, session, updateSession, choiceKey) {
|
|
2509
|
-
return new Promise(function (resolve) {
|
|
2510
|
-
var _session$data;
|
|
2511
|
-
|
|
2512
|
-
log('updateSession type: ', (0, _typeof2["default"])(updateSession));
|
|
2513
|
-
log('session: ', session);
|
|
2514
|
-
var currentShuffled = compact((session === null || session === void 0 ? void 0 : (_session$data = session.data) === null || _session$data === void 0 ? void 0 : _session$data.shuffledValues) || (session === null || session === void 0 ? void 0 : session.shuffledValues) || []);
|
|
2515
|
-
|
|
2516
|
-
if (!session) {
|
|
2517
|
-
// eslint-disable-next-line quotes
|
|
2518
|
-
warn("unable to save shuffled choices because there's no session.");
|
|
2519
|
-
resolve(undefined);
|
|
2520
|
-
} else if (!(0, _isEmpty["default"])(currentShuffled)) {
|
|
2521
|
-
var _session$data2;
|
|
2522
|
-
|
|
2523
|
-
debug('use shuffledValues to sort the choices...', (_session$data2 = session.data) === null || _session$data2 === void 0 ? void 0 : _session$data2.shuffledValues);
|
|
2524
|
-
resolve(compact(currentShuffled.map(function (v) {
|
|
2525
|
-
return choices.find(function (c) {
|
|
2526
|
-
return c[choiceKey] === v;
|
|
2527
|
-
});
|
|
2528
|
-
})));
|
|
2529
|
-
} else {
|
|
2530
|
-
var shuffledChoices = (0, _shuffle["default"])(choices);
|
|
2531
|
-
|
|
2532
|
-
if (updateSession && typeof updateSession === 'function') {
|
|
2533
|
-
try {
|
|
2534
|
-
//Note: session.id refers to the id of the element within a session
|
|
2535
|
-
var shuffledValues = compact(shuffledChoices.map(function (c) {
|
|
2536
|
-
return c[choiceKey];
|
|
2537
|
-
}));
|
|
2538
|
-
log('try to save shuffledValues to session...', shuffledValues);
|
|
2539
|
-
log('call updateSession... ', session.id, session.element);
|
|
2540
|
-
|
|
2541
|
-
if ((0, _isEmpty["default"])(shuffledValues)) {
|
|
2542
|
-
error("shuffledValues is an empty array? - refusing to call updateSession: shuffledChoices: ".concat(JSON.stringify(shuffledChoices), ", key: ").concat(choiceKey));
|
|
2543
|
-
} else {
|
|
2544
|
-
updateSession(session.id, session.element, {
|
|
2545
|
-
shuffledValues: shuffledValues
|
|
2546
|
-
})["catch"](function (e) {
|
|
2547
|
-
return (// eslint-disable-next-line no-console
|
|
2548
|
-
console.error('update session failed for: ', session.id, e)
|
|
2549
|
-
);
|
|
2550
|
-
});
|
|
2551
|
-
}
|
|
2552
|
-
} catch (e) {
|
|
2553
|
-
warn('unable to save shuffled order for choices');
|
|
2554
|
-
error(e);
|
|
2555
|
-
}
|
|
2556
|
-
} else {
|
|
2557
|
-
warn('unable to save shuffled choices, shuffle will happen every time.');
|
|
2558
|
-
} //save this shuffle to the session for later retrieval
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
resolve(shuffledChoices);
|
|
2562
|
-
}
|
|
2563
|
-
});
|
|
2564
|
-
};
|
|
2565
|
-
/**
|
|
2566
|
-
* If we return:
|
|
2567
|
-
* - true - that means that the order of the choices will be ordinal (as is created in the configure item)
|
|
2568
|
-
* - false - that means the getShuffledChoices above will be called and that in turn means that we either
|
|
2569
|
-
* return the shuffled values on the session (if any exists) or we shuffle the choices
|
|
2570
|
-
* @param model - model to check if we should lock order
|
|
2571
|
-
* @param session - session to check if we should lock order
|
|
2572
|
-
* @param env - env to check if we should lock order
|
|
2573
|
-
* @returns {boolean}
|
|
2574
|
-
*/
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
persistence.getShuffledChoices = getShuffledChoices;
|
|
2578
|
-
|
|
2579
|
-
var lockChoices = function lockChoices(model, session, env) {
|
|
2580
|
-
if (model.lockChoiceOrder) {
|
|
2581
|
-
return true;
|
|
2582
|
-
}
|
|
2583
|
-
|
|
2584
|
-
log('lockChoiceOrder: ', (0, _get["default"])(env, ['@pie-element', 'lockChoiceOrder'], false));
|
|
2585
|
-
|
|
2586
|
-
if ((0, _get["default"])(env, ['@pie-element', 'lockChoiceOrder'], false)) {
|
|
2587
|
-
return true;
|
|
2588
|
-
}
|
|
2589
|
-
|
|
2590
|
-
var role = (0, _get["default"])(env, 'role', 'student');
|
|
2591
|
-
|
|
2592
|
-
if (role === 'instructor') {
|
|
2593
|
-
// TODO: .. in the future the instructor can toggle between ordinal and shuffled here, so keeping this code until then
|
|
2594
|
-
|
|
2595
|
-
/*const alreadyShuffled = hasShuffledValues(session);
|
|
2596
|
-
if (alreadyShuffled) {
|
|
2597
|
-
return false;
|
|
2598
|
-
}
|
|
2599
|
-
return true;*/
|
|
2600
|
-
return true;
|
|
2601
|
-
} // here it's a student, so don't lock and it will shuffle if needs be
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
return false;
|
|
2605
|
-
};
|
|
2606
|
-
|
|
2607
|
-
persistence.lockChoices = lockChoices;
|
|
2608
|
-
|
|
2609
|
-
(function (exports) {
|
|
2610
|
-
|
|
2611
|
-
var _typeof$1 = _typeof.exports;
|
|
2612
|
-
|
|
2613
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2614
|
-
value: true
|
|
2615
|
-
});
|
|
2616
|
-
Object.defineProperty(exports, "getShuffledChoices", {
|
|
2617
|
-
enumerable: true,
|
|
2618
|
-
get: function get() {
|
|
2619
|
-
return _persistence.getShuffledChoices;
|
|
2620
|
-
}
|
|
2621
|
-
});
|
|
2622
|
-
Object.defineProperty(exports, "lockChoices", {
|
|
2623
|
-
enumerable: true,
|
|
2624
|
-
get: function get() {
|
|
2625
|
-
return _persistence.lockChoices;
|
|
2626
|
-
}
|
|
2627
|
-
});
|
|
2628
|
-
exports.partialScoring = void 0;
|
|
2629
|
-
|
|
2630
|
-
var partialScoring$1 = _interopRequireWildcard(partialScoring);
|
|
2631
|
-
|
|
2632
|
-
exports.partialScoring = partialScoring$1;
|
|
2633
|
-
|
|
2634
|
-
var _persistence = persistence;
|
|
2635
|
-
|
|
2636
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
2637
|
-
|
|
2638
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof$1(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
2639
|
-
|
|
2640
|
-
}(controllerUtils));
|
|
2641
|
-
|
|
2642
|
-
(function (exports) {
|
|
2643
|
-
|
|
2644
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2645
|
-
value: true
|
|
2646
|
-
});
|
|
2647
|
-
Object.defineProperty(exports, "getShuffledChoices", {
|
|
2648
|
-
enumerable: true,
|
|
2649
|
-
get: function get() {
|
|
2650
|
-
return _controllerUtils.getShuffledChoices;
|
|
2651
|
-
}
|
|
2652
|
-
});
|
|
2653
|
-
Object.defineProperty(exports, "lockChoices", {
|
|
2654
|
-
enumerable: true,
|
|
2655
|
-
get: function get() {
|
|
2656
|
-
return _controllerUtils.lockChoices;
|
|
2657
|
-
}
|
|
2658
|
-
});
|
|
2659
|
-
Object.defineProperty(exports, "partialScoring", {
|
|
2660
|
-
enumerable: true,
|
|
2661
|
-
get: function get() {
|
|
2662
|
-
return _controllerUtils.partialScoring;
|
|
2663
|
-
}
|
|
2664
|
-
});
|
|
2665
|
-
|
|
2666
|
-
var _controllerUtils = controllerUtils;
|
|
2667
|
-
|
|
2668
|
-
}(controllerUtils$1));
|
|
1721
|
+
const lg = (n) => console[n].bind(console, 'controller-utils:');
|
|
1722
|
+
lg('debug');
|
|
1723
|
+
lg('log');
|
|
1724
|
+
lg('warn');
|
|
1725
|
+
lg('error');
|
|
2669
1726
|
|
|
2670
1727
|
var defaults = {
|
|
2671
1728
|
feedbackEnabled: false,
|
|
@@ -2757,11 +1814,11 @@ const outcome = (question, session, env) =>
|
|
|
2757
1814
|
if (env.mode !== 'evaluate') {
|
|
2758
1815
|
resolve({ score: undefined, completed: undefined });
|
|
2759
1816
|
} else {
|
|
2760
|
-
const enabled =
|
|
1817
|
+
const enabled$1 = enabled(question, env, true);
|
|
2761
1818
|
const totalCorrect = question.tokens.filter((t) => t.correct);
|
|
2762
1819
|
const score = getPartialScore(question, session, totalCorrect);
|
|
2763
1820
|
resolve({
|
|
2764
|
-
score: enabled ? score : score === 1 ? 1 : 0,
|
|
1821
|
+
score: enabled$1 ? score : score === 1 ? 1 : 0,
|
|
2765
1822
|
});
|
|
2766
1823
|
}
|
|
2767
1824
|
});
|
|
@@ -2790,7 +1847,7 @@ const model = (question, session, env) => {
|
|
|
2790
1847
|
|
|
2791
1848
|
const fb =
|
|
2792
1849
|
env.mode === 'evaluate' && normalizedQuestion.feedbackEnabled
|
|
2793
|
-
?
|
|
1850
|
+
? getFeedbackForCorrectness(correctness, normalizedQuestion.feedback)
|
|
2794
1851
|
: Promise.resolve(undefined);
|
|
2795
1852
|
|
|
2796
1853
|
fb.then((feedback) => {
|