@pie-element/select-text 11.0.2-esm.0 → 11.0.3-esm.0
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/package.json +4 -4
- package/controller/package.json +3 -3
- package/esm/configure.js +318 -2
- package/esm/configure.js.map +1 -1
- package/module/configure.js +1 -1
- package/module/controller.js +25 -26
- package/module/element.js +1 -1
- package/module/index.html +1 -1
- package/module/manifest.json +1 -1
- package/module/print.html +1 -1
- package/module/print.js +1 -1
- package/package.json +6 -6
package/module/controller.js
CHANGED
|
@@ -972,26 +972,25 @@ function isEmpty(value) {
|
|
|
972
972
|
|
|
973
973
|
var isEmpty_1 = isEmpty;
|
|
974
974
|
|
|
975
|
-
function
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
return obj;
|
|
988
|
-
}
|
|
975
|
+
function _extends() {
|
|
976
|
+
_extends = Object.assign || function (target) {
|
|
977
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
978
|
+
var source = arguments[i];
|
|
979
|
+
|
|
980
|
+
for (var key in source) {
|
|
981
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
982
|
+
target[key] = source[key];
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
}
|
|
989
986
|
|
|
990
|
-
|
|
987
|
+
return target;
|
|
988
|
+
};
|
|
991
989
|
|
|
992
|
-
|
|
990
|
+
return _extends.apply(this, arguments);
|
|
991
|
+
}
|
|
993
992
|
|
|
994
|
-
|
|
993
|
+
const defaults$1 = {
|
|
995
994
|
correct: {
|
|
996
995
|
type: 'default',
|
|
997
996
|
default: 'Correct',
|
|
@@ -1025,7 +1024,7 @@ var defaults$1 = {
|
|
|
1025
1024
|
* @property {FeedbackConfig} partial
|
|
1026
1025
|
*/
|
|
1027
1026
|
|
|
1028
|
-
|
|
1027
|
+
const normalizeCorrectness = c => {
|
|
1029
1028
|
if (c === 'partially-correct') {
|
|
1030
1029
|
return 'partial';
|
|
1031
1030
|
}
|
|
@@ -1040,11 +1039,11 @@ var normalizeCorrectness = c => {
|
|
|
1040
1039
|
*/
|
|
1041
1040
|
|
|
1042
1041
|
|
|
1043
|
-
|
|
1044
|
-
feedback =
|
|
1042
|
+
const getFeedbackForCorrectness = (correctness, feedback) => new Promise(resolve => {
|
|
1043
|
+
feedback = _extends({}, defaults$1, feedback);
|
|
1045
1044
|
correctness = normalizeCorrectness(correctness);
|
|
1046
|
-
|
|
1047
|
-
|
|
1045
|
+
const fb = feedback[correctness] || defaults$1[correctness] || {};
|
|
1046
|
+
const d = defaults$1[correctness] || {};
|
|
1048
1047
|
getFeedback(fb, d[fb.type || 'default']).then(result => resolve(result));
|
|
1049
1048
|
});
|
|
1050
1049
|
/**
|
|
@@ -1054,14 +1053,14 @@ var getFeedbackForCorrectness = (correctness, feedback) => new Promise(resolve =
|
|
|
1054
1053
|
* @param {string} fallback
|
|
1055
1054
|
*/
|
|
1056
1055
|
|
|
1057
|
-
|
|
1056
|
+
const getFeedback = (feedback, fallback) => new Promise(resolve => {
|
|
1058
1057
|
if (!feedback || feedback.type === 'none') {
|
|
1059
1058
|
resolve(undefined);
|
|
1060
1059
|
return;
|
|
1061
1060
|
}
|
|
1062
1061
|
|
|
1063
1062
|
feedback = feedback || {};
|
|
1064
|
-
|
|
1063
|
+
const out = feedback[feedback.type] || fallback;
|
|
1065
1064
|
resolve(out);
|
|
1066
1065
|
}); // TODO: should replace getFeedbackForCorrectness
|
|
1067
1066
|
|
|
@@ -1728,7 +1727,7 @@ var Symbol = _Symbol;
|
|
|
1728
1727
|
var symbolProto = Symbol ? Symbol.prototype : undefined;
|
|
1729
1728
|
symbolProto ? symbolProto.toString : undefined;
|
|
1730
1729
|
|
|
1731
|
-
|
|
1730
|
+
const enabled = (config, env, defaultValue) => {
|
|
1732
1731
|
// if model.partialScoring = false
|
|
1733
1732
|
// - if env.partialScoring = false || env.partialScoring = true => use dichotomous scoring
|
|
1734
1733
|
// else if model.partialScoring = true || undefined
|
|
@@ -1753,7 +1752,7 @@ var partialScoring = /*#__PURE__*/Object.freeze({
|
|
|
1753
1752
|
enabled: enabled
|
|
1754
1753
|
});
|
|
1755
1754
|
|
|
1756
|
-
|
|
1755
|
+
const lg = n => console[n].bind(console, 'controller-utils:');
|
|
1757
1756
|
|
|
1758
1757
|
lg('debug');
|
|
1759
1758
|
lg('log');
|