@micromag/screen-quiz 0.3.417 → 0.3.419
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 +6 -3
- package/lib/index.js +6 -3
- package/package.json +15 -15
package/es/index.js
CHANGED
|
@@ -664,6 +664,9 @@ var QuizScreen = function QuizScreen(_ref) {
|
|
|
664
664
|
}
|
|
665
665
|
}, [isEdit, current, userAnswerIndex, setUserAnswerIndex]);
|
|
666
666
|
useEffect(function () {
|
|
667
|
+
if (!isView) {
|
|
668
|
+
return;
|
|
669
|
+
}
|
|
667
670
|
if (userAnswerIndex !== null) {
|
|
668
671
|
var _ref2 = userAnswerIndex !== null && answers ? answers[userAnswerIndex] : {},
|
|
669
672
|
_ref2$good = _ref2.good,
|
|
@@ -678,7 +681,7 @@ var QuizScreen = function QuizScreen(_ref) {
|
|
|
678
681
|
value: isGood ? 1 : 0
|
|
679
682
|
});
|
|
680
683
|
}
|
|
681
|
-
}, [userAnswerIndex, answers, submitQuiz]);
|
|
684
|
+
}, [isView, userAnswerIndex, answers, submitQuiz]);
|
|
682
685
|
var scrollingDisabled = !isEdit && transitionDisabled || !current;
|
|
683
686
|
var _useState3 = useState(false),
|
|
684
687
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
@@ -1251,14 +1254,14 @@ var QuizMultipleScreen = function QuizMultipleScreen(_ref) {
|
|
|
1251
1254
|
}),
|
|
1252
1255
|
submitQuiz = _useQuizCreate.create;
|
|
1253
1256
|
useEffect(function () {
|
|
1254
|
-
if (!isResults ||
|
|
1257
|
+
if (!isResults || !isView) {
|
|
1255
1258
|
return;
|
|
1256
1259
|
}
|
|
1257
1260
|
submitQuiz({
|
|
1258
1261
|
choice: userAnswers,
|
|
1259
1262
|
value: currentPoints
|
|
1260
1263
|
});
|
|
1261
|
-
}, [isResults, userAnswers, submitQuiz]);
|
|
1264
|
+
}, [isView, isResults, userAnswers, submitQuiz]);
|
|
1262
1265
|
|
|
1263
1266
|
// Switch state
|
|
1264
1267
|
useEffect(function () {
|
package/lib/index.js
CHANGED
|
@@ -688,6 +688,9 @@ var QuizScreen = function QuizScreen(_ref) {
|
|
|
688
688
|
}
|
|
689
689
|
}, [isEdit, current, userAnswerIndex, setUserAnswerIndex]);
|
|
690
690
|
React.useEffect(function () {
|
|
691
|
+
if (!isView) {
|
|
692
|
+
return;
|
|
693
|
+
}
|
|
691
694
|
if (userAnswerIndex !== null) {
|
|
692
695
|
var _ref2 = userAnswerIndex !== null && answers ? answers[userAnswerIndex] : {},
|
|
693
696
|
_ref2$good = _ref2.good,
|
|
@@ -702,7 +705,7 @@ var QuizScreen = function QuizScreen(_ref) {
|
|
|
702
705
|
value: isGood ? 1 : 0
|
|
703
706
|
});
|
|
704
707
|
}
|
|
705
|
-
}, [userAnswerIndex, answers, submitQuiz]);
|
|
708
|
+
}, [isView, userAnswerIndex, answers, submitQuiz]);
|
|
706
709
|
var scrollingDisabled = !isEdit && transitionDisabled || !current;
|
|
707
710
|
var _useState3 = React.useState(false),
|
|
708
711
|
_useState4 = _slicedToArray__default["default"](_useState3, 2),
|
|
@@ -1275,14 +1278,14 @@ var QuizMultipleScreen = function QuizMultipleScreen(_ref) {
|
|
|
1275
1278
|
}),
|
|
1276
1279
|
submitQuiz = _useQuizCreate.create;
|
|
1277
1280
|
React.useEffect(function () {
|
|
1278
|
-
if (!isResults ||
|
|
1281
|
+
if (!isResults || !isView) {
|
|
1279
1282
|
return;
|
|
1280
1283
|
}
|
|
1281
1284
|
submitQuiz({
|
|
1282
1285
|
choice: userAnswers,
|
|
1283
1286
|
value: currentPoints
|
|
1284
1287
|
});
|
|
1285
|
-
}, [isResults, userAnswers, submitQuiz]);
|
|
1288
|
+
}, [isView, isResults, userAnswers, submitQuiz]);
|
|
1286
1289
|
|
|
1287
1290
|
// Switch state
|
|
1288
1291
|
React.useEffect(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.419",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -53,19 +53,19 @@
|
|
|
53
53
|
"@fortawesome/fontawesome-svg-core": "^1.2.32",
|
|
54
54
|
"@fortawesome/free-solid-svg-icons": "^5.15.1",
|
|
55
55
|
"@fortawesome/react-fontawesome": "^0.1.13",
|
|
56
|
-
"@micromag/core": "^0.3.
|
|
57
|
-
"@micromag/data": "^0.3.
|
|
58
|
-
"@micromag/element-background": "^0.3.
|
|
59
|
-
"@micromag/element-button": "^0.3.
|
|
60
|
-
"@micromag/element-container": "^0.3.
|
|
61
|
-
"@micromag/element-footer": "^0.3.
|
|
62
|
-
"@micromag/element-header": "^0.3.
|
|
63
|
-
"@micromag/element-heading": "^0.3.
|
|
64
|
-
"@micromag/element-layout": "^0.3.
|
|
65
|
-
"@micromag/element-scroll": "^0.3.
|
|
66
|
-
"@micromag/element-text": "^0.3.
|
|
67
|
-
"@micromag/element-visual": "^0.3.
|
|
68
|
-
"@micromag/transforms": "^0.3.
|
|
56
|
+
"@micromag/core": "^0.3.418",
|
|
57
|
+
"@micromag/data": "^0.3.418",
|
|
58
|
+
"@micromag/element-background": "^0.3.418",
|
|
59
|
+
"@micromag/element-button": "^0.3.418",
|
|
60
|
+
"@micromag/element-container": "^0.3.418",
|
|
61
|
+
"@micromag/element-footer": "^0.3.418",
|
|
62
|
+
"@micromag/element-header": "^0.3.418",
|
|
63
|
+
"@micromag/element-heading": "^0.3.418",
|
|
64
|
+
"@micromag/element-layout": "^0.3.418",
|
|
65
|
+
"@micromag/element-scroll": "^0.3.418",
|
|
66
|
+
"@micromag/element-text": "^0.3.418",
|
|
67
|
+
"@micromag/element-visual": "^0.3.418",
|
|
68
|
+
"@micromag/transforms": "^0.3.418",
|
|
69
69
|
"@react-spring/core": "^9.6.1",
|
|
70
70
|
"@react-spring/web": "^9.6.1",
|
|
71
71
|
"classnames": "^2.2.6",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"access": "public",
|
|
80
80
|
"registry": "https://registry.npmjs.org/"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "bb157b313431174b2ea43649e3049b76e5922c21"
|
|
83
83
|
}
|