@micromag/screen-quiz 0.3.649 → 0.3.652
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 +11 -11
- package/package.json +15 -15
package/es/index.js
CHANGED
|
@@ -450,14 +450,14 @@ var Question = function Question(_ref) {
|
|
|
450
450
|
var answered = answeredIndex !== null;
|
|
451
451
|
var answer = answeredIndex !== null && answers[answeredIndex] ? answers[answeredIndex] : null;
|
|
452
452
|
var _ref3 = answer || {},
|
|
453
|
-
_ref3$
|
|
454
|
-
|
|
453
|
+
_ref3$result = _ref3.result,
|
|
454
|
+
answerResult = _ref3$result === undefined ? null : _ref3$result,
|
|
455
455
|
_ref3$answerImage = _ref3.answerImage,
|
|
456
456
|
answerImage = _ref3$answerImage === undefined ? null : _ref3$answerImage;
|
|
457
|
-
var hasResult = isTextFilled(
|
|
457
|
+
var hasResult = isTextFilled(answerResult) || isTextFilled(result);
|
|
458
458
|
var hasResultVisual = isImageFilled(answerImage) || isImageFilled(resultImage);
|
|
459
459
|
var defaultResult = isTextFilled(result) ? result : null;
|
|
460
|
-
var customResult = isTextFilled(
|
|
460
|
+
var customResult = isTextFilled(answerResult) ? answerResult : null;
|
|
461
461
|
var finalResult = customResult || defaultResult;
|
|
462
462
|
var _ref4 = finalResult || {},
|
|
463
463
|
_ref4$textStyle = _ref4.textStyle,
|
|
@@ -764,7 +764,7 @@ var QuizScreen = function QuizScreen(_ref) {
|
|
|
764
764
|
}, [numberOfAnswers, onQuizReset]);
|
|
765
765
|
var isSplitted = layout === 'split';
|
|
766
766
|
var verticalAlign = isSplitted ? null : layout;
|
|
767
|
-
var showReset = isEdit;
|
|
767
|
+
var showReset = isEdit && userAnswerIndex !== null;
|
|
768
768
|
return /*#__PURE__*/React.createElement("div", {
|
|
769
769
|
className: classNames([styles$2.container, _defineProperty(_defineProperty({}, styles$2.disabled, clickDisabled), className, className !== null)]),
|
|
770
770
|
"data-screen-ready": true
|
|
@@ -1259,13 +1259,13 @@ var QuizMultipleScreen = function QuizMultipleScreen(_ref) {
|
|
|
1259
1259
|
var currentAnsweredIndex = userAnswers !== null && typeof userAnswers[questionIndex] !== 'undefined' ? userAnswers[questionIndex] : null;
|
|
1260
1260
|
var answer = currentAnsweredIndex !== null && typeof answers[currentAnsweredIndex] !== 'undefined' ? answers[currentAnsweredIndex] : null;
|
|
1261
1261
|
var _ref5 = answer || {},
|
|
1262
|
-
_ref5$
|
|
1263
|
-
|
|
1264
|
-
var
|
|
1262
|
+
_ref5$result = _ref5.result,
|
|
1263
|
+
answerResult = _ref5$result === undefined ? null : _ref5$result;
|
|
1264
|
+
var firstCustomResult = (answers || []).find(function () {
|
|
1265
1265
|
var it = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
1266
|
-
return (it === null || it === undefined ? undefined : it.
|
|
1266
|
+
return (it === null || it === undefined ? undefined : it.result) !== null;
|
|
1267
1267
|
}) || null;
|
|
1268
|
-
var hasResult = questionResult !== null || questionResultImage !== null ||
|
|
1268
|
+
var hasResult = questionResult !== null || questionResultImage !== null || answerResult !== null || firstCustomResult !== null;
|
|
1269
1269
|
var onNextSlide = useCallback(function () {
|
|
1270
1270
|
if (isEdit) {
|
|
1271
1271
|
return;
|
|
@@ -1414,7 +1414,7 @@ var QuizMultipleScreen = function QuizMultipleScreen(_ref) {
|
|
|
1414
1414
|
verticalAlign = questionLayout;
|
|
1415
1415
|
}
|
|
1416
1416
|
var showPoints = isEdit;
|
|
1417
|
-
var showReset = isEdit;
|
|
1417
|
+
var showReset = isEdit && currentAnsweredIndex !== null;
|
|
1418
1418
|
return /*#__PURE__*/React.createElement("div", {
|
|
1419
1419
|
className: classNames([styles$2.container, _defineProperty(_defineProperty({}, styles$2[direction], direction !== null), className, className !== null)]),
|
|
1420
1420
|
"data-screen-ready": true
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-quiz",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.652",
|
|
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.651",
|
|
67
|
+
"@micromag/data": "^0.3.651",
|
|
68
|
+
"@micromag/element-background": "^0.3.651",
|
|
69
|
+
"@micromag/element-button": "^0.3.651",
|
|
70
|
+
"@micromag/element-container": "^0.3.651",
|
|
71
|
+
"@micromag/element-footer": "^0.3.651",
|
|
72
|
+
"@micromag/element-header": "^0.3.651",
|
|
73
|
+
"@micromag/element-heading": "^0.3.651",
|
|
74
|
+
"@micromag/element-layout": "^0.3.651",
|
|
75
|
+
"@micromag/element-scroll": "^0.3.651",
|
|
76
|
+
"@micromag/element-text": "^0.3.651",
|
|
77
|
+
"@micromag/element-visual": "^0.3.651",
|
|
78
|
+
"@micromag/transforms": "^0.3.651",
|
|
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": "77f459a1fabeb2d40fb26866e2d2c8353d54fd9f"
|
|
93
93
|
}
|