@micromag/screen-quiz 0.3.334 → 0.3.336

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 CHANGED
@@ -206,7 +206,7 @@ var Answers = function Answers(_ref) {
206
206
  });
207
207
 
208
208
  return /*#__PURE__*/React.createElement("div", {
209
- className: classNames([styles$4.container, (_ref7 = {}, _defineProperty(_ref7, styles$4.answered, answered), _defineProperty(_ref7, styles$4.withoutGoodAnswer, withoutGoodAnswer || !hasRightAnswer), _defineProperty(_ref7, styles$4.withGoodAnswer, !withoutGoodAnswer && hasRightAnswer), _defineProperty(_ref7, styles$4.withIcon, !withoutGoodAnswer && hasRightAnswer && !withoutIcon), _defineProperty(_ref7, styles$4.willCollapse, shouldCollapse && answersCollapsed), _defineProperty(_ref7, styles$4.didCollapsed, shouldCollapse && answersDidCollapse), _defineProperty(_ref7, styles$4.isPlaceholder, isPlaceholder), _defineProperty(_ref7, className, className !== null), _ref7)])
209
+ className: classNames([styles$4.container, (_ref7 = {}, _defineProperty(_ref7, styles$4.answered, answered), _defineProperty(_ref7, styles$4.withIcon, !withoutIcon), _defineProperty(_ref7, styles$4.isPlaceholder, isPlaceholder), _defineProperty(_ref7, className, className !== null), _ref7)])
210
210
  }, filteredListOfItems !== null || isPlaceholder ? /*#__PURE__*/React.createElement("div", {
211
211
  className: styles$4.items
212
212
  }, transitions(function (style, answer, t, answerI) {
@@ -260,13 +260,13 @@ var Answers = function Answers(_ref) {
260
260
  focusable: focusable,
261
261
  buttonStyle: _objectSpread(_objectSpread({}, buttonsStyle), answerButtonStyle),
262
262
  textStyle: _objectSpread(_objectSpread({}, buttonsTextStyle), answerButtonTextStyle)
263
- }, !withoutGoodAnswer && !withoutIcon && rightAnswer ? /*#__PURE__*/React.createElement("span", {
263
+ }, answered && !withoutIcon && rightAnswer ? /*#__PURE__*/React.createElement("span", {
264
264
  className: styles$4.resultIcon,
265
265
  style: getStyleFromColor(goodAnswerColor, 'backgroundColor')
266
266
  }, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
267
267
  className: styles$4.faIcon,
268
268
  icon: faCheck
269
- })) : null, !withoutGoodAnswer && !withoutIcon && answered && !hasAnsweredRight && userAnswer ? /*#__PURE__*/React.createElement("span", {
269
+ })) : null, !withoutIcon && answered && !hasAnsweredRight && userAnswer ? /*#__PURE__*/React.createElement("span", {
270
270
  className: styles$4.resultIcon,
271
271
  style: getStyleFromColor(badAnswerColor, 'backgroundColor')
272
272
  }, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
@@ -587,8 +587,7 @@ var QuizScreen = function QuizScreen(_ref) {
587
587
  var goodAnswerIndex = answers !== null ? answers.findIndex(function (answer) {
588
588
  return answer !== null && answer.good;
589
589
  }) : null;
590
- // const withoutGoodAnswer = goodAnswerIndex === null || goodAnswerIndex === -1;
591
-
590
+ var withoutGoodAnswer = goodAnswerIndex === null || goodAnswerIndex === -1;
592
591
  var _useState = useState(showInstantAnswer ? goodAnswerIndex : null),
593
592
  _useState2 = _slicedToArray(_useState, 2),
594
593
  userAnswerIndex = _useState2[0],
@@ -677,9 +676,8 @@ var QuizScreen = function QuizScreen(_ref) {
677
676
  buttonsTextStyle: buttonsTextStyle,
678
677
  goodAnswerColor: goodAnswerColor,
679
678
  badAnswerColor: badAnswerColor,
680
- withoutTrueFalse: withoutTrueFalse
681
- // withoutGoodAnswer={withoutGoodAnswer}
682
- ,
679
+ withoutTrueFalse: withoutTrueFalse,
680
+ withoutGoodAnswer: withoutGoodAnswer,
683
681
  focusable: current && isView,
684
682
  showInstantAnswer: showInstantAnswer,
685
683
  withResult: true,
@@ -1336,6 +1334,7 @@ var QuizMultipleScreen = function QuizMultipleScreen(_ref) {
1336
1334
  showInstantAnswer: showInstantAnswer,
1337
1335
  layout: questionLayout || layout,
1338
1336
  withoutGoodAnswer: true,
1337
+ withoutTrueFalse: true,
1339
1338
  transitions: transitions,
1340
1339
  transitionPlaying: transitionPlaying,
1341
1340
  transitionStagger: transitionStagger,
package/lib/index.js CHANGED
@@ -228,7 +228,7 @@ var Answers = function Answers(_ref) {
228
228
  });
229
229
 
230
230
  return /*#__PURE__*/React__default["default"].createElement("div", {
231
- className: classNames__default["default"]([styles$4.container, (_ref7 = {}, _defineProperty__default["default"](_ref7, styles$4.answered, answered), _defineProperty__default["default"](_ref7, styles$4.withoutGoodAnswer, withoutGoodAnswer || !hasRightAnswer), _defineProperty__default["default"](_ref7, styles$4.withGoodAnswer, !withoutGoodAnswer && hasRightAnswer), _defineProperty__default["default"](_ref7, styles$4.withIcon, !withoutGoodAnswer && hasRightAnswer && !withoutIcon), _defineProperty__default["default"](_ref7, styles$4.willCollapse, shouldCollapse && answersCollapsed), _defineProperty__default["default"](_ref7, styles$4.didCollapsed, shouldCollapse && answersDidCollapse), _defineProperty__default["default"](_ref7, styles$4.isPlaceholder, isPlaceholder), _defineProperty__default["default"](_ref7, className, className !== null), _ref7)])
231
+ className: classNames__default["default"]([styles$4.container, (_ref7 = {}, _defineProperty__default["default"](_ref7, styles$4.answered, answered), _defineProperty__default["default"](_ref7, styles$4.withIcon, !withoutIcon), _defineProperty__default["default"](_ref7, styles$4.isPlaceholder, isPlaceholder), _defineProperty__default["default"](_ref7, className, className !== null), _ref7)])
232
232
  }, filteredListOfItems !== null || isPlaceholder ? /*#__PURE__*/React__default["default"].createElement("div", {
233
233
  className: styles$4.items
234
234
  }, transitions(function (style, answer, t, answerI) {
@@ -282,13 +282,13 @@ var Answers = function Answers(_ref) {
282
282
  focusable: focusable,
283
283
  buttonStyle: _objectSpread__default["default"](_objectSpread__default["default"]({}, buttonsStyle), answerButtonStyle),
284
284
  textStyle: _objectSpread__default["default"](_objectSpread__default["default"]({}, buttonsTextStyle), answerButtonTextStyle)
285
- }, !withoutGoodAnswer && !withoutIcon && rightAnswer ? /*#__PURE__*/React__default["default"].createElement("span", {
285
+ }, answered && !withoutIcon && rightAnswer ? /*#__PURE__*/React__default["default"].createElement("span", {
286
286
  className: styles$4.resultIcon,
287
287
  style: utils.getStyleFromColor(goodAnswerColor, 'backgroundColor')
288
288
  }, /*#__PURE__*/React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, {
289
289
  className: styles$4.faIcon,
290
290
  icon: faCheck.faCheck
291
- })) : null, !withoutGoodAnswer && !withoutIcon && answered && !hasAnsweredRight && userAnswer ? /*#__PURE__*/React__default["default"].createElement("span", {
291
+ })) : null, !withoutIcon && answered && !hasAnsweredRight && userAnswer ? /*#__PURE__*/React__default["default"].createElement("span", {
292
292
  className: styles$4.resultIcon,
293
293
  style: utils.getStyleFromColor(badAnswerColor, 'backgroundColor')
294
294
  }, /*#__PURE__*/React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, {
@@ -609,8 +609,7 @@ var QuizScreen = function QuizScreen(_ref) {
609
609
  var goodAnswerIndex = answers !== null ? answers.findIndex(function (answer) {
610
610
  return answer !== null && answer.good;
611
611
  }) : null;
612
- // const withoutGoodAnswer = goodAnswerIndex === null || goodAnswerIndex === -1;
613
-
612
+ var withoutGoodAnswer = goodAnswerIndex === null || goodAnswerIndex === -1;
614
613
  var _useState = React.useState(showInstantAnswer ? goodAnswerIndex : null),
615
614
  _useState2 = _slicedToArray__default["default"](_useState, 2),
616
615
  userAnswerIndex = _useState2[0],
@@ -699,9 +698,8 @@ var QuizScreen = function QuizScreen(_ref) {
699
698
  buttonsTextStyle: buttonsTextStyle,
700
699
  goodAnswerColor: goodAnswerColor,
701
700
  badAnswerColor: badAnswerColor,
702
- withoutTrueFalse: withoutTrueFalse
703
- // withoutGoodAnswer={withoutGoodAnswer}
704
- ,
701
+ withoutTrueFalse: withoutTrueFalse,
702
+ withoutGoodAnswer: withoutGoodAnswer,
705
703
  focusable: current && isView,
706
704
  showInstantAnswer: showInstantAnswer,
707
705
  withResult: true,
@@ -1358,6 +1356,7 @@ var QuizMultipleScreen = function QuizMultipleScreen(_ref) {
1358
1356
  showInstantAnswer: showInstantAnswer,
1359
1357
  layout: questionLayout || layout,
1360
1358
  withoutGoodAnswer: true,
1359
+ withoutTrueFalse: true,
1361
1360
  transitions: transitions,
1362
1361
  transitionPlaying: transitionPlaying,
1363
1362
  transitionStagger: transitionStagger,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/screen-quiz",
3
- "version": "0.3.334",
3
+ "version": "0.3.336",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "javascript"
@@ -53,8 +53,8 @@
53
53
  "@fortawesome/free-solid-svg-icons": "^5.15.1",
54
54
  "@fortawesome/react-fontawesome": "^0.1.13",
55
55
  "@micromag/core": "^0.3.332",
56
- "@micromag/data": "^0.3.334",
57
- "@micromag/element-background": "^0.3.332",
56
+ "@micromag/data": "^0.3.335",
57
+ "@micromag/element-background": "^0.3.336",
58
58
  "@micromag/element-button": "^0.3.332",
59
59
  "@micromag/element-call-to-action": "^0.3.332",
60
60
  "@micromag/element-container": "^0.3.332",
@@ -75,5 +75,5 @@
75
75
  "publishConfig": {
76
76
  "access": "public"
77
77
  },
78
- "gitHead": "aecd5e405aff415fe8d1a627f03d1e74ccd9ef95"
78
+ "gitHead": "b5514916d2f4e88b20bc5f04af4d4b696c85a114"
79
79
  }