diff --git a/docs/bundle.js b/docs/bundle.js
index c8a6060..02da233 100644
--- a/docs/bundle.js
+++ b/docs/bundle.js
@@ -1 +1 @@
-(()=>{var __webpack_modules__={412:(__unused_webpack_module,__unused_webpack___webpack_exports__,__webpack_require__)=>{"use strict";eval('\n// EXTERNAL MODULE: ./node_modules/react/index.js\nvar react = __webpack_require__(294);\n// EXTERNAL MODULE: ./node_modules/react-dom/client.js\nvar client = __webpack_require__(745);\n;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/native.js\nconst randomUUID = typeof crypto !== \'undefined\' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\n/* harmony default export */ const esm_browser_native = ({\n randomUUID\n});\n;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/rng.js\n// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nlet getRandomValues;\nconst rnds8 = new Uint8Array(16);\nfunction rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.\n getRandomValues = typeof crypto !== \'undefined\' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);\n\n if (!getRandomValues) {\n throw new Error(\'crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported\');\n }\n }\n\n return getRandomValues(rnds8);\n}\n;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/stringify.js\n\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\n\nfunction unsafeStringify(arr, offset = 0) {\n // Note: Be careful editing this code! It\'s been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + \'-\' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + \'-\' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + \'-\' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + \'-\' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];\n}\n\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it\'s likely due to one\n // of the following:\n // - One or more input array values don\'t map to a hex octet (leading to\n // "undefined" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError(\'Stringified UUID is invalid\');\n }\n\n return uuid;\n}\n\n/* harmony default export */ const esm_browser_stringify = ((/* unused pure expression or super */ null && (stringify)));\n;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/v4.js\n\n\n\n\nfunction v4(options, buf, offset) {\n if (esm_browser_native.randomUUID && !buf && !options) {\n return esm_browser_native.randomUUID();\n }\n\n options = options || {};\n const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return unsafeStringify(rnds);\n}\n\n/* harmony default export */ const esm_browser_v4 = (v4);\n;// CONCATENATED MODULE: ./src/lib/core-components/QuizResultFilter.jsx\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction QuizResultFilter(_ref) {\n var filteredValue = _ref.filteredValue,\n handleChange = _ref.handleChange,\n appLocale = _ref.appLocale;\n var _useState = (0,react.useState)(false),\n _useState2 = _slicedToArray(_useState, 2),\n isOpen = _useState2[0],\n setIsOpen = _useState2[1];\n var dropdownRef = (0,react.useRef)(null);\n var toggleDropdown = function toggleDropdown() {\n setIsOpen(!isOpen);\n };\n var handleOptionClick = function handleOptionClick(value) {\n handleChange({\n target: {\n value: value\n }\n });\n setIsOpen(false);\n };\n var selectedOptionClass = isOpen ? \'selected-open\' : \'\';\n (0,react.useEffect)(function () {\n var handleOutsideClick = function handleOutsideClick(e) {\n if (isOpen && dropdownRef.current && !dropdownRef.current.contains(e.target)) {\n setIsOpen(false);\n }\n };\n document.addEventListener(\'click\', handleOutsideClick);\n return function () {\n document.removeEventListener(\'click\', handleOutsideClick);\n };\n }, [isOpen]);\n return /*#__PURE__*/react.createElement("div", {\n className: "quiz-result-filter"\n }, /*#__PURE__*/react.createElement("div", {\n ref: dropdownRef,\n className: "filter-dropdown-select ".concat(isOpen ? \'open\' : \'\'),\n onClick: toggleDropdown,\n onKeyDown: function onKeyDown(e) {\n if (e.key === \'Enter\') {\n toggleDropdown();\n }\n },\n role: "button",\n tabIndex: 0\n }, /*#__PURE__*/react.createElement("div", {\n className: "selected-option ".concat(selectedOptionClass)\n }, filteredValue === \'all\' ? appLocale.resultFilterAll : filteredValue), /*#__PURE__*/react.createElement("span", {\n className: "arrow ".concat(isOpen ? \'up\' : \'down\')\n })), isOpen && /*#__PURE__*/react.createElement("div", {\n className: "dropdown-options",\n role: "menu",\n "aria-labelledby": "quiz-filter"\n }, /*#__PURE__*/react.createElement("div", {\n className: "dropdown-options-item ".concat(filteredValue === \'all\' ? \'selected\' : \'\'),\n onClick: function onClick() {\n return handleOptionClick(\'all\');\n },\n onKeyDown: function onKeyDown(e) {\n if (e.key === \'Enter\') {\n handleOptionClick(\'all\');\n }\n },\n role: "menuitem",\n tabIndex: 0\n }, appLocale.resultFilterAll), /*#__PURE__*/react.createElement("div", {\n className: "dropdown-options-item ".concat(filteredValue === \'correct\' ? \'selected\' : \'\'),\n onClick: function onClick() {\n return handleOptionClick(\'correct\');\n },\n onKeyDown: function onKeyDown(e) {\n if (e.key === \'Enter\') {\n handleOptionClick(\'correct\');\n }\n },\n role: "menuitem",\n tabIndex: 0\n }, appLocale.resultFilterCorrect), /*#__PURE__*/react.createElement("div", {\n className: "dropdown-options-item ".concat(filteredValue === \'incorrect\' ? \'selected\' : \'\'),\n onClick: function onClick() {\n return handleOptionClick(\'incorrect\');\n },\n onKeyDown: function onKeyDown(e) {\n if (e.key === \'Enter\') {\n handleOptionClick(\'incorrect\');\n }\n },\n role: "menuitem",\n tabIndex: 0\n }, appLocale.resultFilterIncorrect)));\n}\n/* harmony default export */ const core_components_QuizResultFilter = (QuizResultFilter);\n;// CONCATENATED MODULE: ./node_modules/snarkdown/dist/snarkdown.es.js\nvar e={"":["",""],_:["",""],"*":["",""],"~":["",""],"\\n":["
"]," ":["
"],"-":["
"+n(r(p).replace(/^\\n+|\\n+$/g,""))+"
":(p=g[6])?(p.match(/\\./)&&(g[5]=g[5].replace(/^\\d+/gm,"")),s=t(n(g[5].replace(/^\\s*[>*+.-]/gm,""))),">"==p?p="blockquote":(p=p.match(/\\./)?"ol":"ul",s=s.replace(/^(.*)(\\n|$)/gm,""+r(g[16])+"
":(g[17]||g[1])&&(o=f(g[17]||"--"))),h+=l,h+=o;return(h+a.substring(d)+$()).replace(/^\\n+|\\n+$/g,"")}\n//# sourceMappingURL=snarkdown.es.js.map\n\n// EXTERNAL MODULE: ./node_modules/dompurify/dist/purify.js\nvar purify = __webpack_require__(856);\nvar purify_default = /*#__PURE__*/__webpack_require__.n(purify);\n;// CONCATENATED MODULE: ./src/lib/core-components/helpers.jsx\nfunction _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = helpers_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || helpers_unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }\nfunction helpers_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return helpers_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return helpers_arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return helpers_arrayLikeToArray(arr); }\nfunction helpers_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\n\n\nvar rawMarkup = function rawMarkup(data) {\n var sanitizer = (purify_default()).sanitize;\n return {\n __html: t(sanitizer(data))\n };\n};\nvar checkAnswer = function checkAnswer(index, correctAnswer, answerSelectionType, _ref) {\n var userInput = _ref.userInput,\n userAttempt = _ref.userAttempt,\n currentQuestionIndex = _ref.currentQuestionIndex,\n continueTillCorrect = _ref.continueTillCorrect,\n showNextQuestionButton = _ref.showNextQuestionButton,\n incorrect = _ref.incorrect,\n correct = _ref.correct,\n setButtons = _ref.setButtons,\n setIsCorrect = _ref.setIsCorrect,\n setIncorrectAnswer = _ref.setIncorrectAnswer,\n setCorrect = _ref.setCorrect,\n setIncorrect = _ref.setIncorrect,\n setShowNextQuestionButton = _ref.setShowNextQuestionButton,\n setUserInput = _ref.setUserInput,\n setUserAttempt = _ref.setUserAttempt;\n var indexStr = "".concat(index);\n var disabledAll = {\n 0: {\n disabled: true\n },\n 1: {\n disabled: true\n },\n 2: {\n disabled: true\n },\n 3: {\n disabled: true\n }\n };\n var userInputCopy = _toConsumableArray(userInput);\n if (answerSelectionType === \'single\') {\n if (userInputCopy[currentQuestionIndex] === undefined) {\n userInputCopy[currentQuestionIndex] = index;\n }\n if (indexStr === correctAnswer) {\n if (incorrect.indexOf(currentQuestionIndex) < 0 && correct.indexOf(currentQuestionIndex) < 0) {\n correct.push(currentQuestionIndex);\n }\n setButtons(function (prevState) {\n return _objectSpread(_objectSpread(_objectSpread({}, prevState), disabledAll), {}, _defineProperty({}, index - 1, {\n className: indexStr === correctAnswer ? \'correct\' : \'incorrect\'\n }));\n });\n setIsCorrect(true);\n setIncorrectAnswer(false);\n setCorrect(correct);\n setShowNextQuestionButton(true);\n } else {\n if (correct.indexOf(currentQuestionIndex) < 0 && incorrect.indexOf(currentQuestionIndex) < 0) {\n incorrect.push(currentQuestionIndex);\n }\n if (continueTillCorrect) {\n setButtons(function (prevState) {\n return _objectSpread(_objectSpread({}, prevState), {}, _defineProperty({}, index - 1, {\n disabled: !prevState[index - 1]\n }));\n });\n } else {\n setButtons(function (prevState) {\n return _objectSpread(_objectSpread(_objectSpread({}, prevState), disabledAll), {}, _defineProperty({}, index - 1, {\n className: indexStr === correctAnswer ? \'correct\' : \'incorrect\'\n }));\n });\n setShowNextQuestionButton(true);\n }\n setIncorrectAnswer(true);\n setIsCorrect(false);\n setIncorrect(incorrect);\n }\n } else {\n var maxNumberOfMultipleSelection = correctAnswer.length;\n if (userInputCopy[currentQuestionIndex] === undefined) {\n userInputCopy[currentQuestionIndex] = [];\n }\n if (userInputCopy[currentQuestionIndex].length < maxNumberOfMultipleSelection) {\n userInputCopy[currentQuestionIndex].push(index);\n if (correctAnswer.includes(index)) {\n if (userInputCopy[currentQuestionIndex].length <= maxNumberOfMultipleSelection) {\n setButtons(function (prevState) {\n return _objectSpread(_objectSpread({}, prevState), {}, _defineProperty({}, index - 1, {\n disabled: !prevState[index - 1],\n className: correctAnswer.includes(index) ? \'correct\' : \'incorrect\'\n }));\n });\n }\n } else if (userInputCopy[currentQuestionIndex].length <= maxNumberOfMultipleSelection) {\n setButtons(function (prevState) {\n return _objectSpread(_objectSpread({}, prevState), {}, _defineProperty({}, index - 1, {\n className: correctAnswer.includes(index) ? \'correct\' : \'incorrect\'\n }));\n });\n }\n }\n if (maxNumberOfMultipleSelection === userAttempt) {\n var cnt = 0;\n for (var i = 0; i < correctAnswer.length; i += 1) {\n if (userInputCopy[currentQuestionIndex].includes(correctAnswer[i])) {\n cnt += 1;\n }\n }\n if (cnt === maxNumberOfMultipleSelection) {\n correct.push(currentQuestionIndex);\n setIsCorrect(true);\n setIncorrectAnswer(false);\n setCorrect(correct);\n setShowNextQuestionButton(true);\n setUserAttempt(1);\n } else {\n incorrect.push(currentQuestionIndex);\n setIncorrectAnswer(true);\n setIsCorrect(false);\n setIncorrect(incorrect);\n setShowNextQuestionButton(true);\n setUserAttempt(1);\n }\n } else if (!showNextQuestionButton) {\n setUserAttempt(userAttempt + 1);\n }\n }\n setUserInput(userInputCopy);\n};\nvar selectAnswer = function selectAnswer(index, correctAnswer, answerSelectionType, _ref2) {\n var userInput = _ref2.userInput,\n currentQuestionIndex = _ref2.currentQuestionIndex,\n setButtons = _ref2.setButtons,\n setShowNextQuestionButton = _ref2.setShowNextQuestionButton,\n incorrect = _ref2.incorrect,\n correct = _ref2.correct,\n setCorrect = _ref2.setCorrect,\n setIncorrect = _ref2.setIncorrect,\n setUserInput = _ref2.setUserInput;\n var selectedButtons = {\n 0: {\n selected: false\n },\n 1: {\n selected: false\n },\n 2: {\n selected: false\n },\n 3: {\n selected: false\n }\n };\n var userInputCopy = _toConsumableArray(userInput);\n if (answerSelectionType === \'single\') {\n correctAnswer = Number(correctAnswer);\n userInputCopy[currentQuestionIndex] = index;\n if (index === correctAnswer) {\n if (correct.indexOf(currentQuestionIndex) < 0) {\n correct.push(currentQuestionIndex);\n }\n if (incorrect.indexOf(currentQuestionIndex) >= 0) {\n incorrect.splice(incorrect.indexOf(currentQuestionIndex), 1);\n }\n } else {\n if (incorrect.indexOf(currentQuestionIndex) < 0) {\n incorrect.push(currentQuestionIndex);\n }\n if (correct.indexOf(currentQuestionIndex) >= 0) {\n correct.splice(correct.indexOf(currentQuestionIndex), 1);\n }\n }\n setCorrect(correct);\n setIncorrect(incorrect);\n setButtons(function (prevState) {\n return _objectSpread(_objectSpread(_objectSpread({}, prevState), selectedButtons), {}, _defineProperty({}, index - 1, {\n className: \'selected\'\n }));\n });\n setShowNextQuestionButton(true);\n } else {\n if (userInputCopy[currentQuestionIndex] === undefined) {\n userInputCopy[currentQuestionIndex] = [];\n }\n if (userInputCopy[currentQuestionIndex].includes(index)) {\n userInputCopy[currentQuestionIndex].splice(userInputCopy[currentQuestionIndex].indexOf(index), 1);\n } else {\n userInputCopy[currentQuestionIndex].push(index);\n }\n if (userInputCopy[currentQuestionIndex].length === correctAnswer.length) {\n var exactMatch = true;\n var _iterator = _createForOfIteratorHelper(userInput[currentQuestionIndex]),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var input = _step.value;\n if (!correctAnswer.includes(input)) {\n exactMatch = false;\n if (incorrect.indexOf(currentQuestionIndex) < 0) {\n incorrect.push(currentQuestionIndex);\n }\n if (correct.indexOf(currentQuestionIndex) >= 0) {\n correct.splice(correct.indexOf(currentQuestionIndex), 1);\n }\n break;\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n if (exactMatch) {\n if (correct.indexOf(currentQuestionIndex) < 0) {\n correct.push(currentQuestionIndex);\n }\n if (incorrect.indexOf(currentQuestionIndex) >= 0) {\n incorrect.splice(incorrect.indexOf(currentQuestionIndex), 1);\n }\n }\n } else {\n if (incorrect.indexOf(currentQuestionIndex) < 0) {\n incorrect.push(currentQuestionIndex);\n }\n if (correct.indexOf(currentQuestionIndex) >= 0) {\n correct.splice(correct.indexOf(currentQuestionIndex), 1);\n }\n }\n setCorrect(correct);\n setIncorrect(incorrect);\n setButtons(function (prevState) {\n return _objectSpread(_objectSpread({}, prevState), {}, _defineProperty({}, index - 1, {\n className: userInputCopy[currentQuestionIndex].includes(index) ? \'selected\' : undefined\n }));\n });\n if (userInputCopy[currentQuestionIndex].length > 0) {\n setShowNextQuestionButton(true);\n }\n }\n setUserInput(userInputCopy);\n};\n;// CONCATENATED MODULE: ./src/lib/core-components/Explanation.jsx\n\nfunction Explanation(_ref) {\n var question = _ref.question,\n isResultPage = _ref.isResultPage;\n var explanation = question.explanation;\n if (!explanation) {\n return null;\n }\n if (isResultPage) {\n return /*#__PURE__*/react.createElement("div", {\n className: "explanation"\n }, explanation);\n }\n return /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("br", null), explanation);\n}\n/* harmony default export */ const core_components_Explanation = (Explanation);\n;// CONCATENATED MODULE: ./src/lib/core-components/InstantFeedback.jsx\n\n\nvar renderMessageForCorrectAnswer = function renderMessageForCorrectAnswer(question) {\n var defaultMessage = \'You are correct. Please click Next to continue.\';\n return question.messageForCorrectAnswer || defaultMessage;\n};\nvar renderMessageForIncorrectAnswer = function renderMessageForIncorrectAnswer(question) {\n var defaultMessage = \'Incorrect answer. Please try again.\';\n return question.messageForIncorrectAnswer || defaultMessage;\n};\nfunction InstantFeedback(_ref) {\n var showInstantFeedback = _ref.showInstantFeedback,\n incorrectAnswer = _ref.incorrectAnswer,\n correctAnswer = _ref.correctAnswer,\n question = _ref.question,\n onQuestionSubmit = _ref.onQuestionSubmit,\n userAnswer = _ref.userAnswer;\n (0,react.useEffect)(function () {\n if (onQuestionSubmit && (correctAnswer || incorrectAnswer)) {\n onQuestionSubmit({\n question: question,\n userAnswer: userAnswer,\n isCorrect: correctAnswer\n });\n }\n }, [correctAnswer, incorrectAnswer]);\n return /*#__PURE__*/react.createElement(react.Fragment, null, incorrectAnswer && showInstantFeedback && /*#__PURE__*/react.createElement("div", {\n className: "alert incorrect"\n }, renderMessageForIncorrectAnswer(question)), correctAnswer && showInstantFeedback && /*#__PURE__*/react.createElement("div", {\n className: "alert correct"\n }, renderMessageForCorrectAnswer(question), /*#__PURE__*/react.createElement(core_components_Explanation, {\n question: question,\n isResultPage: false\n })));\n}\n/* harmony default export */ const core_components_InstantFeedback = (InstantFeedback);\n;// CONCATENATED MODULE: ./src/lib/Core.jsx\nfunction Core_toConsumableArray(arr) { return Core_arrayWithoutHoles(arr) || Core_iterableToArray(arr) || Core_unsupportedIterableToArray(arr) || Core_nonIterableSpread(); }\nfunction Core_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }\nfunction Core_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }\nfunction Core_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return Core_arrayLikeToArray(arr); }\nfunction Core_slicedToArray(arr, i) { return Core_arrayWithHoles(arr) || Core_iterableToArrayLimit(arr, i) || Core_unsupportedIterableToArray(arr, i) || Core_nonIterableRest(); }\nfunction Core_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }\nfunction Core_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return Core_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Core_arrayLikeToArray(o, minLen); }\nfunction Core_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction Core_iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction Core_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n\n\n\n\n\nfunction Core(_ref) {\n var questions = _ref.questions,\n appLocale = _ref.appLocale,\n showDefaultResult = _ref.showDefaultResult,\n onComplete = _ref.onComplete,\n customResultPage = _ref.customResultPage,\n showInstantFeedback = _ref.showInstantFeedback,\n continueTillCorrect = _ref.continueTillCorrect,\n revealAnswerOnSubmit = _ref.revealAnswerOnSubmit,\n allowNavigation = _ref.allowNavigation,\n onQuestionSubmit = _ref.onQuestionSubmit;\n var _useState = (0,react.useState)(false),\n _useState2 = Core_slicedToArray(_useState, 2),\n incorrectAnswer = _useState2[0],\n setIncorrectAnswer = _useState2[1];\n var _useState3 = (0,react.useState)(false),\n _useState4 = Core_slicedToArray(_useState3, 2),\n isCorrect = _useState4[0],\n setIsCorrect = _useState4[1];\n var _useState5 = (0,react.useState)(false),\n _useState6 = Core_slicedToArray(_useState5, 2),\n showNextQuestionButton = _useState6[0],\n setShowNextQuestionButton = _useState6[1];\n var _useState7 = (0,react.useState)(false),\n _useState8 = Core_slicedToArray(_useState7, 2),\n endQuiz = _useState8[0],\n setEndQuiz = _useState8[1];\n var _useState9 = (0,react.useState)(0),\n _useState10 = Core_slicedToArray(_useState9, 2),\n currentQuestionIndex = _useState10[0],\n setCurrentQuestionIndex = _useState10[1];\n var _useState11 = (0,react.useState)({}),\n _useState12 = Core_slicedToArray(_useState11, 2),\n buttons = _useState12[0],\n setButtons = _useState12[1];\n var _useState13 = (0,react.useState)([]),\n _useState14 = Core_slicedToArray(_useState13, 2),\n correct = _useState14[0],\n setCorrect = _useState14[1];\n var _useState15 = (0,react.useState)([]),\n _useState16 = Core_slicedToArray(_useState15, 2),\n incorrect = _useState16[0],\n setIncorrect = _useState16[1];\n var _useState17 = (0,react.useState)([]),\n _useState18 = Core_slicedToArray(_useState17, 2),\n userInput = _useState18[0],\n setUserInput = _useState18[1];\n var _useState19 = (0,react.useState)(\'all\'),\n _useState20 = Core_slicedToArray(_useState19, 2),\n filteredValue = _useState20[0],\n setFilteredValue = _useState20[1];\n var _useState21 = (0,react.useState)(1),\n _useState22 = Core_slicedToArray(_useState21, 2),\n userAttempt = _useState22[0],\n setUserAttempt = _useState22[1];\n var _useState23 = (0,react.useState)(true),\n _useState24 = Core_slicedToArray(_useState23, 2),\n showDefaultResultState = _useState24[0],\n setShowDefaultResult = _useState24[1];\n var _useState25 = (0,react.useState)(undefined),\n _useState26 = Core_slicedToArray(_useState25, 2),\n answerSelectionTypeState = _useState26[0],\n setAnswerSelectionType = _useState26[1];\n var _useState27 = (0,react.useState)(0),\n _useState28 = Core_slicedToArray(_useState27, 2),\n totalPoints = _useState28[0],\n setTotalPoints = _useState28[1];\n var _useState29 = (0,react.useState)(0),\n _useState30 = Core_slicedToArray(_useState29, 2),\n correctPoints = _useState30[0],\n setCorrectPoints = _useState30[1];\n var _useState31 = (0,react.useState)(questions[currentQuestionIndex]),\n _useState32 = Core_slicedToArray(_useState31, 2),\n activeQuestion = _useState32[0],\n setActiveQuestion = _useState32[1];\n var _useState33 = (0,react.useState)(undefined),\n _useState34 = Core_slicedToArray(_useState33, 2),\n questionSummary = _useState34[0],\n setQuestionSummary = _useState34[1];\n (0,react.useEffect)(function () {\n setShowDefaultResult(showDefaultResult !== undefined ? showDefaultResult : true);\n }, [showDefaultResult]);\n (0,react.useEffect)(function () {\n setActiveQuestion(questions[currentQuestionIndex]);\n }, [currentQuestionIndex]);\n (0,react.useEffect)(function () {\n var answerSelectionType = activeQuestion.answerSelectionType;\n // Default single to avoid code breaking due to automatic version upgrade\n setAnswerSelectionType(answerSelectionType || \'single\');\n }, [activeQuestion, currentQuestionIndex]);\n (0,react.useEffect)(function () {\n if (endQuiz) {\n var totalPointsTemp = 0;\n var correctPointsTemp = 0;\n for (var i = 0; i < questions.length; i += 1) {\n var point = questions[i].point || 0;\n if (typeof point === \'string\' || point instanceof String) {\n point = parseInt(point, 10);\n }\n totalPointsTemp += point;\n if (correct.includes(i)) {\n correctPointsTemp += point;\n }\n }\n setTotalPoints(totalPointsTemp);\n setCorrectPoints(correctPointsTemp);\n }\n }, [endQuiz]);\n (0,react.useEffect)(function () {\n setQuestionSummary({\n numberOfQuestions: questions.length,\n numberOfCorrectAnswers: correct.length,\n numberOfIncorrectAnswers: incorrect.length,\n questions: questions,\n userInput: userInput,\n totalPoints: totalPoints,\n correctPoints: correctPoints\n });\n }, [totalPoints, correctPoints]);\n (0,react.useEffect)(function () {\n if (endQuiz && onComplete !== undefined && questionSummary !== undefined) {\n onComplete(questionSummary);\n }\n }, [questionSummary]);\n var nextQuestion = function nextQuestion(currentQuestionIdx) {\n setIncorrectAnswer(false);\n setIsCorrect(false);\n setShowNextQuestionButton(false);\n setButtons({});\n if (currentQuestionIdx + 1 === questions.length) {\n if (userInput.length !== questions.length) {\n alert(\'Quiz is incomplete\');\n } else if (allowNavigation) {\n var submitQuiz = confirm(\'You have finished all the questions. Submit Quiz now?\');\n if (submitQuiz) {\n setEndQuiz(true);\n }\n } else {\n setEndQuiz(true);\n }\n } else {\n setCurrentQuestionIndex(currentQuestionIdx + 1);\n }\n };\n var handleChange = function handleChange(event) {\n setFilteredValue(event.target.value);\n };\n var renderAnswerInResult = function renderAnswerInResult(question, userInputIndex) {\n var answers = question.answers,\n correctAnswer = question.correctAnswer,\n questionType = question.questionType;\n var answerSelectionType = question.answerSelectionType;\n var answerBtnCorrectClassName;\n var answerBtnIncorrectClassName;\n\n // Default single to avoid code breaking due to automatic version upgrade\n answerSelectionType = answerSelectionType || \'single\';\n return answers.map(function (answer, index) {\n if (answerSelectionType === \'single\') {\n // correctAnswer - is string\n answerBtnCorrectClassName = "".concat(index + 1) === correctAnswer ? \'correct\' : \'\';\n answerBtnIncorrectClassName = "".concat(userInputIndex) !== correctAnswer && "".concat(index + 1) === "".concat(userInputIndex) ? \'incorrect\' : \'\';\n } else {\n // correctAnswer - is array of numbers\n answerBtnCorrectClassName = correctAnswer.includes(index + 1) ? \'correct\' : \'\';\n answerBtnIncorrectClassName = !correctAnswer.includes(index + 1) && userInputIndex.includes(index + 1) ? \'incorrect\' : \'\';\n }\n return /*#__PURE__*/react.createElement("div", {\n key: esm_browser_v4()\n }, /*#__PURE__*/react.createElement("button", {\n type: "button",\n disabled: true,\n className: "answerBtn btn ".concat(answerBtnCorrectClassName).concat(answerBtnIncorrectClassName)\n }, questionType === \'text\' && /*#__PURE__*/react.createElement("span", null, answer), questionType === \'photo\' && /*#__PURE__*/react.createElement("img", {\n src: answer,\n alt: "answer"\n })));\n });\n };\n var renderTags = function renderTags(answerSelectionType, numberOfSelection, segment) {\n var singleSelectionTagText = appLocale.singleSelectionTagText,\n multipleSelectionTagText = appLocale.multipleSelectionTagText,\n pickNumberOfSelection = appLocale.pickNumberOfSelection;\n return /*#__PURE__*/react.createElement("div", {\n className: "tag-container"\n }, answerSelectionType === \'single\' && /*#__PURE__*/react.createElement("span", {\n className: "single selection-tag"\n }, singleSelectionTagText), answerSelectionType === \'multiple\' && /*#__PURE__*/react.createElement("span", {\n className: "multiple selection-tag"\n }, multipleSelectionTagText), /*#__PURE__*/react.createElement("span", {\n className: "number-of-selection"\n }, pickNumberOfSelection.replace(\'"+n(r(p).replace(/^\\n+|\\n+$/g,""))+"
":(p=g[6])?(p.match(/\\./)&&(g[5]=g[5].replace(/^\\d+/gm,"")),s=t(n(g[5].replace(/^\\s*[>*+.-]/gm,""))),">"==p?p="blockquote":(p=p.match(/\\./)?"ol":"ul",s=s.replace(/^(.*)(\\n|$)/gm,""+r(g[16])+"
":(g[17]||g[1])&&(o=f(g[17]||"--"))),h+=l,h+=o;return(h+a.substring(d)+$()).replace(/^\\n+|\\n+$/g,"")}\n//# sourceMappingURL=snarkdown.es.js.map\n\n// EXTERNAL MODULE: ./node_modules/dompurify/dist/purify.js\nvar purify = __webpack_require__(856);\nvar purify_default = /*#__PURE__*/__webpack_require__.n(purify);\n;// CONCATENATED MODULE: ./src/lib/core-components/helpers.jsx\nfunction _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = helpers_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || helpers_unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }\nfunction helpers_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return helpers_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return helpers_arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return helpers_arrayLikeToArray(arr); }\nfunction helpers_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\n\n\nvar rawMarkup = function rawMarkup(data) {\n var sanitizer = (purify_default()).sanitize;\n return {\n __html: t(sanitizer(data))\n };\n};\nvar checkAnswer = function checkAnswer(index, correctAnswer, answerSelectionType, _ref) {\n var userInput = _ref.userInput,\n userAttempt = _ref.userAttempt,\n currentQuestionIndex = _ref.currentQuestionIndex,\n continueTillCorrect = _ref.continueTillCorrect,\n showNextQuestionButton = _ref.showNextQuestionButton,\n incorrect = _ref.incorrect,\n correct = _ref.correct,\n setButtons = _ref.setButtons,\n setIsCorrect = _ref.setIsCorrect,\n setIncorrectAnswer = _ref.setIncorrectAnswer,\n setCorrect = _ref.setCorrect,\n setIncorrect = _ref.setIncorrect,\n setShowNextQuestionButton = _ref.setShowNextQuestionButton,\n setUserInput = _ref.setUserInput,\n setUserAttempt = _ref.setUserAttempt;\n var indexStr = "".concat(index);\n var disabledAll = {\n 0: {\n disabled: true\n },\n 1: {\n disabled: true\n },\n 2: {\n disabled: true\n },\n 3: {\n disabled: true\n }\n };\n var userInputCopy = _toConsumableArray(userInput);\n if (answerSelectionType === \'single\') {\n if (userInputCopy[currentQuestionIndex] === undefined) {\n userInputCopy[currentQuestionIndex] = index;\n }\n if (indexStr === correctAnswer) {\n if (incorrect.indexOf(currentQuestionIndex) < 0 && correct.indexOf(currentQuestionIndex) < 0) {\n correct.push(currentQuestionIndex);\n }\n setButtons(function (prevState) {\n return _objectSpread(_objectSpread(_objectSpread({}, prevState), disabledAll), {}, _defineProperty({}, index - 1, {\n className: indexStr === correctAnswer ? \'correct\' : \'incorrect\'\n }));\n });\n setIsCorrect(true);\n setIncorrectAnswer(false);\n setCorrect(correct);\n setShowNextQuestionButton(true);\n } else {\n if (correct.indexOf(currentQuestionIndex) < 0 && incorrect.indexOf(currentQuestionIndex) < 0) {\n incorrect.push(currentQuestionIndex);\n }\n if (continueTillCorrect) {\n setButtons(function (prevState) {\n return _objectSpread(_objectSpread({}, prevState), {}, _defineProperty({}, index - 1, {\n disabled: !prevState[index - 1]\n }));\n });\n } else {\n setButtons(function (prevState) {\n return _objectSpread(_objectSpread(_objectSpread({}, prevState), disabledAll), {}, _defineProperty({}, index - 1, {\n className: indexStr === correctAnswer ? \'correct\' : \'incorrect\'\n }));\n });\n setShowNextQuestionButton(true);\n }\n setIncorrectAnswer(true);\n setIsCorrect(false);\n setIncorrect(incorrect);\n }\n } else {\n var maxNumberOfMultipleSelection = correctAnswer.length;\n if (userInputCopy[currentQuestionIndex] === undefined) {\n userInputCopy[currentQuestionIndex] = [];\n }\n if (userInputCopy[currentQuestionIndex].length < maxNumberOfMultipleSelection) {\n userInputCopy[currentQuestionIndex].push(index);\n if (correctAnswer.includes(index)) {\n if (userInputCopy[currentQuestionIndex].length <= maxNumberOfMultipleSelection) {\n setButtons(function (prevState) {\n return _objectSpread(_objectSpread({}, prevState), {}, _defineProperty({}, index - 1, {\n disabled: !prevState[index - 1],\n className: correctAnswer.includes(index) ? \'correct\' : \'incorrect\'\n }));\n });\n }\n } else if (userInputCopy[currentQuestionIndex].length <= maxNumberOfMultipleSelection) {\n setButtons(function (prevState) {\n return _objectSpread(_objectSpread({}, prevState), {}, _defineProperty({}, index - 1, {\n className: correctAnswer.includes(index) ? \'correct\' : \'incorrect\'\n }));\n });\n }\n }\n if (maxNumberOfMultipleSelection === userAttempt) {\n var cnt = 0;\n for (var i = 0; i < correctAnswer.length; i += 1) {\n if (userInputCopy[currentQuestionIndex].includes(correctAnswer[i])) {\n cnt += 1;\n }\n }\n if (cnt === maxNumberOfMultipleSelection) {\n correct.push(currentQuestionIndex);\n setIsCorrect(true);\n setIncorrectAnswer(false);\n setCorrect(correct);\n setShowNextQuestionButton(true);\n setUserAttempt(1);\n } else {\n incorrect.push(currentQuestionIndex);\n setIncorrectAnswer(true);\n setIsCorrect(false);\n setIncorrect(incorrect);\n setShowNextQuestionButton(true);\n setUserAttempt(1);\n }\n } else if (!showNextQuestionButton) {\n setUserAttempt(userAttempt + 1);\n }\n }\n setUserInput(userInputCopy);\n};\nvar selectAnswer = function selectAnswer(index, correctAnswer, answerSelectionType, _ref2) {\n var userInput = _ref2.userInput,\n currentQuestionIndex = _ref2.currentQuestionIndex,\n setButtons = _ref2.setButtons,\n setShowNextQuestionButton = _ref2.setShowNextQuestionButton,\n incorrect = _ref2.incorrect,\n correct = _ref2.correct,\n setCorrect = _ref2.setCorrect,\n setIncorrect = _ref2.setIncorrect,\n setUserInput = _ref2.setUserInput;\n var selectedButtons = {\n 0: {\n selected: false\n },\n 1: {\n selected: false\n },\n 2: {\n selected: false\n },\n 3: {\n selected: false\n }\n };\n var userInputCopy = _toConsumableArray(userInput);\n if (answerSelectionType === \'single\') {\n correctAnswer = Number(correctAnswer);\n userInputCopy[currentQuestionIndex] = index;\n if (index === correctAnswer) {\n if (correct.indexOf(currentQuestionIndex) < 0) {\n correct.push(currentQuestionIndex);\n }\n if (incorrect.indexOf(currentQuestionIndex) >= 0) {\n incorrect.splice(incorrect.indexOf(currentQuestionIndex), 1);\n }\n } else {\n if (incorrect.indexOf(currentQuestionIndex) < 0) {\n incorrect.push(currentQuestionIndex);\n }\n if (correct.indexOf(currentQuestionIndex) >= 0) {\n correct.splice(correct.indexOf(currentQuestionIndex), 1);\n }\n }\n setCorrect(correct);\n setIncorrect(incorrect);\n setButtons(function (prevState) {\n return _objectSpread(_objectSpread(_objectSpread({}, prevState), selectedButtons), {}, _defineProperty({}, index - 1, {\n className: \'selected\'\n }));\n });\n setShowNextQuestionButton(true);\n } else {\n if (userInputCopy[currentQuestionIndex] === undefined) {\n userInputCopy[currentQuestionIndex] = [];\n }\n if (userInputCopy[currentQuestionIndex].includes(index)) {\n userInputCopy[currentQuestionIndex].splice(userInputCopy[currentQuestionIndex].indexOf(index), 1);\n } else {\n userInputCopy[currentQuestionIndex].push(index);\n }\n if (userInputCopy[currentQuestionIndex].length === correctAnswer.length) {\n var exactMatch = true;\n var _iterator = _createForOfIteratorHelper(userInput[currentQuestionIndex]),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var input = _step.value;\n if (!correctAnswer.includes(input)) {\n exactMatch = false;\n if (incorrect.indexOf(currentQuestionIndex) < 0) {\n incorrect.push(currentQuestionIndex);\n }\n if (correct.indexOf(currentQuestionIndex) >= 0) {\n correct.splice(correct.indexOf(currentQuestionIndex), 1);\n }\n break;\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n if (exactMatch) {\n if (correct.indexOf(currentQuestionIndex) < 0) {\n correct.push(currentQuestionIndex);\n }\n if (incorrect.indexOf(currentQuestionIndex) >= 0) {\n incorrect.splice(incorrect.indexOf(currentQuestionIndex), 1);\n }\n }\n } else {\n if (incorrect.indexOf(currentQuestionIndex) < 0) {\n incorrect.push(currentQuestionIndex);\n }\n if (correct.indexOf(currentQuestionIndex) >= 0) {\n correct.splice(correct.indexOf(currentQuestionIndex), 1);\n }\n }\n setCorrect(correct);\n setIncorrect(incorrect);\n setButtons(function (prevState) {\n return _objectSpread(_objectSpread({}, prevState), {}, _defineProperty({}, index - 1, {\n className: userInputCopy[currentQuestionIndex].includes(index) ? \'selected\' : undefined\n }));\n });\n if (userInputCopy[currentQuestionIndex].length > 0) {\n setShowNextQuestionButton(true);\n }\n }\n setUserInput(userInputCopy);\n};\n;// CONCATENATED MODULE: ./src/lib/core-components/Explanation.jsx\n\nfunction Explanation(_ref) {\n var question = _ref.question,\n isResultPage = _ref.isResultPage;\n var explanation = question.explanation;\n if (!explanation) {\n return null;\n }\n if (isResultPage) {\n return /*#__PURE__*/react.createElement("div", {\n className: "explanation"\n }, explanation);\n }\n return /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("br", null), explanation);\n}\n/* harmony default export */ const core_components_Explanation = (Explanation);\n;// CONCATENATED MODULE: ./src/lib/core-components/InstantFeedback.jsx\n\n\nvar renderMessageForCorrectAnswer = function renderMessageForCorrectAnswer(question) {\n var defaultMessage = \'You are correct. Please click Next to continue.\';\n return question.messageForCorrectAnswer || defaultMessage;\n};\nvar renderMessageForIncorrectAnswer = function renderMessageForIncorrectAnswer(question) {\n var defaultMessage = \'Incorrect answer. Please try again.\';\n return question.messageForIncorrectAnswer || defaultMessage;\n};\nfunction InstantFeedback(_ref) {\n var showInstantFeedback = _ref.showInstantFeedback,\n incorrectAnswer = _ref.incorrectAnswer,\n correctAnswer = _ref.correctAnswer,\n question = _ref.question,\n onQuestionSubmit = _ref.onQuestionSubmit,\n userAnswer = _ref.userAnswer;\n (0,react.useEffect)(function () {\n if (onQuestionSubmit && (correctAnswer || incorrectAnswer)) {\n onQuestionSubmit({\n question: question,\n userAnswer: userAnswer,\n isCorrect: correctAnswer\n });\n }\n }, [correctAnswer, incorrectAnswer]);\n return /*#__PURE__*/react.createElement(react.Fragment, null, incorrectAnswer && showInstantFeedback && /*#__PURE__*/react.createElement("div", {\n className: "alert incorrect"\n }, renderMessageForIncorrectAnswer(question)), correctAnswer && showInstantFeedback && /*#__PURE__*/react.createElement("div", {\n className: "alert correct"\n }, renderMessageForCorrectAnswer(question), /*#__PURE__*/react.createElement(core_components_Explanation, {\n question: question,\n isResultPage: false\n })));\n}\n/* harmony default export */ const core_components_InstantFeedback = (InstantFeedback);\n;// CONCATENATED MODULE: ./src/lib/Core.jsx\nfunction Core_toConsumableArray(arr) { return Core_arrayWithoutHoles(arr) || Core_iterableToArray(arr) || Core_unsupportedIterableToArray(arr) || Core_nonIterableSpread(); }\nfunction Core_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }\nfunction Core_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }\nfunction Core_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return Core_arrayLikeToArray(arr); }\nfunction Core_slicedToArray(arr, i) { return Core_arrayWithHoles(arr) || Core_iterableToArrayLimit(arr, i) || Core_unsupportedIterableToArray(arr, i) || Core_nonIterableRest(); }\nfunction Core_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }\nfunction Core_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return Core_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Core_arrayLikeToArray(o, minLen); }\nfunction Core_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction Core_iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction Core_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n\n\n\n\n\nfunction Core(_ref) {\n var questions = _ref.questions,\n appLocale = _ref.appLocale,\n showDefaultResult = _ref.showDefaultResult,\n onComplete = _ref.onComplete,\n customResultPage = _ref.customResultPage,\n showInstantFeedback = _ref.showInstantFeedback,\n continueTillCorrect = _ref.continueTillCorrect,\n revealAnswerOnSubmit = _ref.revealAnswerOnSubmit,\n allowNavigation = _ref.allowNavigation,\n onQuestionSubmit = _ref.onQuestionSubmit;\n var _useState = (0,react.useState)(false),\n _useState2 = Core_slicedToArray(_useState, 2),\n incorrectAnswer = _useState2[0],\n setIncorrectAnswer = _useState2[1];\n var _useState3 = (0,react.useState)(false),\n _useState4 = Core_slicedToArray(_useState3, 2),\n isCorrect = _useState4[0],\n setIsCorrect = _useState4[1];\n var _useState5 = (0,react.useState)(false),\n _useState6 = Core_slicedToArray(_useState5, 2),\n showNextQuestionButton = _useState6[0],\n setShowNextQuestionButton = _useState6[1];\n var _useState7 = (0,react.useState)(false),\n _useState8 = Core_slicedToArray(_useState7, 2),\n endQuiz = _useState8[0],\n setEndQuiz = _useState8[1];\n var _useState9 = (0,react.useState)(0),\n _useState10 = Core_slicedToArray(_useState9, 2),\n currentQuestionIndex = _useState10[0],\n setCurrentQuestionIndex = _useState10[1];\n var _useState11 = (0,react.useState)({}),\n _useState12 = Core_slicedToArray(_useState11, 2),\n buttons = _useState12[0],\n setButtons = _useState12[1];\n var _useState13 = (0,react.useState)([]),\n _useState14 = Core_slicedToArray(_useState13, 2),\n correct = _useState14[0],\n setCorrect = _useState14[1];\n var _useState15 = (0,react.useState)([]),\n _useState16 = Core_slicedToArray(_useState15, 2),\n incorrect = _useState16[0],\n setIncorrect = _useState16[1];\n var _useState17 = (0,react.useState)([]),\n _useState18 = Core_slicedToArray(_useState17, 2),\n userInput = _useState18[0],\n setUserInput = _useState18[1];\n var _useState19 = (0,react.useState)(\'all\'),\n _useState20 = Core_slicedToArray(_useState19, 2),\n filteredValue = _useState20[0],\n setFilteredValue = _useState20[1];\n var _useState21 = (0,react.useState)(1),\n _useState22 = Core_slicedToArray(_useState21, 2),\n userAttempt = _useState22[0],\n setUserAttempt = _useState22[1];\n var _useState23 = (0,react.useState)(true),\n _useState24 = Core_slicedToArray(_useState23, 2),\n showDefaultResultState = _useState24[0],\n setShowDefaultResult = _useState24[1];\n var _useState25 = (0,react.useState)(undefined),\n _useState26 = Core_slicedToArray(_useState25, 2),\n answerSelectionTypeState = _useState26[0],\n setAnswerSelectionType = _useState26[1];\n var _useState27 = (0,react.useState)(0),\n _useState28 = Core_slicedToArray(_useState27, 2),\n totalPoints = _useState28[0],\n setTotalPoints = _useState28[1];\n var _useState29 = (0,react.useState)(0),\n _useState30 = Core_slicedToArray(_useState29, 2),\n correctPoints = _useState30[0],\n setCorrectPoints = _useState30[1];\n var _useState31 = (0,react.useState)(questions[currentQuestionIndex]),\n _useState32 = Core_slicedToArray(_useState31, 2),\n activeQuestion = _useState32[0],\n setActiveQuestion = _useState32[1];\n var _useState33 = (0,react.useState)(undefined),\n _useState34 = Core_slicedToArray(_useState33, 2),\n questionSummary = _useState34[0],\n setQuestionSummary = _useState34[1];\n (0,react.useEffect)(function () {\n setShowDefaultResult(showDefaultResult !== undefined ? showDefaultResult : true);\n }, [showDefaultResult]);\n (0,react.useEffect)(function () {\n setActiveQuestion(questions[currentQuestionIndex]);\n }, [currentQuestionIndex]);\n (0,react.useEffect)(function () {\n var answerSelectionType = activeQuestion.answerSelectionType;\n // Default single to avoid code breaking due to automatic version upgrade\n setAnswerSelectionType(answerSelectionType || \'single\');\n }, [activeQuestion, currentQuestionIndex]);\n (0,react.useEffect)(function () {\n if (endQuiz) {\n var totalPointsTemp = 0;\n var correctPointsTemp = 0;\n for (var i = 0; i < questions.length; i += 1) {\n var point = questions[i].point || 0;\n if (typeof point === \'string\' || point instanceof String) {\n point = parseInt(point, 10);\n }\n totalPointsTemp += point;\n if (correct.includes(i)) {\n correctPointsTemp += point;\n }\n }\n setTotalPoints(totalPointsTemp);\n setCorrectPoints(correctPointsTemp);\n }\n }, [endQuiz]);\n (0,react.useEffect)(function () {\n setQuestionSummary({\n numberOfQuestions: questions.length,\n numberOfCorrectAnswers: correct.length,\n numberOfIncorrectAnswers: incorrect.length,\n questions: questions,\n userInput: userInput,\n totalPoints: totalPoints,\n correctPoints: correctPoints\n });\n }, [totalPoints, correctPoints]);\n (0,react.useEffect)(function () {\n if (endQuiz && onComplete !== undefined && questionSummary !== undefined) {\n onComplete(questionSummary);\n }\n }, [questionSummary]);\n var nextQuestion = function nextQuestion(currentQuestionIdx) {\n setIncorrectAnswer(false);\n setIsCorrect(false);\n setShowNextQuestionButton(false);\n setButtons({});\n if (currentQuestionIdx + 1 === questions.length) {\n if (userInput.length !== questions.length) {\n alert(\'Quiz is incomplete\');\n } else if (allowNavigation) {\n var submitQuiz = confirm(\'You have finished all the questions. Submit Quiz now?\');\n if (submitQuiz) {\n setEndQuiz(true);\n }\n } else {\n setEndQuiz(true);\n }\n } else {\n setCurrentQuestionIndex(currentQuestionIdx + 1);\n }\n };\n var handleChange = function handleChange(event) {\n setFilteredValue(event.target.value);\n };\n var renderAnswerInResult = function renderAnswerInResult(question, userInputIndex) {\n var answers = question.answers,\n correctAnswer = question.correctAnswer,\n questionType = question.questionType;\n var answerSelectionType = question.answerSelectionType;\n var answerBtnCorrectClassName;\n var answerBtnIncorrectClassName;\n\n // Default single to avoid code breaking due to automatic version upgrade\n answerSelectionType = answerSelectionType || \'single\';\n return answers.map(function (answer, index) {\n if (answerSelectionType === \'single\') {\n // correctAnswer - is string\n answerBtnCorrectClassName = "".concat(index + 1) === correctAnswer ? \'correct\' : \'\';\n answerBtnIncorrectClassName = "".concat(userInputIndex) !== correctAnswer && "".concat(index + 1) === "".concat(userInputIndex) ? \'incorrect\' : \'\';\n } else {\n // correctAnswer - is array of numbers\n answerBtnCorrectClassName = correctAnswer.includes(index + 1) ? \'correct\' : \'\';\n answerBtnIncorrectClassName = !correctAnswer.includes(index + 1) && userInputIndex.includes(index + 1) ? \'incorrect\' : \'\';\n }\n return /*#__PURE__*/react.createElement("div", {\n key: esm_browser_v4()\n }, /*#__PURE__*/react.createElement("button", {\n type: "button",\n disabled: true,\n className: "answerBtn btn ".concat(answerBtnCorrectClassName).concat(answerBtnIncorrectClassName)\n }, questionType === \'text\' && /*#__PURE__*/react.createElement("span", null, answer), questionType === \'photo\' && /*#__PURE__*/react.createElement("img", {\n src: answer,\n alt: "answer"\n })));\n });\n };\n var renderTags = function renderTags(answerSelectionType, numberOfSelection, segment) {\n var singleSelectionTagText = appLocale.singleSelectionTagText,\n multipleSelectionTagText = appLocale.multipleSelectionTagText,\n pickNumberOfSelection = appLocale.pickNumberOfSelection;\n return /*#__PURE__*/react.createElement("div", {\n className: "tag-container"\n }, answerSelectionType === \'single\' && /*#__PURE__*/react.createElement("span", {\n className: "single selection-tag"\n }, singleSelectionTagText), answerSelectionType === \'multiple\' && /*#__PURE__*/react.createElement("span", {\n className: "multiple selection-tag"\n }, multipleSelectionTagText), /*#__PURE__*/react.createElement("span", {\n className: "number-of-selection"\n }, pickNumberOfSelection.replace(\'