@micromag/screen-quiz 0.3.767 → 0.3.769
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/es/index.js +25 -11
- package/package.json +15 -15
package/es/index.js
CHANGED
|
@@ -742,7 +742,8 @@ var QuizScreen = function QuizScreen(_ref) {
|
|
|
742
742
|
trackScreenEvent('click_answer', "".concat(userAnswerIndex + 1, ": ").concat(answer.label.body), {
|
|
743
743
|
linkType: 'quiz_answer',
|
|
744
744
|
answer: answer,
|
|
745
|
-
answerIndex: answerI
|
|
745
|
+
answerIndex: answerI,
|
|
746
|
+
isGood: answer.good || false
|
|
746
747
|
});
|
|
747
748
|
}, [userAnswerIndex, setUserAnswerIndex, trackScreenEvent, answers]);
|
|
748
749
|
useEffect(function () {
|
|
@@ -1372,11 +1373,24 @@ var QuizMultipleScreen = function QuizMultipleScreen(_ref) {
|
|
|
1372
1373
|
return currentPoints >= (lastPoints || 0) && currentPoints >= points ? result : lastResult;
|
|
1373
1374
|
}, null);
|
|
1374
1375
|
}, [isResults, results, currentPoints, stateId, stateIndex]);
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1376
|
+
useEffect(function () {
|
|
1377
|
+
if (currentResult !== null && isResults) {
|
|
1378
|
+
var _ref10 = currentResult || {},
|
|
1379
|
+
_ref10$title = _ref10.title,
|
|
1380
|
+
resultTitle = _ref10$title === void 0 ? null : _ref10$title,
|
|
1381
|
+
_ref10$points = _ref10.points,
|
|
1382
|
+
points = _ref10$points === void 0 ? null : _ref10$points;
|
|
1383
|
+
trackScreenEvent('view_result', "Result: ".concat((resultTitle === null || resultTitle === void 0 ? void 0 : resultTitle.body) || 'No title'), {
|
|
1384
|
+
resultPoints: points || null,
|
|
1385
|
+
userPoints: currentPoints || null
|
|
1386
|
+
});
|
|
1387
|
+
}
|
|
1388
|
+
}, [currentResult, currentPoints, isResults, trackScreenEvent]);
|
|
1389
|
+
var _ref11 = currentResult || {},
|
|
1390
|
+
_ref11$background = _ref11.background,
|
|
1391
|
+
resultBackground = _ref11$background === void 0 ? null : _ref11$background,
|
|
1392
|
+
_ref11$layout = _ref11.layout,
|
|
1393
|
+
resultLayout = _ref11$layout === void 0 ? null : _ref11$layout;
|
|
1380
1394
|
var _useQuizCreate = useQuizCreate({
|
|
1381
1395
|
screenId: screenId
|
|
1382
1396
|
}),
|
|
@@ -1436,8 +1450,8 @@ var QuizMultipleScreen = function QuizMultipleScreen(_ref) {
|
|
|
1436
1450
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
1437
1451
|
scrolledBottom = _useState6[0],
|
|
1438
1452
|
setScrolledBottom = _useState6[1];
|
|
1439
|
-
var onScrolledBottom = useCallback(function (
|
|
1440
|
-
var initial =
|
|
1453
|
+
var onScrolledBottom = useCallback(function (_ref12) {
|
|
1454
|
+
var initial = _ref12.initial;
|
|
1441
1455
|
if (initial) {
|
|
1442
1456
|
trackScreenEvent('scroll', 'Screen');
|
|
1443
1457
|
}
|
|
@@ -1450,9 +1464,9 @@ var QuizMultipleScreen = function QuizMultipleScreen(_ref) {
|
|
|
1450
1464
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
1451
1465
|
hasScroll = _useState8[0],
|
|
1452
1466
|
setHasScroll = _useState8[1];
|
|
1453
|
-
var onScrollHeightChange = useCallback(function (
|
|
1454
|
-
var
|
|
1455
|
-
canScroll =
|
|
1467
|
+
var onScrollHeightChange = useCallback(function (_ref13) {
|
|
1468
|
+
var _ref13$canScroll = _ref13.canScroll,
|
|
1469
|
+
canScroll = _ref13$canScroll === void 0 ? false : _ref13$canScroll;
|
|
1456
1470
|
setHasScroll(canScroll);
|
|
1457
1471
|
}, [setHasScroll]);
|
|
1458
1472
|
var onQuizReset = useCallback(function () {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-quiz",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.769",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -63,19 +63,19 @@
|
|
|
63
63
|
"@fortawesome/fontawesome-svg-core": "^6.5.2",
|
|
64
64
|
"@fortawesome/free-solid-svg-icons": "^6.5.2",
|
|
65
65
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
66
|
-
"@micromag/core": "^0.3.
|
|
67
|
-
"@micromag/data": "^0.3.
|
|
68
|
-
"@micromag/element-background": "^0.3.
|
|
69
|
-
"@micromag/element-button": "^0.3.
|
|
70
|
-
"@micromag/element-container": "^0.3.
|
|
71
|
-
"@micromag/element-footer": "^0.3.
|
|
72
|
-
"@micromag/element-header": "^0.3.
|
|
73
|
-
"@micromag/element-heading": "^0.3.
|
|
74
|
-
"@micromag/element-layout": "^0.3.
|
|
75
|
-
"@micromag/element-scroll": "^0.3.
|
|
76
|
-
"@micromag/element-text": "^0.3.
|
|
77
|
-
"@micromag/element-visual": "^0.3.
|
|
78
|
-
"@micromag/transforms": "^0.3.
|
|
66
|
+
"@micromag/core": "^0.3.769",
|
|
67
|
+
"@micromag/data": "^0.3.769",
|
|
68
|
+
"@micromag/element-background": "^0.3.769",
|
|
69
|
+
"@micromag/element-button": "^0.3.769",
|
|
70
|
+
"@micromag/element-container": "^0.3.769",
|
|
71
|
+
"@micromag/element-footer": "^0.3.769",
|
|
72
|
+
"@micromag/element-header": "^0.3.769",
|
|
73
|
+
"@micromag/element-heading": "^0.3.769",
|
|
74
|
+
"@micromag/element-layout": "^0.3.769",
|
|
75
|
+
"@micromag/element-scroll": "^0.3.769",
|
|
76
|
+
"@micromag/element-text": "^0.3.769",
|
|
77
|
+
"@micromag/element-visual": "^0.3.769",
|
|
78
|
+
"@micromag/transforms": "^0.3.769",
|
|
79
79
|
"@react-spring/core": "^9.6.1",
|
|
80
80
|
"@react-spring/web": "^9.6.1",
|
|
81
81
|
"classnames": "^2.2.6",
|
|
@@ -89,5 +89,5 @@
|
|
|
89
89
|
"access": "public",
|
|
90
90
|
"registry": "https://registry.npmjs.org/"
|
|
91
91
|
},
|
|
92
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "a009106ec28c6e34288f0b3292f1bc6826812dd0"
|
|
93
93
|
}
|